|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--opencard.core.service.SmartCard
The SmartCard object is the point of access to the OpenCard framework for the application. CardServices are accessible through the services of the SmartCard object.
A SmartCard object is always tied to the controlling CardServiceScheduler.
CardService
Constructor Summary | |
SmartCard(CardServiceScheduler scheduler,
CardID cid)
Instantiates a SmartCard object that is tied to scheduler. |
Method Summary | |
void |
beginMutex()
Gain exclusive access to the card. |
void |
close()
Closes this SmartCard object and signals to OCF that the allocated resources are not any longer required. |
void |
endMutex()
Releases exclusive access to the card. |
protected void |
finalize()
Finalizer: close this SmartCard in case it is still open. |
CardID |
getCardID()
Gets the CardID object representing this smart card. |
CardService |
getCardService(java.lang.Class clazz,
boolean block)
Tries to instantiate a CardService for the smart card that implements class clazz. |
static SmartCard |
getSmartCard(CardTerminalEvent ctEvent)
Deprecated. use getSmartCard(CardTerminalEvent, CardRequest) |
static SmartCard |
getSmartCard(CardTerminalEvent ctEvent,
CardRequest req)
Gets a SmartCard object for a received CardTerminalEvent provided that the CardRequest can be satisfied. |
static SmartCard |
getSmartCard(CardTerminalEvent ctEvent,
CardRequest req,
java.lang.Object lockHandle)
Gets a SmartCard object for a received CardTerminalEvent provided that the CardRequest can be satisfied. |
static java.lang.String |
getVersion()
return version information about OCF It returns a string of the form OCF1.2;IBM Reference Implementation, Build Hudson, 21-May-1999 The first part indicates the API. |
static boolean |
isStarted()
Determines whether the startup process has already been carried out during this session. |
static void |
shutdown()
Shuts down the entire OpenCard Framework. |
static void |
start()
Initializes the entire OpenCard Framework and is meant to be the first method to be invoked in any application in order to setup OpenCard properly. |
static SmartCard |
waitForCard(CardRequest req)
Waits for a card to be inserted into any of the card terminals attached to the system. |
static SmartCard |
waitForCard(CardRequest req,
java.lang.Object lockHandle)
Waits for a card to be inserted into any of the locked card terminals attached to the system. |
Methods inherited from class java.lang.Object |
clone,
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public SmartCard(CardServiceScheduler scheduler, CardID cid)
scheduler
- The controlling CardServiceScheduler.cid
- The CardID object representing the physical
smart card.Method Detail |
public static java.lang.String getVersion()
OCF1.2;IBM Reference Implementation, Build Hudson, 21-May-1999
The first part indicates the API. It always starts with "OCF", followed by an API version number, and terminate by a semicolon. Currently, this the API version number is simply the OCF release number. When a formal OCF specification becomes available, it would refer to the version of that specification it implements. After the semicolon, vendor specific information is included. The format of the vendor specific information is not specified.
public void beginMutex() throws java.lang.InterruptedException, CardTerminalException
CardService.setCardChannel(opencard.core.service.CardChannel)
,
CardServiceScheduler.allocateCardChannel(java.lang.Object, boolean)
public void close() throws CardTerminalException
public void endMutex()
protected void finalize()
public CardID getCardID()
public CardService getCardService(java.lang.Class clazz, boolean block) throws java.lang.ClassNotFoundException, CardServiceException
clazz
- The class that the CardService shall implement.block
- If true, indicates that the CardService should run in
blocking mode.public static SmartCard getSmartCard(CardTerminalEvent ctEvent) throws CardTerminalException
public static SmartCard getSmartCard(CardTerminalEvent ctEvent, CardRequest req) throws CardTerminalException
ctEvent
- The received CardTerminalEvent.req
- A CardRequest object describing the kind of
smart card that we are interested in.public static SmartCard getSmartCard(CardTerminalEvent ctEvent, CardRequest req, java.lang.Object lockHandle) throws CardTerminalException
ctEvent
- The received CardTerminalEvent.req
- A CardRequest object describing the kind of
smart card that we are interested in.lockHandle
- the handle obtained by the lock owner when locking a
slot or terminal.public static boolean isStarted()
public static void shutdown() throws CardTerminalException
public static void start() throws OpenCardPropertyLoadingException, java.lang.ClassNotFoundException, CardServiceException, CardTerminalException
public static SmartCard waitForCard(CardRequest req) throws CardTerminalException
req
- A CardRequest object describing the kind of
smart card that we are interested in.CardRequest
,
CTListener
,
CTListener.cardInserted(opencard.core.event.CardTerminalEvent)
,
CTListener.cardRemoved(opencard.core.event.CardTerminalEvent)
,
getSmartCard(opencard.core.event.CardTerminalEvent, opencard.core.service.CardRequest)
public static SmartCard waitForCard(CardRequest req, java.lang.Object lockHandle) throws CardTerminalException
req
- A CardRequest object describing the kind of
smart card that we are interested in.lockHandle
- handle obtained by lock owner when locking a terminal. This
parameter is only necessary for locked terminals / slots.CardRequest
,
CTListener
,
CTListener.cardInserted(opencard.core.event.CardTerminalEvent)
,
CTListener.cardRemoved(opencard.core.event.CardTerminalEvent)
,
getSmartCard(opencard.core.event.CardTerminalEvent, opencard.core.service.CardRequest)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |