Package com.sun.enterprise.ee.admin.servermgmt

Examples of com.sun.enterprise.ee.admin.servermgmt.InstanceConfig


        String url = null;

        if (ctx != null) {
            DASPropertyReader dpr = new DASPropertyReader(
                    new InstanceConfig(InstanceDirs.getInstanceRoot()));
            dpr.read();
            url = getSynchronizationURL(ctx, dpr);
        }

        return url;
View Full Code Here


    public static SynchronizationDriver getSynchronizationDriver(
            String root, String xml, String url) throws IOException {

        SynchronizationDriver driver = null;

        DASPropertyReader dpr = new DASPropertyReader(new InstanceConfig());
        dpr.read();

        if (url != null) {
            String transport= System.getProperty(SYNCHRONIZATION_TRANSPORT_KEY);
            if (JMX_TRANSPORT.equalsIgnoreCase(transport)) {
View Full Code Here

           
            // connecting to DAS. Using DAS property reader
            if ( SystemPropertyConstants.DEFAULT_SERVER_INSTANCE_NAME.compareTo(
                    instanceName) == 0 ) {
               DASPropertyReader dpr = new DASPropertyReader(
                            new InstanceConfig());

                try {
                    dpr.read();
                } catch (IOException ioe) {
                    String msg = _localStrMgr.getString("DASPropReadNotFound");
View Full Code Here

           
            // connecting to DAS. Using DAS property reader
            if ( SystemPropertyConstants.DEFAULT_SERVER_INSTANCE_NAME.compareTo(
                    instanceName) == 0 ) {
               DASPropertyReader dpr = new DASPropertyReader(
                            new InstanceConfig());

                try {
                    dpr.read();
                } catch (IOException ioe) {
                    String msg = _localStrMgr.getString("DASPropReadNotFound");
View Full Code Here

    private void getBits(ApplicationSynchRequest appSyncReq)
            throws SynchronizationException {

        DASPropertyReader dpr = new DASPropertyReader(
                            new InstanceConfig(InstanceDirs.getInstanceRoot()));

        List l = appSyncReq.toSynchronizationRequest();
        SynchronizationRequest[] allReqs = new SynchronizationRequest[
                                                l.size()];
        allReqs = (SynchronizationRequest[])l.toArray(allReqs);
View Full Code Here

     */   
    public synchronized RuntimeStatus updateStatusFromAdminChannel(String instanceName, int statusCode)
    {
        int newStatusCode = statusCode;
        try {
            InstanceConfig instanceConfig=new InstanceConfig(
                InstanceDirs.getRepositoryName(), InstanceDirs.getRepositoryRoot(), instanceName);
            EEInstancesManager eeInstancesManager=new EEInstancesManager(instanceConfig);       
            newStatusCode = eeInstancesManager.getInstanceStatus();             
            if (newStatusCode != statusCode) {
                getLogger().log(Level.INFO, "server " + instanceName + " has admin channel status of " +
View Full Code Here

                                getConfigContext())
            Server[] servers=domain.getServers().getServer();
           
            // get EEInstancesManager and get instances that currently
            // physically exist in repository
            InstanceConfig instanceConfig = new InstanceConfig(
                                            InstanceDirs.getInstanceRoot());
            EEInstancesManager eeInstancesManager = new EEInstancesManager(
                                                    instanceConfig);
            HashMap hmInstances = getInstancesAndStatus(
                                  instanceConfig, eeInstancesManager);
            // loop through for creatation of instances boolean match = false;
            Iterator serverIt = null;
            String instanceName = null;
            int status = 0;
           
            // get node controller config bean from domain
            com.sun.enterprise.config.serverbeans.NodeAgent nodeController
        = getNodeAgentConfigBean(getConfigContext());

            if (nodeController != null) {
                Properties props = null;
                ElementProperty elementProperty = null;
                Cluster cluster = null;
                // need a default, can't have %%%DOMAIN_NAME%%% go into
                // running server
                String domainName="DomainPropertyNotFound";
                // set default to "" because this string will actual be placed
                // in the startserv's java command for starting the instance
                // via the ProcessLauncher. This is the easiest way to have the
                // com.sun.aas.clusterName set to null for a standalone Instance
                String clusterArg = "";
               
                for (int ii = 0; ii < servers.length; ii++) {
                    // check to see if the server belongs to this
                    // node agent (repository)
                    if (instanceConfig.getRepositoryName().equals(
                            servers[ii].getNodeAgentRef())) {
                        // check if instance already exists or
                        // needs to be created.
                        if (instanceExists(servers[ii].getName())) {
                            getLogger().log(Level.INFO,
                            "nodeagent.instance.exists", servers[ii].getName());
                        } else {
                            // instance does not exist so create it
                            getLogger().log(Level.INFO,
                            "nodeagent.create.instance", servers[ii].getName());
                            instanceConfig.setInstanceName(servers[ii].getName());
                            // set properties for token replacing startserv scripts
                            props = new Properties();
                            // add proper domain
                            elementProperty = domain.getElementPropertyByName(
                                           DOMAIN_XML_DOMAIN_NAME_PROPERTY_NAME);
                            if (elementProperty != null)
                               domainName=elementProperty.getValue();
                           
                            getLogger().log(Level.INFO,
                                        "domain for instance - " + domainName);
                            props.setProperty(EEScriptsTokens.DOMAIN_NAME,
                                              domainName);

                            if (ServerHelper.isServerClustered(
                                  getConfigContext(), servers[ii].getName())) {
                                try {
                                    // see if part of cluster
                                    cluster = ClusterHelper.getClusterForInstance(
                                      getConfigContext(), servers[ii].getName());
                                    if (cluster != null)
                                        clusterArg = "-D" + CLUSTER_NAME + "=\""
                                                   + cluster.getName() + "\"";                                   
                                } catch (ConfigException ce) {
                                    // show at finest, because the server may
                                    // not be part of cluster
                                    getLogger().log(Level.FINEST,
                                        "Server isn't part of cluster", ce);
                                }
                            }
                            props.setProperty(EEScriptsTokens.CLUSTER_NAME, clusterArg);                           
                            // set the overriding properties used in token replacement
                            eeInstancesManager.setOverridingProperties(props);
                            // create instance
                            eeInstancesManager.createInstance();                           
                            // make list of created server instances to know which ones to
                            // sync on nodeagent startup.
                            createdInstances.add(servers[ii].getName());
                        }
                        // remove it from delete instances array
                        hmInstances.remove(servers[ii].getName());
                    }
                }
            }
           
            // loop through and delete instances if nessesary
            serverIt = hmInstances.keySet().iterator();
            while (serverIt.hasNext()) {
                instanceName = (String)serverIt.next();
                status = ((Status)hmInstances.get(instanceName)).getStatusCode();
               
                // delete instances
                if (bDebug) System.out.println("Delete Server =" + instanceName
                                             + " with status:" + status);
                getLogger().log(Level.INFO, "nodeagent.delete.instance",
                                instanceName);
                instanceConfig.setInstanceName(instanceName);
               
                // check to see if instances is
                if(status != Status.kInstanceNotRunningCode) {
                    try {
                        stopInstance(instanceName);
View Full Code Here

     * This method gets the reposority instances and their status
     *
     * @return HashMap of instance names as the key and the status as the value
     */
    protected HashMap getInstancesAndStatus() throws RepositoryException {
        InstanceConfig instanceConfig =
            new InstanceConfig(InstanceDirs.getInstanceRoot());
        EEInstancesManager eeInstancesManager =
            new EEInstancesManager(instanceConfig);
        return getInstancesAndStatus(instanceConfig, eeInstancesManager);
    }
View Full Code Here

               "nodeagent.synchronization.Exception", ce);
        }
       
        long startSync = System.currentTimeMillis();
        try {
            InstanceConfig instanceConfig = new InstanceConfig(
                InstanceDirs.getRepositoryName(),
                InstanceDirs.getRepositoryRoot(), instance);
            String iRoot = instanceConfig.getRepositoryRoot() + File.separator +
                           instanceConfig.getRepositoryName() + File.separator +
                           instance;
            if (bDebug) System.out.println("*** SYNCHRONIZE INSTANCE: "+ iRoot);

            //SynchronizationDriver sd =
            // new SynchronizationDriverFactory.getSynchronizationDriver(
View Full Code Here

     * startInstance - start sequence specific to intances that are internal to the appserver
     */
    public void startInstance() throws ProcessManagerException {
        try {
            if(bDebug) System.err.println("\n" + this.getClass().getName() + ": ProcessInstanceInternal:startInstance for :" + getName());
            InstanceConfig instanceConfig=new InstanceConfig(InstanceDirs.getRepositoryName(), InstanceDirs.getRepositoryRoot(), getName());
            EEInstancesManager eeInstancesManager=new EEInstancesManager(instanceConfig);
            // reset exitcode to make sure on restart it doesn't incur a race condition in the
            // monitor where the exitCode is non-zero and it has a process so another reset is attempted
            setExitCode(0);
            // start instance, this will not sync since sync call was moved to nodeagent, and it is not supposed to sync
View Full Code Here

TOP

Related Classes of com.sun.enterprise.ee.admin.servermgmt.InstanceConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.