Package com.sun.enterprise.ee.admin.servermgmt

Examples of com.sun.enterprise.ee.admin.servermgmt.AgentException


                    match=true;
                    break;
                }
            }
        } catch (RepositoryException e) {
            throw new AgentException(e);
        }
        return match;
    }
View Full Code Here


                }
            }
        }
        if (tooMany) {
            // There were more than one domain matching the specified host & port
            throw new AgentException(_strMgr.getString(
                "nodeAgent.attemptLocalRendezvous.TooManyLocalDomains",
                dasHost2 + ":" + dasPort2, root.getAbsolutePath()));
        } else if (goodConfigContext == null) {
            // There were no domains matching the specified host
            // and port NoLocalDomains
            throw new AgentException(_strMgr.getString(
                "nodeAgent.attemptLocalRendezvous.NoLocalDomains",
                dasHost2 + ":" + dasPort2, root.getAbsolutePath()));
        } else {
            // There was exactly one domain, flush out its domain.xml
            NodeAgentsConfigBean ncb =
View Full Code Here

           
        } catch (Exception e) {
            // need to catch specific exception for sync
            getLogger().log(Level.WARNING,
                "nodeagent.synchronization.Exception",e);
            throw new AgentException(e);
        }
        return iret;
    }
View Full Code Here

                StringManagerBase sm = StringManagerBase.getStringManager(
                                        getLogger().getResourceBundleName());
                String msg = sm.getString(
                    "nodeagent.noKeyStoreFoundForInstanceSync");
                getLogger().log(Level.SEVERE, msg);                                      
                throw new AgentException(msg);
            } else {
                ar.add("-D" + "javax.net.ssl.keyStore" + "=" +
                    System.getProperty("javax.net.ssl.keyStore"));
                ar.add("-D" + "javax.net.ssl.trustStore" + "=" +
                    System.getProperty("javax.net.ssl.trustStore"));
View Full Code Here

        } catch (AgentException ae) {
            throw ae;
           
        } catch (Exception e) {
            getLogger().log(Level.WARNING, "nodeagent.initialization.Exception", e);
            throw new AgentException(e);
        }
       
    }
View Full Code Here

            //FIXTHIS: We could expect the proxy to do this for us as it
            //seems to be a common case.
            if (NodeAgentProxy.isUnreachable(ex)) {
                // do nothing
            } else {
                throw new AgentException(ex);
            }
        }
    }
View Full Code Here

            //FIXTHIS: We could expect the proxy to do this for us as it
            //seems to be a common case.
            if (NodeAgentProxy.isUnreachable(ex)) {
                return new RuntimeStatus(agentName);
            } else {
                throw new AgentException(ex);
            }
        }
    }
View Full Code Here

            //Ensure that there are no server instances referring to the node agent
            Server[] servers = ServerHelper.getServersOfANodeAgent(configContext,
                nodeAgentName);
            if (servers.length > 0) {
                throw new AgentException(_strMgr.getString("agentHasServerReferrences",
                    nodeAgentName, ServerHelper.getServersAsString(servers)));
            }

            //Get a connection to the agent's mbean server before removing the node controller;
            //otherwise, we may never be able to find it in domain.xml when we want to
            //synchronizeWithDAS below.
            try {
                NodeAgentRegistry.getNodeAgentConnection(nodeAgentName);
            } catch (Exception ex) {
                //The node agent may be unreachable (i.e. not listening) so this exception is expected.
                if (!NodeAgentRegistry.isMBeanServerUnreachable(ex)) {
                    throw new AgentException(ex);
                }
            }

            Domain domain = ConfigAPIHelper.getDomainConfigBean(configContext);
            NodeAgents controllers = domain.getNodeAgents();
View Full Code Here

        String port="9999";
        try {
            final ConfigContext configContext = getConfigContext();
            //validate name uniqueness
            if (!ConfigAPIHelper.isNameUnique(configContext, nodeAgentName)) {
                 throw new AgentException(_strMgr.getString("agentNameNotUnique",
                    nodeAgentName));
            }

            //Get the node controller specified by nodeAgentName and ensure that it does not
            //already exist
            Domain domain = ServerBeansFactory.getDomainBean(configContext);
            NodeAgents controllers =domain.getNodeAgents();
            NodeAgent controller = controllers.getNodeAgentByName(nodeAgentName);
            if (controller != null) {
                throw new AgentException(_strMgr.getString("agentAlreadyExists", nodeAgentName));
            }

            // add in "0.0.0.0"  as use host as clientHostName has a place holder until CLI is decided ???
            addNodeAgent(AgentConfig.NODEAGENT_DEFAULT_HOST_ADDRESS, port, nodeAgentName,
                AgentConfig.NODEAGENT_JMX_DEFAULT_PROTOCOL, host, Boolean.FALSE);
View Full Code Here

            if (controller != null) {
               ElementProperty rendezvousProperty = controller.getElementPropertyByName(RENDEZVOUS_PROPERTY_NAME);
               String rendezvous=rendezvousProperty.getValue();
               if (rendezvous != null && rendezvousProperty.getValue().equals(Boolean.TRUE.toString())) {
                    // should only rendezvous once, not the same, throw exception
                    throw new AgentException(_strMgr.getString("agentAlreadyExists", nodeAgentName));
                }

                // alter node agent in domain.xml to the criteria sent
                alterNodeAgent(host, port, nodeAgentName, protocol, clientHostName, Boolean.TRUE);

            } else {
                // need to make sure a unique instance is being added.
                if (!ConfigAPIHelper.isNameUnique(configContext, nodeAgentName)) {
                     throw new AgentException(_strMgr.getString("agentNameNotUnique",
                        nodeAgentName));
                }

                // add node agent to domain.xml
                addNodeAgent(host, port, nodeAgentName, protocol, clientHostName, Boolean.TRUE);
            }

            // after proper nodeagent rendezvous, return port for system jmx connector
            String dasName = System.getProperty(SystemPropertyConstants.SERVER_NAME);
            if (dasName == null) {
                throw new AgentException(_strMgr.getString("noDASServerNameProperty"));
            }
           
            JmxConnector dasConnector=ServerHelper.getServerSystemConnector(configContext, dasName);
            //JMXConnectorConfig dasConnectorConfig = ServerHelper.getJMXConnectorInfo(configContext, dasName);
            getLogger().log(Level.FINE," Nodeagent: " + nodeAgentName + " has Renezvoused -  returning DAS JMXport|Security Enabled - " +
View Full Code Here

TOP

Related Classes of com.sun.enterprise.ee.admin.servermgmt.AgentException

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.