FileDocCategorySizeDatePackage
SATBaseApplet.javaAPI DocphoneME MR2 API (J2ME)3829Wed May 02 18:00:40 BST 2007sim.toolkit

SATBaseApplet

public abstract class SATBaseApplet extends Applet implements ToolkitInterface, ToolkitConstants
This is a base class for all SAT applets. It provides shareable interface, local APDU buffer creation, local instance of the Toolkit Exception. The 'process' method should be never invoked and its overriding not needed.

Derived SAT applet can look like:

public class SATApplet extends SATBaseApplet {
private SATApplet() {
ToolkitRegistry reg;
register();
reg = ToolkitRegistry.getEntry();
reg.setEvent(EVENT_XXXXX);
}

public static void install(byte[] bArray, short bOffset, byte bLength) {
new SATApplet();
}

public void processToolkit(byte event) {
switch (event) {
case EVENT_XXXXX:
break;
}
}
}

Fields Summary
private byte[]
apduBuffer
APDU buffer
private ToolkitException
toolkitExceptionInstance
Shared instance of TookitException
Constructors Summary
protected SATBaseApplet()
Constructor

    
          
      
    
Methods Summary
public byte[]getAPDUBuffer()
Returns the APDUBuffer. If it does not exist then allocates it.

return
apdu buffer
throws
ToolkitException if SATAccessor is unavailable

        if (apduBuffer == null) {
            apduBuffer = new byte[ViewHandler.SATAccessor.getAPDUBufferMax()];
        }
        return apduBuffer;
    
public ShareablegetShareableInterfaceObject(AID clientAID, byte parameter)
Returns shareable interface object to SAT Applet.

param
clientAID - aid of SIM Framework
param
parameter
return
The current applet instance

        return this;
    
public ToolkitExceptiongetToolkitExceptionInstance()
Returns the ToolkitException instance. If it does not exist yet then creates it.

return
ToolkitException instance

        if (toolkitExceptionInstance == null) {
            toolkitExceptionInstance = new ToolkitException((short)0);
        }
        return toolkitExceptionInstance;
    
public voidprocess(APDU apdu)
Process method that is called by JCRE if this applet is selected.

param
apdu An APDU to process

    
public abstract voidprocessToolkit(byte event)
Process method called by GSMApplet when an evelope is received.

param
event An event to be handled