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
  • Constructor Details

    • AmqpConnection

      public AmqpConnection(AmqpProvider provider, JmsConnectionInfo info, org.apache.qpid.proton.engine.Connection protonConnection)
  • Method Details

    • createSession

      public void createSession(JmsSessionInfo sessionInfo, AsyncResult request)
    • createTemporaryDestination

      public void createTemporaryDestination(JmsTemporaryDestination destination, AsyncResult request)
    • getTemporaryDestination

      public AmqpTemporaryDestination getTemporaryDestination(JmsTemporaryDestination destination)
    • unsubscribe

      public void unsubscribe(String subscriptionName, AsyncResult request)
    • addChildResource

      public void addChildResource(AmqpResource resource)
      Description copied from interface: AmqpResourceParent
      Adds the given resource as a child of this resource so that it's lifetime becomes managed by that of its parent.
      Specified by:
      addChildResource in interface AmqpResourceParent
      Parameters:
      resource - The AmqpResource that is a child of this one.
    • removeChildResource

      public void removeChildResource(AmqpResource resource)
      Description copied from interface: AmqpResourceParent
      Removes the given resource from the registered child resources managed by this one.
      Specified by:
      removeChildResource in interface AmqpResourceParent
      Parameters:
      resource - The AmqpResource that is no longer a child of this one.
    • handleResourceClosure

      public void handleResourceClosure(AmqpProvider provider, ProviderException cause)
      Overrides:
      handleResourceClosure in class AmqpAbstractResource<JmsConnectionInfo,org.apache.qpid.proton.engine.Connection>
    • processRemoteClose

      public void processRemoteClose(AmqpProvider provider) throws ProviderException
      Description copied from interface: AmqpEventSink
      Event handler for remote peer close of this resource.
      Specified by:
      processRemoteClose in interface AmqpEventSink
      Overrides:
      processRemoteClose in class AmqpAbstractResource<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

      public URI getRemoteURI()
    • getProvider

      public AmqpProvider getProvider()
      Specified by:
      getProvider in interface AmqpResourceParent
      Returns:
      a reference to the root AmqpProvider.
    • getQueuePrefix

      public String getQueuePrefix()
    • setQueuePrefix

      public void setQueuePrefix(String queuePrefix)
    • getTopicPrefix

      public String getTopicPrefix()
    • setTopicPrefix

      public void setTopicPrefix(String topicPrefix)
    • getSession

      public AmqpSession getSession(JmsSessionId sessionId)
      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

      public AmqpConnectionSession 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

      public AmqpJmsMessageFactory getAmqpMessageFactory()
      Returns:
      the AMQP based JmsMessageFactory for this Connection.
    • getProperties

      public AmqpConnectionProperties 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

      public AmqpSubscriptionTracker getSubTracker()
    • schedule

      public ScheduledFuture<?> schedule(Runnable task, long delay)
      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

      public ScheduledFuture<?> 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.
      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

      public String toString()
      Overrides:
      toString in class Object