Package com.sun.enterprise.instance

Examples of com.sun.enterprise.instance.InstanceEnvironment


     */
    public boolean useManualConfigChanges() throws ServerInstanceException
    {
        try {
            initDelegate();
            InstanceEnvironment ie =
                    new InstanceEnvironment(ServerManager.ADMINSERVER_ID);
            // copy server.xml from hot to back
            //ie.useManualServerXmlChanges();
            // Reinitialize mbeans
            mDelegate.reloadAfterChange(ie);
            // Set restart needed to true because we do not know whether admin
View Full Code Here


     */
    public void onInitialization(ServerContext sc)
                        throws ServerLifecycleException {
   
        // Setup Catalina's environment
        InstanceEnvironment instance = sc.getInstanceEnvironment();
        System.setProperty("catalina.home", instance.getInstancesRoot());
        System.setProperty("catalina.base", instance.getInstancesRoot());
        System.setProperty("catalina.useNaming", "false");
    }
View Full Code Here

        return app.getRarDescriptorByUri(raLoc);
    }
   
   
    private AppsManager getAppsManager() throws ConfigException{
        InstanceEnvironment iEnv = sc_.getInstanceEnvironment();
        return InstanceFactory.createAppsManager(iEnv, false);
    }
View Full Code Here

        InstanceEnvironment iEnv = sc_.getInstanceEnvironment();
        return InstanceFactory.createAppsManager(iEnv, false);
    }
   
    private EjbModulesManager getEjbModulesManager() throws ConfigException{
        InstanceEnvironment iEnv = sc_.getInstanceEnvironment();
        return InstanceFactory.createEjbModuleManager(iEnv, false);
    }
View Full Code Here

        if (m_AdminContext != null) {
            configContext = m_AdminContext.getAdminConfigContext();
        } else {
            try
            {
                InstanceEnvironment instanceEnvironment = new InstanceEnvironment(instanceName);
                //String fileUrl  = instanceEnvironment.getConfigFilePath();
          /*Everything should be set in the backup file*/
          String fileUrl  = instanceEnvironment.getConfigFilePath();
                configContext   = ConfigFactory.createConfigContext(fileUrl);
            }
            catch(ConfigException e)
            {
                //e.printStackTrace();
View Full Code Here

  {
    super.begin();
   
    // get environment object refs
   
    InstanceEnvironment instanceEnv = getInstanceEnv();
    moduleEnv            = request.getModuleEnv();
    moduleName            = request.getName();
   
    // check them
   
View Full Code Here

        int wildDescrIndex = -1;
        Name name = null;
        int  nNameTokens = 0;

        //if there is no such instance - next statement will throw runtime exception
        InstanceEnvironment instanceEnvironment= new InstanceEnvironment(instanceName);
       
        //First: add "static" continuations
        try
        {
            name = new Name(dottedName);
            nNameTokens = name.getNumParts();
        }
        catch (Exception e)
        {
            sLogger.log(Level.FINE, MSG_MALFORMED_DOTTED_NAME, e);
            return new String[0];
        }

        for(int i=0; i<m_mbeanDescr.length; i++) //enumerate all descriptors
        {
            Object[][] tokens = m_mbeanDescr[i].getDottedTokens();
            if(tokens!=null)
            {
                for(int j=0; j<tokens.length; j++) //enum different dotted patterns presentations
                {
                    if(MBeanNamingDescriptor.isDottedPatternMatch(name, tokens[j], false) && tokens[j].length>nNameTokens)
                    {
                        //dotted pattern beginning matches to sample
                        if(!(tokens[j][nNameTokens] instanceof String)) //wildcard?
                        {
                            if(tokens[j].length==nNameTokens+1) //only if wildcard at the end; otherwise - ignore
                                wildDescrIndex = i;
                        }
                        else
                        {
                            hs.add(dottedName+"."+tokens[j][nNameTokens]);
                        }
                    }
                }
            }
        }
        //Now try to add childrens names
        String xpath = null;
        if(wildDescrIndex>=0)
        {
            try
            {
                ConfigMBeanNamingInfo info = new ConfigMBeanNamingInfo(dottedName + ".fake");
                xpath = info.getXPath();
            }
            catch (Exception e)
            {
               sLogger.log(Level.FINE, MSG_EXCEPTION_DURING_LIST_NAMES, e);
            }
        }
        if(xpath!=null)
        {
            String attributeName = null;
            String elementName= null;
            // seek for elemname[@attrname=]
            xpath = xpath.trim();
            if(xpath.length()>0 && xpath.endsWith("]"))
            {
                int i = xpath.lastIndexOf('@') + 1;
                int j = xpath.indexOf('=',i) ;
                if(i>0 && j>i)
                {
                    attributeName = xpath.substring(i,j).trim();
                    j = xpath.lastIndexOf('[');
                    if(j>0 && j<i)
                    {
                        xpath = xpath.substring(0,j);
                        j = xpath.lastIndexOf('/');
                        if(j>0 && j<xpath.length()-2)
                        {
                            elementName = xpath.substring(j+1).trim();
                            xpath = xpath.substring(0,j);
                        }
                    }
                }
               
            }
           
            if(attributeName!=null && elementName!=null) //is parsed successfully
            {
                //here we are to call ConfiBeans methods
                ConfigContext configContext;
                try
                {
                    String fileUrl  = instanceEnvironment.getConfigFilePath();
                    configContext   = ConfigFactory.createConfigContext(fileUrl);
                    ConfigBean bean = ConfigBeansFactory.getConfigBeanByXPath(configContext, xpath);
                    ConfigBean[] childs =  bean.getChildBeansByName(elementName);
                    for(int i=0; i<childs.length; i++)
                    {
View Full Code Here

     * @param    mgr    manager obj that provides access to application config
     * @return   the common class path urls
     */
    static List getCommonClasspath(BaseManager mgr) throws IOException {

        InstanceEnvironment env  = mgr.getInstanceEnvironment();
        String dir               = env.getLibClassesPath();
        String jarDir            = env.getLibPath();

        return ClassLoaderUtils.getUrlList(new File[] {new File(dir)},
                                           new File[] {new File(jarDir)});
    }
View Full Code Here

                   
                    String[] instanceIds = ServerManager.instance().getInstanceNames(false);
                    for (int i = 0 ; i < instanceIds.length ; i ++) {
                        try {
                            String instanceId = instanceIds[i];
                            InstanceEnvironment ie = new InstanceEnvironment(instanceId);
                            ManualChangeStatus mcs = new ManualChangeStatus();

                            /* TOMCAT_BEGIN Ramakanth */
                            mcs.setServerXmlFileChanged(
                                ie.hasHotXmlChanged());
                            mcs.setRealmsKeyFileChanged(
                                ie.hasHotRealmsKeyChanged());
                            /* TOMCAT_END Ramakanth */
                            logger.log(Level.FINE, "Got Manual Change status for "+  instanceId);
                            logger.log(Level.FINEST,"-------------------------------------");
                            logger.log(Level.FINEST,mcs.toString());
                            logger.log(Level.FINEST,"------------------------------------");
View Full Code Here

        init_position = 0;
    }
   
    public void initialise(String instanceName, boolean bBackupFile) throws IOException
    {
        InstanceEnvironment environ = new InstanceEnvironment(instanceName);
        String confFile;
        confFile = environ.getInitFilePath();
        initialize(confFile);
    }
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.