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 Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected final LINK_TYPEprotected booleanprotected final AmqpSession -
Constructor Summary
ConstructorsConstructorDescriptionAmqpAbstractLink(AmqpSession session, LINK_TYPE endpoint) Creates a new AmqpLink type. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCloseAction(Runnable action) Adds a new Runnable that is called on close of this link.voidclose()Request from the remote peer to close this resource.voidclose(org.apache.qpid.proton.amqp.transport.ErrorCondition error) Close the Link with an error indicating the reson for the close.voiddetach()Request from the remote peer to detach this resource.booleanisClosed()booleanisOpened()voidopen()Request from the remote peer to open this resource.protected voidsendToActiveMQ(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.protected voidsendToActiveMQ(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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.activemq.transport.amqp.protocol.AmqpLink
commit, delivery, flow, getDestination, rollback, setDestination
-
Field Details
-
session
-
endpoint
-
closed
protected boolean closed -
opened
protected boolean opened -
closeActions
-
-
Constructor Details
-
AmqpAbstractLink
Creates a new AmqpLink type.- Parameters:
session- the AmqpSession that servers as the parent of this Link.endpoint- the link endpoint this object represents.
-
-
Method Details
-
open
public void open()Description copied from interface:AmqpResourceRequest from the remote peer to open this resource.- Specified by:
openin interfaceAmqpResource
-
detach
public void detach()Description copied from interface:AmqpLinkRequest from the remote peer to detach this resource. -
close
public void close(org.apache.qpid.proton.amqp.transport.ErrorCondition error) Description copied from interface:AmqpLinkClose the Link with an error indicating the reson for the close. -
close
public void close()Description copied from interface:AmqpResourceRequest from the remote peer to close this resource.- Specified by:
closein interfaceAmqpResource
-
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
- Returns:
- the Proton Link type this link represents.
-
getSession
- Returns:
- the parent AmqpSession for this Link instance.
-
addCloseAction
Description copied from interface:AmqpLinkAdds a new Runnable that is called on close of this link.- Specified by:
addCloseActionin interfaceAmqpLink- 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
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.
-