use of com.sun.enterprise.config.serverbeans.Cluster in project Payara by payara.
the class LogFilter method getInstanceLogFileDetails.
/*
This function is used to get log file details from logging.properties file for given target.
*/
private String getInstanceLogFileDetails(Server targetServer) throws IOException {
String logFileDetailsForServer = "";
String targetConfigName = "";
Cluster clusterForInstance = targetServer.getCluster();
if (clusterForInstance != null) {
targetConfigName = clusterForInstance.getConfigRef();
} else {
targetConfigName = targetServer.getConfigRef();
}
logFileDetailsForServer = loggingConfig.getLoggingFileDetails(targetConfigName);
return logFileDetailsForServer;
}
use of com.sun.enterprise.config.serverbeans.Cluster in project Payara by payara.
the class HazelcastCore method postConstruct.
@PostConstruct
public void postConstruct() {
theCore = this;
events.register(this);
enabled = Boolean.valueOf(nodeConfig.getEnabled());
transactions.addListenerForType(HazelcastConfigSpecificConfiguration.class, this);
transactions.addListenerForType(HazelcastRuntimeConfiguration.class, this);
if (env.isMicro()) {
memberName = nodeConfig.getMemberName();
memberGroup = nodeConfig.getMemberGroup();
} else {
memberName = context.getInstanceName();
Cluster cluster = context.getConfigBean().getCluster();
if (cluster == null) {
memberGroup = context.getConfigBean().getConfigRef();
} else {
memberGroup = cluster.getName();
}
}
}
use of com.sun.enterprise.config.serverbeans.Cluster in project Payara by payara.
the class ConnectorMessageBeanClient method getActivationName.
/**
* {@inheritDoc}
* @Override
*/
public String getActivationName() {
if (activationName == null) {
String appName = descriptor_.getApplication().getName();
String moduleID = descriptor_.getEjbBundleDescriptor().getModuleID();
int pound = moduleID.indexOf("#");
if (pound >= 0) {
// the module ID is in the format: appName#ejbName.jar
// remove the appName part since it is duplicated
moduleID = moduleID.substring(pound + 1);
}
String mdbClassName = descriptor_.getEjbClassName();
ServerEnvironmentImpl env = Globals.get(ServerEnvironmentImpl.class);
String instanceName = env.getInstanceName();
Domain domain = Globals.get(Domain.class);
String domainName = domain.getName();
Cluster cluster = domain.getServerNamed(instanceName).getCluster();
String clusterName = null;
if (cluster != null) {
// this application is deployed in a cluster
clusterName = cluster.getName();
}
if (clusterName != null) {
// this application is deployed in a cluster
activationName = combineString(domainName, clusterName, appName, moduleID, mdbClassName);
} else {
// this application is deployed in a stand-alone server instance.
activationName = combineString(domainName, instanceName, appName, moduleID, mdbClassName);
}
}
return activationName;
}
use of com.sun.enterprise.config.serverbeans.Cluster in project Payara by payara.
the class DatabaseEJBTimerService method memberRemoved.
@Override
public void memberRemoved(MemberEvent event) {
// work out whether we should be attempting to migrate timers
String server = event.getServer();
String group = event.getServerGroup();
String thisServer = serverEnv.getInstanceName();
// check whether the server is any of the same clusters or deployment groups
// as the disappeared server and if so migrate timers
boolean migrate = false;
Cluster forServer = domain.getClusterForInstance(server);
if (forServer != null) {
for (Server instance : forServer.getInstances()) {
if (instance.getName().equals(thisServer)) {
// if I am in the same cluster
migrate = true;
break;
}
}
}
if (!migrate) {
for (DeploymentGroup deploymentGroup : domain.getDeploymentGroupsForInstance(server)) {
for (Server instance : deploymentGroup.getInstances()) {
if (instance.getName().equals(thisServer)) {
// if I am in the same cluster
migrate = true;
break;
}
}
}
}
if (migrate) {
migrateTimers(event.getServer());
}
}
use of com.sun.enterprise.config.serverbeans.Cluster in project Payara by payara.
the class IiopFolbGmsClient method getAllClusterInstanceInfo.
private Map<String, ClusterInstanceInfo> getAllClusterInstanceInfo() {
final Cluster myCluster = myServer.getCluster();
fineLog("getAllClusterInstanceInfo: myCluster {0}", myCluster);
final Config myConfig = getConfigForServer(myServer);
fineLog("getAllClusterInstanceInfo: myConfig {0}", myConfig);
final Map<String, ClusterInstanceInfo> result = new HashMap<String, ClusterInstanceInfo>();
// null check is needed.
if (myCluster != null) {
for (Server server : myCluster.getInstances()) {
ClusterInstanceInfo cii = getClusterInstanceInfo(server, myConfig, false);
if (cii != null) {
result.put(server.getName(), cii);
}
}
}
fineLog("getAllClusterInstanceInfo: result {0}", result);
return result;
}
Aggregations