FileDocCategorySizeDatePackage
MQJMXConnectorInfo.javaAPI DocGlassfish v2 API6108Fri May 04 22:34:26 BST 2007com.sun.enterprise.connectors.system

MQJMXConnectorInfo

public class MQJMXConnectorInfo extends Object
The MQJMXConnectorInfo holds MBean Server connection information to a SJSMQ broker instance. This API is used by the admin infrastructure for performing MQ administration/configuration operations on a broker instance.
author
Sivakumar Thyagarajan
since
SJSAS 9.0

Fields Summary
private String
jmxServiceURL
private Map
jmxConnectorEnv
private String
asInstanceName
private String
brokerInstanceName
private String
brokerType
static Logger
_logger
private JMXConnector
connector
Constructors Summary
public MQJMXConnectorInfo(String asInstanceName, String brokerInstanceName, String brokerType, String jmxServiceURL, Map jmxConnectorEnv)


        
                                  
                                          
        this.brokerInstanceName = brokerInstanceName;
        this.asInstanceName = asInstanceName;
        this.jmxServiceURL = jmxServiceURL;
        this.brokerType = brokerType;
        this.jmxConnectorEnv = jmxConnectorEnv;
        if (_logger.isLoggable(Level.FINE)) {
            _logger.log(Level.FINE, "MQJMXConnectorInfo : brokerInstanceName " + 
                            brokerInstanceName + " ASInstanceName " + asInstanceName + 
                            " jmxServiceURL "  + jmxServiceURL +  " BrokerType " + brokerType 
                            + " jmxConnectorEnv " + jmxConnectorEnv);
        }
    
Methods Summary
public voidcloseMQMBeanServerConnection()

        try {
           if (connector != null) {
                 connector.close();
           }
        } catch (IOException e) {
            ConnectorRuntimeException cre = new ConnectorRuntimeException(e.getMessage());
            cre.initCause(e);
            throw cre;
        }
    
public java.lang.StringgetASInstanceName()

        return this.asInstanceName;
    
public java.lang.StringgetBrokerInstanceName()

        return this.brokerInstanceName;
    
public java.lang.StringgetBrokerType()

        return this.brokerType;
    
public java.util.MapgetJMXConnectorEnv()

        return this.jmxConnectorEnv;
    
public java.lang.StringgetJMXServiceURL()

        _logger.log(Level.FINE,"MQJMXConnectorInfo :: JMXServiceURL is " + this.jmxServiceURL);
        return this.jmxServiceURL;
    
public javax.management.MBeanServerConnectiongetMQMBeanServerConnection()
Returns an MBeanServerConnection representing the MQ broker instance's MBean server.

return
throws
ConnectorRuntimeException

        try {
            if (_logger.isLoggable(Level.FINE)) {
                _logger.log(Level.FINE, 
                "creating MBeanServerConnection to MQ JMXServer with "+getJMXServiceURL());
            }
            JMXServiceURL jmxServiceURL = new JMXServiceURL(getJMXServiceURL());
            connector = JMXConnectorFactory.connect(jmxServiceURL, this.jmxConnectorEnv);
            //XXX: Do we need to pass in a Subject? 
            MBeanServerConnection mbsc = connector.getMBeanServerConnection();
            return mbsc;
        } catch (Exception e) {
            e.printStackTrace();
            ConnectorRuntimeException cre = new ConnectorRuntimeException(e.getMessage());
            cre.initCause(e);
            throw cre;
        }