kaos.cougaar.clik.util
Class CougaarServiceRoot

java.lang.Object
  extended by kaos.cougaar.clik.util.CougaarServiceRoot
All Implemented Interfaces:
KAoSServiceRoot

public class CougaarServiceRoot
extends java.lang.Object
implements KAoSServiceRoot


Field Summary
 BlackboardService _blackboardService
           
 java.lang.String _rootType
           
 ServiceBroker _sb
           
 TransactionLock _transactionLock
           
static java.lang.String DOMAIN_MANAGER_LOCATOR
           
static java.lang.String DOMAIN_MANAGER_NICKNAME
           
 
Fields inherited from interface kaos.core.service.KAoSServiceRoot
DIRECTORY_SERVICE_ROOT, ENTITY_ROOT
 
Constructor Summary
CougaarServiceRoot(ServiceBroker sb, BlackboardService blackboardService, TransactionLock transactionLock, JasBean entityInfo)
           
 
Method Summary
 AgentDirectoryService getAgentDirectoryService()
          Allows getter access to the well known directory service.
 AgentNamingService getAgentNamingService()
          Allows getter access to the well known naming service.
 MessageTransportService getPreferredMessageTransportService()
          Obtain the preferred MessageTransportService.
 java.lang.String getRootType()
           
 Service getService(java.lang.String type)
          Allows access to the specified service type.
 TransportSystem getTransportSystem()
          Allows getter access to the well known transport system.
 KAoSEntityDescription setLocatorForDescription(KAoSEntityDescription desc, Locator locator)
          This method is defined to avoid the java.io.NotSerializableException while serializing the KAoSEntityDescription in the kaos.core.util.Msg.
 void setRootType(java.lang.String type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DOMAIN_MANAGER_LOCATOR

public static final java.lang.String DOMAIN_MANAGER_LOCATOR
See Also:
Constant Field Values

DOMAIN_MANAGER_NICKNAME

public static final java.lang.String DOMAIN_MANAGER_NICKNAME
See Also:
Constant Field Values

_rootType

public java.lang.String _rootType

_blackboardService

public BlackboardService _blackboardService

_transactionLock

public TransactionLock _transactionLock

_sb

public ServiceBroker _sb
Constructor Detail

CougaarServiceRoot

public CougaarServiceRoot(ServiceBroker sb,
                          BlackboardService blackboardService,
                          TransactionLock transactionLock,
                          JasBean entityInfo)
Parameters:
entityInfo - optional (null is OK) JasBean containing the following information needed for obtaining the AgentDirectoryService DOMAIN_MANAGER_LOCATOR locator for the domain manager (required) DOMAIN_MANAGER_NICKNAME nickname for the domain manager (optional) whatever else is needed for CougaarMTS.newLocalLocator(entityInfo)
Method Detail

getAgentDirectoryService

public AgentDirectoryService getAgentDirectoryService()
Allows getter access to the well known directory service.

Returns:
the well known directory service for this environment.
See Also:
AgentDirectoryService

getPreferredMessageTransportService

public MessageTransportService getPreferredMessageTransportService()
Description copied from interface: KAoSServiceRoot
Obtain the preferred MessageTransportService. There could be several MessageTransportServices loaded into the TransportSystem, however, the TransportSystem uses only one to send/receive messages, so to avoid exceptions, it is useful to specify the one that the TransportSystem uses.

Specified by:
getPreferredMessageTransportService in interface KAoSServiceRoot
Returns:
MessageTransportService, which is the preferred one for the platform this ServiceRoot supports.

setLocatorForDescription

public KAoSEntityDescription setLocatorForDescription(KAoSEntityDescription desc,
                                                      Locator locator)
Description copied from interface: KAoSServiceRoot
This method is defined to avoid the java.io.NotSerializableException while serializing the KAoSEntityDescription in the kaos.core.util.Msg. It will have to be looked into why the NotSerializableException is thrown, but now the Locator set in the KAoSEntityDescription must be a concrete class (not interface 'Locator'), otherwise the KAoSEntityDescription cannot be sierialized. If the default implementation in the KAoSServiceRootImpl works, then nothing has to be done. If not, then do the following using your app's transport locator (the example is taken from the CoABS Grid transport): 1. Cast the argument locator to the transport-specific locator class: KAoSGridLocator glctr = (KAoSGridLocator) locator; 2. Create a new instance of the transport-specific locator: KAoSGridLocator gridLocator = new KAoSGridLocator(); 3. Copy all vars (whatever your locator needs) from the received argument into the new Locator. gridLocator.setId(glctr.getId()); gridLocator.setName(glctr.getName()); gridLocator.setTransportType(glctr.getTransportType()); gridLocator.setAddress( glctr.getAddress()); 4. Set the locator in the KAoSEntitydescription. desc.addLocator(gridLocator);

Specified by:
setLocatorForDescription in interface KAoSServiceRoot
Returns:
KAoSEntityDescription containing created instance of the concrete transport Locator.

getAgentNamingService

public AgentNamingService getAgentNamingService()
Allows getter access to the well known naming service.

Returns:
the well known naming service for this environment.
See Also:
AgentNamingService

getTransportSystem

public TransportSystem getTransportSystem()
Allows getter access to the well known transport system.

Returns:
the well known transport system for this environment.
See Also:
TransportSystem

getService

public Service getService(java.lang.String type)
Allows access to the specified service type. This method may return null if no Service is associated with the specified description.

Parameters:
type - specifies a Service.
Returns:
a Service defined by the argument.

getRootType

public java.lang.String getRootType()
Specified by:
getRootType in interface KAoSServiceRoot

setRootType

public void setRootType(java.lang.String type)
Specified by:
setRootType in interface KAoSServiceRoot