org.objectweb.jeremie.services.handler.CosTransactions
Class TSHandler
java.lang.Object
org.objectweb.jeremie.services.handler.CosTransactions.TSHandler
- Service, TSIdentification
public abstract class TSHandler
Provides an abstract implementation of a Transaction service handler, to be
used as a base class by TS implementations, following the CosTSPortability
apis.
protected PropagationContext | decodeContext(ServiceContext sc) - Decodes a PropagationContext instance from a ServiceContext instance.
|
protected ServiceContext | encodeContext(PropagationContext ctx) - Encodes the provided PropagationContext into a ServiceContext.
|
ServiceContext | getReplyContext(int request_id, Context ignored) - Returns a reply context.
|
ServiceContext | getRequestContext(int request_id, boolean response_expected, byte[] object_key, Context ignored) - Returns a request context.
|
void | handleReplyContext(ServiceContext context, int request_id, Context ignored) - This method is called by the services handler to let the operations
related to the target service be performed on reply arrival.
|
void | handleRequestContext(ServiceContext context, int request_id, boolean response_expected, byte[] object_key, Context ignored) - This method is called by the services handler to let the operations
related to the target service be performed on request arrival.
|
void | identify_receiver(Receiver receiver)
|
void | identify_sender(Sender sender)
|
receiver
protected Receiver receiver
A Receiver instance
sender
protected Sender sender
A Sender instance
service_id
protected int service_id
The transaction service id. The default value is
org.omg.IOP.TransactionService.value.
TSHandler
protected TSHandler()
TSHandler
protected TSHandler(int service_id,
Sender sender,
Receiver receiver)
throws JonathanException
TSHandler
protected TSHandler(Sender sender,
Receiver receiver)
throws JonathanException
Creates a new TSHandler instance.
decodeContext
protected PropagationContext decodeContext(ServiceContext sc)
Decodes a PropagationContext instance from a ServiceContext instance.
sc
- a ServiceContext instance.
- a PropagationContext instance.
encodeContext
protected ServiceContext encodeContext(PropagationContext ctx)
Encodes the provided PropagationContext into a ServiceContext.
ctx
- a PropagationContext instance.
- a ServiceContext instance.
getReplyContext
public ServiceContext getReplyContext(int request_id,
Context ignored)
Returns a reply context.
If
receiver
is not null, this method
encodes
the propagation context
returned by its
sending_reply
method, else it returns null.
- getReplyContext in interface Service
request_id
- the corresponding request id.
- a service context.
getRequestContext
public ServiceContext getRequestContext(int request_id,
boolean response_expected,
byte[] object_key,
Context ignored)
Returns a request context.
If
sender
is not null, this method
encodes
the propagation context
returned by its
sending_request
method, else it returns null.
- getRequestContext in interface Service
request_id
- the request identifier;response_expected
- unused;object_key
- unused.
- a service context.
handleReplyContext
public void handleReplyContext(ServiceContext context,
int request_id,
Context ignored)
This method is called by the services handler to let the operations
related to the target service be performed on reply arrival.
If
sender
is null, this method returns immediately.
Else, it uses the
decodeContext
method to obtain a PropagationContext instance, and call the
received_reply
method on it.
- handleReplyContext in interface Service
context
- the service context of the reply;request_id
- the corresponding request identifier.
handleRequestContext
public void handleRequestContext(ServiceContext context,
int request_id,
boolean response_expected,
byte[] object_key,
Context ignored)
This method is called by the services handler to let the operations
related to the target service be performed on request arrival.
If
receiver
is null, this method returns immediately.
Else, it uses the
decodeContext
method to obtain a PropagationContext instance, and call the
received_request
method on it.
- handleRequestContext in interface Service
context
- the service context of the request;request_id
- the request identifier;response_expected
- unused;object_key
- unused.