Package com.sun.enterprise.server

Examples of com.sun.enterprise.server.ServerContext


      if (propertiesInitialized)
    return ;

      try {
    ServerContext serverContext = ApplicationServer.getServerContext();
    if (serverContext == null) {
        // serverContext is null inside the ACC.
        String initialPort = checkORBInitialPort( EMPTY_PROPERTIES ) ;

        return ;
    } else {
        ConfigContext configContext = serverContext.getConfigContext();
        assert(configContext != null);

        Server serverBean = ServerBeansFactory.getServerBean(configContext);
        assert(serverBean != null);
View Full Code Here


    // Switch.getSwitch().setInvocationManager(invMgr);
    // createJTSTransactionManager();
  }
        // START IASRI 4662745

        ServerContext sCtx = ApplicationServer.getServerContext();
        // running on the server side
        if (sCtx != null) {
            ConfigContext ctx = sCtx.getConfigContext();
            TransactionService txnService = null;
            try {
                txnService = ServerBeansFactory.getTransactionServiceBean(ctx);
                transactionTimeout = Integer.parseInt(txnService.getTimeoutInSeconds());
                ElementProperty[] eprops = txnService.getElementProperty();
View Full Code Here

    /**
     *  A Utility method to get the LogService Configuration element.
     */
    static LogService getLogService( ) {
        try {
            ServerContext sc = ApplicationServer.getServerContext();
            if( sc == null ) {
                return null;
            }
            return ServerBeansFactory.getConfigBean(
                sc.getConfigContext()).getLogService( );
        } catch( Exception e ) {
            new ErrorManager().error( "Error In getLogService  ", e,
                ErrorManager.GENERIC_FAILURE );
        }
        return null;
View Full Code Here

      if ( verboseMode.booleanValue() == true ) {
    return true;
      }

      // check if log-console / echo-log-messages-to-stderr is true
      ServerContext sc = ApplicationServer.getServerContext();
      if (sc == null) {
    // This can happen before ApplicationServer.onInitialization()
    // has been called.
    return false;
      }

            Config cfg =
                ServerBeansFactory.getConfigBean(sc.getConfigContext());
            return cfg.getLogService().isLogToConsole();

        } catch ( Exception ex ) {
            new ErrorManager().error(
                "Error while geting echo-log-messages-to-stderr attribute of " +
View Full Code Here

     * in domain.xml (the app server config file).
     * _REVISIT_:
     * 1. Replace multiple if (loggerName) checks with a Hashmap
     */
    public static Level getConfiguredLogLevel(String loggerName) {
        ServerContext sc = ApplicationServer.getServerContext();
        if (sc == null) {
            if (loggerName.startsWith(SYNCHRONIZATION)) {
                try {
                    String level = System.getProperty(SYNCHRONIZATION, "INFO");
                    return Level.parse(level);
                } catch (Exception e) {
                    return Level.INFO;
                }
            } else {
                return Level.INFO;
            }
        }

        if (loggerName.equals(LogDomains.DPLAUDIT_LOGGER)) {
            try {
                Level level = DeploymentAuditLogHandler.getConfiguredLevel();
                return level;
            } catch (Throwable thr) {
                return Level.OFF;
            }
        }
       
        Level logLevel = null;
        try {
            Config cfg =
                ServerBeansFactory.getConfigBean(sc.getConfigContext());
            ModuleLogLevels allModulesLogLevels =
                cfg.getLogService().getModuleLogLevels( );
            // _REVISIT_: Right now ModuleLogLevels element in Log-Service
            // is optional. If the user doesn't specify any module log levels
            // then we will use 'INFO' as the default. For 8.1 this should
View Full Code Here

     *Prepare HostAndPort from the current configuration.
     *@param securityEnabled whether the listener should be secure (vs. open)
     *@return HostAndPort for the first non-admin listener matching the security setting
     */
    private static HostAndPort buildHostAndPortFromCurrentConfig(boolean securityEnabled) throws ConfigException {
        ServerContext serverContext = ApplicationServer.getServerContext();
        if (serverContext == null) {
            throw new IllegalStateException("Unable to locate server context");
        }
        ConfigContext configContext = serverContext.getConfigContext();
        if (configContext == null) {
            throw new IllegalStateException("Unable to locate config context from server");
        }
        return buildHostAndPortFromConfig(configContext, securityEnabled);
    }
View Full Code Here

    /**
     * Get AlertService config from domain.xml
     */
    private AlertService getAlertService( ) {
        try {
            ServerContext sc = ApplicationServer.getServerContext();
            if( sc == null ) {
                return null;
            }
            return ServerBeansFactory.getConfigBean(
                sc.getConfigContext()).getAlertService( );
        } catch( Exception e ) {
            new ErrorManager().error( "Error In getAlertService  ", e,
                ErrorManager.GENERIC_FAILURE );
        }
        return null;
View Full Code Here

     * then the method returns that value, otherwise it returns default
     * log file name.
     */
    private static String getLogFileName() {
        if (logFileName == null) {
            ServerContext sc = ApplicationServer.getServerContext();
            if (sc != null) {
                ConfigContext ctx = sc.getConfigContext();
                LogService ls = null;
                try {
                    ls = ServerBeansFactory.getConfigBean(ctx).getLogService();
                } catch (ConfigException ce) {
                    // Ignore this exception, intent is to use default file
View Full Code Here

    /**
     * Get default log file name.
     */
    private static String getDefaultLogFileName() {
        if (defaultLogFileName == null) {
            ServerContext sc = ApplicationServer.getServerContext();
            String instDir;
            if (sc != null) {
                instDir = sc.getInstanceEnvironment().getInstancesRoot();
            } else {
                // FIX: Use some other system property before user.dir
                instDir = System.getProperty("user.dir");
            }
            String[] names = {instDir, LOGS_DIR, LOG_FILE};
View Full Code Here

                // multicaster already sets the restart required to true
                //_logger.log(Level.INFO, "mbean.notif_failed");
            }

        }
        ServerContext svcCtx = ApplicationServer.getServerContext();
        PluggableFeatureFactory featureFactory = null;
        if (svcCtx != null) {
            featureFactory = svcCtx.getPluggableFeatureFactory();
           
            // see if there were any non reconfigurabled changes
            NotificationFactory nFactory =
                featureFactory.getNotificationFactory();
            RestartEventHelper helper = nFactory.createRestartEventHelper();
View Full Code Here

TOP

Related Classes of com.sun.enterprise.server.ServerContext

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.