| org.cougaar.core.plugin.ComponentPlugin org.cougaar.servicediscovery.plugin.AgreeableProviderPlugin
AgreeableProviderPlugin | public class AgreeableProviderPlugin extends ComponentPlugin (Code) | | ServiceDiscovery Plugin at Provider that agrees to new incoming requests as is.
It receives ServiceContractRelays, and creates new ServiceContracts that
exactly match the request, sending that as the response back on the relay.
The SD Relay will see the Contract, and fill in the necessary Relationship
on the Entities, so that the relationship can be used, and Tasks allocated.
Extenders of this plugin might not agree to all requests, but for example might
check a local capacity, or put time constraints on the contracts. More complex
providers support contracts being revoked, for example.
This plugin is limited by: not looking at ProviderCapabilities or handling
changes to them, and not handling changes to service contract requests.
|
Method Summary | |
public void | execute() For each new ServiceContractRelay, reply with a Contract exactly matching what they requested. | public DomainService | getDomainService() Get a pointer to the DomainService, for creating factories. | protected Asset | getLocalEntity() Get the local (self) Entity; the first Asset on the Entity subscription. | protected void | handleServiceContractRelay(ProviderServiceContractRelay relay) Create a ServiceContract that matches the request, add it to the Relay, and publishChange the Relay.
This is how the plugin responds to the customer. | public void | load() Load less critical services, and get pointers to factoreis. | public void | setDomainService(DomainService domainService) | protected void | setupSubscriptions() Create subscriptions to ServiceContractRelays and the self Asset. | public void | unload() Every load method should have an unload; Here we unload the LoggingService. |
execute | public void execute()(Code) | | For each new ServiceContractRelay, reply with a Contract exactly matching what they requested.
|
getDomainService | public DomainService getDomainService()(Code) | | Get a pointer to the DomainService, for creating factories.
|
getLocalEntity | protected Asset getLocalEntity()(Code) | | Get the local (self) Entity; the first Asset on the Entity subscription.
the local (self) Asset, if any on our subscription |
handleServiceContractRelay | protected void handleServiceContractRelay(ProviderServiceContractRelay relay)(Code) | | Create a ServiceContract that matches the request, add it to the Relay, and publishChange the Relay.
This is how the plugin responds to the customer. In this case, the response is always YES to whatever
they asked. Other users might, for example, check the capacity of this provider in some way. Or
confirm that the local self Entity has the requested Role.
Parameters: relay - the service request relay to which we will respond |
load | public void load()(Code) | | Load less critical services, and get pointers to factoreis.
|
setDomainService | public void setDomainService(DomainService domainService)(Code) | | Used by the binding utility through reflection to set my DomainService
|
setupSubscriptions | protected void setupSubscriptions()(Code) | | Create subscriptions to ServiceContractRelays and the self Asset.
|
unload | public void unload()(Code) | | Every load method should have an unload; Here we unload the LoggingService.
|
|
|