Search in sources :

Example 16 with Cluster

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;
}
Also used : Cluster(com.sun.enterprise.config.serverbeans.Cluster)

Example 17 with Cluster

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();
        }
    }
}
Also used : Cluster(com.sun.enterprise.config.serverbeans.Cluster) PostConstruct(javax.annotation.PostConstruct)

Example 18 with Cluster

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;
}
Also used : ServerEnvironmentImpl(org.glassfish.server.ServerEnvironmentImpl) Cluster(com.sun.enterprise.config.serverbeans.Cluster) Domain(com.sun.enterprise.config.serverbeans.Domain) MessageEndpoint(javax.resource.spi.endpoint.MessageEndpoint)

Example 19 with Cluster

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());
    }
}
Also used : Server(com.sun.enterprise.config.serverbeans.Server) PayaraCluster(fish.payara.nucleus.cluster.PayaraCluster) Cluster(com.sun.enterprise.config.serverbeans.Cluster) DeploymentGroup(fish.payara.enterprise.config.serverbeans.DeploymentGroup)

Example 20 with Cluster

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;
}
Also used : Server(com.sun.enterprise.config.serverbeans.Server) HashMap(java.util.HashMap) Config(com.sun.enterprise.config.serverbeans.Config) PayaraCluster(fish.payara.nucleus.cluster.PayaraCluster) Cluster(com.sun.enterprise.config.serverbeans.Cluster) ClusterInstanceInfo(com.sun.corba.ee.spi.folb.ClusterInstanceInfo)

Aggregations

Cluster (com.sun.enterprise.config.serverbeans.Cluster)45 Server (com.sun.enterprise.config.serverbeans.Server)26 ActionReport (org.glassfish.api.ActionReport)12 TransactionFailure (org.jvnet.hk2.config.TransactionFailure)9 Domain (com.sun.enterprise.config.serverbeans.Domain)8 HashMap (java.util.HashMap)8 Config (com.sun.enterprise.config.serverbeans.Config)6 DeploymentGroup (fish.payara.enterprise.config.serverbeans.DeploymentGroup)6 ArrayList (java.util.ArrayList)6 Map (java.util.Map)6 ServerRef (com.sun.enterprise.config.serverbeans.ServerRef)5 ConfigApiTest (com.sun.enterprise.configapi.tests.ConfigApiTest)5 PropertyVetoException (java.beans.PropertyVetoException)5 Test (org.junit.Test)5 SystemProperty (com.sun.enterprise.config.serverbeans.SystemProperty)4 Logger (java.util.logging.Logger)4 ConfigBean (org.jvnet.hk2.config.ConfigBean)4 ConfigSupport (org.jvnet.hk2.config.ConfigSupport)4 ApplicationRef (com.sun.enterprise.config.serverbeans.ApplicationRef)3 JmsService (com.sun.enterprise.connectors.jms.config.JmsService)3