|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSOMA.agent.AgentSystem
Classe di interfaccia fra agenti e sistema.
Si tratta dell'unico riferimento fornito ad un agente al momento
dell'attivazione in un place. Quindi, per interagire con il mondo esterno
l'agente dovra' necessariamente utilizzare riferimenti e metodi
dell'AgentSystem
che gli e' stato associato.
L'AgentSystem, se necessario, effettuerà i dovuti controlli di sicurezza prima di consentire ad un agente l'accesso ad una determinata risorsa.
E' possibile costruire sottoclassi di AgentSystem
in modo
da fornire interfacce di tipo diverso ad agenti diversi per motivi di
flessibilità, efficienza o compatibilità.
Agent
,
AgentWorker
Field Summary | |
IndexHashtable |
sharedObjects
Contenitore per oggetti condivisi fra agenti. |
Constructor Summary | |
AgentSystem(Environment env)
Costruttore. |
Method Summary | |
void |
addCacheManager(ICacheManager cacheManager)
This method is used for runtime deploy of the cache manager. |
boolean |
addComponent(MyComponent component)
This method let the agent to add a component of the local component repository. |
void |
addMultimediaClient(AgentID agent,
IClientSessionManager csm)
This method add a new client to a place |
void |
addMultimediaServer(java.lang.String classPath,
java.lang.String interfaceName,
java.lang.Object[] param)
This method istantiate a multimedia service (which has to be present on the place) to the multimedia services directory. |
int |
agentsNumber()
Restituisce il numero di worker e quindi di agenti del place. |
ICacheManager |
getCacheManager()
Returns the cache manager reference if it has already been installed, null otherwise |
MyComponent |
getComponent(java.lang.String packageName,
java.lang.String interfaceName)
Get a component for the requested packageName and class, or null in case of error |
java.lang.Object |
getComponentInstance(java.lang.String packageName,
java.lang.String interfaceName,
java.lang.Object[] arguments)
This method let agent get an instance of the required class of the required packageName. |
ICPUStatusNotifier |
getCPUStatusNotifier()
This method returns a reference to the CPU status notifier |
PlaceID[] |
getDomains()
Restituisce l'elenco degli identificatori dei domini, o un array vuoto se non e' presente un Domain Name Service, perche' non siamo in un default place. |
IDownloadManager |
getDownloadManager(ISwDownloadedListener listener)
Gets the download manager, this call is suspensive until the agent is ready |
Environment |
getEnvironment()
|
java.io.PrintStream |
getErr()
|
java.io.InputStream |
getIn()
|
IInitManager |
getInitManager(IInitListener listener,
IProfile profile,
AgentID clientAgent)
Gets the init manager |
IPresentationMetadataRepository |
getMetadataAgent()
This method returns an agent which can interact with the meta data container |
IClientSessionManager |
getMultimediaClient(AgentID agent)
This method requires a client reference |
ComponentInfo |
getMultimediaComponentInfo(java.lang.String classPath,
java.lang.String interfaceName)
This method gets the ComponentInfo (host:port) of the multimedia service passed as argument |
java.io.PrintStream |
getOut()
|
Path |
getPathToTheRoot()
This method returns the path to the root, assuming that the system doesn't change its topology at the runtime. |
PlaceID |
getPlaceID()
|
PlaceID[] |
getPlaces()
Restituisce l'elenco degli identificatori dei place di questo dominio. |
IProfileContainerManager |
getProfileManager()
This method returns an agent which can interact with the profile container |
Threshold |
getResourceConsumptionThresholds()
Metodo usato da un agente per conoscere i valori delle soglie di consumo del place |
AgentInfo[] |
getResourceDiffConsumption(Agent ag)
Metodo usato da un agente per conoscere i consumi differenziali, cioè relativi ad un intervallo di t secondi, di ciascuno dei suoi thread |
AgentInfo[] |
getResourceTotalConsumption(Agent ag)
Metodo usato da un agente per conoscere i consumi complessivi dei suoi thread dal momento del lancio |
IMetaDataToResourceTranslator |
getResourceTranslator()
This method returns a reference to the resource translator |
protected void |
go(Agent agent,
PlaceID destination)
Metodo di migrazione. |
protected void |
idle(Agent agent)
|
boolean |
insertComponentDescriptor(ComponentDescriptor componentDescriptor)
This method introduce a new entry in the DB |
MUM.repository.proxy.cache.IMetaDataCache |
isInCache(IMetadata metadata)
Requires if the metadata is present into the local cache. |
MUM.repository.proxy.cache.IMetaDataCache |
isInCacheNoHit(IMetadata metadata)
Requires if the metadata is present into the local cache. |
boolean |
isInitiated()
Verifies if the local cache is present and initiated... |
boolean |
isMultimediaService(java.lang.String classPath,
java.lang.String interfaceName)
This method checks if the multiemdia service passed as argument is present in the multimedia service directory. |
boolean |
isONMultimediaService(java.lang.String classPath,
java.lang.String interfaceName)
This method checks if the multiemdia service passed as argument is ON. |
boolean |
isPresentComponentDescriptor(java.lang.String packageName,
java.lang.String interfaceName)
This method let the agent ask the database. |
boolean |
resetInUseFromCache(IMetadata requiredMetadata)
This method returns true, if it finds that the required metadata is streamed from the cache, false otherwise. |
void |
sendMessage(Message message)
Spedizione di un messaggio Non e' possibile statilire se il messaggio sara' correttamente recapitato. |
boolean |
setInUseFromCache(IMetadata requiredMetadata)
This method returns true, if it finds that the required metadata will be streamed from the cache, false otherwise. |
void |
startMultimediaServer(java.lang.String classPath,
java.lang.String interfaceName,
java.lang.Object[] param)
This method starts the multimedia service. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public IndexHashtable sharedObjects
Ad ogni oggetto e' associato un indice di tipo int.
Constructor Detail |
public AgentSystem(Environment env)
Method Detail |
protected void go(Agent agent, PlaceID destination) throws CantGoException
Effettua i controlli di sicurezza, quindi
invoca il metodo AgentWorker.go( PlaceID destination )
.
CantGoException
protected void idle(Agent agent)
public Threshold getResourceConsumptionThresholds()
public AgentInfo[] getResourceTotalConsumption(Agent ag)
public AgentInfo[] getResourceDiffConsumption(Agent ag)
public boolean addComponent(MyComponent component)
public boolean isPresentComponentDescriptor(java.lang.String packageName, java.lang.String interfaceName)
packageName
- this is the uniquer identifier for a class of similar components.
It will be defined by implemetation of this interfacepublic MyComponent getComponent(java.lang.String packageName, java.lang.String interfaceName)
public IDownloadManager getDownloadManager(ISwDownloadedListener listener)
public IInitManager getInitManager(IInitListener listener, IProfile profile, AgentID clientAgent)
public java.lang.Object getComponentInstance(java.lang.String packageName, java.lang.String interfaceName, java.lang.Object[] arguments)
getComponentInstance
in interface IMUMBaseFacilities
packageName
- this is the uniquer identifier for a packageinterfaceName
- this is the name of the ADT we are interested in.
public boolean insertComponentDescriptor(ComponentDescriptor componentDescriptor)
public IPresentationMetadataRepository getMetadataAgent()
public IProfileContainerManager getProfileManager()
public Path getPathToTheRoot()
getPathToTheRoot
in interface IMUMBaseFacilities
public void addMultimediaServer(java.lang.String classPath, java.lang.String interfaceName, java.lang.Object[] param) throws SoftwareToAddNotFoundException
SOMA.MUM.MultimediaServicesService.SoftwareToAddNotFoundException
SoftwareToAddNotFoundException
public void addMultimediaClient(AgentID agent, IClientSessionManager csm)
public IClientSessionManager getMultimediaClient(AgentID agent)
public boolean isInitiated()
isInitiated
in interface IMUMFacilitiesLocalCacheEnabled
public void addCacheManager(ICacheManager cacheManager)
cacheManager
- the reference to the cache manager that will be usedpublic ICacheManager getCacheManager()
public MUM.repository.proxy.cache.IMetaDataCache isInCache(IMetadata metadata)
isInCache
in interface IMUMFacilitiesLocalCacheEnabled
metadata
- the required metadata
public MUM.repository.proxy.cache.IMetaDataCache isInCacheNoHit(IMetadata metadata)
isInCacheNoHit
in interface IMUMFacilitiesLocalCacheEnabled
metadata
- the required metadata
public boolean setInUseFromCache(IMetadata requiredMetadata)
setInUseFromCache
in interface IMUMFacilitiesLocalCacheEnabled
public boolean resetInUseFromCache(IMetadata requiredMetadata)
resetInUseFromCache
in interface IMUMFacilitiesLocalCacheEnabled
public ComponentInfo getMultimediaComponentInfo(java.lang.String classPath, java.lang.String interfaceName) throws MultimediaServiceNotInstantiatedException
MultimediaServiceNotInstantiatedException
public boolean isMultimediaService(java.lang.String classPath, java.lang.String interfaceName)
public boolean isONMultimediaService(java.lang.String classPath, java.lang.String interfaceName)
public void startMultimediaServer(java.lang.String classPath, java.lang.String interfaceName, java.lang.Object[] param) throws MultimediaServiceNotInstantiatedException
MultimediaServiceNotInstantiatedException
public IMetaDataToResourceTranslator getResourceTranslator()
public ICPUStatusNotifier getCPUStatusNotifier()
public PlaceID getPlaceID()
public java.io.InputStream getIn()
public java.io.PrintStream getOut()
public java.io.PrintStream getErr()
public Environment getEnvironment()
public PlaceID[] getPlaces()
public PlaceID[] getDomains()
public void sendMessage(Message message)
Non e' possibile statilire se il messaggio sara' correttamente recapitato.
Questo metodo richiama {@AgentWorker.sendMessage( Message )
public int agentsNumber()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |