Package com.sun.enterprise.instance

Examples of com.sun.enterprise.instance.InstanceEnvironment


       
            // runtime server context
            ServerContext ctx = ApplicationServer.getServerContext();
        
            // environment object for this server instance
            InstanceEnvironment env = ctx.getInstanceEnvironment();
        
            // application object associated with this ejb
            Application application = desc.getApplication();
            String dirName = null;
            String componentSeparator = "_";
            if (application.isVirtual()) {
                // ejb is part of a stand alone ejb module
    String archURI = desc.getEjbBundleDescriptor().
        getModuleDescriptor().getArchiveUri();
                passivationDirName = env.getModulePassivatedEjbPath()
        + File.separator + FileUtils.makeFriendlyFilename(archURI)
        + componentSeparator + desc.getName();
            } else {
                // ejb is part of an application
                passivationDirName = env.getApplicationPassivatedEjbPath()
        + File.separator + application.getRegistrationName()
        + componentSeparator + desc.getName()
        + componentSeparator + desc.getUniqueId();
            }
        
View Full Code Here


            try
            {
                if (mAdminContext != null) {
                    configContext = mAdminContext.getAdminConfigContext();
                } else {
                    InstanceEnvironment instanceEnvironment = new InstanceEnvironment(instanceName);
                    //String fileUrl  = instanceEnvironment.getConfigFilePath();
                    /*Everything should be set in the backup file*/
                    String fileUrl  = instanceEnvironment.getBackupConfigFilePath();
                    configContext   = ConfigFactory.createConfigContext(fileUrl);
                }
                return ((MBeanRegistryEntry)mConfigBean).instantiateMBean(mObjectName,null, configContext);
            }
            catch(Exception e)
View Full Code Here

    private ConfigContext getConfigContext(String instanceName) throws ConfigException
    {
        if (mAdminContext != null) {
            return mAdminContext.getAdminConfigContext();
        } else {
            String backupServerXmlPath = new InstanceEnvironment(instanceName).getBackupConfigFilePath();
            return (ConfigFactory.createConfigContext(backupServerXmlPath) );
        }
    }
View Full Code Here

    public String[] getSecurityPasswordTokens() throws ControlException
    {
        try
        {
            //first testing existance of password file
            InstanceEnvironment env = new InstanceEnvironment(mInstanceName);
            String pwdFileName = env.getSecurityPasswordsFilePath();
            File pwdFile = new File(pwdFileName);
            if(pwdFile.exists())
                return null;
            //now test the security attribute in init.conf file in "live" directory
            InitConfFileBean conf = new InitConfFileBean();
View Full Code Here

        catch (ConfigException e)
        {
            throw new ServerInstanceException(e.getMessage());
        }
        if (!applyNeeded && checkAllFiles) {
            InstanceEnvironment ie = new InstanceEnvironment(mInstanceName);
            applyNeeded = ie.hasRealmsKeyConfFileChanged();
        }
        return applyNeeded;
    }
View Full Code Here

    public boolean overwriteConfigChanges() throws ServerInstanceException
    {
         try {
             return applyChanges(true);
  } catch (AFRuntimeStoreException e) {
            InstanceEnvironment ie = new InstanceEnvironment(mInstanceName);

             if(ie.canReloadManualXmlChanges()) {
    try {
                    ie.useManualServerXmlChanges();
                    reloadAfterChange(ie);
    } catch(ConfigException ce) {
        // Sorry cant do anything.
    }
                return true;
View Full Code Here

    private boolean applyChanges(boolean force) throws ServerInstanceException
    {
        boolean requiresRestart = false;
        try
        {
            InstanceEnvironment instanceEnv = new InstanceEnvironment(mInstanceName);
            /* TOMCAT_BEGIN Ramakanth*/
            boolean hasConfChanges = false;
            boolean hasMimeChanges = false;
            hasConfChanges = instanceEnv.hasRealmsKeyConfFileChanged();
            /* TOMCAT_END Ramakanth*/

            instanceEnv.applyChangesFromBackup(force);
            // multicastEvent(CONFIG_CHANGED, null);
            /* New for 8.0 - temporary - gen server.xml b4 notif */
            /* This call most likely goes away */
            this.transform(instanceEnv);
            /* New for 8.0 - temporary - gen server.xml b4 notif */
 
View Full Code Here

        return requiresRestart;
    }

    public boolean canApplyConfigChanges() throws ConfigException {
        boolean b = false;
        InstanceEnvironment ie = new InstanceEnvironment(mInstanceName);
        if(AdminService.ENABLE_PERFORMANCE_THREAD) {
            b = (!ManualChangeManager.hasHotChanged(mInstanceName));
        } else {
            b = (!ie.hasHotChanged());
        }
        if((!b&& ie.canReloadManualXmlChanges()) {
            ie.useManualServerXmlChanges();
            reloadAfterChange(ie);
            boolean requiresRestart = ie.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

    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

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.