Java Doc for SimpleMatchmakerPlugin.java in  » Science » Cougaar12_4 » org » cougaar » servicediscovery » 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.servicediscovery.plugin 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.cougaar.core.plugin.ComponentPlugin
   org.cougaar.servicediscovery.plugin.SimpleMatchmakerPlugin

All known Subclasses:   org.cougaar.pizza.plugin.MatchmakerPlugin,
SimpleMatchmakerPlugin
public class SimpleMatchmakerPlugin extends ComponentPlugin (Code)
The Matchmaker is responsible for taking service discovery requests (MMQueryRequests) from the SDClient, and issuing asynchronous queries to the YP to find matching providers. When one (or more) is found, send the scored results back the SDClient on the MMQueryRequest.

This version assumes the Role requested will be in the CommercialServiceScheme, and allows the YP to handle walking up YP communities as necessary. It does not handle quiescence, is not guaranteed to work with kills/restarts (persistence), only works with a distributed YP (using communities, not a single static instance), etc.


Inner Class :public class QueryAlarm implements Alarm

Field Summary
protected  LoggingServicemyLoggingService
    


Method Summary
protected  voidexecute()
     Loop through new MMQueryRequests, posting a new asynchronous YP query for each.
protected  voidfindServiceWithDistributedYP(RQ r)
     This is the workhourse: ask the YP to find a service that matches the given request, and to tell us when it is done with a callback we supply.
protected  StringgetServiceSchemeForRoles()
     Return the UDDI Service Scheme that contains the Roles we will look for.
protected  longgetWarningCutoffTime()
     Get the real time after which DEBUG level problems become ERROR: This is the parametrized warning cut-off interval (in minutes, default of 2), plus the time of the first error.
protected  voidhandleException(RQ r)
     Handle an exception from a YP query callback by logging something, waiting a while, and trying again.
protected  voidhandleResponse(RQ r)
     Process a real response from the YP for a lookup.
public  voidload()
     Over-ride parent load to get non-essential services (the log service here).
public  voidsetRegistryQueryService(RegistryQueryService rqs)
     Reflection sets the RegistryQueryService at startup - plugin will not load if not found.
protected  voidsetupSubscriptions()
     Subscribe to MMQueryRequests from the SDClientPlugin.
public  voidunload()
     Every load() should have an unload(), to unload() the manually loaded service.

Field Detail
myLoggingService
protected LoggingService myLoggingService(Code)





Method Detail
execute
protected void execute()(Code)
Loop through new MMQueryRequests, posting a new asynchronous YP query for each. Also runs when the YP query callbacks signal that the plugin should run. So loop through the pending requests, posting alarms to retry those with errors later, and sending back the answer to the SDClient for those that have a list of providers.

Note that you must specify the service scheme in which Roles will be found in the YP, through the helper getServiceSchemeForRoles() method.




findServiceWithDistributedYP
protected void findServiceWithDistributedYP(RQ r)(Code)
This is the workhourse: ask the YP to find a service that matches the given request, and to tell us when it is done with a callback we supply. It asks the YP to walk up the hierarchy of YP communities to find ever broader YP servers if that is necessary.



getServiceSchemeForRoles
protected String getServiceSchemeForRoles()(Code)
Return the UDDI Service Scheme that contains the Roles we will look for. This is typically the COMMERCIAL_SERVICE_SCHEME or MILITARY_SERVICE_SCHEME.

This method may be the only one an extender of this plugin needs to over-ride. UDDI Service Scheme to find Roles in




getWarningCutoffTime
protected long getWarningCutoffTime()(Code)
Get the real time after which DEBUG level problems become ERROR: This is the parametrized warning cut-off interval (in minutes, default of 2), plus the time of the first error. time in millis



handleException
protected void handleException(RQ r)(Code)
Handle an exception from a YP query callback by logging something, waiting a while, and trying again.
Parameters:
  r - YP query that had error.



handleResponse
protected void handleResponse(RQ r)(Code)
Process a real response from the YP for a lookup. Score it using the scoring function on the original query. If it scores well, then put this service provider on the response back to the SDClient. If we don't have a good provider to send the SDClient, then check to see if the YP said there was another higher (parent) YP server to check. If there is, then post the query to that server. Otherwise, we've failed.



load
public void load()(Code)
Over-ride parent load to get non-essential services (the log service here).



setRegistryQueryService
public void setRegistryQueryService(RegistryQueryService rqs)(Code)
Reflection sets the RegistryQueryService at startup - plugin will not load if not found.



setupSubscriptions
protected void setupSubscriptions()(Code)
Subscribe to MMQueryRequests from the SDClientPlugin.



unload
public void unload()(Code)
Every load() should have an unload(), to unload() the manually loaded service.



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.