Package org.glassfish.server

Examples of org.glassfish.server.ServerEnvironmentImpl


    public String getInstallDir() {
        return SmartFile.sanitize("" + System.getProperty("com.sun.aas.installRoot"));
    }

    public Object[] getUptimeMillis() {
        final ServerEnvironmentImpl env = InjectedValues.getInstance().getServerEnvironment();

        final long elapsed = System.currentTimeMillis() - env.getStartupContext().getCreationTime();
        final Duration duration = new Duration(elapsed);

        return new Object[]{
                    elapsed, duration.toString()
                };
View Full Code Here


        mServerName = serverName;
        FILE_SEP = System.getProperty("file.separator");

        mLevelToNotificationTypeMap = initLevelToNotificationTypeMap();
        mNotificationTypeToNotificationBuilderMap = new HashMap<String, NotificationBuilder>();
        final ServerEnvironmentImpl env = InjectedValues.getInstance().getServerEnvironment();
        loggingConfig = new LoggingConfigImpl();
        loggingConfig.setupConfigDir(env.getConfigDirPath(), env.getLibPath());
        msgIdCatalog = new MessageIdCatalog();
        mHabitat = InjectedValues.getInstance().getHabitat();
        gfFileHandler = mHabitat.getService(GFFileHandler.class);
        logFilter = mHabitat.getService(LogFilter.class);
        logger = Logger.getAnonymousLogger();
View Full Code Here

        // Only if this RA is running in a server environment and the server
        // is a clustered instance, set the variable instanceName as the real
        // server instance name. Otherwise keep the instance name as null.
        if(processType.isServer()){
          ServerEnvironmentImpl env = Globals.get(ServerEnvironmentImpl.class);
          String instance = env.getInstanceName();
         
          // Only if this RA is running in a server environment, then the Domain instance
          // can be looked up through HK2.
          Domain domain = Globals.get(Domain.class);
          Server server = domain.getServerNamed(instance);
View Full Code Here

    class Duck {

        public static String setLoggingProperty(Config c, String property, String value){
            ConfigBean cb = (ConfigBean) ((ConfigView)Proxy.getInvocationHandler(c)).getMasterView();
            ServerEnvironmentImpl env = cb.getHabitat().getComponent(ServerEnvironmentImpl.class);
            LoggingConfigImpl loggingConfig = new LoggingConfigImpl();
            loggingConfig.setupConfigDir(env.getConfigDirPath(), env.getLibPath());

            String prop = null;
            try{
                   prop= loggingConfig.setLoggingProperty(property, value);
            } catch (IOException ex){
View Full Code Here

            return prop;
        }

        public static Map<String, String>getLoggingProperties(Config c) {
            ConfigBean cb = (ConfigBean) ((ConfigView)Proxy.getInvocationHandler(c)).getMasterView();
            ServerEnvironmentImpl env = cb.getHabitat().getComponent(ServerEnvironmentImpl.class);
            LoggingConfigImpl loggingConfig = new LoggingConfigImpl();
            loggingConfig.setupConfigDir(env.getConfigDirPath(), env.getLibPath());

            Map <String, String> map = new HashMap<String, String>() ;
            try {
                map = loggingConfig.getLoggingProperties();
            } catch (IOException ex){
View Full Code Here

            return map;
        }

        public static Map<String, String>updateLoggingProperties(Config c, Map<String, String>properties){
            ConfigBean cb = (ConfigBean) ((ConfigView)Proxy.getInvocationHandler(c)).getMasterView();
            ServerEnvironmentImpl env = cb.getHabitat().getComponent(ServerEnvironmentImpl.class);
            LoggingConfigImpl loggingConfig = new LoggingConfigImpl();
            loggingConfig.setupConfigDir(env.getConfigDirPath(), env.getLibPath());

            Map <String, String> map = new HashMap<String, String>() ;
            try {
                map = loggingConfig.updateLoggingProperties(properties);
            } catch (IOException ex){
View Full Code Here

            timeout = Integer.parseInt(specifiedTimeOut) * 1000L;
        return timeout;
    }

    public static String getBrokerInstanceName(JmsService js){
        ServerEnvironmentImpl serverenv = Globals.get(ServerEnvironmentImpl.class);
        Domain domain = Globals.get(Domain.class);
        String asInstance = serverenv.getInstanceName();
        String domainName = null;
        if (isClustered()) {
            Server server = domain.getServerNamed(asInstance);

            domainName = server.getCluster().getName();
            /*ClusterHelper.getClusterForInstance(
                            ApplicationServer.getServerContext().getConfigContext(),
                            asInstance).getName();*/
        } else {
            domainName = serverenv.getDomainName();//ServerManager.instance().getDomainName();
        }
        String s = getBrokerInstanceName(domainName, asInstance, js);
        logFine("Got broker Instancename as " + s);
        String converted = convertStringToValidMQIdentifier(s);
        logFine("converted instance name " + converted);
View Full Code Here

            // remove the appName part since it is duplicated
            moduleID = moduleID.substring(pound+1);
        }
        String mdbClassName = descriptor_.getEjbClassName();

        ServerEnvironmentImpl env = Globals.get(ServerEnvironmentImpl.class);
        String instanceName = env.getInstanceName();
       
        Domain domain = Globals.get(Domain.class);
        String domainName = domain.getName();
        Cluster cluster = domain.getServerNamed(instanceName).getCluster();
View Full Code Here

    protected EJBTimerService() throws Exception {
        timerCache_     = new TimerCache();
        shutdown_       = false;

        ServerEnvironmentImpl env = ejbContainerUtil.getServerEnvironment();

        // Compose owner id for all timers created with this
        // server instance. 
        ownerIdOfThisServer_ = env.getInstanceName();
        domainName_ = env.getDomainName();
        isDas = env.isDas() || env.isEmbedded();

        initProperties();
    }
View Full Code Here

    class Duck {
        private final static Logger LOG = Logger.getLogger(Duck.class.getName());

        public static String setLoggingProperty(Config c, String property, String value) {
            ConfigBean cb = (ConfigBean) ((ConfigView) Proxy.getInvocationHandler(c)).getMasterView();
            ServerEnvironmentImpl env = cb.getHabitat().getService(ServerEnvironmentImpl.class);
            LoggingConfigImpl loggingConfig = new LoggingConfigImpl();
            loggingConfig.setupConfigDir(env.getConfigDirPath(), env.getLibPath());

            String prop = null;
            try {
                prop = loggingConfig.setLoggingProperty(property, value);
            } catch (IOException ex) {
View Full Code Here

TOP

Related Classes of org.glassfish.server.ServerEnvironmentImpl

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.