public class TransportConfiguration extends Object implements Serializable
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<String, Object> map = new HashMap<String, Object>(); map.put("host", "localhost"); map.put("port", 61616); TransportConfiguration config = new TransportConfiguration(InVMConnectorFactory.class.getName(), map); ClientSessionFactory sf = new ClientSessionFactoryImpl(config);
Constructor and Description |
---|
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. |
TransportConfiguration(String className,
Map<String,Object> params,
String name,
Map<String,Object> extraProps)
Creates a TransportConfiguration with a specific name providing the class name of the
ConnectorFactory
and any parameters needed. |
Modifier and Type | Method and Description |
---|---|
void |
decode(ActiveMQBuffer buffer)
Decodes this TransportConfiguration from a buffer.
|
void |
encode(ActiveMQBuffer buffer)
Encodes this TransportConfiguration into a buffer.
|
boolean |
equals(Object o) |
Map<String,Object> |
getExtraParams() |
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() |
boolean |
isEquivalent(TransportConfiguration otherConfig)
There's a case on ClusterConnections that we need to find an equivalent Connector and we can't
use a Netty Cluster Connection on an InVM ClusterConnection (inVM used on tests) for that
reason I need to test if the two instances of the TransportConfiguration are equivalent while
a test a connector against an acceptor
|
boolean |
isSameParams(TransportConfiguration that) |
TransportConfiguration |
newTransportConfig(String newName) |
void |
setFactoryClassName(String factoryClassName) |
static String[] |
splitHosts(String commaSeparatedHosts)
Utility method for splitting a comma separated list of hosts
|
JsonObject |
toJson() |
String |
toString() |
static String |
toStringParameters(Map<String,Object> params,
Map<String,Object> extraProps) |
public TransportConfiguration()
public TransportConfiguration(String className, Map<String,Object> params, String name)
ConnectorFactory
and any parameters needed.className
- The class name of the ConnectorFactoryparams
- The parameters needed by the ConnectorFactoryname
- The name of this TransportConfigurationpublic TransportConfiguration(String className, Map<String,Object> params, String name, Map<String,Object> extraProps)
ConnectorFactory
and any parameters needed.className
- The class name of the ConnectorFactoryparams
- The parameters needed by the ConnectorFactoryname
- The name of this TransportConfigurationextraProps
- The extra properties that specific to protocolspublic TransportConfiguration(String className, Map<String,Object> params)
ConnectorFactory
and any parameters needed.className
- The class name of the ConnectorFactoryparams
- The parameters needed by the ConnectorFactorypublic TransportConfiguration(String className)
ConnectorFactory
className
- The class name of the ConnectorFactorypublic JsonObject toJson()
public static String[] splitHosts(String commaSeparatedHosts)
commaSeparatedHosts
- the comma separated host stringpublic TransportConfiguration newTransportConfig(String newName)
public String getName()
public String getFactoryClassName()
public Map<String,Object> getParams()
public boolean isSameParams(TransportConfiguration that)
public boolean isEquivalent(TransportConfiguration otherConfig)
otherConfig
- true
if the factory class names are equivalentspublic static String toStringParameters(Map<String,Object> params, Map<String,Object> extraProps)
public void encode(ActiveMQBuffer buffer)
Note that this is only used internally ActiveMQ Artemis.
buffer
- the buffer to encode intopublic void decode(ActiveMQBuffer buffer)
Note this is only used internally by ActiveMQ
buffer
- the buffer to decode frompublic void setFactoryClassName(String factoryClassName)
Copyright © 2018 JBoss by Red Hat. All rights reserved.