Package com.adaptris.jmx.remote.jms
Class JmsJmxConnectionFactoryImpl
- java.lang.Object
-
- com.adaptris.jmx.remote.jms.JmsJmxConnectionFactoryImpl
-
- All Implemented Interfaces:
JmsJmxConnectionFactory
,javax.jms.ConnectionFactory
public abstract class JmsJmxConnectionFactoryImpl extends java.lang.Object implements JmsJmxConnectionFactory
Base class forJmsJmxConnectionFactory
instances.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
JmsJmxConnectionFactoryImpl.DestinationFactory
protected class
JmsJmxConnectionFactoryImpl.JmxJmsConnection
-
Field Summary
Fields Modifier and Type Field Description protected JmsJmxConnectionFactoryImpl.JmxJmsConnection
defaultConnection
protected JmsJmxConnectionFactoryImpl.DestinationFactory
destinationFactory
protected java.util.Map<java.lang.String,?>
initialEnvironment
protected java.util.Map<java.lang.String,java.lang.String>
jmsEnvironment
protected java.lang.Object
lock
protected static org.slf4j.Logger
log
-
Fields inherited from interface com.adaptris.jmx.remote.jms.JmsJmxConnectionFactory
ATTR_BROKER_PASSWORD, ATTR_BROKER_USERNAME, ATTR_CLIENT_ID, ATTR_DESTINATION, ATTR_DESTINATION_TYPE, ATTR_RETRY_INTERVAL_MS, ATTR_TIMEOUT_MS, DEFAULT_RETRY_INTERVAL_MS, DEFAULT_TIMEOUT_MS
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
JmsJmxConnectionFactoryImpl(java.util.Map<java.lang.String,?> env, javax.management.remote.JMXServiceURL url)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
addOpenedConnection(javax.jms.Connection c)
protected void
addTemporaryQueue(javax.jms.TemporaryQueue t)
protected void
addTemporaryTopic(javax.jms.TemporaryTopic t)
protected java.util.Map<java.lang.String,java.lang.String>
buildJmsEnvironment(java.util.Map<java.lang.String,?> initial, java.util.Map<java.lang.String,java.lang.String> defaultEnv)
protected JmsJmxConnectionFactoryImpl.JmxJmsConnection
connect(javax.jms.ConnectionFactory factory, java.lang.String loggingString)
protected java.util.Map<java.lang.String,java.lang.String>
createDefaultEnvironment()
com.adaptris.jmx.remote.jms.JmsInvokerProxy
createInvokerProxy()
Create the invoker proxy.protected javax.jms.Queue
createQueueDestination(java.lang.String qName)
ExtendedJmsInvokerServiceExporter
createServiceExporter()
Create the invoker proxy.javax.jms.Destination
createTemporaryDestination(javax.jms.Session s)
Create a temporary destination (either a queue or a topic).protected javax.jms.Topic
createTopicDestination(java.lang.String tName)
void
destroy()
Destroy any resources that may need destroying.protected java.net.URI
getBrokerURI(javax.management.remote.JMXServiceURL serviceURL)
javax.jms.Destination
getTargetDestination()
Get the target dstination where you want to send requests and other things to.protected static java.net.URI
maskUserInfo(java.net.URI uri)
protected static java.net.URI
newURI(java.net.URI uri, java.lang.String query)
static java.util.Map<java.lang.String,java.lang.String>
parseParameters(java.net.URI uri)
protected static java.lang.String
rebuildQuery(java.util.Map<java.lang.String,java.lang.String> params, java.util.Set<java.lang.String> ignoreKeys)
static java.net.URI
removeQuery(java.net.URI uri)
Removes any URI query from the given uriprotected void
validateProtocol(java.lang.String protocol)
Validate the protocolprotected abstract java.util.Collection<java.lang.String>
validProtocols()
protected static javax.jms.JMSException
wrapJmsException(java.lang.Throwable e)
-
-
-
Field Detail
-
log
protected static final org.slf4j.Logger log
-
initialEnvironment
protected transient java.util.Map<java.lang.String,?> initialEnvironment
-
jmsEnvironment
protected transient java.util.Map<java.lang.String,java.lang.String> jmsEnvironment
-
defaultConnection
protected transient JmsJmxConnectionFactoryImpl.JmxJmsConnection defaultConnection
-
destinationFactory
protected transient JmsJmxConnectionFactoryImpl.DestinationFactory destinationFactory
-
lock
protected transient java.lang.Object lock
-
-
Method Detail
-
validateProtocol
protected void validateProtocol(java.lang.String protocol) throws java.net.MalformedURLException
Validate the protocol- Parameters:
protocol
- the protocol from theJMXServiceURL
- Throws:
java.net.MalformedURLException
- if the protocol is invalid
-
validProtocols
protected abstract java.util.Collection<java.lang.String> validProtocols()
-
createQueueDestination
protected final javax.jms.Queue createQueueDestination(java.lang.String qName) throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
-
createTopicDestination
protected final javax.jms.Topic createTopicDestination(java.lang.String tName) throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
-
createTemporaryDestination
public javax.jms.Destination createTemporaryDestination(javax.jms.Session s) throws javax.jms.JMSException
Description copied from interface:JmsJmxConnectionFactory
Create a temporary destination (either a queue or a topic).- Specified by:
createTemporaryDestination
in interfaceJmsJmxConnectionFactory
- Parameters:
s
- the session- Returns:
- a
TemporaryQueue
orTemporaryTopic
. - Throws:
javax.jms.JMSException
- if there was an error creating the temporary destination.
-
connect
protected JmsJmxConnectionFactoryImpl.JmxJmsConnection connect(javax.jms.ConnectionFactory factory, java.lang.String loggingString)
-
createDefaultEnvironment
protected java.util.Map<java.lang.String,java.lang.String> createDefaultEnvironment()
-
buildJmsEnvironment
protected java.util.Map<java.lang.String,java.lang.String> buildJmsEnvironment(java.util.Map<java.lang.String,?> initial, java.util.Map<java.lang.String,java.lang.String> defaultEnv)
-
destroy
public void destroy()
Description copied from interface:JmsJmxConnectionFactory
Destroy any resources that may need destroying.- Specified by:
destroy
in interfaceJmsJmxConnectionFactory
-
createInvokerProxy
public com.adaptris.jmx.remote.jms.JmsInvokerProxy createInvokerProxy() throws javax.jms.JMSException
Description copied from interface:JmsJmxConnectionFactory
Create the invoker proxy.- Specified by:
createInvokerProxy
in interfaceJmsJmxConnectionFactory
- Returns:
- a
JmsInvokerProxy
instance. - Throws:
javax.jms.JMSException
- if there was an problem creating the invoker proxy.
-
createServiceExporter
public ExtendedJmsInvokerServiceExporter createServiceExporter() throws javax.jms.JMSException
Description copied from interface:JmsJmxConnectionFactory
Create the invoker proxy.- Specified by:
createServiceExporter
in interfaceJmsJmxConnectionFactory
- Returns:
- a
ExtendedJmsInvokerServiceExporter
instance. - Throws:
javax.jms.JMSException
- if there was an problem creating the ServiceExport proxy.
-
getTargetDestination
public javax.jms.Destination getTargetDestination() throws javax.jms.JMSException
Description copied from interface:JmsJmxConnectionFactory
Get the target dstination where you want to send requests and other things to.- Specified by:
getTargetDestination
in interfaceJmsJmxConnectionFactory
- Returns:
- the destination.
- Throws:
javax.jms.JMSException
-
addOpenedConnection
protected void addOpenedConnection(javax.jms.Connection c)
-
addTemporaryTopic
protected void addTemporaryTopic(javax.jms.TemporaryTopic t)
-
addTemporaryQueue
protected void addTemporaryQueue(javax.jms.TemporaryQueue t)
-
getBrokerURI
protected java.net.URI getBrokerURI(javax.management.remote.JMXServiceURL serviceURL) throws java.net.URISyntaxException
- Throws:
java.net.URISyntaxException
-
parseParameters
public static java.util.Map<java.lang.String,java.lang.String> parseParameters(java.net.URI uri) throws java.net.URISyntaxException
- Throws:
java.net.URISyntaxException
-
rebuildQuery
protected static java.lang.String rebuildQuery(java.util.Map<java.lang.String,java.lang.String> params, java.util.Set<java.lang.String> ignoreKeys) throws java.net.URISyntaxException
- Throws:
java.net.URISyntaxException
-
removeQuery
public static java.net.URI removeQuery(java.net.URI uri) throws java.net.URISyntaxException
Removes any URI query from the given uri- Throws:
java.net.URISyntaxException
-
maskUserInfo
protected static java.net.URI maskUserInfo(java.net.URI uri) throws java.net.URISyntaxException
- Throws:
java.net.URISyntaxException
-
newURI
protected static java.net.URI newURI(java.net.URI uri, java.lang.String query) throws java.net.URISyntaxException
- Throws:
java.net.URISyntaxException
-
wrapJmsException
protected static javax.jms.JMSException wrapJmsException(java.lang.Throwable e)
-
-