org.jboss.soa.esb.listeners.gateway.mina
Class UdpGatewayConfig

java.lang.Object
  extended by org.jboss.soa.esb.listeners.gateway.mina.UdpGatewayConfig

public class UdpGatewayConfig
extends java.lang.Object

Deals with UDP configuration properties and parsing.

Author:
Daniel Bevenius

Field Summary
static java.lang.String HANDLER_CLASS_ATTR
          Handler class configuration attribute name.
static java.lang.String HOST_ATTR
          Host name configuration attribute name.
static java.lang.String PORT_ATTR
          Port configuration attribute name.
 
Constructor Summary
UdpGatewayConfig(ConfigTree config)
          Sole constructor.
 
Method Summary
 MessageHandler getHandler()
          Get the configured MessageHandler instance.
 int getPort()
          Gets the port from the configuration.
 java.lang.String getServiceCategory()
          Gets the target service category from the configuration.
 java.lang.String getServiceName()
          Gets the target service name from the configuration.
 java.net.InetSocketAddress getSocketAddress()
          Gets the InetSocketAddress that this gateway should listen to.
static int parsePort(java.lang.String portString)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HOST_ATTR

public static final java.lang.String HOST_ATTR
Host name configuration attribute name.

See Also:
Constant Field Values

PORT_ATTR

public static final java.lang.String PORT_ATTR
Port configuration attribute name.

See Also:
Constant Field Values

HANDLER_CLASS_ATTR

public static final java.lang.String HANDLER_CLASS_ATTR
Handler class configuration attribute name.

See Also:
Constant Field Values
Constructor Detail

UdpGatewayConfig

public UdpGatewayConfig(ConfigTree config)
Sole constructor.

Parameters:
config - The ConfigTree that contains the configuration information.
Method Detail

getPort

public int getPort()
            throws ConfigurationException
Gets the port from the configuration.

Returns:
int the port that the gateway should listen to.
Throws:
ConfigurationException - If the port was missing from the configuration or it could not be parse as an int.

getSocketAddress

public java.net.InetSocketAddress getSocketAddress()
                                            throws ConfigurationException
Gets the InetSocketAddress that this gateway should listen to.

Returns:
InetSocketAddress the InetSocketAddress that the gateway should listen to.
Throws:
ConfigurationException - If the host or port was missing from the configuration or if the port could not be parsed.

getServiceCategory

public java.lang.String getServiceCategory()
                                    throws ConfigurationException
Gets the target service category from the configuration.

Returns:
String The target service category
Throws:
ConfigurationException - If service category attribute is missing from the configuration.

getServiceName

public java.lang.String getServiceName()
                                throws ConfigurationException
Gets the target service name from the configuration.

Returns:
String The target service name
Throws:
ConfigurationException - If service name attribute is missing from the configuration.

getHandler

public MessageHandler getHandler()
                          throws ConfigurationException
Get the configured MessageHandler instance.

Defaults to DefaultMessageHandler.

Parameters:
config - The listener configuration.
Returns:
The MessageHandler implementation.
Throws:
ConfigurationException - Unable to create the configured MessageHandler instance.

parsePort

public static int parsePort(java.lang.String portString)
                     throws ConfigurationException
Throws:
ConfigurationException