org.hornetq.api.core
Class TransportConfiguration

java.lang.Object
  extended by org.hornetq.api.core.TransportConfiguration
All Implemented Interfaces:
Serializable

public class TransportConfiguration
extends Object
implements Serializable

A TransportConfiguration is used by a client to specify a connections to a server and its backup if one exists.

Typically the constructors take the class name and parameters for needed to create the connection. These will be different dependent on which connector is being used, i.e. Netty or InVM etc. For example:

HashMap map = new HashMap();
map.put("host", "localhost");
map.put("port", 5445);
TransportConfiguration config = new TransportConfiguration(InVMConnectorFactory.class.getName(), map);
ClientSessionFactory sf = new ClientSessionFactoryImpl(config);


Author:
Tim Fox
See Also:
Serialized Form

Constructor Summary
TransportConfiguration()
          Creates a default TransportConfiguration with no configured transport.
TransportConfiguration(String className)
          Creates a TransportConfiguration providing the class name of the ConnectorFactory
TransportConfiguration(String className, Map<String,Object> params)
          Creates a TransportConfiguration providing the class name of the ConnectorFactory and any parameters needed.
TransportConfiguration(String className, Map<String,Object> params, String name)
          Creates a TransportConfiguration with a specific name providing the class name of the ConnectorFactory and any parameters needed.
 
Method Summary
 void decode(HornetQBuffer buffer)
          Decodes this TransportConfiguration from a buffer.
 void encode(HornetQBuffer buffer)
          Encodes this TransportConfiguration into a buffer.
 boolean equals(Object other)
           
 String getFactoryClassName()
          Returns the class name of ConnectorFactory being used by this TransportConfiguration
 String getName()
          Returns the name of this TransportConfiguration.
 Map<String,Object> getParams()
          Returns any parameters set for this TransportConfiguration
 int hashCode()
           
static String[] splitHosts(String commaSeparatedHosts)
          Utility method for splitting a comma separated list of hosts
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TransportConfiguration

public TransportConfiguration()
Creates a default TransportConfiguration with no configured transport.


TransportConfiguration

public TransportConfiguration(String className,
                              Map<String,Object> params,
                              String name)
Creates a TransportConfiguration with a specific name providing the class name of the ConnectorFactory and any parameters needed.

Parameters:
className - The class name of the ConnectorFactory
params - The parameters needed by the ConnectorFactory
name - The name of this TransportConfiguration

TransportConfiguration

public TransportConfiguration(String className,
                              Map<String,Object> params)
Creates a TransportConfiguration providing the class name of the ConnectorFactory and any parameters needed.

Parameters:
className - The class name of the ConnectorFactory
params - The parameters needed by the ConnectorFactory

TransportConfiguration

public TransportConfiguration(String className)
Creates a TransportConfiguration providing the class name of the ConnectorFactory

Parameters:
className - The class name of the ConnectorFactory
Method Detail

splitHosts

public static String[] splitHosts(String commaSeparatedHosts)
Utility method for splitting a comma separated list of hosts

Parameters:
commaSeparatedHosts - the comma separated host string
Returns:
the hosts

getName

public String getName()
Returns the name of this TransportConfiguration.

Returns:
the name

getFactoryClassName

public String getFactoryClassName()
Returns the class name of ConnectorFactory being used by this TransportConfiguration

Returns:
The factory's class name

getParams

public Map<String,Object> getParams()
Returns any parameters set for this TransportConfiguration

Returns:
the parameters

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object other)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

encode

public void encode(HornetQBuffer buffer)
Encodes this TransportConfiguration into a buffer.

Note that this is only used internally HornetQ.

Parameters:
buffer - the buffer to encode into

decode

public void decode(HornetQBuffer buffer)
Decodes this TransportConfiguration from a buffer.

Note this is only used internally by HornetQ

Parameters:
buffer - the buffer to decode from


Copyright © 2009 Red Hat Inc. All Rights Reserved.