All Packages Class Hierarchy This Package Previous Next Index
Class semper.payment.PurseReference
java.lang.Object
|
+----semper.payment.PurseReference
- public class PurseReference
- extends Object
- implements Serializable
This class is nothing more than a specialised cover for the archive
AccessName object. It provides a unified way to refer to a purse,
regardless of whether it exists or not. If this class were not
available, various entities in the payment block that need to refer
to purses must use the AccessName of the purse directly.
A cleaner solution would have been as follows:
- during purse creation, assign a unique internal name for the purse.
- all internal references to purses must be based on this internal name.
- everyone always asks the PaymentManager for a real Purse object; all
references to real Purse objects must be transient.
- Version:
- $Revision: 1.21 $ $Date: 1998/08/03 07:41:30 $
- Author:
- N. Asokan ([email protected])
- See Also:
- Purse, AccessName
-
PurseReference()
- Constructor without args
-
PurseReference(String)
-
-
PurseReference(String, Purse, AccessName)
-
-
getHandle()
- Get the archive handle of this purse.
-
getName()
- Get the purse name.
-
getPurse()
- Get the object reference of this purse.
-
isActivated()
- Check if the purse is active.
-
isDisabled()
- Check if the purse has been disabled by the user.
-
toString()
- rewrite toString() to suit our needs
PurseReference
public PurseReference(String purse_name,
Purse purse_reference,
AccessName purse_handle)
- Parameters:
- purse_name - distinguished name of a purse
- purse_reference - object reference to this purse
- purse_handle - archive handle of this purse
PurseReference
public PurseReference(String purse_name)
- Parameters:
- purse_name - distinguished name of a purse
PurseReference
public PurseReference()
- Constructor without args
toString
public String toString()
- rewrite toString() to suit our needs
- Returns:
- string describing this object
- Overrides:
- toString in class Object
getPurse
public Purse getPurse() throws PaymentServiceException
- Get the object reference of this purse. If the purse is still in
the archive, it will be retrieved and instantiated. Otherwise,
the reference to the already instantiated object will be returned.
If we don't already have the purse, we first check with the payment
manager to see if it had already instantiated a purse. If so, we
borrow the reference from the payment manager. This way, we'll
guarantee that a purse is not instantiated multiple times (we assume
that the payment manager is the first to instantiate a purse)
- Returns:
- purse object (or null, if the purse no longer exists)
- Throws: PaymentServiceException
- if purse retrieval from
archive failed.
- See Also:
- Purse
getName
public String getName()
- Get the purse name. (TODO: just get it from the purse)
- Returns:
- distinguished name of purse
getHandle
public AccessName getHandle()
- Get the archive handle of this purse.
- Returns:
- archive handle of purse
isActivated
public boolean isActivated()
- Check if the purse is active.
- Used-by: Payment Manager while constructing the list of
active purses
- Returns:
- true if the purse is active
- See Also:
- getListOfPurses
isDisabled
public boolean isDisabled()
- Check if the purse has been disabled by the user.
- Used-by: Payment Manager to see whether the purse should be
activated at startup
- Returns:
- true if the purse has been disabled by the user
- See Also:
- init
All Packages Class Hierarchy This Package Previous Next Index