org.objectweb.david.libs.services.java_serial
Class JavaSerialService

java.lang.Object
  |
  +--org.objectweb.david.libs.services.java_serial.JavaSerialService
All Implemented Interfaces:
Factory, JAVA_SERIAL_SERVICE, Service

public class JavaSerialService
extends Object
implements Service, Factory, JAVA_SERIAL_SERVICE

The Java Serial Service is used by clients that wish to use Java Serialization instead of CDR serialization to encode values. It may be used only if the server reference contains an indication that the server supports Java serialization. Service information is passed only with requests. Replies use the same encoding as replies.


Fields inherited from interface org.objectweb.david.apis.services.java_serial.JAVA_SERIAL_SERVICE
TAG_JAVA_SERIAL
 
Constructor Summary
JavaSerialService()
          Creates an instance of the service.
 
Method Summary
 org.omg.IOP.ServiceContext getReplyContext(int request_id, Context ignored)
          Returns null;
 org.omg.IOP.ServiceContext getRequestContext(int request_id, boolean response_expected, byte[] object_key, Context message_context)
          Returns an indication whether java serialization is used.
 void handleReplyContext(org.omg.IOP.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(org.omg.IOP.ServiceContext context, int request_id, boolean response_expected, byte[] object_key, Context message_context)
          This method is called by the services handler to let the operations related to the target service be performed on request arrival.
 Object newObject(Context c)
          Returns an object created using information contained in the provided context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaSerialService

public JavaSerialService()
Creates an instance of the service.
Method Detail

newObject

public Object newObject(Context c)
Description copied from interface: Factory
Returns an object created using information contained in the provided context.
Specified by:
newObject in interface Factory
Following copied from interface: org.objectweb.jonathan.apis.kernel.Factory
Parameters:
context - a Context object;
Returns:
an object created using information contained in context.
Throws:
JonathanException - if something goes wrong.

getRequestContext

public org.omg.IOP.ServiceContext getRequestContext(int request_id,
                                                    boolean response_expected,
                                                    byte[] object_key,
                                                    Context message_context)
Returns an indication whether java serialization is used.
Specified by:
getRequestContext in interface Service
Parameters:
request_id - the request identifier (ignored);
response_expected - indicates whether a response is expected or not (ignored);
object_key - the request target object key (ignored).
Returns:
always null.

getReplyContext

public org.omg.IOP.ServiceContext getReplyContext(int request_id,
                                                  Context ignored)
Returns null;
Specified by:
getReplyContext in interface Service
Parameters:
request_id - the corresponding request id (unused).
Returns:
a service context.

handleRequestContext

public void handleRequestContext(org.omg.IOP.ServiceContext context,
                                 int request_id,
                                 boolean response_expected,
                                 byte[] object_key,
                                 Context message_context)
This method is called by the services handler to let the operations related to the target service be performed on request arrival.
Specified by:
handleRequestContext in interface Service
Parameters:
context - the service context of the request;
request_id - the request identifier;
response_expected - indicates whether a response is expected or not;
object_key - the request target object key.

handleReplyContext

public void handleReplyContext(org.omg.IOP.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.
Specified by:
handleReplyContext in interface Service
Parameters:
context - the service context of the reply;
request_id - the corresponding request identifier.