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.


Variable Index

 o ALREADY_SEEN
 o MATCHES
 o NOT_YET
 o WRONG_TARGET

Method Index

 o 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.
 o getSpecifiedTarget()
 o matches(int)
Returns different values based on whether the serial number matches the number passed as a parameter.
 o serialNumber()
This returns the ticket's serial number.
 o target()
Return the target.
 o toString()

Variables

 o MATCHES
 public static final int MATCHES
 o ALREADY_SEEN
 public static final int ALREADY_SEEN
 o NOT_YET
 public static final int NOT_YET
 o WRONG_TARGET
 public static final int WRONG_TARGET

Methods

 o 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.

 o getSpecifiedTarget
 public Specifiable getSpecifiedTarget()
 o 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.

 o 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
 o matches
 public int matches(int number)
Returns different values based on whether the serial number matches the number passed as a parameter.

 o toString
 public String toString()
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index