Package com.sun.enterprise.instance

Examples of com.sun.enterprise.instance.AppsManager


        File timerServiceShutdownDirectory;
        File timerServiceShutdownFile;

        InstanceEnvironment env = ApplicationServer.getServerContext().
                                    getInstanceEnvironment();
        AppsManager appsManager = new AppsManager(env, false);

        String j2eeAppPath = appsManager.getLocation(appID);
        timerServiceShutdownDirectory = new File(j2eeAppPath + File.separator);
        timerServiceShutdownDirectory.mkdirs();
        timerServiceShutdownFile = new File(j2eeAppPath + File.separator
                + TIMER_SERVICE_FILE);
View Full Code Here


     * This method gets the Application Manager for this server context
     * @return ApplicationManager
     */
    public static synchronized ApplicationManager getApplicationManager() throws ConfigException{
        if(applicationManager == null) {   
            AppsManager appsManager =
            InstanceFactory.createAppsManager(getInstanceEnvironment(), false);
            try {
                if (appsManager.isByteCodePreprocessingEnabled()){
                    // Initialize the preprocessor.  If for some reason there's a
                    // problem, the preprocessor will be disabled before we attempt
                    // to use it.
                    PreprocessorUtil.init
                    (appsManager.getBytecodeProcessorClassNames());
                }
            } catch (ConfigException confEx) {
                _logger.log(Level.WARNING,
                            "bytecodepreprocessor.config_ex",
                            confEx);
View Full Code Here

        DeployableObjectType moduleType) {
        try {
            InstanceEnvironment insEnv =
                new InstanceEnvironment(getInstanceName());
            if (moduleType.equals(DeployableObjectType.APP)) {
                return new AppsManager(insEnv);
            } else if (moduleType.equals(DeployableObjectType.EJB)) {
                return new EjbModulesManager(insEnv);
            } else if(moduleType.equals(DeployableObjectType.WEB)) {
                return new WebModulesManager(insEnv);
            } else if(moduleType.equals(DeployableObjectType.CONN)) {
View Full Code Here

     *          application
     */
    public static String[] getContextRootsForEmbeddedWebApp(String appName)
        throws IASDeploymentException {
        try {
            AppsManager appsManager =
                new AppsManager(new InstanceEnvironment(getInstanceName()));
            Application application =
                appsManager.getRegisteredDescriptor(appName);
            // if the application already loaded on DAS
            if (application != null) {
                ArrayList contextRoots = new ArrayList();
                for (Iterator itr = application.getWebBundleDescriptors().iterator(); itr.hasNext();) {
                    WebBundleDescriptor wbd = (WebBundleDescriptor) itr.next();
                    contextRoots.add(wbd.getContextRoot());
                }
                return (String[])contextRoots.toArray(new String[contextRoots.size()]);
            // if not, read from disk
            } else {
                // load from generated/xml dir first
                // print a warning if generated/xml dir is not there
                // and load from original dir (upgrade scenario)
                String xmlDir = appsManager.getGeneratedXMLLocation(appName);
                if (!FileUtils.safeIsDirectory(xmlDir)) {
                    String appDir = appsManager.getLocation(appName);
                    // log a warning message in the server log
                    sLogger.log(Level.WARNING, "deployment.no_xmldir",
                        new Object[]{xmlDir, appDir});
                    xmlDir = appDir;
                }
View Full Code Here

            ObjectName appsObjName = new ObjectName("com.sun.appserv:type=applications,category=config");
            String appLocation = null;
            ObjectName appObjName = null;
            try {
                appObjName = (ObjectName)getMBeanServer().invoke(appsObjName, "getJ2eeApplicationByName", new Object[] {appName}, new String[] {"java.lang.String"});
                AppsManager appsManager = new AppsManager(iEnv);
                appLocation = appsManager.getGeneratedXMLLocation(appName);
            } catch(Exception ee) {
                // no application by this name
            }
            if(appObjName == null) {
                try {
View Full Code Here

        ModuleType moduleType = null;

        try {
            // Get application descriptor

            AppsManager am = InstanceFactory.createAppsManager(
        ApplicationServer.getServerContext().getInstanceName());

            Application appD = (Application)
                DeploymentUtils.getDescriptor(standaloneModuleName, am);

            // Get the bundle descriptor for the given module
            // and determine its' type

            BundleDescriptor bd = null;
            java.util.Set bds = appD.getBundleDescriptors();
            for(Iterator it=bds.iterator(); it.hasNext(); ) {
                bd = (BundleDescriptor)it.next();
                if ((bd.getModuleDescriptor().getArchiveUri()).equals(subModuleName) ||
                     bd.getModuleID().equals(subModuleName) ||
         bd.getName().equals(subModuleName)) {
                        moduleType = bd.getModuleType();
      // set dd location
      ddLocation = am.getLocation(standaloneModuleName) +
        File.separator +
        FileUtils.makeFriendlyFileName(
          bd.getModuleDescriptor().getArchiveUri());
      break;
                }
View Full Code Here

                "ApplicationsConfigMBean.getModuleComponents for application = " +
                appName + " and module = " + modName);

            // Get application descriptor

            AppsManager am = InstanceFactory.createAppsManager(getInstanceName());
      Application appD = null;
      try {
            appD = (Application) DeploymentUtils.getDescriptor(appName, am);
      } catch (java.lang.NullPointerException npe) {
                throw new ServerInstanceException(
View Full Code Here

     * @throws ServerInstanceException
     */
    Application getDescrForApplication (String appName)
                throws ServerInstanceException {
        try {
        AppsManager appsMgr =
                InstanceFactory.createAppsManager(getInstanceName());
            return (Application)
                DeploymentUtils.getDescriptor(appName, appsMgr);
        } catch (Exception e) {
            throw new ServerInstanceException(e.getLocalizedMessage());
View Full Code Here

    public AppServWSMonitorLifeCycleProvider() {
        try {
            cfgProv = ConfigFactory.getConfigFactory().getConfigProvider();
            InstanceEnvironment ienv =
                ApplicationServer.getServerContext().getInstanceEnvironment();
            appsMgr = new AppsManager(ienv);
        } catch (Exception e) {
            _logger.fine(" Exception during initialization of AppServWSMonitorLifeCycleProvider " + e.getMessage());
            // log exception in FINE level. This excpetion should never occur.
        }
    }
View Full Code Here

        }
        wsInfoMap = new WeakHashMap();
        try {
            InstanceEnvironment ienv =
                    ApplicationServer.getServerContext().getInstanceEnvironment();
            appsMgr = new AppsManager(ienv);
        } catch (Exception e) {
            _logger.fine("AppsManager could not be instantiated: " +
                    e.getMessage());
            // log exception in FINE level. This excpetion should never occur.
        }
View Full Code Here

TOP

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

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.