Class AmqpConnection
java.lang.Object
org.apache.qpid.jms.provider.amqp.AmqpAbstractResource<JmsConnectionInfo,org.apache.qpid.proton.engine.Connection>
org.apache.qpid.jms.provider.amqp.AmqpConnection
- All Implemented Interfaces:
AmqpEventSink,AmqpResource,AmqpResourceParent
public class AmqpConnection
extends AmqpAbstractResource<JmsConnectionInfo,org.apache.qpid.proton.engine.Connection>
implements AmqpResourceParent
-
Field Summary
Fields inherited from class org.apache.qpid.jms.provider.amqp.AmqpAbstractResource
closeRequest, closeTimeoutTask -
Constructor Summary
ConstructorsConstructorDescriptionAmqpConnection(AmqpProvider provider, JmsConnectionInfo info, org.apache.qpid.proton.engine.Connection protonConnection) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChildResource(AmqpResource resource) Adds the given resource as a child of this resource so that it's lifetime becomes managed by that of its parent.voidcreateSession(JmsSessionInfo sessionInfo, AsyncResult request) voidcreateTemporaryDestination(JmsTemporaryDestination destination, AsyncResult request) intintRetrieves the AmqpConnectionSession owned by this AmqpConnection.Returns the connection properties for an established connection which defines the various capabilities and configuration options of the remote connection.getSession(JmsSessionId sessionId) Retrieve the indicated Session instance from the list of active sessions.getTemporaryDestination(JmsTemporaryDestination destination) voidhandleResourceClosure(AmqpProvider provider, ProviderException cause) booleanvoidprocessRemoteClose(AmqpProvider provider) Event handler for remote peer close of this resource.voidremoveChildResource(AmqpResource resource) Removes the given resource from the registered child resources managed by this one.Allows a connection resource to schedule a task for future execution.scheduleWithFixedDelay(Runnable task, long delay) Allows a connection resource to schedule a task for future execution which will start after the given delay and then repeat with a fixed delay between the end of one execution of the task and the beginning of the next execution.voidsetObjectMessageUsesAmqpTypes(boolean objectMessageUsesAmqpTypes) Configures the body type used in ObjectMessage instances that are sent from this connection.voidsetQueuePrefix(String queuePrefix) voidsetTopicPrefix(String topicPrefix) toString()voidunsubscribe(String subscriptionName, AsyncResult request) Methods inherited from class org.apache.qpid.jms.provider.amqp.AmqpAbstractResource
close, closeOrDetachEndpoint, closeResource, getEndpoint, getLocalState, getParent, getRemoteState, getResourceInfo, isAwaitingClose, isClosed, isOpen, processDeliveryUpdates, processFlowUpdates, processRemoteDetach, processRemoteOpen
-
Constructor Details
-
AmqpConnection
public AmqpConnection(AmqpProvider provider, JmsConnectionInfo info, org.apache.qpid.proton.engine.Connection protonConnection)
-
-
Method Details
-
createSession
-
createTemporaryDestination
-
getTemporaryDestination
-
unsubscribe
-
addChildResource
Description copied from interface:AmqpResourceParentAdds the given resource as a child of this resource so that it's lifetime becomes managed by that of its parent.- Specified by:
addChildResourcein interfaceAmqpResourceParent- Parameters:
resource- The AmqpResource that is a child of this one.
-
removeChildResource
Description copied from interface:AmqpResourceParentRemoves the given resource from the registered child resources managed by this one.- Specified by:
removeChildResourcein interfaceAmqpResourceParent- Parameters:
resource- The AmqpResource that is no longer a child of this one.
-
handleResourceClosure
- Overrides:
handleResourceClosurein classAmqpAbstractResource<JmsConnectionInfo,org.apache.qpid.proton.engine.Connection>
-
processRemoteClose
Description copied from interface:AmqpEventSinkEvent handler for remote peer close of this resource.- Specified by:
processRemoteClosein interfaceAmqpEventSink- Overrides:
processRemoteClosein classAmqpAbstractResource<JmsConnectionInfo,org.apache.qpid.proton.engine.Connection> - Parameters:
provider- the AmqpProvider instance for easier access to fire events.- Throws:
ProviderException- if an error occurs while processing the update.
-
getRemoteURI
-
getProvider
- Specified by:
getProviderin interfaceAmqpResourceParent- Returns:
- a reference to the root AmqpProvider.
-
getQueuePrefix
-
setQueuePrefix
-
getTopicPrefix
-
setTopicPrefix
-
getSession
Retrieve the indicated Session instance from the list of active sessions.- Parameters:
sessionId- The JmsSessionId that's associated with the target session.- Returns:
- the AmqpSession associated with the given id.
-
getConnectionSession
Retrieves the AmqpConnectionSession owned by this AmqpConnection.- Returns:
- the AmqpConnectionSession owned by this AmqpConnection.
-
isObjectMessageUsesAmqpTypes
public boolean isObjectMessageUsesAmqpTypes()- Returns:
- true if new ObjectMessage instance should default to using AMQP Typed bodies.
-
setObjectMessageUsesAmqpTypes
public void setObjectMessageUsesAmqpTypes(boolean objectMessageUsesAmqpTypes) Configures the body type used in ObjectMessage instances that are sent from this connection.- Parameters:
objectMessageUsesAmqpTypes- the objectMessageUsesAmqpTypes value to set.
-
getAnonymousProducerCacheSize
public int getAnonymousProducerCacheSize()- Returns:
- the configured max number of cached anonymous fallback producers to keep.
-
getAnonymousProducerCacheTimeout
public int getAnonymousProducerCacheTimeout()- Returns:
- The configured time before a cache anonymous producer link is close due to inactivity.
-
getAmqpMessageFactory
- Returns:
- the AMQP based JmsMessageFactory for this Connection.
-
getProperties
Returns the connection properties for an established connection which defines the various capabilities and configuration options of the remote connection. Prior to the establishment of a connection this method returns null.- Returns:
- the properties available for this connection or null if not connected.
-
getSubTracker
-
schedule
Allows a connection resource to schedule a task for future execution.- Parameters:
task- The Runnable task to be executed after the given delay.delay- The delay in milliseconds to schedule the given task for execution.- Returns:
- a ScheduledFuture instance that can be used to cancel the task.
-
scheduleWithFixedDelay
Allows a connection resource to schedule a task for future execution which will start after the given delay and then repeat with a fixed delay between the end of one execution of the task and the beginning of the next execution.- Parameters:
task- The Runnable task to be executed after the given delay.delay- The delay in milliseconds to schedule the given task for execution.- Returns:
- a ScheduledFuture instance that can be used to cancel the task.
-
toString
-