|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectopencard.core.service.CardServiceRegistry
public final class CardServiceRegistry
The CardServiceRegistry keeps track of CardServiceFactories. When asked for a certain CardService it searches through its registered CardServiceFactorys to find one which is able to create this. NOTE that there exists only one system-wide instance of this class which can be accessed via CardServiceRegistry.getRegistry ().
CardService
,
CardServiceFactory
,
CardServiceScheduler
,
CardChannel
Method Summary | |
---|---|
void |
add(CardServiceFactory factory)
Adds a CardServiceFactory to the registry. |
protected java.lang.Class |
getCardServiceClassFor(java.lang.Class clazz,
CardID cid,
CardServiceScheduler scheduler)
Gets a CardService class object for clazz. |
java.util.Enumeration |
getCardServiceFactories()
Gets all registered card service factories. |
protected CardService |
getCardServiceInstance(java.lang.Class clazz,
CardID cid,
CardServiceScheduler scheduler,
SmartCard card,
boolean block)
Tries to instantiate a CardService that is an instance of clazz and that works with the smart card represented by cid. |
static CardServiceRegistry |
getRegistry()
Gets a reference to the system-wide CardServiceRegistry object ('Singleton' pattern). |
protected SmartCard |
getSmartCard(CardTerminalEvent ctEvent,
CardRequest req,
java.lang.Object lockHandle)
Gets a SmartCard object based on a received CardTerminalEvent. |
protected void |
releaseScheduler(CardServiceScheduler scheduler)
Releases a CardServiceScheduler. |
void |
remove(CardServiceFactory factory)
Removes the passed CardServiceFactory from the registry. |
java.lang.String |
toString()
Gets a meaningful String representation of this CardServiceRegistry. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public void add(CardServiceFactory factory)
factory
- The CardServiceFactory to add.protected java.lang.Class getCardServiceClassFor(java.lang.Class clazz, CardID cid, CardServiceScheduler scheduler)
clazz
- The class that the requested CardService
should be an instance of.cid
- A CardID object representing the smart card
for which the CardService is requested.scheduler
- The CardServiceScheduler for the card
to be inspected.
public final java.util.Enumeration getCardServiceFactories()
protected CardService getCardServiceInstance(java.lang.Class clazz, CardID cid, CardServiceScheduler scheduler, SmartCard card, boolean block) throws java.lang.ClassNotFoundException
clazz
- The class that the requested CardService should be
an instance of.cid
- A CardID object representing the smart card for which
the CardService is requested.scheduler
- The controlling CardServiceSchedulercard
- The SmarCard object requesting the CardServiceblock
- Specifies the waiting behavior of the newly created CardService;
if true it will wait for CardChannel (i.e., block).
java.lang.ClassNotFoundException
- Thrown when no fitting CardService could be found.public static CardServiceRegistry getRegistry()
protected SmartCard getSmartCard(CardTerminalEvent ctEvent, CardRequest req, java.lang.Object lockHandle) throws CardTerminalException
ctEvent
- A CardTerminalEvent event received
from a terminal.req
- A CardRequest object describing what
kind of SmartCard is requested.lockHandle
- handle obtained by lock owner when locking the
terminal
CardTerminalException
protected void releaseScheduler(CardServiceScheduler scheduler)
scheduler
- The CardServiceScheduler to release.public void remove(CardServiceFactory factory)
factory
- The CardServiceFactory to add.public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |