The classes listed and described below define the non-annotated objects of the POJO Service engine API.
Context - org.glassfish.openesb.pojose.api.res.Context
When a field is annotated with @Resource (org.glassfish.openesb.pojose.api.annotation.Resource), the POJO SE inserts an instance of Context before invoking the POJO instance method. A Context instance can be used to look up JNDI resources, look up service endpoints, retrieve an instance of Consumer, access a MessageExchange object, and create a new MessageExchange object.
Consumer - org.glassfish.openesb.pojose.api.Consumer
When a field is annotated with @ConsumerEndpoint (org.glassfish.openesb.pojose.api.annotation.ConsumerEndpoint), the POJO SE inserts an instance of Consumer before invoking the POJO instance method. A Consumer instance can be used to consume JBI services both synchronously and asynchronously. Consumer.sendSynchInOnly() and sendSynchInOut methods are used to send messages in synchronous mode, and sendInOnly() and sendInOut are used to send and receive messages asynchronously. A Consumer instance can also be used to create a MessageExchanges object specific to the ServiceEndpoint that annotates the field.
ErrorMessage - org.glassfish.openesb.pojose.api.ErrorMessage
A POJO class can throw an ErrorMessage object from its @Opeation method to send the JBI error status to the caller of the service.
You need to specifically throw a FaultMessage exception to return a fault message; otherwise, throw an ErrorMessage exception to return the MessageExchange with the error status and exception. If there is a runtime exception, the MessageExchange is returned with a status of "error" and an exception.
FaultMessage - org.glassfish.openesb.pojose.api.FaultMessage
A POJO class can throw a FaultMessage object from its @Operation method to send the JBI fault status to the caller of the service. See the above note for information about when to use ErrorMessage and when to use FaultMessage.