Class AmqpAnonymousFallbackProducer
- java.lang.Object
-
- org.apache.qpid.jms.provider.amqp.AmqpAbstractResource<JmsProducerInfo,org.apache.qpid.proton.engine.Sender>
-
- org.apache.qpid.jms.provider.amqp.AmqpProducer
-
- org.apache.qpid.jms.provider.amqp.AmqpAnonymousFallbackProducer
-
- All Implemented Interfaces:
AmqpEventSink,AmqpResource
public class AmqpAnonymousFallbackProducer extends AmqpProducer
Handles the case of anonymous JMS MessageProducers. In order to simulate the anonymous producer we must create a sender for each message send attempt and close it following a successful send.
-
-
Field Summary
-
Fields inherited from class org.apache.qpid.jms.provider.amqp.AmqpProducer
delayedDeliverySupported, presettle, session
-
Fields inherited from class org.apache.qpid.jms.provider.amqp.AmqpAbstractResource
closeRequest, closeTimeoutTask
-
-
Constructor Summary
Constructors Constructor Description AmqpAnonymousFallbackProducer(AmqpSession session, JmsProducerInfo info)Creates the Anonymous Producer object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose(AsyncResult request)org.apache.qpid.proton.engine.EndpointStategetLocalState()org.apache.qpid.proton.engine.EndpointStategetRemoteState()booleanisAnonymous()voidsend(JmsOutboundMessageDispatch envelope, AsyncResult request)Sends the given message-
Methods inherited from class org.apache.qpid.jms.provider.amqp.AmqpProducer
getProducerId, isPresettle, setDelayedDeliverySupported, setPresettle
-
Methods inherited from class org.apache.qpid.jms.provider.amqp.AmqpAbstractResource
closeOrDetachEndpoint, closeResource, getEndpoint, getParent, getResourceInfo, handleResourceClosure, isAwaitingClose, isClosed, isOpen, processDeliveryUpdates, processFlowUpdates, processRemoteClose, processRemoteDetach, processRemoteOpen
-
-
-
-
Constructor Detail
-
AmqpAnonymousFallbackProducer
public AmqpAnonymousFallbackProducer(AmqpSession session, JmsProducerInfo info)
Creates the Anonymous Producer object.- Parameters:
session- the session that owns this producerinfo- the JmsProducerInfo for this producer.
-
-
Method Detail
-
send
public void send(JmsOutboundMessageDispatch envelope, AsyncResult request) throws ProviderException
Description copied from class:AmqpProducerSends the given message- Specified by:
sendin classAmqpProducer- Parameters:
envelope- The envelope that contains the message and it's targeted destination.request- The AsyncRequest that will be notified on send success or failure.- Throws:
ProviderException- if an error occurs sending the message
-
close
public void close(AsyncResult request)
- Overrides:
closein classAmqpAbstractResource<JmsProducerInfo,org.apache.qpid.proton.engine.Sender>
-
isAnonymous
public boolean isAnonymous()
- Specified by:
isAnonymousin classAmqpProducer- Returns:
- true if this is an anonymous producer or false if fixed to a given destination.
-
getLocalState
public org.apache.qpid.proton.engine.EndpointState getLocalState()
- Overrides:
getLocalStatein classAmqpAbstractResource<JmsProducerInfo,org.apache.qpid.proton.engine.Sender>
-
getRemoteState
public org.apache.qpid.proton.engine.EndpointState getRemoteState()
- Overrides:
getRemoteStatein classAmqpAbstractResource<JmsProducerInfo,org.apache.qpid.proton.engine.Sender>
-
-