org.objectweb.jeremie.services.handler.lib
Class DavidServicesHandler
- ServicesHandler
public class DavidServicesHandler
Default implementation of a ServicesHandler.
The services managed by this handler must be components of
a
Context
provided at initialization time. The
names to use should be integers representing service identifiers.
The service components' values must be
Service
instances.
The list of services managed by a DavidServicesHandler instance is
initialized when the instance is created.
ServiceContext[] | getReplyContexts(int request_id, Context message_context) - Returns a list of service contexts.
|
ServiceContext[] | getRequestContexts(int request_id, boolean response_expected, byte[] object_key, Context message_context) - Returns a list of service contexts.
|
void | handleReplyContexts(ServiceContext contexts, int request_id, Context message_context) - Lets the handler manage the provided contexts.
|
void | handleRequestContexts(ServiceContext contexts, int request_id, boolean response_expected, byte[] object_key, Context message_context) - Lets the handler manage the provided contexts.
|
DavidServicesHandler
public DavidServicesHandler(Context services_context)
throws JonathanException
Builds a new DavidServicesHandler instance.
services_context
- the context containing the services (as local
objects);
getReplyContexts
public ServiceContext[] getReplyContexts(int request_id,
Context message_context)
Returns a list of service contexts.
This method simply tries to get a reply context from each managed
service. No service order is specified.
- getReplyContexts in interface ServicesHandler
request_id
- the request id.message_context
- the context of the reply marshaller.
- a list of service contexts.
getRequestContexts
public ServiceContext[] getRequestContexts(int request_id,
boolean response_expected,
byte[] object_key,
Context message_context)
Returns a list of service contexts.
This method simply tries to get a request context from each managed
service. No service order is specified.
- getRequestContexts in interface ServicesHandler
request_id
- the request id;response_expected
- indicates if a response is expected;object_key
- the target object key.message_context
- the context of the request marshaller.
- a list of service contexts.
handleReplyContexts
public void handleReplyContexts(ServiceContext contexts,
int request_id,
Context message_context)
Lets the handler manage the provided contexts.
When a context bears the same identifier as one of the services handled
by the target handler, the context is
sent
to
the service. No order is specified.
- handleReplyContexts in interface ServicesHandler
contexts
- the list of contexts contained in the reply;request_id
- the request id;message_context
- the context of the reply unmarshaller.
handleRequestContexts
public void handleRequestContexts(ServiceContext contexts,
int request_id,
boolean response_expected,
byte[] object_key,
Context message_context)
Lets the handler manage the provided contexts.
When a context bears the same identifier as one of the services handled
by the target handler, the context is
sent
to
the service. No order is specified.
- handleRequestContexts in interface ServicesHandler
contexts
- the list of contexts contained in the request;request_id
- the request id;response_expected
- indicates whether a response is expected;object_key
- the target object key.message_context
- the context of the request unmarshaller.