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 forJmsJmxConnectionFactoryinstances.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classJmsJmxConnectionFactoryImpl.DestinationFactoryprotected classJmsJmxConnectionFactoryImpl.JmxJmsConnection
-
Field Summary
Fields Modifier and Type Field Description protected JmsJmxConnectionFactoryImpl.JmxJmsConnectiondefaultConnectionprotected JmsJmxConnectionFactoryImpl.DestinationFactorydestinationFactoryprotected java.util.Map<java.lang.String,?>initialEnvironmentprotected java.util.Map<java.lang.String,java.lang.String>jmsEnvironmentprotected java.lang.Objectlockprotected static org.slf4j.Loggerlog-
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 protectedJmsJmxConnectionFactoryImpl(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 voidaddOpenedConnection(javax.jms.Connection c)protected voidaddTemporaryQueue(javax.jms.TemporaryQueue t)protected voidaddTemporaryTopic(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.JmxJmsConnectionconnect(javax.jms.ConnectionFactory factory, java.lang.String loggingString)protected java.util.Map<java.lang.String,java.lang.String>createDefaultEnvironment()com.adaptris.jmx.remote.jms.JmsInvokerProxycreateInvokerProxy()Create the invoker proxy.protected javax.jms.QueuecreateQueueDestination(java.lang.String qName)ExtendedJmsInvokerServiceExportercreateServiceExporter()Create the invoker proxy.javax.jms.DestinationcreateTemporaryDestination(javax.jms.Session s)Create a temporary destination (either a queue or a topic).protected javax.jms.TopiccreateTopicDestination(java.lang.String tName)voiddestroy()Destroy any resources that may need destroying.protected java.net.URIgetBrokerURI(javax.management.remote.JMXServiceURL serviceURL)javax.jms.DestinationgetTargetDestination()Get the target dstination where you want to send requests and other things to.protected static java.net.URImaskUserInfo(java.net.URI uri)protected static java.net.URInewURI(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.StringrebuildQuery(java.util.Map<java.lang.String,java.lang.String> params, java.util.Set<java.lang.String> ignoreKeys)static java.net.URIremoveQuery(java.net.URI uri)Removes any URI query from the given uriprotected voidvalidateProtocol(java.lang.String protocol)Validate the protocolprotected abstract java.util.Collection<java.lang.String>validProtocols()protected static javax.jms.JMSExceptionwrapJmsException(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.MalformedURLExceptionValidate 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.JMSExceptionDescription copied from interface:JmsJmxConnectionFactoryCreate a temporary destination (either a queue or a topic).- Specified by:
createTemporaryDestinationin interfaceJmsJmxConnectionFactory- Parameters:
s- the session- Returns:
- a
TemporaryQueueorTemporaryTopic. - 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:JmsJmxConnectionFactoryDestroy any resources that may need destroying.- Specified by:
destroyin interfaceJmsJmxConnectionFactory
-
createInvokerProxy
public com.adaptris.jmx.remote.jms.JmsInvokerProxy createInvokerProxy() throws javax.jms.JMSExceptionDescription copied from interface:JmsJmxConnectionFactoryCreate the invoker proxy.- Specified by:
createInvokerProxyin interfaceJmsJmxConnectionFactory- Returns:
- a
JmsInvokerProxyinstance. - 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:JmsJmxConnectionFactoryCreate the invoker proxy.- Specified by:
createServiceExporterin interfaceJmsJmxConnectionFactory- Returns:
- a
ExtendedJmsInvokerServiceExporterinstance. - Throws:
javax.jms.JMSException- if there was an problem creating the ServiceExport proxy.
-
getTargetDestination
public javax.jms.Destination getTargetDestination() throws javax.jms.JMSExceptionDescription copied from interface:JmsJmxConnectionFactoryGet the target dstination where you want to send requests and other things to.- Specified by:
getTargetDestinationin 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.URISyntaxExceptionRemoves 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)
-
-