org.apache.qpid.management.domain.services
Class QMan

java.lang.Object
  extended by javax.management.NotificationBroadcasterSupport
      extended by org.apache.qpid.management.domain.services.QMan
All Implemented Interfaces:
EventListener, DynamicMBean, NotificationBroadcaster, NotificationEmitter, NotificationListener

public class QMan
extends NotificationBroadcasterSupport
implements DynamicMBean, NotificationListener

Main entry point for starting Q-Man application.


Constructor Summary
QMan()
           
 
Method Summary
 void addBroker(String host, int port, String username, String password, String virtualHost, int initialPoolCapacity, int maxPoolCapacity, long maxWaitTimeout)
          Connects Q-Man with a broker defined by the given parameter.
 void createManagementClient(UUID brokerId, BrokerConnectionData data)
          Creates a management client using the given data.
 Object getAttribute(String attribute)
          Not implemented for this MBean.
 AttributeList getAttributes(String[] attributes)
          Not implemented for this MBean.
 List<ManagementClient> getManagementClients()
          Returns the list of management clients currently handled by QMan.
 MBeanInfo getMBeanInfo()
          Returns the metadata for this MBean
 void handleNotification(Notification notification, Object handback)
          Simply dispatches the incoming notification to registered listeners.
 Object invoke(String actionName, Object[] params, String[] signature)
          Invokes an operation on QMan (MBean).
static void main(String[] args)
          Main method used for starting Q-Man.
 void setAttribute(Attribute attribute)
          Not implemented for this MBean.
 AttributeList setAttributes(AttributeList attributes)
          Not implemented for this MBean.
 void setConfigurator(Configurator configurator)
          Injects the configurator on this QMan instance.
 void start()
          Starts QMan.
 void stop()
          Stop Qman
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QMan

public QMan()
Method Detail

start

public void start()
           throws StartupFailureException
Starts QMan.

Throws:
StartupFailureException - when it's not possible to proceed with startup.

addBroker

public void addBroker(String host,
                      int port,
                      String username,
                      String password,
                      String virtualHost,
                      int initialPoolCapacity,
                      int maxPoolCapacity,
                      long maxWaitTimeout)
               throws BrokerAlreadyConnectedException,
                      BrokerConnectionException
Connects Q-Man with a broker defined by the given parameter.

Parameters:
host - the hostname where the broker is running.
port - the port where the broker is running.
username - the username for connecting with the broker.
password - the password for connecting with the broker.
virtualHost - the virtual host.
initialPoolCapacity - the number of the connection that must be immediately opened.
maxPoolCapacity - the maximum number of opened connection.
maxWaitTimeout - the maximum amount of time that a client will wait for obtaining a connection.
Throws:
MBeanException - when it's not possible to connect with the broker.
BrokerAlreadyConnectedException
BrokerConnectionException

stop

public void stop()
Stop Qman


createManagementClient

public void createManagementClient(UUID brokerId,
                                   BrokerConnectionData data)
Creates a management client using the given data.

Parameters:
brokerId - the broker identifier.
data - the broker connection data.

getManagementClients

public List<ManagementClient> getManagementClients()
Returns the list of management clients currently handled by QMan.

Returns:
the list of management clients currently handled by QMan.

setConfigurator

public void setConfigurator(Configurator configurator)
Injects the configurator on this QMan instance. That configutator later will be responsible to manage the configuration.

Parameters:
configurator - the configurator to be injected.

main

public static void main(String[] args)
Main method used for starting Q-Man.

Parameters:
args - the command line arguments.

getAttribute

public Object getAttribute(String attribute)
Not implemented for this MBean.

Specified by:
getAttribute in interface DynamicMBean

getAttributes

public AttributeList getAttributes(String[] attributes)
Not implemented for this MBean.

Specified by:
getAttributes in interface DynamicMBean

getMBeanInfo

public MBeanInfo getMBeanInfo()
Returns the metadata for this MBean

Specified by:
getMBeanInfo in interface DynamicMBean
Returns:
the metadata for this MBean

invoke

public Object invoke(String actionName,
                     Object[] params,
                     String[] signature)
              throws MBeanException,
                     ReflectionException
Invokes an operation on QMan (MBean).

Specified by:
invoke in interface DynamicMBean
Parameters:
actionName - the operation name.
params - the operation parameters.
signature - the operation signature.
Returns:
the result of the invocation (if the operation is not void);
Throws:
MBeanException - Wraps a java.lang.Exception thrown by the MBean's invoked method.
ReflectionException - Wraps a java.lang.Exception thrown while trying to invoke the method

setAttribute

public void setAttribute(Attribute attribute)
Not implemented for this MBean.

Specified by:
setAttribute in interface DynamicMBean

setAttributes

public AttributeList setAttributes(AttributeList attributes)
Not implemented for this MBean.

Specified by:
setAttributes in interface DynamicMBean

handleNotification

public void handleNotification(Notification notification,
                               Object handback)
Simply dispatches the incoming notification to registered listeners. Consider that the notification is sent asynchronously so the QMan current thread is not waiting for completion of receiver task.

Specified by:
handleNotification in interface NotificationListener
Parameters:
notification - the incoming notification.
handback - the context associated to this notification.


Licensed to the Apache Software Foundation