Package com.sun.enterprise.admin.util

Examples of com.sun.enterprise.admin.util.JMXConnectorConfig


     */
    public Boolean call() throws Exception {
        boolean isHealthy = true;
       
        String address = listener.getAddress();
        JMXConnectorConfig jmxCfg = null;
        String urlString = null;
        ConfigContext configCtx = InstanceHangAction.configCtx;
       
        try {
            if (address.equals(ANY_ADDR)) {
                jmxCfg = ServerHelper.getJMXConnectorInfo(configCtx,server.getName());
                address = jmxCfg.getHost();
            }
       
            boolean sslEnabled = listener.isSecurityEnabled();
            if (sslEnabled) {
                // ssl connection   
View Full Code Here


     * @author  sridatta.viswanath@sun.com
     */
    public static String getHostNameForServerInstance(String serverName)
    {
        try {
            JMXConnectorConfig info =
    ServerHelper.getJMXConnectorInfo(configCtx, serverName);
            _logger.log(Level.FINE,
      baseMsg + ".getHostNameForServerInstance: " +
      "found info: " + info.toString());
      String host = info.getHost();
            _logger.log(Level.FINE,
      baseMsg + ".getHostNameForServerInstance: " +
      "found host: " + host);
            return host;
        } catch (Throwable e){
View Full Code Here

        ConfigContext cc = AdminService.getAdminService().getAdminContext().getAdminConfigContext();
        if(cc==null) {
            return(getWebServerInfoForDAS(request));
        }
        Config config = ServerHelper.getConfigForServer(cc, serverTarget);
        JMXConnectorConfig info = ServerHelper.getJMXConnectorInfo(cc, serverTarget);
        if((config==null) || (info==null) ) {
            return(getWebServerInfoForDAS(request));
        }
        String host = info.getHost();
        return(getWebServerInfo(cc, config, null, serverTarget, host));
    }
View Full Code Here

            else {
                try {
                    ConfigContext cfgCtx = ApplicationServer.getServerContext().
                                                getConfigContext();
                    assert(cfgCtx != null);
                    JMXConnectorConfig jmxConfig = ServerHelper.
                        getJMXConnectorInfo(cfgCtx, instanceName);
                    if ( jmxConfig == null ) {
                        String msg = _localStrMgr.getString("JMXInfoNotFound",
                            instanceName);
                        throw new RuntimeException(msg);
                    }                                      


        /* Need a better way of handling connector configuration */
                    final JMXServiceURL theUrl =
                    JmxServiceUrlFactory.forRmiWithJndiInAppserver(
                        jmxConfig.getHost(),
                        Integer.parseInt(jmxConfig.getPort()));
                    url = theUrl.toString();
                } catch (ConfigException ce) {
                    throw new SynchronizationException(
                    _strMgr.getString(
                        "synchronization.api.jmx_config_ctor_failed",
View Full Code Here

        ElementProperty hostProp = connector.getElementPropertyByName(HOST_PROPERTY_NAME);   

        if (adminUser == null || adminPassword == null || hostProp == null) {
            throw new ConfigException(_strMgr.getString("missingAgentConnectorAuth", nodeAgentName));
        }
        return new JMXConnectorConfig(hostProp.getValue(), connector.getPort(),                
            adminUser, adminPassword, connector.getProtocol());
    }
View Full Code Here

                                domainXml.getAbsolutePath());                       
                        String dasName =
                            ServerHelper.getDAS(configContext).getName();           
                        Config dasConfig = ServerHelper.getConfigForServer(
                                                configContext, dasName);
                        JMXConnectorConfig dasInfo =
                            ServerHelper.getJMXConnectorInfo(configContext, 
                                                             dasName);
                        String dasPort =
                            dasConfig.getHttpService().getHttpListenerById(
                            "admin-listener").getPort();
                        String dasHost = dasInfo.getHost();                       
                       
                        getLogger().log(Level.FINE, "dasHost: " + dasHost +
                              " dasPort: " + dasPort + " dasHost2: " + dasHost2
                            + " dasPort2: " + dasPort2);
                       
View Full Code Here

       
        if(ok(pw))
            setAdminPassword(pw);
        try
        {
            JMXConnectorConfig config = ServerHelper.getJMXConnectorInfo(configCtx,
                ServerHelper.getDAS(configCtx).getName());
            dasPassword = config.getPassword();
            setAdminPassword(dasPassword);
            pw = adminPassword;
            setSystemPassword(pw);
            setDatabasePassword(pw);
            setDatabaseUser(config.getUser());
            adminPasswordManager    = new PasswordManager(this, Constants.ADMINPASSWORD, adminPassword);
            dbPasswordManager       = new PasswordManager(this, Constants.DBPASSWORD, dbPassword);
        }
        catch (Exception e)
        {
View Full Code Here

    private String getHostNameForServerInstance(ConfigContext ctx,
                                String serverName) throws LbReaderException
    {
        try {
            JMXConnectorConfig info =
                ServerHelper.getJMXConnectorInfo(ctx, serverName);
            String host = info.getHost();
            return host;
        } catch (Exception e){
            String msg = _localStrMgr.getString("GetHostNameFailed");
            throw new LbReaderException(msg,e);
        }
View Full Code Here

   
    protected MBeanServerConnectionInfo findConnectionInfo(ConfigContext configContext, String instanceName)
        throws AgentException
    {
        try {
            JMXConnectorConfig config = ServerHelper.getJMXConnectorInfo(configContext,
                instanceName);           
            return new MBeanServerConnectionInfo(config);
        } catch (Exception ex) {
            throw new AgentException(ex);
        }
View Full Code Here

            // config context
            ConfigContext cCtx = sc.getConfigContext();

            // jmx connector information
            JMXConnectorConfig jcc =
                ServerHelper.getJMXConnectorInfo(cCtx, instanceName);

            // jmx service url
            JMXServiceURL url = JmxServiceUrlFactory.forRmiWithJndiInAppserver(
                jcc.getHost(), Integer.parseInt(jcc.getPort()));

            // domain name
            String domainName =
                ServerHelper.getAdministrativeDomainName(cCtx, instanceName);

            // true when server is DAS
            boolean isDAS = ServerHelper.isDAS(cCtx, instanceName);

            // user data
            Hashtable userData = new Hashtable();
            userData.put(HOST_KEY, jcc.getHost());
            userData.put(PORT_KEY, jcc.getPort());
            userData.put(USER_KEY, jcc.getUser());
            userData.put(PASSWORD_KEY, jcc.getPassword());
            userData.put(PROTOCOL_KEY, jcc.getProtocol());
            userData.put(SystemPropertyConstants.SERVER_NAME, instanceName);
            userData.put(DOMAIN_NAME_KEY, domainName);
            userData.put(IS_DAS_KEY, new Boolean(isDAS));

            // jmx system connector certificate
View Full Code Here

TOP

Related Classes of com.sun.enterprise.admin.util.JMXConnectorConfig

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.