Class AmqpProducerBuilder

java.lang.Object
org.apache.qpid.jms.provider.amqp.builders.AmqpResourceBuilder<AmqpProducer,AmqpSession,JmsProducerInfo,org.apache.qpid.proton.engine.Sender>
org.apache.qpid.jms.provider.amqp.builders.AmqpProducerBuilder
All Implemented Interfaces:
AmqpEventSink, AmqpExceptionBuilder

public class AmqpProducerBuilder extends AmqpResourceBuilder<AmqpProducer,AmqpSession,JmsProducerInfo,org.apache.qpid.proton.engine.Sender>
Resource builder responsible for creating and opening an AmqpProducer instance.
  • Constructor Details

  • Method Details

    • buildResource

      public void buildResource(AsyncResult request)
      Description copied from class: AmqpResourceBuilder
      Called to initiate the process of building the resource type that is managed by this builder. The resource is created and the open process occurs asynchronously. If the resource is successfully opened it will added to its parent resource for use.
      Overrides:
      buildResource in class AmqpResourceBuilder<AmqpProducer,AmqpSession,JmsProducerInfo,org.apache.qpid.proton.engine.Sender>
      Parameters:
      request - The request that initiated the resource creation.
    • createEndpoint

      protected org.apache.qpid.proton.engine.Sender createEndpoint(JmsProducerInfo resourceInfo)
      Description copied from class: AmqpResourceBuilder
      Given the resource information provided create and configure the local endpoint whose open phase is managed by this builder.
      Specified by:
      createEndpoint in class AmqpResourceBuilder<AmqpProducer,AmqpSession,JmsProducerInfo,org.apache.qpid.proton.engine.Sender>
      Returns:
      a new endpoint to be managed.
    • createResource

      protected AmqpProducer createResource(AmqpSession parent, JmsProducerInfo resourceInfo, org.apache.qpid.proton.engine.Sender endpoint)
      Description copied from class: AmqpResourceBuilder
      Create the managed resource instance.
      Specified by:
      createResource in class AmqpResourceBuilder<AmqpProducer,AmqpSession,JmsProducerInfo,org.apache.qpid.proton.engine.Sender>
      Parameters:
      parent - The parent of the newly created resource.
      resourceInfo - The resource information used to configure the resource.
      endpoint - The local endpoint for the managed resource to wrap.
      Returns:
      the resource instance who open life-cycle is managed by this builder.
    • afterOpened

      protected void afterOpened()
      Description copied from class: AmqpResourceBuilder
      Called once an endpoint has been opened and validated to give the subclasses a place to perform any follow-on processing or setup steps before the operation is deemed to have been completed and success is signaled.
      Overrides:
      afterOpened in class AmqpResourceBuilder<AmqpProducer,AmqpSession,JmsProducerInfo,org.apache.qpid.proton.engine.Sender>
    • isClosePending

      protected boolean isClosePending()
      Description copied from class: AmqpResourceBuilder
      If the resource was opened but its current state indicates a close is pending then we do no need to proceed further into the resource creation process. Each endpoint build must implement this and examine the opened endpoint to determine if a close frame will follow the open.
      Specified by:
      isClosePending in class AmqpResourceBuilder<AmqpProducer,AmqpSession,JmsProducerInfo,org.apache.qpid.proton.engine.Sender>
      Returns:
      true if the resource state indicates it will be immediately closed.
    • getDefaultOpenAbortException

      protected ProviderException getDefaultOpenAbortException()
      Description copied from class: AmqpResourceBuilder
      When aborting the open operation, and there isn't an error condition, provided by the peer, the returned exception will be used instead. A subclass may override this method to provide alternative behavior.
      Overrides:
      getDefaultOpenAbortException in class AmqpResourceBuilder<AmqpProducer,AmqpSession,JmsProducerInfo,org.apache.qpid.proton.engine.Sender>
      Returns:
      an Exception to describes the open failure for this resource.