Java Doc for Monitor.java in  » Science » Cougaar12_4 » org » cougaar » lib » aggagent » client » 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.lib.aggagent.client 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.cougaar.lib.aggagent.client.Monitor

All known Subclasses:   org.cougaar.lib.aggagent.client.ResultSetMonitor,  org.cougaar.lib.aggagent.client.AlertMonitor,
Monitor
abstract class Monitor (Code)
Abstract base class for result set and alert monitors. Provides support for both periodic pull monitoring as well as keep alive server push monitoring. Maintains a collection of monitored objects and keeps them updated based on changes on the aggregation agent's blackboard. To react to these changes either:
  • add update listener(s) to the monitor class and receive events for changes to all monitored objects or
  • add update listener(s) to 'live' objects returned by monitor and receive events only for those objects


Field Summary
final public static  intKEEP_ALIVE_METHOD
     KEEP_ALIVE_METHOD is an update method in which the client creates a keep alive session with aggregation agent.
final public static  intPULL_METHOD
     PULL_METHOD is an update method in which the client periodically pulls incremental updates from passive session on aggregation agent.

Constructor Summary
public  Monitor(String serverURL, String monitorTag, int updateMethod)
     Create a new monitor to monitor a set of objects on the aggregation agent.

Method Summary
public  voidaddUpdateListener(UpdateListener ul)
     Add an update listener to observe all monitored objects.
public  booleancancel()
     Cancel this monitor and any overhead associated with it.
abstract protected  StringcreateIdTag(Object identifier)
     Must be defined by subclasses to provide a xml representation of a given identifier.
Parameters:
  identifier - an object that uniquely identifies an object on theaggregation agent.
protected  ObjectgetMonitoredObject(Object identifier)
     Get a specific object being updated by this monitor.
Parameters:
  identifier - an object that uniquely identifies an object on theaggregation agent.
public  CollectiongetMonitoredObjects()
     Returns a collection of all 'live' objects currently being updated by this monitor.
public  TimerTaskgetPullTask()
     Get the timer task to use to periodically pull incremental updates from the aggregation agent. the timer task to use to periodically pull incremental updatesfrom the aggregation agent.
public  booleanisMonitoring(Object identifier)
     Returns true if an object matching the given identifier is currently being updated by this monitor.
Parameters:
  identifier - an object that uniquely identifies an object on theaggregation agent.
public  voidmonitorAllObjects()
     Change mode to monitor all objects on the aggregation agent that are of the type that this monitor handles.
protected  ObjectmonitorObject(Object identifier, Object monitoredObj)
     Monitor a new object.
abstract protected  Objectremove(Element monitoredElement)
     Must be defined by subclasses to define what should be done when a remove event is reported by the aggregation agent to a object described by the given xml element tree.
Parameters:
  monitoredElement - xml element tree that describes the removedmonitored object.
public  voidremoveUpdateListener(UpdateListener ul)
     Remove an update listener such that it no longer gets notified of changes to monitored objects.
protected  ObjectstopMonitoringObject(Object identifier)
     Remove this object from the set of objects being monitored.
abstract protected  Objectupdate(Element monitoredElement)
     Must be defined by subclasses to define what should be done when an update event (either add or change) is reported by the aggregation agent to a object described by the given xml element tree.
Parameters:
  monitoredElement - xml element tree that describes the updatedmonitored object.

Field Detail
KEEP_ALIVE_METHOD
final public static int KEEP_ALIVE_METHOD(Code)
KEEP_ALIVE_METHOD is an update method in which the client creates a keep alive session with aggregation agent. Incremental updates are pushed to the client over this pipe.



PULL_METHOD
final public static int PULL_METHOD(Code)
PULL_METHOD is an update method in which the client periodically pulls incremental updates from passive session on aggregation agent. A new connection is created with each pull.




Constructor Detail
Monitor
public Monitor(String serverURL, String monitorTag, int updateMethod)(Code)
Create a new monitor to monitor a set of objects on the aggregation agent. Each monitor is used to monitor a single type of object (e.g. AlertMonitor, ResultSetMonitor).
Parameters:
  serverURL - aggregation agent cluster's text URL
Parameters:
  monitorTag - magic text string used to tell aggregation PSP whattype of objects are being monitored.(e.g. "alert", "result_set")
Parameters:
  updateMethod - method used to keep monitored objects updatedPULL_METHOD - periodically pull incremental updatesfrom passive session on aggregationagent. Create new connection witheach pull.KEEP_ALIVE_METHOD - create keep alive sessionwith aggregation agent. Incrementalupdates are pushed to the clientover this pipe.




Method Detail
addUpdateListener
public void addUpdateListener(UpdateListener ul)(Code)
Add an update listener to observe all monitored objects. This is roughly equivalent to adding an update listener to each of the currently monitored objects. But, when monitor all objects is turned on, this can also be used to discover newly added objects on the aggregation agent's blackboard (via objectAdded listener call).
Parameters:
  ul - update listener to add to entire monitor.



cancel
public boolean cancel()(Code)
Cancel this monitor and any overhead associated with it. true, if successful.



createIdTag
abstract protected String createIdTag(Object identifier)(Code)
Must be defined by subclasses to provide a xml representation of a given identifier.
Parameters:
  identifier - an object that uniquely identifies an object on theaggregation agent. Must be able to use this objectas a hashtable key (i.e. must have proper equals()and hashcode() methods). a xml representation of given identifier.



getMonitoredObject
protected Object getMonitoredObject(Object identifier)(Code)
Get a specific object being updated by this monitor.
Parameters:
  identifier - an object that uniquely identifies an object on theaggregation agent. Must be able to use this objectas a hashtable key (i.e. must have proper equals()and hashcode() methods). a live object that is actively being updated to match a subjectobject on the aggregation agent.



getMonitoredObjects
public Collection getMonitoredObjects()(Code)
Returns a collection of all 'live' objects currently being updated by this monitor. a collection of all 'live' objects currently being updated bythis monitor.



getPullTask
public TimerTask getPullTask()(Code)
Get the timer task to use to periodically pull incremental updates from the aggregation agent. the timer task to use to periodically pull incremental updatesfrom the aggregation agent. Returns null if monitor is not configured touse the pull update method.



isMonitoring
public boolean isMonitoring(Object identifier)(Code)
Returns true if an object matching the given identifier is currently being updated by this monitor.
Parameters:
  identifier - an object that uniquely identifies an object on theaggregation agent. Must be able to use this objectas a hashtable key (i.e. must have proper equals()and hashcode() methods). true if an object matching the given identifier is currentlybeing updated by this monitor.



monitorAllObjects
public void monitorAllObjects()(Code)
Change mode to monitor all objects on the aggregation agent that are of the type that this monitor handles. Without calling this method, only a defined set of objects are monitored (see monitorObject method).



monitorObject
protected Object monitorObject(Object identifier, Object monitoredObj)(Code)
Monitor a new object. If object matching identifier is already being monitored, existing live object is returned. Otherwise, passed in object becomes live.
Parameters:
  identifier - an object that uniquely identifies an object on theaggregation agent. Must be able to use this objectas a hashtable key (i.e. must have proper equals()and hashcode() methods).
Parameters:
  monitoredObj - a valid object for this type of monitor. a live object that is actively being updated to match a subjectobject on the aggregation agent.



remove
abstract protected Object remove(Element monitoredElement)(Code)
Must be defined by subclasses to define what should be done when a remove event is reported by the aggregation agent to a object described by the given xml element tree.
Parameters:
  monitoredElement - xml element tree that describes the removedmonitored object. previously live object that was removed.



removeUpdateListener
public void removeUpdateListener(UpdateListener ul)(Code)
Remove an update listener such that it no longer gets notified of changes to monitored objects.
Parameters:
  ul - update listener to remove from monitor.



stopMonitoringObject
protected Object stopMonitoringObject(Object identifier)(Code)
Remove this object from the set of objects being monitored. This method has a negligible effect if monitor-all is turned on (old live object will die, but new one will take it's place if that object is still on the log plan).
Parameters:
  identifier - an object that uniquely identifies an object on theaggregation agent. Must be able to use this objectas a hashtable key (i.e. must have proper equals()and hashcode() methods). previously live object that was removed.



update
abstract protected Object update(Element monitoredElement)(Code)
Must be defined by subclasses to define what should be done when an update event (either add or change) is reported by the aggregation agent to a object described by the given xml element tree.
Parameters:
  monitoredElement - xml element tree that describes the updatedmonitored object. a live object updated based on the given xml



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(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.