com.jaccal
Class SessionFactory

java.lang.Object
  extended bycom.jaccal.SessionFactory
Direct Known Subclasses:
JaccalPCSCSessionFactory

public abstract class SessionFactory
extends Object

The SessionFactory creates sessions that bind to the card readers.

Author:
Chang Sau Sheong
See Also:
Session, JaccalPCSCSessionFactory

Field Summary
protected static SessionFactory instance
           
protected  List readers
           
static List sessions
           
 
Constructor Summary
protected SessionFactory()
           
 
Method Summary
 void addReader(Reader reader)
           
abstract  Session createSession(String name)
          Creates and returns a session based on the card in the reader.
abstract  Session createSession(String name, int cardType)
          Creates and returns a specific session object.
abstract  Session createSession(String name, String reader)
          Creates and returns a session object according to the type of card is in the reader
abstract  Session[] createSessions()
           
abstract  Session[] createSessions(int cardType)
           
 Reader[] getAllReaders()
           
static String[] getCardTypes()
          List the card types implemented
static SessionFactory getInstance()
          Returns a singleton instance of the SessionFactory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

protected static SessionFactory instance

sessions

public static List sessions

readers

protected List readers
Constructor Detail

SessionFactory

protected SessionFactory()
                  throws SessionFactoryException
Method Detail

createSession

public abstract Session createSession(String name,
                                      String reader)
                               throws SessionFactoryException
Creates and returns a session object according to the type of card is in the reader

Parameters:
name -
reader -
Returns:
A Session object
Throws:
SessionFactoryException

createSession

public abstract Session createSession(String name)
                               throws SessionFactoryException
Creates and returns a session based on the card in the reader. Assumes there is only 1 reader in the computer

Parameters:
name -
Returns:
A Session object
Throws:
SessionFactoryException

createSession

public abstract Session createSession(String name,
                                      int cardType)
                               throws SessionFactoryException
Creates and returns a specific session object. Goes into each reader and detects the card type and returns the first card type that is of the required type found.

Parameters:
name - name of the session
cardType - type of card to be returned
Returns:
A Session object
Throws:
SessionFactoryException

createSessions

public abstract Session[] createSessions()
                                  throws SessionFactoryException
Throws:
SessionFactoryException

createSessions

public abstract Session[] createSessions(int cardType)
                                  throws SessionFactoryException
Throws:
SessionFactoryException

getInstance

public static SessionFactory getInstance()
                                  throws CardException
Returns a singleton instance of the SessionFactory.

Returns:
A SessionFactory object based on the configuration in jaccal.properties
Throws:
CardException

getCardTypes

public static String[] getCardTypes()
                             throws CardException
List the card types implemented

Returns:
A String array of card types
Throws:
CardException

addReader

public void addReader(Reader reader)

getAllReaders

public Reader[] getAllReaders()


Copyright © 2005 Chang Sau Sheong, Thomas Tarpin-Lyonnet. All Rights Reserved.