com.intel.util
Class ServiceApplet
- java.lang.Object
-
- com.intel.runtime.core.Service
-
- com.intel.util.IntelApplet
-
- com.intel.util.ServiceApplet
-
- All Implemented Interfaces:
- com.intel.runtime.comm.InternalService
public abstract class ServiceApplet extends IntelApplet implements com.intel.runtime.comm.InternalService
This is the base class that must be inherited by a service type applet implementation. This class should be used for implementing the service side of an inter-applet communication only.
-
-
Field Summary
Fields Modifier and Type Field and Description static int
APPLET_ERROR_BAD_PARAMETERS
static int
APPLET_ERROR_GENERIC
static int
APPLET_SUCCESS
-
Fields inherited from class com.intel.util.IntelApplet
APPLET_ERROR_BAD_STATE, APPLET_ERROR_NOT_SUPPORTED, APPLET_ERROR_OUT_OF_RESOURCE, APPLET_ERROR_SMALL_BUFFER, APPLET_INVALID_COMMAND_ID
-
Fields inherited from class com.intel.runtime.core.Service
CMD_CLOSE, CMD_IAC_CLOSE_SESSION, CMD_IAC_CREATE_SESSION, CMD_IAC_SEND_AND_RECV, CMD_PING, ERR_BAD_PARAMETERS, ERR_BAD_STATE, ERR_GENERIC, ERR_IAC_EXIST_INTERNAL_SESSION, ERR_NONE, ERR_OUT_OF_RESOURCE, ERR_SMALL_BUFFER, ERR_UNCAUGHT_EXCEPTION
-
Fields inherited from interface com.intel.runtime.comm.InternalService
CMD_CLOSE_SESSION, CMD_OPEN_SESSION, CMD_SEND_AN_RECV, ERR_ACCESS_DENIED, ERR_BAD_PARAMETERS, ERR_BAD_STATE, ERR_GENERIC, ERR_IAC_CLIENT_SLOT_FULL, ERR_IAC_INTERNAL_SESSION_NUM_EXCEED, ERR_IAC_SERVICE_SESSION_NOT_FOUND, ERR_IAC_SERVICETA_EXITED, ERR_IAC_SERVICETA_UNCAUGHT_EXCEPTION, ERR_MSG_QUEUE_IS_FULL, ERR_NONE, ERR_OUT_OF_MEMORY, ERR_UNCAUGHT_EXCEPTION
-
-
Constructor Summary
Constructors Constructor and Description ServiceApplet()
-
Method Summary
Methods Modifier and Type Method and Description void
onInternalClose(long sessionId)
This method will be called by the VM when the internal session being handled by this service applet instance is closed by the client.abstract void
onInternalCommand(long sessionId, int commandId, byte[] request, ServiceResult result)
This method will be called by the VM to handle an internal command sent to this applet instance.int
onInternalOpen(long sessionId, java.lang.String clientUuid, byte[] request)
This method will be called by the VM when a new internal session is opened to the service applet by a client applet instance.int
onInternalSessionClose(long sessionId)
This method must not be used directly.int
onInternalSessionCommand(long sessionId, int command, byte[] params, com.intel.runtime.comm.InternalSessionResult isr)
This method must not be used directly.int
onInternalSessionOpen(long sessionId, com.intel.runtime.comm.UUID clientId, byte[] params)
This method must not be used directly.-
Methods inherited from class com.intel.util.IntelApplet
getResponseBufferSize, getSessionId, getSessionIdLength, getUUID, invokeCommand, onClose, onCloseSession, onCommand, onInit, onOpenSession, sendAsynchMessage, setResponse, setResponseCode
-
-
-
-
Field Detail
-
APPLET_SUCCESS
public static final int APPLET_SUCCESS
- See Also:
- Constant Field Values
-
APPLET_ERROR_GENERIC
public static final int APPLET_ERROR_GENERIC
- See Also:
- Constant Field Values
-
APPLET_ERROR_BAD_PARAMETERS
public static final int APPLET_ERROR_BAD_PARAMETERS
- See Also:
- Constant Field Values
-
-
Method Detail
-
onInternalSessionOpen
public final int onInternalSessionOpen(long sessionId, com.intel.runtime.comm.UUID clientId, byte[] params)
This method must not be used directly.- Specified by:
onInternalSessionOpen
in interfacecom.intel.runtime.comm.InternalService
- See Also:
onInternalOpen(long sessionId, String clientUuid, byte[] request)
-
onInternalSessionCommand
public final int onInternalSessionCommand(long sessionId, int command, byte[] params, com.intel.runtime.comm.InternalSessionResult isr)
This method must not be used directly.- Specified by:
onInternalSessionCommand
in interfacecom.intel.runtime.comm.InternalService
- See Also:
onInternalCommand(long sessionID, int cmdID, byte[] dataBuf, ServiceResult result)
-
onInternalSessionClose
public final int onInternalSessionClose(long sessionId)
This method must not be used directly.- Specified by:
onInternalSessionClose
in interfacecom.intel.runtime.comm.InternalService
- See Also:
onInternalClose(long sessionId)
-
onInternalOpen
public int onInternalOpen(long sessionId, java.lang.String clientUuid, byte[] request)
This method will be called by the VM when a new internal session is opened to the service applet by a client applet instance.- Parameters:
sessionId
- the internal session identifier of the new sessionclientUuid
- the UUID of the client applet that opened the session, may be used by the applet to decide if it should accept or reject the sessionrequest
- the input data sent to the applet during session creation- Returns:
APPLET_SUCCESS
if the operation was processed successfully, any other status code in case of error (note that all error codes will be treated similarly by the VM by canceling the open session command and sending the status code to the client).
-
onInternalCommand
public abstract void onInternalCommand(long sessionId, int commandId, byte[] request, ServiceResult result)
This method will be called by the VM to handle an internal command sent to this applet instance. To return the response data to the command, set theresult.responseData
member before returning from this method. In order to provide a return value for the command, which will be delivered to the client instance communicating with the applet,result.responseCode
member should be set.- Parameters:
sessionId
- the internal session identifiercommandId
- the command ID (applet specific)request
- the input data for this commandresult
- the argument for setting the resulting response data/code
-
onInternalClose
public void onInternalClose(long sessionId)
This method will be called by the VM when the internal session being handled by this service applet instance is closed by the client.- Parameters:
sessionId
- the internal session identifier
-
-