org.apache.qpid.management.configuration
Class Configurator

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.apache.qpid.management.configuration.Configurator
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class Configurator
extends DefaultHandler

Director used for coordinating the build process of configuration. This is the only component which has a read-write permission on Configuration object.


Field Summary
(package private)  IParser _brokerConfigurationParser
           
(package private)  IParser _currentParser
           
(package private)  IParser _workerManagerConfigurationParser
           
(package private) static IParser DEFAULT_PARSER
          Default (empty) parser used when there's no need to process data (non relevant elements).
 
Constructor Summary
Configurator()
           
 
Method Summary
(package private)  void addMandatoryManagementMessageHandlers()
          Configures the mandatory management message handlers.
(package private)  void addMandatoryMethodReplyMessageHandlers()
          Configures the mandatory management message handlers.
 void characters(char[] ch, int start, int length)
          Delegates the processing to the current parser.
 void configure()
          Builds whole configuration.
 BrokerConnectionData createAndReturnBrokerConnectionData(UUID brokerId, String host, int port, String username, String password, String virtualHost, int initialPoolCapacity, int maxPoolCapacity, long maxWaitTimeout)
          Creates and return a value object (BrokerConnectionData) with the given parameters.
 void endElement(String uri, String localName, String name)
           
 void startElement(String uri, String localName, String name, Attributes attributes)
          Here is defined what parser needs to be used for processing the current data.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PARSER

static final IParser DEFAULT_PARSER
Default (empty) parser used when there's no need to process data (non relevant elements).


_brokerConfigurationParser

IParser _brokerConfigurationParser

_workerManagerConfigurationParser

IParser _workerManagerConfigurationParser

_currentParser

IParser _currentParser
Constructor Detail

Configurator

public Configurator()
Method Detail

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws SAXException
Delegates the processing to the current parser.

Specified by:
characters in interface ContentHandler
Overrides:
characters in class DefaultHandler
Throws:
SAXException

startElement

public void startElement(String uri,
                         String localName,
                         String name,
                         Attributes attributes)
                  throws SAXException
Here is defined what parser needs to be used for processing the current data.

Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class DefaultHandler
Throws:
SAXException

endElement

public void endElement(String uri,
                       String localName,
                       String name)
                throws SAXException
Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class DefaultHandler
Throws:
SAXException

configure

public void configure()
               throws ConfigurationException
Builds whole configuration.

Throws:
ConfigurationException - when the build fails.

createAndReturnBrokerConnectionData

public BrokerConnectionData createAndReturnBrokerConnectionData(UUID brokerId,
                                                                String host,
                                                                int port,
                                                                String username,
                                                                String password,
                                                                String virtualHost,
                                                                int initialPoolCapacity,
                                                                int maxPoolCapacity,
                                                                long maxWaitTimeout)
                                                         throws BrokerAlreadyConnectedException,
                                                                BrokerConnectionException
Creates and return a value object (BrokerConnectionData) with the given parameters. Note that that object will be stored on configuration and it could be used to set a connection with the broker. This happens when the "initialPoolCapacity" is greater than 0 : in this case the caller is indicatinf that it wants to open one or more connections immediately at startup and therefore Q-Man will try to do that.

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.
Returns:
the value object containing the data above.
Throws:
BrokerAlreadyConnectedException - when the broker is already connected.
BrokerConnectionException - when a connection cannot be estabilished.

addMandatoryMethodReplyMessageHandlers

void addMandatoryMethodReplyMessageHandlers()
Configures the mandatory management message handlers.


addMandatoryManagementMessageHandlers

void addMandatoryManagementMessageHandlers()
Configures the mandatory management message handlers.



Licensed to the Apache Software Foundation