Java Doc for InvitePlugin.java in  » Science » Cougaar12_4 » org » cougaar » pizza » plugin » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Science » Cougaar12_4 » org.cougaar.pizza.plugin 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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



Field Summary
protected  PizzaPreferencespizzaPreferences
    
protected  booleanpublishedPreferences
    
protected  longwaitForRSVPDuration
    


Method Summary
protected  voidcheckTimer()
     If the timer has expired, assume all the members of the community have joined, gotten the ABA targeted RSVP Relay, and replied.
protected  voidexecute()
     Onc we have the self org, publish the invite RSVPRelay if we haven't yet.
protected  EntitygetSelfEntity()
     Returns the Entity representing the agent.
protected  longgetTimerExpirationTime()
    
protected  longgetWaitParameter()
     Looks for argument to plugin like: "WAIT_FOR_RSVP_DURATION:60000".
protected  voidpublishRelay()
     Create a PizzaPreferences object to collect local results, and publish my RSVP relay inviting people to the party.
public  voidsetLoggingService(LoggingService log)
    
public  voidsetParameter(Object o)
    
public  voidsetUIDService(UIDService uids)
    
protected  voidsetupSubscriptions()
     We have one subscription, to the relays (the invitation) we produce.

Here we also publish the pizza preferences.

protected  voidstartTimer(long delay)
    
protected  booleantimerExpired()
     Test if the timer has expired.

Field Detail
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





Method Detail
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.



setLoggingService
public void setLoggingService(LoggingService log)(Code)



setParameter
public void setParameter(Object o)(Code)
"setParameter" is only called if a plugin has parameters



setUIDService
public void setUIDService(UIDService uids)(Code)



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



Methods inherited from org.cougaar.core.plugin.ComponentPlugin
abstract protected void execute()(Code)(Java Doc)
protected ConfigFinder getConfigFinder()(Code)(Java Doc)
abstract protected void setupSubscriptions()(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.