Class AmqpAbstractLink<LINK_TYPE extends org.apache.qpid.proton.engine.Link>

java.lang.Object
org.apache.activemq.transport.amqp.protocol.AmqpAbstractLink<LINK_TYPE>
All Implemented Interfaces:
AmqpLink, AmqpResource
Direct Known Subclasses:
AmqpAbstractReceiver, AmqpSender

public abstract class AmqpAbstractLink<LINK_TYPE extends org.apache.qpid.proton.engine.Link> extends Object implements AmqpLink
Abstract AmqpLink implementation that provide basic Link services.
  • Field Details

    • session

      protected final AmqpSession session
    • endpoint

      protected final LINK_TYPE extends org.apache.qpid.proton.engine.Link endpoint
    • closed

      protected boolean closed
    • opened

      protected boolean opened
    • closeActions

      protected List<Runnable> closeActions
  • Constructor Details

  • Method Details

    • open

      public void open()
      Description copied from interface: AmqpResource
      Request from the remote peer to open this resource.
      Specified by:
      open in interface AmqpResource
    • detach

      public void detach()
      Description copied from interface: AmqpLink
      Request from the remote peer to detach this resource.
      Specified by:
      detach in interface AmqpLink
    • close

      public void close(org.apache.qpid.proton.amqp.transport.ErrorCondition error)
      Description copied from interface: AmqpLink
      Close the Link with an error indicating the reson for the close.
      Specified by:
      close in interface AmqpLink
      Parameters:
      error - the error that prompted the close.
    • close

      public void close()
      Description copied from interface: AmqpResource
      Request from the remote peer to close this resource.
      Specified by:
      close in interface AmqpResource
    • isOpened

      public boolean isOpened()
      Returns:
      true if this link has already been opened.
    • isClosed

      public boolean isClosed()
      Returns:
      true if this link has already been closed.
    • getEndpoint

      public LINK_TYPE getEndpoint()
      Returns:
      the Proton Link type this link represents.
    • getSession

      public AmqpSession getSession()
      Returns:
      the parent AmqpSession for this Link instance.
    • addCloseAction

      public void addCloseAction(Runnable action)
      Description copied from interface: AmqpLink
      Adds a new Runnable that is called on close of this link.
      Specified by:
      addCloseAction in interface AmqpLink
      Parameters:
      action - a Runnable that will be executed when the link closes or detaches.
    • sendToActiveMQ

      protected void sendToActiveMQ(org.apache.activemq.command.Command command)
      Shortcut method to hand off an ActiveMQ Command to the broker and assign a ResponseHandler to deal with any reply from the broker.
      Parameters:
      command - the Command object to send to the Broker.
    • sendToActiveMQ

      protected void sendToActiveMQ(org.apache.activemq.command.Command command, ResponseHandler handler)
      Shortcut method to hand off an ActiveMQ Command to the broker and assign a ResponseHandler to deal with any reply from the broker.
      Parameters:
      command - the Command object to send to the Broker.
      handler - the ResponseHandler that will handle the Broker's response.