Top Description Methods
javax.resource.spi.endpoint

public Interface MessageEndpointFactory

Imports
java.lang.NoSuchMethodException, javax.transaction.xa.XAResource, javax.resource.spi.UnavailableException

This serves as a factory for creating message endpoints.
Author
Ram Jeyaraman, Sivakumar Thyagarajan
Since
1.5
Version
1.7

Method Summary

Modifier and TypeMethod and Description
public MessageEndpoint

Returns:

a message endpoint instance.
createEndpoint
(XAResource
an optional XAResource instance used to get transaction notifications when the message delivery is transacted.
xaResource
)

This is used to create a message endpoint.

public MessageEndpoint

Returns:

a message endpoint instance.
createEndpoint
(XAResource
an optional XAResource instance used to get transaction notifications when the message delivery is transacted.
xaResource
,
long
an optional value used to specify the time duration (in milliseconds) within which the message endpoint needs to be created by the MessageEndpointFactory. Otherwise, the MessageEndpointFactory rejects the creation of the MessageEndpoint with an UnavailableException. Note, this does not offer real-time guarantees.
timeout
)

This is used to create a message endpoint.

public String

Returns:

a new String instance representing the unique name of the message endpoint deployment
getActivationName
()

Returns a unique name for the message endpoint deployment represented by the MessageEndpointFactory.

public Class<?>

Returns:

A Class corresponding to the message endpoint class.
getEndpointClass
()

Return the Class object corresponding to the message endpoint class.

public boolean

Returns:

true, if message endpoint requires transacted message delivery.
isDeliveryTransacted
(Method
description of a target method. This information about the intended target method allows an application server to find out whether the target method call will be transacted or not.
method
)

This is used to find out whether message deliveries to a target method on a message listener interface that is implemented by a message endpoint or a target method in the Class returned by the getBeanClass method, will be transacted or not.

Method Detail

createEndpointback to summary
public MessageEndpoint createEndpoint(XAResource xaResource) throws UnavailableException

This is used to create a message endpoint. The message endpoint is expected to implement the correct message listener type.

Parameters
xaResource:XAResource

an optional XAResource instance used to get transaction notifications when the message delivery is transacted.

Returns:MessageEndpoint

a message endpoint instance.

Exceptions
UnavailableException:
indicates a transient failure in creating a message endpoint. Subsequent attempts to create a message endpoint might succeed.
createEndpointback to summary
public MessageEndpoint createEndpoint(XAResource xaResource, long timeout) throws UnavailableException

This is used to create a message endpoint. The message endpoint is expected to implement the correct message listener type.

Parameters
xaResource:XAResource

an optional XAResource instance used to get transaction notifications when the message delivery is transacted.

timeout:long

an optional value used to specify the time duration (in milliseconds) within which the message endpoint needs to be created by the MessageEndpointFactory. Otherwise, the MessageEndpointFactory rejects the creation of the MessageEndpoint with an UnavailableException. Note, this does not offer real-time guarantees.

Returns:MessageEndpoint

a message endpoint instance.

Exceptions
UnavailableException:
indicates a transient failure in creating a message endpoint. Subsequent attempts to create a message endpoint might succeed.
Since
1.6
getActivationNameback to summary
public String getActivationName()

Returns a unique name for the message endpoint deployment represented by the MessageEndpointFactory. If the message endpoint has been deployed into a clustered application server then this method must return the same name for that message endpoint’s activation in each application server instance. It is recommended that this name be human-readable since this name may be used by the resource adapter in ways that may be visible to a user or administrator. It is also recommended that this name remain unchanged even in cases when the application server is restarted or the message endpoint redeployed.

Returns:String

a new String instance representing the unique name of the message endpoint deployment

Since
1.7
getEndpointClassback to summary
public Class<?> getEndpointClass()

Return the Class object corresponding to the message endpoint class. For example, for a Message Driven Bean this is the Class object corresponding to the application's MDB class. The resource adapter may use this to introspect the message endpoint class to discover annotations, interfaces implemented, etc. and modify the behavior of the resource adapter accordingly. A return value of null indicates that the MessageEndpoint doesn't implement the business methods of underlying message endpoint class.

Returns:Class<?>

A Class corresponding to the message endpoint class.

Since
1.7
isDeliveryTransactedback to summary
public boolean isDeliveryTransacted(Method method) throws NoSuchMethodException

This is used to find out whether message deliveries to a target method on a message listener interface that is implemented by a message endpoint or a target method in the Class returned by the getBeanClass method, will be transacted or not. The message endpoint may indicate its transacted delivery preferences (at a per method level) through its deployment descriptor. The message delivery preferences must not change during the lifetime of a message endpoint.

Parameters
method:Method

description of a target method. This information about the intended target method allows an application server to find out whether the target method call will be transacted or not.

Returns:boolean

true, if message endpoint requires transacted message delivery.

Exceptions
NoSuchMethodException:
indicates that the specified method does not exist on the target endpoint.