kaos.core.service
Interface KAoSServiceRoot

All Known Implementing Classes:
CorbaKAoSServiceRootImpl, CougaarServiceRoot, GridKAoSServiceRootImpl, KAoSServiceRootImpl, TCPKAoSServiceRootImpl

public interface KAoSServiceRoot

KAoSServiceRoot extends the functionality of the JAS ServiceRoot. KAoSServiceRoot defines an accessor method in order to obtain a preferred MessageTransportService to be used by the TransportSystem. It also defines a method to create a concrete Locator from the provided Locator interface and set the Locator instance in the KaoSEntityDescription.


Field Summary
static java.lang.String DIRECTORY_SERVICE_ROOT
           
static java.lang.String ENTITY_ROOT
           
 
Method Summary
 MessageTransportService getPreferredMessageTransportService()
          Obtain the preferred MessageTransportService.
 java.lang.String getRootType()
           
 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)
           
 

Field Detail

DIRECTORY_SERVICE_ROOT

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

ENTITY_ROOT

static final java.lang.String ENTITY_ROOT
See Also:
Constant Field Values
Method Detail

getPreferredMessageTransportService

MessageTransportService getPreferredMessageTransportService()
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.

Returns:
MessageTransportService, which is the preferred one for the platform this ServiceRoot supports.

setLocatorForDescription

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. 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);

Parameters:
KAoSEntityDescription - the description that needs a concrete Locator to be set in.
Locator - to use to instantiate its concrete class.
Returns:
KAoSEntityDescription containing created instance of the concrete transport Locator.

setRootType

void setRootType(java.lang.String type)

getRootType

java.lang.String getRootType()