All Packages Class Hierarchy This Package Previous Next Index
Class ncsa.habanero.tickets.Ticket
java.lang.Object
|
+----ncsa.habanero.tickets.Ticket
- public class Ticket
- extends Object
- implements Marshallable
The ticket is created (only) by a TicketGranter, and represents permission
for an associated Action to be executed on a particular target in an
order represented by its serial number. Out of order tickets are
queued by the Serializer until previous tickets arrive. The Serializer
also passes the associated Action the target upon which to execute. The
Ticket is opaque, allowing only a matches operation.
-
ALREADY_SEEN
-
-
MATCHES
-
-
NOT_YET
-
-
WRONG_TARGET
-
-
act(Action)
- We do not really want the target to go outside the ticket, so
we have the ticket make the call to the action.
-
getSpecifiedTarget()
-
-
matches(int)
- Returns different values based on whether the serial number matches
the number passed as a parameter.
-
serialNumber()
- This returns the ticket's serial number.
-
target()
- Return the target.
-
toString()
-
MATCHES
public static final int MATCHES
ALREADY_SEEN
public static final int ALREADY_SEEN
NOT_YET
public static final int NOT_YET
WRONG_TARGET
public static final int WRONG_TARGET
target
public Targetable target()
- Return the target. In some cases the object stored as the target is
not Targetable; an Exception will be thrown in such a case.
getSpecifiedTarget
public Specifiable getSpecifiedTarget()
serialNumber
public int serialNumber()
- This returns the ticket's serial number. I'm making this public
against my better judgement, but it's
needed by Serializer, which cannot be in this package.
act
public void act(Action action)
- We do not really want the target to go outside the ticket, so
we have the ticket make the call to the action.
- Parameters:
- action - The action to perform
matches
public int matches(int number)
- Returns different values based on whether the serial number matches
the number passed as a parameter.
toString
public String toString()
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index