3.16.7 Application Server-specific Connector 1.5 API specifications

This subsection describes the Application Server-specific specifications for the interfaces of the Connector 1.5 specifications.

Organization of this subsection
(1) javax.resource.spi.endpoint.MessageEndpointFactory interface
(2) javax.resource.spi.endpoint.MessageEndpoint interface
(3) Message listener method

(1) javax.resource.spi.endpoint.MessageEndpointFactory interface

Application Server provides specifications for two methods.

(a) createEndpoint method
Format

public MessageEndpoint createEndpoint(XAResource xaResource) throws UnavailableException

Application Server-specific specifications
  • If this method is invoked after you start the stop processing of a J2EE application containing the EJBs, javax.resource.spi.UnavailableException is thrown.
  • The processing to obtain the Message-driven Bean instances is executed in this method. If the upper limit of the Message-driven Bean instance pool is reached, the Message-driven Bean instances can be obtained, or the method is not returned until the J2EE application stops.
Exception
The following table describes the exception operations provided with Application Server.
ExceptionException timing
javax.resource.spi.UnavailableException
  • When this method is invoked after you start the stop processing of a J2EE application containing the EJBs
  • When an attempt to obtain the Message-driven Bean instances fails
(b) isDeliveryTransacted method
Format

public boolean isDeliveryTransacted(Method method) throws NoSuchMethodException

Application Server-specific specifications
If you specify true in the ejbserver.distributedtx.XATransaction.enabled property of the user property file for J2EE servers, true is returned when Required is specified for CMT in the transaction attribute of the method passed by the argument.

(2) javax.resource.spi.endpoint.MessageEndpoint interface

Application Server provides specifications for three methods.

(a) beforeDelivery method
Format

public void beforeDelivery(Method method) throws NoSuchMethodException, ResourceException

Application Server-specific specifications
The specifications provide for exceptions.
Exception
The following table describes the exception operations provided with Application Server.
ExceptionException timing
java.lang.IllegalStateException
  • When you invoke the message listener method after you start the stop processing of the J2EE application containing the EJBs
  • When the release() method has already been invoked
javax.resource.spi.IllegalStateException
  • When the methods are invoked in an invalid order (when the beforeDelivery method is invoked again after invoking the beforeDelivery method or when the beforeDelivery method is invoked after invoking the message listener method)
javax.resource.spi.UnavailableException
  • When an unexpected exception occurs
(b) afterDelivery method
Format

public void afterDelivery() throws ResourceException

Application Server-specific specifications
The specifications provide for exceptions.
Exception
The following table describes the exception operations provided with Application Server.
ExceptionException timing
java.lang.IllegalStateException
  • When you invoke the message listener method after you start the stop processing of the J2EE application containing the EJBs
  • When the release() method has already been invoked
javax.resource.spi.IllegalStateException
  • When the methods are invoked in an invalid order (when afterDelivery() is invoked at a different time after the message listener method Option B# is invoked)
javax.resource.spi.UnavailableException
  • When an unexpected exception occurs

#: A message delivery option coded in the Connector 1.5 specifications.


(c) release method
Format

public void release()

Application Server-specific specifications
If you invoke this method, the Message-driven Bean instance associated with the endpoint is released and returns to the instance pool.
When you finish using the endpoint, make sure you invoke this method and return the Message-driven Beans to the instance pool.
Exception
The following table describes the exception operations provided with Application Server.
ExceptionException timing
java.lang.IllegalStateException
  • When you invoke the message listener method after you start the stop processing of the J2EE application containing the EJBs
  • When the release() method has already been invoked

(3) Message listener method

The interface is defined with the message listener interface. The following table describes the exception operations provided with Application Server.

ExceptionException timing
Exception specified in the message listener interface
  • Message-driven Bean execution time (other than when the system exception occurs)
javax.ejb.EJBException
  • Message-driven Bean execution time (when the system exception occurs)
java.lang.IllegalStateException
  • When you invoke the message listener method after you start the stop processing of the J2EE application containing the EJBs
  • When the release() method has already been invoked
  • When the methods are invoked in an invalid order (the message listener method is invoked continuously after invoking the message listener method in the message delivery of Option B#,)

#: A message delivery option coded in the Connector 1.5 specifications.