/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
* may not use this file except in compliance with the License. You can
* obtain a copy of the License at
* or packager/legal/LICENSE.txt. See the License for the specific
* language governing permissions and limitations under the License.
*
* When distributing the software, include this License Header Notice in each
* file and include the License file at packager/legal/LICENSE.txt.
*
* GPL Classpath Exception:
* Oracle designates this particular file as subject to the "Classpath"
* exception as provided by Oracle in the GPL Version 2 section of the License
* file that accompanied this code.
*
* Modifications:
* If applicable, add the following below the License Header, with the fields
* enclosed by brackets [] replaced by your own identifying information:
* "Portions Copyright [year] [name of copyright owner]"
*
* Contributor(s):
* If you wish your version of this file to be governed by only the CDDL or
* only the GPL Version 2, indicate your decision by adding "[Contributor]
* elects to include this software in this distribution under the [CDDL or GPL
* Version 2] license." If you don't indicate a single choice of license, a
* recipient has the option to distribute your version of this file under
* either the CDDL, the GPL Version 2 or to extend the choice of license to
* its licensees as provided above. However, if you add GPL Version 2 code
* and therefore, elected the GPL Version 2 license, then the option applies
* only if the new code is made subject to such option by the copyright
* holder.
*/
/**
* This service is responsible for loading the group management
* service. In the DAS, GMS will only be enabled if there is at least
* one cluster present with the gms-enabled attribute set to true.
* In an instance, GMS will be enabled if the cluster containing this
* instance has gms-enabled set to true.
*
* Components can inject this service in order to obtain a reference
* to a GMSAdapter object. From this, the appropriate GroupManagementService
* object can be retrieved.
*/
@Service()
/**
* Returns the lifecyle of the service. This service may not be needed
* after startup -- we still need to determine how to load GMS when
* a gms-enabled cluster is first created during runtime.
* TODO: determine SERVER v START
*/
}
/**
* Starts the application loader service.
*/
public void postConstruct() {
// first check that this isn't a config upgrade
if (startupContext != null) {
return;
}
}
// in the UMC case, check server-config, otherwise check clusters
if (server.isClusteredDas()) {
"development. Will remove this once we're stable.");
} else {
}
}
}
}
return "GMS Loader";
}
/*
*/
synchronized(lock) {
throw new IllegalStateException(
} else {
return null;
}
}
}
public boolean isGmsEnabled() {
}
synchronized(lock) {
}
}
/**
* Create a GMSAdapter for each cluster that has gms enabled.
*/
}
}
}
}
}
return result;
}
/*
* In this iteration, will only check for the "seed list," implying
* that multicast is not available. In a future version we can also
* check for multicast address and port.
*
* If the seed list is null, we'll warn and exit. An empty list is
* ok, but null could mean the user forgot to set it. When we're supporting
* UMC with nonmulticast and multicast, something must be set to tell
* GMS which mode to use.
*
* This is for the UMC case only.
*/
boolean gmsEnabled = false;
}
}
if (gmsEnabled) {
return;
}
return;
}
}
}
/*
* Initial support for multiple clusters in DAS. A clustered instance can
* only belong to one cluster. In the UMC case, there will only be
* one cluster at all.
*/
synchronized(lock) {
}
"creating gms-adapter for clustername " + name +
" since no gms adapter found for clustername " +
name);
}
return null;
}
if (initResult == false) {
return null;
}
"loadModule: registered created gmsadapter for cluster " +
}
}
}
return result;
}
/*
* On create-cluster event, DAS joins a gms-enabled cluster.
* On delete-cluster event, DAS leaves a gms-enabled cluster.
*/
public <T extends ConfigBeanProxy> NotProcessed changed(TYPE type, Class<T> changedType, T changedInstance) {
}
if (localGmsAdapter != null) {
}
}
// todo: when supporting multiple clusters, ensure that newly added cluster has a different gms-multicast-address than all existing clusters.
// currently, generating a unique multicast address depending on random so this check is necessary.
}
}
synchronized(lock) {
if (localGmsAdapter != null) {
logger.log(TRACE_LEVEL, "removeIndex(" + GMSAdapter.class.getName() + ") returned result of " + result);
}
// remove GMS module for deleted cluster. Must do this or will fail if the cluster is recreated before DAS is stopped.
}
}
}
return null;
}
}, logger);
}
return null;
}
}