Package com.sun.appserv.management.j2ee

Examples of com.sun.appserv.management.j2ee.J2EEServer


        public static void getClusterInstanceGeneralAttributes(HandlerContext handlerCtx) {
        String instanceName = (String) handlerCtx.getInputValue("instanceName");
        try {
            ClusteredServerConfig server = AMXUtil.getDomainConfig().getClusteredServerConfigMap().get(instanceName);
            J2EEServer j2eeServer = AMXUtil.getJ2EEDomain().getJ2EEServerMap().get(instanceName);
            String config = server.getReferencedConfigName();
            String version = j2eeServer.getserverVersion();
            String node = null;
            //nodeagent name and status
            node = server.getReferencedNodeAgentName();
            String sts = NodeAgentHandlers.getNodeAgentStatus(node);
            StandAloneInstanceHandlers.getInstanceGeneralAttributes(handlerCtx, instanceName, config, version, node, sts);
View Full Code Here


        try{
            for(Map oneRow : selectedRows){
                String name = (String)oneRow.get("name");
                // see if the instance is running...
                boolean running = true;
                J2EEServer j2eeServer = AMXUtil.getJ2EEDomain().getJ2EEServerMap().get(name);
                // try to stop the cluster.
                if(j2eeServer.getstate() == StateManageable.STATE_RUNNING){
                    j2eeServer.stop();
                }
                // remove instance
                AMXUtil.getDomainConfig().removeClusteredServerConfig(name);
            }
           
View Full Code Here

        }
        else
        {
            final Map<String,J2EEServer> servers =
                domainRoot.getJ2EEDomain().getJ2EEServerMap();
            J2EEServer server = servers.get( instanceName );

            boolean running = server != null &&
                                server.getstate() == server.STATE_RUNNING ||
                                server.getstate() == server.STATE_STARTING;
            if (!running)
                throw new CommandException(getLocalizedString("InstanceNotRunning",
                                                  new Object[] {instanceName}));
        }       
    }
View Full Code Here

            }
            else
            {
                final Map<String,J2EEServer> servers =
                    domainRoot.getJ2EEDomain().getJ2EEServerMap();
                final J2EEServer server = servers.get( instanceName );

                final boolean running = server != null &&
                                    server.getstate() == server.STATE_RUNNING ||
                                    server.getstate() == server.STATE_STARTING;
                if (!running)
                    throw new CommandException(getLocalizedString("InstanceNotRunning",
                                                      new Object[] {instanceName}));
            }       
        }
View Full Code Here

  }
 
    protected Map<String,String>
  getConfigPeerProps()
  {
    final J2EEServer  server      = (J2EEServer)getContainer();
    final ServerConfig   serverConfig  = (ServerConfig)server.getConfigPeer();
    final String    configName    = serverConfig.getReferencedConfigName();
   
    final Map<String,String>  props  = new HashMap<String,String>();
   
    props.put( XTypes.CONFIG_CONFIG, configName );
View Full Code Here

        public static void getStandaloneInstanceGeneralAttributes(HandlerContext handlerCtx) {
        String instanceName = (String) handlerCtx.getInputValue("instanceName");
        Boolean isAdminServer = (Boolean) handlerCtx.getInputValue("isAdminServer");
        try {
            StandaloneServerConfig server = AMXUtil.getDomainConfig().getStandaloneServerConfigMap().get(instanceName);
            J2EEServer j2eeServer = AMXUtil.getJ2EEDomain().getJ2EEServerMap().get(instanceName);
            String config = server.getReferencedConfigName();
            String version = j2eeServer.getserverVersion();
            String sts = null;
            String node = null;
            //nodeagent name and status
            if(!isAdminServer.booleanValue()) {
                node = server.getReferencedNodeAgentName();
View Full Code Here

     */
    @Handler(id="getAppServerVersion",
        output={
        @HandlerOutput(name="version", type=String.class)})
    public static void getAppServerVersion(HandlerContext handlerCtx) {
        J2EEServer server = AMXUtil.getJ2EEDomain().getJ2EEServerMap().get("server");   
        handlerCtx.setOutputValue("version", server.getserverVersion());
    }
View Full Code Here

        ClusterConfig cluster = AMXUtil.getDomainConfig().getClusterConfigMap().get(clusterName);
        if (cluster == null) return "";
        Map<String,ClusteredServerConfig> serverMap = cluster.getClusteredServerConfigMap();
        if (serverMap.size() == 0) return "";
        for(String instance : serverMap.keySet()){
            J2EEServer j2eeServer = AMXUtil.getJ2EEDomain().getJ2EEServerMap().get(instance);
            if(j2eeServer != null){
                int state = j2eeServer.getstate();
                if (state == StateManageable.STATE_RUNNING){
                    return AMXUtil.getStatusForDisplay(j2eeServer, false);
                }
            }
        }
View Full Code Here

        if(instances != null){
            List<Map> instanceMap = (List) instances;
            for(Map oneRow : instanceMap){
                String name = (String)oneRow.get("name");
                try{
                    J2EEServer j2eeServer = AMXUtil.getJ2EEDomain().getJ2EEServerMap().get(name);
                    if(j2eeServer.getstate() == StateManageable.STATE_STOPPING || j2eeServer.getstate() == StateManageable.STATE_STOPPED || j2eeServer.getstate() == StateManageable.STATE_FAILED) {
                        stopped++;
                    }
                    if(j2eeServer.getRestartRequired() == true){
                        restart++;
                    }
                }catch(Exception ex){
                    //ignoring exception since attribute might not be found
                }
View Full Code Here

        List obj = (List) handlerCtx.getInputValue("selectedRows");
        List<Map> selectedRows = (List) obj;
        try{
            for(Map oneRow : selectedRows){
                String name = (String)oneRow.get("name");
                J2EEServer instance = AMXUtil.getJ2EEDomain().getJ2EEServerMap().get(name);
                if(start){
                    instance.start();
                }else{
                    instance.stop();
                }   
            }
        }catch(Exception ex){
            GuiUtil.handleException(handlerCtx, ex);
        }
View Full Code Here

TOP

Related Classes of com.sun.appserv.management.j2ee.J2EEServer

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.