Package com.sun.enterprise.config.serverbeans

Examples of com.sun.enterprise.config.serverbeans.Server$CreateDecorator


            if (lcm == null || config == null) {
                return false;
            }

            // find the ref to the life cycle module
            final Server server = ServerBeansFactory.getServerBean(config);
            final ApplicationRef appRef=server.getApplicationRefByRef(lcm.getName());

            // true if enabled in both lifecyle module and in the ref
            return ((lcm.isEnabled()) &&
                        (appRef != null && appRef.isEnabled()));
View Full Code Here


      //Server[] servers = ServerHelper.getServersInCluster(configCtx, cluster);

      if (serverRefs != null) {
          for (int i = 0; i < serverRefs.length; i++) {
        String serverName = serverRefs[i].getRef();
        Server server = ServerHelper.getServerByName(configCtx, serverName);
        List<SocketInfo> listOfSocketInfo =
          getSocketInfoForServer(serverRefs[i], listeners[i]);
               
        // REVISIT - make orbutil utility
        // and use in IiopFolbGmsClient and here.
        SocketInfo[] arrayOfSocketInfo =
          new SocketInfo[listOfSocketInfo.size()];
        int x = 0;
        for (SocketInfo si : listOfSocketInfo) {
          arrayOfSocketInfo[x++] = si;
        }
        _logger.fine("server.getLbWeight() = "+ server.getLbWeight());
        // REVISIT - default 100 weight
        // Not used by JNLP but should put in the actual weight.
        ClusterInstanceInfo clusterInstanceInfo =
          new ClusterInstanceInfo(serverName, (Integer.valueOf(server.getLbWeight())).intValue(), arrayOfSocketInfo);
        result.add(clusterInstanceInfo);
        if (_logger.isLoggable(Level.FINE)) {
          _logger.log(Level.INFO,
          baseMsg + ".getClusterForInstance: " +
          ASORBUtilities.toString(clusterInstanceInfo));
View Full Code Here

  // one for non ssl, one for ssl and third for ssl mutual auth
 
        IiopListener[][] listeners = new IiopListener[serverRefs.length][3]//SHEETAL can there be multiple SSL or
                                                                         //SSL_MUTH_AUTH ports? bug 6321813
  for (int i = 0; i < serverRefs.length; i++) {
      Server server =
    ServerHelper.getServerByName(configCtx, serverRefs[i].getRef());
      String configRef = server.getConfigRef();
      Config config =
    ConfigAPIHelper.getConfigByName(configCtx, configRef);
      IiopService iiopService = config.getIiopService();
      listeners[i] = iiopService.getIiopListener();
  }
View Full Code Here

    public void run() {
        Boolean isHealthy = false;
        try {
            ArrayList<HttpListener> enabledListeners = new ArrayList<HttpListener>();
         
            Server serv = instance.getServer();
            ConfigContext cfgCtx = InstanceHangAction.configCtx;
            Config cfg = ServerHelper.getConfigForServer(cfgCtx, serv.getName());
       
            // get http-listeners on this server
            HttpService httpSrv = cfg.getHttpService();
            HttpListener[] listeners = httpSrv.getHttpListener();
            for (HttpListener listener : listeners) {
                if (listener.isEnabled()) {
                    enabledListeners.add(listener);
                    //count++;         
                }
            }
       
            int size = enabledListeners.size();
           
            ExecutorService exSrv = Executors.newFixedThreadPool(size);
            ArrayList<Future<Boolean>> checkTasks = new ArrayList<Future<Boolean>>(size);
            int timeout = instance.getTimeout();
            int i = 0;
       
            for (HttpListener listener : enabledListeners) {
                Callable<Boolean> checkListener = new CheckListenerHealth(serv,
                                                                       listener,
                                                                     timeout);
                Future<Boolean> task = exSrv.submit(checkListener);
                checkTasks.add(task);
            }
       
            // wait for status from the checks
            for (Future<Boolean> task : checkTasks) {
                isHealthy = task.get();
                if (isHealthy) {
                    //found atleast one healthy listener on the instance
                    if (instance.getClusterName()!=null) {
                        _logger.log(Level.INFO,"sgmt.instancehang_clserverhealthy",
                                    new Object[]{serv.getName(),instance.getClusterName()});
                       
                    } else {
                        _logger.log(Level.INFO,"sgmt.instancehang_serverhealthy",
                                    serv.getName());
                    }
                    break;
               
            }
       
            if(!isHealthy) {
                String cName = instance.getClusterName();
                if (cName!=null) {
                    //clustered server
                    _logger.log(Level.WARNING,"sgmt.instancehang_clserverunhealthy",
                                new Object[]{cName,serv.getName()});
                } else {
                    //standalone server
                    _logger.log(Level.WARNING,"sgmt.instancehang_serverunhealthy",
                                serv.getName());
                }
            }
        } catch (InterruptedException ex) {
            throw new RuntimeException(ex);
        } catch (ExecutionException ex) {
View Full Code Here

    }
   
    private int calcMaxPoolSize(String poolName) {
        int maxConnections = poolNameMap.get(poolName);
        ConfigContext ctx = AdminService.getAdminService().getAdminContext().getAdminConfigContext();
        Server servers[] = null;
        try {
            servers = ServerHelper.getServersReferencingJdbcPool(ctx, poolName);
        } catch (ConfigException ex) {
            // log the exception
        }
View Full Code Here

            throws ConfigException {
        getWebModule(modId).setDescription(desc);
    }
   
    public String getVirtualServers(String modId) throws ConfigException {
  Server server = ServerBeansFactory.getServerBean(configContext);
  ApplicationRef ar = server.getApplicationRefByRef(modId);
  return ar.getVirtualServers();
    }
View Full Code Here

     */
    protected boolean isEnabled(ConfigContext config, String moduleName) {
        try {
            ConfigBean app = ApplicationHelper.findApplication(config, moduleName);

            Server server = ServerBeansFactory.getServerBean(config);
            ApplicationRef appRef = server.getApplicationRefByRef(moduleName);

            return ((app != null && app.isEnabled()) &&
                        (appRef != null && appRef.isEnabled()));
        } catch (ConfigException e) {
            AdminEventListenerException ex = new AdminEventListenerException();
View Full Code Here

     */
    protected boolean isEnabled(ConfigContext config, String moduleName) {
        try {
            ConfigBean app = ApplicationHelper.findApplication(config, moduleName);

            Server server = ServerBeansFactory.getServerBean(config);
            ApplicationRef appRef = server.getApplicationRefByRef(moduleName);

            return ((app != null && app.isEnabled()) &&
                        (appRef != null && appRef.isEnabled()));
        } catch (ConfigException e) {
            AdminEventListenerException ex = new AdminEventListenerException();
View Full Code Here

            logger.log(Level.FINE, "Instance Name :" + instanceName);

            ConfigContext configContext =
                    AdminService.getAdminService().getAdminContext().getAdminConfigContext();
            Server server = ServerHelper.getServerByName(configContext, instanceName);
            configName = server.getConfigRef();
            Config config = ConfigAPIHelper.getConfigByName(configContext,
                    configName);
      if(attribute.equals(ServerTags.FILE)) {
    LogService logService = config.getLogService();
                return determineLogFile(logService.getFile());
View Full Code Here

     */
    protected boolean isEnabled (ConfigContext config, String moduleName) {
        try {
            ConfigBean app = ApplicationHelper.findApplication(config, moduleName);

            Server server = ServerBeansFactory.getServerBean(config);
            ApplicationRef appRef = server.getApplicationRefByRef(moduleName);
            return ((app != null && app.isEnabled()) &&
                        (appRef != null && appRef.isEnabled()));
        } catch (ConfigException e) {
            AdminEventListenerException ex = new AdminEventListenerException();
            ex.initCause(e);
View Full Code Here

TOP

Related Classes of com.sun.enterprise.config.serverbeans.Server$CreateDecorator

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.