Package com.sun.enterprise.config.serverbeans

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


            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())) {
                    // 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
View Full Code Here


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

            // 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);
            }
           
            rendezvousProperty=new ElementProperty();
            rendezvousProperty.setName(RENDEZVOUS_PROPERTY_NAME);
            rendezvousProperty.setValue(rendezvousOccurred.toString());
            controller.addElementProperty(rendezvousProperty);                        

            // add/alter proper JmxConnector
            JmxConnector connector=controller.getJmxConnector();
            // alter/add attribute information
            connector.setAddress(host);
            connector.setPort(port);
            connector.setProtocol(protocol);

            // set host name for jmxconnector
            ElementProperty hostnameProperty=connector.getElementPropertyByName(HOST_PROPERTY_NAME);
            if(hostnameProperty == null) {
                hostnameProperty=new ElementProperty();
                hostnameProperty.setName(HOST_PROPERTY_NAME);
                connector.addElementProperty(hostnameProperty);
            }
            hostnameProperty.setValue(clientHostName);

            //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

        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
        //are unbinding from a node agent, the node controller element will already be
        //removed before invoking synchronizeWithDAS via this proxy.
        //Tested case where nodeagent has never rendezvoused and then it is deleted, works correctly
        //with connection failure exception being thrown
        if (controller != null) {                   
            //See if a rendezvous has occurred       
            rendezvousProperty = controller.getElementPropertyByName(
                IAdminConstants.RENDEZVOUS_PROPERTY_NAME);           
            rendezvousOccurred = new Boolean(rendezvousProperty.getValue()).booleanValue();                
        }
       
        if (rendezvousOccurred) {
            if (controller == null) {
                getLogger().log(Level.FINEST, "NodeAgentProxy: Defaulted to NodeAgent has rendezvoused since the agent has been removed ???");
View Full Code Here

        com.sun.enterprise.config.serverbeans.LoadBalancer lb = null;
        try{
            lb = ((Domain)_ctx.getRootConfigBean()).
                    getLoadBalancers().getLoadBalancerByName(lbName);
            ElementProperty [] properties = lb.getElementProperty();
            ElementProperty host = null;
            ElementProperty port = null;
            ElementProperty proxyHost = null;
            ElementProperty proxyPort = null;
            ElementProperty secProp = null;
            for(ElementProperty prop : properties){
                if(prop.getName().equals(LoadBalancerConfig.SSL_PROXY_HOST_PROPERTY))
                    proxyHost = prop;
                else if(prop.getName().equals(LoadBalancerConfig.SSL_PROXY_PORT_PROPERTY))
                    proxyPort = prop;
                else if(prop.getName().equals(LoadBalancerConfig.DEVICE_HOST_PROPERTY))
                    host = prop;
                else if(prop.getName().equals(LoadBalancerConfig.DEVICE_ADMIN_PORT_PROPERTY))
                    port = prop;
                else
                if(prop.getName().equals(LoadBalancerConfig.IS_SECURE_PROPERTY))
                   secProp = prop;
            }
            String lbHost = host!=null?host.getValue():null;
            String lbPort = port!=null?port.getValue():null;
            String lbProxyHost = proxyHost!=null?proxyHost.getValue():null;
            String lbProxyPort = proxyPort!=null?proxyPort.getValue():null;
            boolean isSec = secProp!=null? Boolean.getBoolean(secProp.getValue()):true;

            _connectionManager = new
            ConnectionManager(lbHost,lbPort,lbProxyHost,lbProxyPort,lbName,isSec);
        } catch ( Exception e ){
            e.printStackTrace();
View Full Code Here

            int i =0;
            eprops = new ElementProperty [props.size()];
            for(Enumeration names = props.propertyNames();
                    names.hasMoreElements(); ){
                name = (String)names.nextElement();                       
                eprops[i] = new ElementProperty();
                eprops[i].setName(name);
                eprops[i].setValue(props.getProperty(name));
                i++;
            }
        }
View Full Code Here

        _ctx = ctx;
        com.sun.enterprise.config.serverbeans.LoadBalancer lb = null;
        try{
            lb = ((Domain)_ctx.getRootConfigBean()).
                    getLoadBalancers().getLoadBalancerByName(lbName);
            ElementProperty host = lb.getElementPropertyByName(LoadBalancerConfig.DEVICE_HOST_PROPERTY);
            ElementProperty port = lb.getElementPropertyByName(LoadBalancerConfig.DEVICE_ADMIN_PORT_PROPERTY);
            ElementProperty proxyHost = lb.getElementPropertyByName(LoadBalancerConfig.SSL_PROXY_HOST_PROPERTY);
            ElementProperty proxyPort = lb.getElementPropertyByName(LoadBalancerConfig.SSL_PROXY_PORT_PROPERTY);
            ElementProperty isSecure = lb.getElementPropertyByName(LoadBalancerConfig.IS_SECURE_PROPERTY);
            String lbHost = host!=null?host.getValue():null;
            String lbPort = port!=null?port.getValue():null;
            String lbProxyHost = proxyHost!=null?proxyHost.getValue():null;
            String lbProxyPort = proxyPort!=null?proxyPort.getValue():null;
            boolean isSec = isSecure!=null? Boolean.getBoolean(isSecure.getValue()):true;
            _connectionManager = new
            ConnectionManager(lbHost,lbPort,lbProxyHost,lbProxyPort,lbName,isSec);
        } catch ( Exception e ){
            throw new IOException(e.getMessage());
        }
View Full Code Here

   
    private static ElementProperty[] map2Properties(final Map<String, String> attributes) {
        final ElementProperty[] props = new ElementProperty[attributes.size()];
        int i = 0;
        for (String n : attributes.keySet()) {
            final ElementProperty prop = new ElementProperty();
            prop.setName(n);
            prop.setValue(attributes.get(n));
            props[i] = prop;
            i++;
        }
        return ( props ) ;
    }
View Full Code Here

        ArrayList list = new ArrayList();
        Enumeration keys = props.keys();

        while (keys.hasMoreElements()) {
            final String key = (String) keys.nextElement();
            ElementProperty property = new ElementProperty();
            property.setName(key);
            property.setValue((String) props.get(key));
            list.add(property);
        }

        return (ElementProperty[]) list.toArray(new ElementProperty[list.size()]);
    }
View Full Code Here

        _applicationRef = ref;
    }

    public String getContextRoot() throws LbReaderException {
        String context = null;
        ElementProperty prop = null;

        if (_extMod != null) {
            prop = _extMod.getElementPropertyByName(CONTEXT_ROOT);
            if (prop != null)
                context = prop.getValue();
        }
        return context;
    }
View Full Code Here

TOP

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

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.