Package com.sun.enterprise.instance

Examples of com.sun.enterprise.instance.InstanceEnvironment


    public boolean useManualConfigChanges() throws ServerInstanceException
    {
        boolean requiresRestart = false;
        try
        {
            InstanceEnvironment instanceEnv = new InstanceEnvironment(mInstanceName);

            // 1. copy from hot to back
            instanceEnv.useManualConfigChanges();

            reloadAfterChange(instanceEnv);

            // multicastEvent(CONFIG_CHANGED, null);
            /* New for 8.0 - temporary */
            this.transform(instanceEnv);
            /* New for 8.0 - temporary */
            requiresRestart = instanceEnv.restartRequired();
            if (requiresRestart) {
                // The instance was not started after manual config changes, so
                // persist the restart required state.
                AdminEventCache cache =
                        AdminEventCache.getInstance(mInstanceName);
View Full Code Here


        }
        String clientJarLocation = null;
        try
        {
            ConfigContext serverContext = getConfigContext(mInstanceName);
            InstanceEnvironment iEnv = new InstanceEnvironment(mInstanceName);
            Applications applicationsConfigBean =
                (Applications) ConfigBeansFactory.getConfigBeanByXPath(
                    serverContext, ServerXPathHelper.XPATH_APPLICATIONS);
            String appLocation = null;
            switch (appType)
View Full Code Here

        }
        String wsdlFileLocation = null;
        try
        {
            ConfigContext serverContext = getConfigContext(mInstanceName);
            InstanceEnvironment iEnv = new InstanceEnvironment(mInstanceName);
            Applications applicationsConfigBean =
                (Applications) ConfigBeansFactory.getConfigBeanByXPath(
                    serverContext, ServerXPathHelper.XPATH_APPLICATIONS);
            String appLocation = null;
            AbstractArchive moduleArchive = null;
View Full Code Here

        if (targetName != null) {
            event.setTargetDestination(targetName);
        }

        /* New for 8.0 - temporary */
        this.transform(new InstanceEnvironment(name));
        /* New for 8.0 - temporary */

        if (event instanceof ApplicationDeployEvent
                || event instanceof ModuleDeployEvent) {
            AdminEventCache.populateConfigChange(getConfigContext(), event);
View Full Code Here

    // ****************************************************************************
    //Security Realms keyfile operations
    // ****************************************************************************
    private FileRealm getInstanceRealmKeyFile() throws MBeanConfigException
    {
        InstanceEnvironment env = new InstanceEnvironment(mInstanceName);
        try
        {
            return new FileRealm(env.getBackupRealmsKeyFilePath());
        }
        catch(BadRealmException bre)
        {
            //String msg =  localStrings.getString( "admin.server.core.mbean.config.bad_realm", mInstanceName);
            throw new MBeanConfigException(bre.getMessage());
View Full Code Here

        }

    }
    private void saveInstanceRealmKeyFile(FileRealm realm) throws MBeanConfigException
    {
        InstanceEnvironment env = new InstanceEnvironment(mInstanceName);
        try
        {
            final String filePath = env.getBackupRealmsKeyFilePath();
            sLogger.log(Level.INFO, "filerealm.write", filePath);
            realm.writeKeyFile(filePath);
        }
        catch(IOException ioe)
        {
View Full Code Here

    /**
     * Returns Instance dir path
     */
    public String getInstanceRoot()
    {
        InstanceEnvironment env = new InstanceEnvironment(mInstanceName);
        return env.getInstancesRoot();
    }
View Full Code Here

                    sLogger.log(Level.CONFIG, "delete_unregistration_failed",
                            objectNames[i]);
                }
            }
            // Message to Config to refresh contexts
            InstanceEnvironment instanceEnvironment = new
                    InstanceEnvironment(instanceName);
            String fileUrl  = instanceEnvironment.getConfigFilePath();
            ConfigFactory.removeConfigContext(fileUrl);

            String instanceRoot = instanceEnvironment.getInstancesRoot();
            deleteJMSProviderInstance(instanceRoot, instanceName);
           
            // Now stop it delete the files from file system */
            sm.deleteServerInstance(instanceName);
            sLogger.log(Level.INFO, "mbean.del_instance_ok", instanceName);
View Full Code Here

  Delete JMS provider data specific to this instance.
    */
    private void deleteJMSProviderInstance(String instancesRoot,
                                           String instanceName)
    {
        InstanceEnvironment instanceEnvironment;
        ConfigContext configContext;
        JmsService jmsService;
        String fileUrl;

        try
        {
            if (mAdminContext != null) {
                configContext = mAdminContext.getAdminConfigContext();
            } else {
                instanceEnvironment = new InstanceEnvironment(instanceName);
                fileUrl = instanceEnvironment.getConfigFilePath();
                configContext = ConfigFactory.createConfigContext(fileUrl);
            }

            jmsService = (JmsService)ConfigBeansFactory.getConfigBeanByXPath(
                configContext, ServerXPathHelper.XPATH_JMS_SERVICE);
View Full Code Here

     * @return True means requires restart.
     */
    public boolean applyConfigChanges() throws ServerInstanceException
    {
        try {
            InstanceEnvironment ie = new InstanceEnvironment(
                    ServerManager.ADMINSERVER_ID);
            // Force write of server.xml changes because the check to ensure
            // that manual edits are not lost (the method canApplyConfigChanges)
            // is already invoked from MBeanServer just before invoking this
            // (applyConfigChanges) method.
            //ie.applyServerXmlChanges(true);
            initDelegate();
            ConfigContext ctx = mDelegate.getConfigContext(
                    ServerManager.ADMINSERVER_ID);
            ctx.resetConfigChangeList();
            mRestartNeeded = true;
            /* New for 8.0 - temporary - gen server.xml b4 notif */
            /* This call most likely goes away */
            if (ManagedServerInstance.PORT_DOMAIN_TO_SERVER) {
                final String domainXMLPath = ie.getConfigFilePath();
                final String serverXMLPath = System.getProperty(Constants.IAS_ROOT)
                    + "/"
                    + ie.getName()
                    + "/config/"
                    + ie.kServerXMLFileName;
                new Domain2ServerTransformer(domainXMLPath, serverXMLPath).transform();
            }
            /* New for 8.0 - temporary - gen server.xml b4 notif */
 
View Full Code Here

TOP

Related Classes of com.sun.enterprise.instance.InstanceEnvironment

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.