Package com.sun.enterprise.config.serverbeans

Examples of com.sun.enterprise.config.serverbeans.NodeAgents


            ConfigContext configContext =
                ConfigFactory.createConfigContext(domainXMLLocation);
            if (configContext != null) {
                Domain domain = ServerBeansFactory.getDomainBean(configContext);
                if (domain != null) {
                    NodeAgents nodeAgents = domain.getNodeAgents();
                    if (nodeAgents != null) {
                        NodeAgent nodeAgent = nodeAgents.getNodeAgentByName(
                            System.getProperty(
                            SystemPropertyConstants.SERVER_NAME));
                        if (nodeAgent != null) {
                            elementProps = nodeAgent.getElementProperty();
                        }
View Full Code Here


   
    public static boolean isANodeAgent(ConfigContext configContext, String agentName)
        throws ConfigException
    {
        final Domain domain = getDomainConfigBean(configContext);   
        final NodeAgents controllers = domain.getNodeAgents();
        if (controllers == null) {
            return false;
        }
        final NodeAgent controller = controllers.getNodeAgentByName(agentName);
        return (controller != null ? true : false);
    }
View Full Code Here

                    throw new AgentException(ex);
                }
            }

            Domain domain = ConfigAPIHelper.getDomainConfigBean(configContext);
            NodeAgents controllers = domain.getNodeAgents();
            controllers.removeNodeAgent(controller, OVERWRITE);

            //Notify the Node Agent to rendezvous
            //FIXTHIS: We force persistence, clear any notifications, and update the
            //Application server's config context explicitely. Until this is modelled
            //as an event notification (TBD) we need this to happen before notifying or
View Full Code Here

            }

            //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 ???
View Full Code Here

            final ConfigContext configContext = getConfigContext();

            //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) {
               ElementProperty rendezvousProperty = controller.getElementPropertyByName(RENDEZVOUS_PROPERTY_NAME);
               String rendezvous=rendezvousProperty.getValue();
               if (rendezvous != null && rendezvousProperty.getValue().equals(Boolean.TRUE.toString())) {
View Full Code Here

            } catch (NumberFormatException ex) {
                throw new AgentException(_strMgr.getString("portMustBeNumeric",
                    port));
            }

            NodeAgents controllers = ServerBeansFactory.getDomainBean(configContext).getNodeAgents();

            //Create the new node controller
            NodeAgent controller = new NodeAgent();
            controller.setName(nodeAgentName);

            ElementProperty rendezvousProperty = new ElementProperty();
            rendezvousProperty.setName(RENDEZVOUS_PROPERTY_NAME);
            rendezvousProperty.setValue(rendezvousOccurred.toString());
            controller.addElementProperty(rendezvousProperty);

            JmxConnector connector = new JmxConnector();
            connector.setName(SYSTEM_CONNECTOR_NAME);
            connector.setAddress(host);
            connector.setPort(port);
            connector.setProtocol(protocol);           
            Ssl ssl = new Ssl();
            ssl.setCertNickname(KeystoreManager.CERTIFICATE_ALIAS);
            connector.setSsl(ssl);

            ElementProperty hostnameProperty = new ElementProperty();
            hostnameProperty.setName(HOST_PROPERTY_NAME);
            hostnameProperty.setValue(clientHostName);
            connector.addElementProperty(hostnameProperty);

            //ISSUE: Not sure how to set the realm name here??? The realm name in the jmx-connector
            //element refers to a realm in the security-service which is associated with a configuration.
            //Unfortunately, the node-agent does not reference a configuration!!!!!!
            connector.setAuthRealmName("admin-realm");
            controller.setJmxConnector(connector);

            // TODO: need to reconcile authrealms ???
            AuthRealm[] authRealms = new AuthRealm[1];
            authRealms[0]=new AuthRealm();
            authRealms[0].setName("admin-realm");
            authRealms[0].setClassname("com.sun.enterprise.security.auth.realm.file.FileRealm");
            ElementProperty fileProperty = new ElementProperty();
            fileProperty.setName("file");
            fileProperty.setValue("${com.sun.aas.instanceRoot}/config/admin-keyfile");
            authRealms[0].addElementProperty(fileProperty);
            ElementProperty jaasContextProperty = new ElementProperty();
            jaasContextProperty.setName("jaas-context");
            jaasContextProperty.setValue("fileRealm");
            authRealms[0].addElementProperty(jaasContextProperty);
            controller.setAuthRealm(authRealms[0]);

            controller.setSystemJmxConnectorName(SYSTEM_CONNECTOR_NAME);

            LogService log = new LogService();
            ModuleLogLevels logLevels = new ModuleLogLevels();
            log.setModuleLogLevels(logLevels);
            log.setFile("${com.sun.aas.instanceRoot}/logs/server.log");
            controller.setLogService(log);

            controllers.addNodeAgent(controller, OVERWRITE);

            //Notify the Node Agent to rendezvous
            //FIXTHIS: We force persistence, clear any notifications, and update the
            //Application server's config context explicitely. Until this is modelled
            //as an event notification (TBD) we need this to happen before notifying or
View Full Code Here

                throw new AgentException(_strMgr.getString("portMustBeNumeric",
                    port));
            }

            // TODO: get nodeagent to alter, ** need to verify code when dtd is finalized ???
            NodeAgents controllers = ServerBeansFactory.getDomainBean(configContext).getNodeAgents();
            NodeAgent controller = controllers.getNodeAgentByName(nodeAgentName);

            // Alter proper rendezvousProperties
            ElementProperty rendezvousProperty=controller.getElementPropertyByName(RENDEZVOUS_PROPERTY_NAME);
            if (rendezvousProperty != null) {
                controller.removeElementProperty(rendezvousProperty);
View Full Code Here

           
      ConfigAPIHelper.checkLegalName(serverName);
     
            // see if nodeagent exists, if not create an empty reference
            Domain domain = ConfigAPIHelper.getDomainConfigBean(configContext);           
            NodeAgents agents=domain.getNodeAgents();
            NodeAgent agent=agents.getNodeAgentByName(nodeAgentName);
            if (agent == null) {
                // create an implnodeagent reference
                NodeAgentsConfigBean naMBean = getNodeAgentsConfigBean();
                naMBean.createNodeAgentConfig(nodeAgentName);
            }                   
View Full Code Here

            if (cluster != null) {
                throw new ConfigException(_strMgr.getString(
                    "configurationNameAlreadyExistsAsCluster", newConfigName));
            }

      NodeAgents nas = domain.getNodeAgents();
      NodeAgent na = nas.getNodeAgentByName(newConfigName);
            if (na != null) {
                throw new ConfigException(_strMgr.getString(
                    "configurationNameAlreadyExistsAsNodeAgent", newConfigName));
            }
View Full Code Here

    private boolean hasRendezvousOccurred() throws ConfigException, MBeanException
    {      
        final ConfigContext configContext =
            ApplicationServer.getServerContext().getConfigContext();
        final Domain domain = ServerBeansFactory.getDomainBean(configContext);
        final NodeAgents controllers = domain.getNodeAgents();
        final NodeAgent controller = controllers.getNodeAgentByName(getNodeAgentName());
       
        boolean rendezvousOccurred = true;
        ElementProperty rendezvousProperty = null;
       
        //It is an expected case for the controller to be null. In the case where we
View Full Code Here

TOP

Related Classes of com.sun.enterprise.config.serverbeans.NodeAgents

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.