6.2.1 JSMService Interface
For a Java class to be loaded and successfully executed, it must implement the JSMService interface as shown in this example:
public interface JSMService
{
public void service ( JSMContainer container ) ;
public JSMResponse command ( JSMCommand command ) throws JSMException ;
}
The service method of the class is called when the service first loads. This method will only be called once, so the JSMContainer object should be saved for later access in the current service program. The JSMContainer object allows access to the service trace object, service resource object and service storage object. The container resource is currently not used.
The command method is called every time the JSM client program sends a command string.
The command object allows access to the command string in Unicode, helper methods allow access to keywords. The client program byte encoding and locale can be accessed from the command object. Also a byte array object is available from the command object. This byte array is never null and will be a zero length array or a copy of the byte array sent from the client. No byte code transformation is done, so the byte array is raw and reflects the same encoding as the client.