Package com.sun.enterprise.config.serverbeans

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


       
        // check to see if jmx secure flas has changed
        Server das = ServerHelper.getDAS(getConfigContext());
        if (das != null) {
            String dasName=das.getName();
            JmxConnector dasConnector = ServerHelper.getServerSystemConnector(
                                            getConfigContext(), dasName);
            if (dasConnector != null) {
                String jmxConnSecure =
                    String.valueOf(dasConnector.isSecurityEnabled());
                if (!String.valueOf(
                        dasProperty.isDASSecure()).equals(jmxConnSecure)) {
                    dasProperty.setIsDASSecure(jmxConnSecure);
                    bWrite = true;
                }
View Full Code Here


    private boolean haveDASCoordinatesChanged(String newHost, String newPort)
    throws ConfigException {
       
        AdminService as =
            ServerHelper.getAdminServiceForServer(getConfigContext(), "server");
        JmxConnector jmxConn =
            as.getJmxConnectorByName(as.getSystemJmxConnectorName());
       
        if (!jmxConn.getPort().equals(newPort)) return true;

        ElementProperty clientHostname =
            jmxConn.getElementPropertyByName(HOST_PROPERTY_NAME);
        if (!newHost.equals((String)clientHostname.getValue())) return true;
       
        return false;
    }
View Full Code Here

    private void notifyAllNodeAgentsOfNewLocation(ConfigContext cc) {
        try {
            AdminService as = ServerHelper.getAdminServiceForServer(
                                cc, "server");
            JmxConnector config = as.getJmxConnectorByName(
                                      as.getSystemJmxConnectorName());           
            ElementProperty clientHostname = config.getElementPropertyByName(
                                            IAdminConstants.HOST_PROPERTY_NAME);
            if (clientHostname != null) {
                String newHost = (String) clientHostname.getValue();
                NodeAgent[] nas = NodeAgentHelper.getNodeAgentsInDomain(cc);
                for (NodeAgent na : nas)
                    dasHasMoved(newHost, config.getPort(), na);
            }           
        } catch (ConfigException ce) {
            _logger.log(Level.WARNING, _strMgr.getString(
                            "notifier.fetch_error", ce.getMessage()));
        }
View Full Code Here

            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 - " +
                dasConnector.getPort() + "|" + dasConnector.isSecurityEnabled());
            sxRet=dasConnector.getPort() + "|" + String.valueOf(dasConnector.isSecurityEnabled());

        } catch (Exception ex) {
            throw getExceptionHandler().handleAgentException(
                ex, "nodeagent.rendezvousWithDAS.Exception", nodeAgentName);
        }
View Full Code Here

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

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

     */
    private String getCertNickname(ConfigContext ctx, String instanceName)
            throws ConfigException {

        String certNickname = null;
        JmxConnector con =
            ServerHelper.getServerSystemConnector(ctx, instanceName);
        if (con != null) {
            Ssl ssl = con.getSsl();
            if (ssl != null) {
                certNickname = ssl.getCertNickname();
            }
        }
        if (certNickname == null) {
View Full Code Here

        jmsh.setHost(System.getProperty(SystemPropertyConstants.HOST_NAME_PROPERTY));
        //don't set the port as it is "tokenized" appropriately
    }
    private static void addClientHostNameProperty2SystemJmxConnector(final Config someConfig) throws ConfigException {
        final com.sun.enterprise.config.serverbeans.AdminService as = someConfig.getAdminService();
        final JmxConnector jc    = as.getJmxConnectorByName(IAdminConstants.SYSTEM_CONNECTOR_NAME);
        final String hostValue   = System.getProperty(SystemPropertyConstants.HOST_NAME_PROPERTY);
        final String hostName    = IAdminConstants.HOST_PROPERTY_NAME;
        ElementProperty ep       = jc.getElementPropertyByName(hostName);

        if (ep == null) {
            ep = new ElementProperty();
            ep.setName(hostName);
            ep.setValue(hostValue);
            jc.addElementProperty(ep);
        } else {
            ep.setValue(hostValue);
        }
    }
View Full Code Here

                        String host=null;
                        Node node = nodes.createChild(Node.class);

                        node.setName(na.getName());
                        node.setType("CONFIG");
                        JmxConnector jc = na.getJmxConnector();
                        if (jc != null){
                            List<Property> agentProp =jc.getProperty()//get the properties and see if host name is specified
                            for ( Property p : agentProp)  {
                                String name = p.getName();
                                if (name.equals("client-hostname")) {
                                    node.setNodeHost(p.getValue()); //create the node with a host name
                                    node.setInstallDir("${com.sun.aas.productRoot}");
View Full Code Here

    }

    private void addSslToJMXConnector(Config config, ActionReport report) {
        AdminService adminService = config.getAdminService();
        // ensure we have the specified listener
        JmxConnector jmxConnector = null;
        for (JmxConnector jmxConn : adminService.getJmxConnector()) {
            if (jmxConn.getName().equals(listenerId)) {
                jmxConnector = jmxConn;
            }
        }
        if (jmxConnector == null) {
            report.setMessage(
                localStrings.getLocalString("create.ssl.jmx.notfound",
                    "JMX Connector named {0} to which this ssl element is " +
                        "being added does not exist.", listenerId));
            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
            return;
        }
        if (jmxConnector.getSsl() != null) {
            report.setMessage(
                localStrings.getLocalString("create.ssl.jmx.alreadyExists",
                    "IIOP Listener named {0} to which this ssl element is " +
                        "being added already has an ssl element.", listenerId));
            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
View Full Code Here

TOP

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

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.