Package com.sun.mfwk.agent.appserv.connection

Examples of com.sun.mfwk.agent.appserv.connection.ConnectionRegistry


        Logger logger = LogDomains.getLogger();

        // application server domain
        String domain = (String) rms.getProperty(Constants.DOMAIN_NAME_PROP);

        ConnectionRegistry registry = ConnectionRegistry.getInstance();
        MBeanServerConnection connection =
            registry.getConnection(Constants.ADMIN_SERVER_NAME, domain);

        RelationFactory rf = new RelationFactory(rm.getContext());
            
        ObjectName[] instances =
            (ObjectName[])connection.invoke(
                new ObjectName("com.sun.appserv:type=cluster,name="
                         + ON.getKeyProperty("name") + ",category=config"),
                "listServerInstances", null, null);

         for (int i = 0; i<instances.length; i++) {

            logger.finest("Adding cluster-instance relation for instance "
                + instances[i]);
                String instanceName = instances[i].getKeyProperty("name");
                try {
                    MBeanServerConnection con =
                        registry.getConnection(instanceName, domain);
                } catch (Exception ex) {
                    continue;
                }
                String dest = "com.sun.cmm.as:type=CMM_J2eeServer,domain=" +
                    ON.getKeyProperty("domain")
View Full Code Here


        Logger logger = LogDomains.getLogger();

        // application server domain
        String domain = (String) rms.getProperty(Constants.DOMAIN_NAME_PROP);

        ConnectionRegistry registry = ConnectionRegistry.getInstance();
        MBeanServerConnection connection =
            registry.getConnection(Constants.ADMIN_SERVER_NAME, domain);

        RelationFactory rf = new RelationFactory(rm.getContext());
            
        ObjectName[] instances =
            (ObjectName[])connection.invoke(
                new ObjectName("com.sun.appserv:type=cluster,name="
                         + ON.getKeyProperty("name") + ",category=config"),
                "listServerInstances", null, null);

         for (int i = 0; i<instances.length; i++) {

            logger.finest("Adding cluster-instance relation for instance "
                + instances[i]);
                String instanceName = instances[i].getKeyProperty("name");
                try {
                    MBeanServerConnection con =
                        registry.getConnection(instanceName, domain);
                } catch (Exception ex) {
                    continue;
                }
                String dest = "com.sun.cmm.as:type=CMM_J2eeServer,domain=" +
                    ON.getKeyProperty("domain")
View Full Code Here

            String server = (String)
            rms.getProperty(Constants.SERVER_NAME_PROP);
            String domain = (String)
            rms.getProperty(Constants.DOMAIN_NAME_PROP);
           
            ConnectionRegistry registry = ConnectionRegistry.getInstance();
            MBeanServerConnection connection =
                    registry.getConnection(server, domain);
           
            //query the bean type
            beanType = (String)connection.invoke(AS_ObjectName,
                    "getType", null, null);
            Utils.log(Level.FINE, " beantype = " + beanType);
View Full Code Here

             String server = (String)
                mappingQueryService.getProperty(Constants.SERVER_NAME_PROP);
             String domain = (String)
                mappingQueryService.getProperty(Constants.DOMAIN_NAME_PROP);

             ConnectionRegistry registry = ConnectionRegistry.getInstance();
             MBeanServerConnection connection =
                    registry.getConnection(server, domain);

             //query the bean type
             beanType = (String)connection.invoke(AS_ObjectName,
                                            "getType", null, null);
         }
View Full Code Here

     * @return  mbean server connection
     * @throws  IOException  if an i/o error
     */
    private MBeanServerConnection getConnection() throws IOException {

        ConnectionRegistry reg = ConnectionRegistry.getInstance();
        String serverName = _context.getServerName();
        String domainName = _context.getDomainName();
        MBeanServerConnection mbs = reg.getConnection(serverName, domainName);

        return mbs;

        // trust any implementation
        //Map map = _context.getConnectorEnv();
View Full Code Here

       
        // unload all cmm mbeans
        unload(mbeans);
       
        // remove connection
        ConnectionRegistry reg = ConnectionRegistry.getInstance();
        reg.removeConnection(_serverName, _domainName);
    }
View Full Code Here

     * @throws IOException if i/o problem occurred in the processing
     * @throws MalformedObjectNameException  if query pattern is malformed
     */
    private Set discoverASMonitorMBeans() throws Exception {
       
        ConnectionRegistry registry = ConnectionRegistry.getInstance();
        MBeanServerConnection con =
                registry.getConnection(_serverName, _domainName);
       
        ASMBeanDiscoveryService discoveryService  =
                ASMBeanDiscoveryServiceFactory.getInstance().
                getASMBeanDiscoveryService(con);
       
        Set asMBeans =  discoveryService.discoverASMBeans(_serverName);

       
        //Get the config mbean for Cluster from the DAS Server instance
        //Ideally, we should instrument CMM object for Cluster on registration
        //event from DAS. Somehow, we are not getting an event from DAS for
        //Cluster mbean registration.
        MBeanServerConnection dasConn;
        try {
           dasConn = registry.getConnection(Constants.ADMIN_SERVER_NAME, _domainName);
        } catch (Exception e) {
           dasConn = null;
           Utils.log(Level.INFO, "Not able to get hold of DAS Connection. Not instrumenting Cluster objects");
        }
       
View Full Code Here

       
        // unload all cmm mbeans
        unload(mbeans);
       
        // remove connection
        ConnectionRegistry reg = ConnectionRegistry.getInstance();
        reg.removeConnection(_serverName, _domainName);
    }
View Full Code Here

     * @throws IOException if i/o problem occurred in the processing
     * @throws MalformedObjectNameException  if query pattern is malformed
     */
    private Set discoverASMonitorMBeans() throws Exception {
       
        ConnectionRegistry registry = ConnectionRegistry.getInstance();
        MBeanServerConnection con =
                registry.getConnection(_serverName, _domainName);
       
        ASMBeanDiscoveryService discoveryService  =
                ASMBeanDiscoveryServiceFactory.getInstance().
                getASMBeanDiscoveryService(con);
       
        Set asMBeans =  discoveryService.discoverASMBeans(_serverName);

       
        //Get the config mbean for Cluster from the DAS Server instance
        //Ideally, we should instrument CMM object for Cluster on registration
        //event from DAS. Somehow, we are not getting an event from DAS for
        //Cluster mbean registration.
        MBeanServerConnection dasConn;
        try {
           dasConn = registry.getConnection(Constants.ADMIN_SERVER_NAME, _domainName);
        } catch (Exception e) {
           dasConn = null;
           Utils.log(Level.INFO, "Not able to get hold of DAS Connection. Not instrumenting Cluster objects");
        }
       
View Full Code Here

            throw new IllegalArgumentException();
        }

        try {
            //get the connection
            ConnectionRegistry registry = ConnectionRegistry.getInstance();
            MBeanServerConnection connection = registry.getConnection(server, domain);

            ASMBeanDiscoveryServiceFactory dicoveryServiceFactory =
                ASMBeanDiscoveryServiceFactory.getInstance();

            ASMBeanDiscoveryService discoveryService =
View Full Code Here

TOP

Related Classes of com.sun.mfwk.agent.appserv.connection.ConnectionRegistry

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.