| org.cougaar.core.plugin.ComponentPlugin org.cougaar.servicediscovery.plugin.SimpleSDRegistrationPlugin
All known Subclasses: org.cougaar.pizza.plugin.SDRegistrationPlugin,
SimpleSDRegistrationPlugin | public class SimpleSDRegistrationPlugin extends ComponentPlugin (Code) | | Simplified version of SDRegistrationPlugin that registers this agent
using the -profile.owl file if any in the plugin parameter-named YP agent.
This version of the plugin is somewhat simplified -- fewer error checks for example. It
does not create
org.cougaar.servicediscovery.description.ProviderCapabilities objects (used by more complex SDProviderPlugins).
First plugin argument is the name of the agent hosting the YP that we will register with.
The
SDRegistrationPluginBase and extensions are more complex; they handle more errors,
dynamic changes to the services provided, deal with society quiescence issues, create
ProviderCapabilities, etc.
Complex applications will likely want to use those plugins, but most users will prefer
to extend this plugin. Extensions should over-rider the getServiceProfileURL() method,
to specify where their application's service profiles are located. For an example,
see the pizza application.
See Also: org.cougaar.pizza.plugin.SDRegistrationPlugin |
OWL_IDENTIFIER | final protected static String OWL_IDENTIFIER(Code) | | |
execute | protected void execute()(Code) | | If this agent has a -profile.owl file, then ask for a handle on the named (in the only plugin parameter)
YP agent's YP community. Once we have the community (may be
a subsequent execute when our CommunityListener tells us
we found the YP community), we call initialRegister
to register this agent in the YP.
|
findYPCommunity | protected void findYPCommunity()(Code) | | Issue an asynchronous query to the CommunityService, looking for the
YP Community named by
SimpleSDRegistrationPlugin.getYPCommunityName(String) , with a registered
org.cougaar.servicediscovery.plugin.SimpleSDRegistrationPlugin.YPCommunityResponseListener to learn about changes.
|
getServiceProfileURL | protected URL getServiceProfileURL()(Code) | | Get the URL for the service profiles directory for this application.
This is the only method application specific versions of this plugin
will likely over-ride.
|
getYPCommunityName | protected String getYPCommunityName(String ypAgentName)(Code) | | Construct the name of the YP Community hosted at the given named agent.
This version produces <AgentName>-YPCOMMUNITY.
Extenders could use a different convention for naming YP Communities.
Parameters: ypAgentName - String name of the agent hosting a YP Server String name of the YP Community to look for. |
initYPInfo | protected void initYPInfo()(Code) | | Create the YPInfo object for this instance.
Takes the first plugin parameter as the name of the agent hosting the YP that
we will register with.
Extenders might want a different mechanism for specifying the YP server
to register with.
|
initialRegister | protected void initialRegister()(Code) | | Do the actual registration of this provider in the YP. Get the
ProviderDescription, and then invoke the UDDI4JRegistrationService, with
a Callback to notify us when the registration completes (or fails).
Extenders might choose to over-ride this in an attempt to avoid
using ProviderDescriptions at all.
|
isProvider | protected boolean isProvider()(Code) | | This agent is a provider if there is a provider file for it.
|
setupSubscriptions | protected void setupSubscriptions()(Code) | | This plugin has no subscriptions. It will execute exactly once, since the
infrastructure calls the execute() method once at plugin startup.
|
suspend | public void suspend()(Code) | | When the agent moves, we don't want dangling callbacks - so clear them. On resume, we'll just re-register
from scratch, since we can't otherwise recover where we'd gotten to.
|
|
|