| org.cougaar.core.plugin.ComponentPlugin org.cougaar.pizza.plugin.InvitePlugin
InvitePlugin | public class InvitePlugin extends ComponentPlugin (Code) | | Sends a simple relay invitation to all "FriendsOfMark" (members of the community),
whose responses are automatically collected in the PizzaPreferences object.
Waits for a set amount of time, WAIT_FOR_RSVP_DURATION, until it
publishes the pizza preference list to the blackboard. While it's
waiting, replies come back from invitees and update the PizzaPreferences
object in memory.
It must wait because people may take a while to join the FriendsOfMark community,
and the PlaceOrderPlugin will place the orders as soon as the PizzaPreferences
object is published.
An alternate way to do this instead of an alarm would be to tell this Plugin in
advance how many people to expect, or allow it to publishChange the
PizzaPreferences object.
See Also: PizzaPreferences See Also: PlaceOrderPlugin |
Method Summary | |
protected void | checkTimer() If the timer has expired, assume all the members of the community have joined,
gotten the ABA targeted RSVP Relay, and replied. | protected void | execute() Onc we have the self org, publish the invite RSVPRelay if we haven't yet. | protected Entity | getSelfEntity() Returns the Entity representing the agent. | protected long | getTimerExpirationTime() | protected long | getWaitParameter() Looks for argument to plugin like: "WAIT_FOR_RSVP_DURATION:60000". | protected void | publishRelay() Create a PizzaPreferences object to collect local results, and
publish my RSVP relay inviting people to the party. | public void | setLoggingService(LoggingService log) | public void | setParameter(Object o) | public void | setUIDService(UIDService uids) | protected void | setupSubscriptions() We have one subscription, to the relays (the invitation) we produce.
Here we also publish the pizza preferences. | protected void | startTimer(long delay) | protected boolean | timerExpired() Test if the timer has expired. |
pizzaPreferences | protected PizzaPreferences pizzaPreferences(Code) | | my list of pizza preferences generated from RSVPs
|
publishedPreferences | protected boolean publishedPreferences(Code) | | Have we published preferences
|
waitForRSVPDuration | protected long waitForRSVPDuration(Code) | | How long to wait before publish preferences
|
checkTimer | protected void checkTimer()(Code) | | If the timer has expired, assume all the members of the community have joined,
gotten the ABA targeted RSVP Relay, and replied. So publish the
PizzaPreferences object, so the PlaceOrderPlugin can begin.
|
execute | protected void execute()(Code) | | Onc we have the self org, publish the invite RSVPRelay if we haven't yet.
When the timer expires, assume all replies have come in, and publish the collected
PizzaPreferences object for the PlaceOrderPlugin.
|
getSelfEntity | protected Entity getSelfEntity()(Code) | | Returns the Entity representing the agent. Checks the entity subscription and
returns the first element. In this example, there should be only one self entity.
local Entity, null if none yet |
getTimerExpirationTime | protected long getTimerExpirationTime()(Code) | | When will (has) the timer expire(d)?
|
getWaitParameter | protected long getWaitParameter()(Code) | | Looks for argument to plugin like: "WAIT_FOR_RSVP_DURATION:60000".
For example :
WAIT_FOR_RSVP_DURATION:60000
millis to wait |
publishRelay | protected void publishRelay()(Code) | | Create a PizzaPreferences object to collect local results, and
publish my RSVP relay inviting people to the party. The relay itself
will update the PizzaPreferences object as replies come in.
|
setParameter | public void setParameter(Object o)(Code) | | "setParameter" is only called if a plugin has parameters
|
setupSubscriptions | protected void setupSubscriptions()(Code) | | We have one subscription, to the relays (the invitation) we produce.
Here we also publish the pizza preferences. Initially it only holds
the preference for Alice, the inviting agent.
Sets a timer that fires when we have waited long enough for responses
to return.
|
startTimer | protected void startTimer(long delay)(Code) | | Schedule a update wakeup after some interval of time
Parameters: delay - how long to delay before the timer expires. |
timerExpired | protected boolean timerExpired()(Code) | | Test if the timer has expired.
false if the timer is not running or has not yet expired |
|
|