org.cougaar.pizza
Class Constants.Roles

java.lang.Object
  extended byorg.cougaar.pizza.Constants.Roles
Enclosing class:
Constants

public static class Constants.Roles
extends java.lang.Object

Roles used on Assets in the Pizza application.


Field Summary
static org.cougaar.planning.ldm.plan.Role CARNIVORE
          Someone who wants a meat pizza
static org.cougaar.planning.ldm.plan.Role PIZZACUSTOMER
          The inverse of a PizzaProvider; orders pizza.
static org.cougaar.planning.ldm.plan.Role PIZZAPROVIDER
          An Agent that provides the PizzaProvider service
static org.cougaar.planning.ldm.plan.Role VEGETARIAN
          Someone who wants a Veggie pizza - no meat!
 
Constructor Summary
Constants.Roles()
           
 
Method Summary
static void init()
          Ensure that Role constants are initialized.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CARNIVORE

public static final org.cougaar.planning.ldm.plan.Role CARNIVORE
Someone who wants a meat pizza


VEGETARIAN

public static final org.cougaar.planning.ldm.plan.Role VEGETARIAN
Someone who wants a Veggie pizza - no meat!


PIZZAPROVIDER

public static final org.cougaar.planning.ldm.plan.Role PIZZAPROVIDER
An Agent that provides the PizzaProvider service


PIZZACUSTOMER

public static final org.cougaar.planning.ldm.plan.Role PIZZACUSTOMER
The inverse of a PizzaProvider; orders pizza.

Constructor Detail

Constants.Roles

public Constants.Roles()
Method Detail

init

public static void init()
Ensure that Role constants are initialized. Actually does nothing, but the classloader ensures that all static initializers have been run before executing any code in this class. This ensures that Roles required for the Pizza app are created properly before a application code calls Role.get(Constants.Role.XXX)

All Roles have a converse - PizzaProvider/PizzaConsumer for example. The following Role.create calls specify both the Role and its converse. In the case of the Carnivore Role - the Role and its converse are the same. The call to create PizzaProvider, however, designates PizzaConsumer as the converse. (See RelationshipType.PROVIDER definition above.

If Role.get(XXX) is called before a proper Role.create, the Role code will create a default pairing of XXX and ConverseOfXXX Roles. The ConverseOfXXX Role is typically unusable.