Package jadex.platform.service.awareness
Class IntraVMAwarenessAgent
- java.lang.Object
-
- jadex.platform.service.awareness.IntraVMAwarenessAgent
-
- All Implemented Interfaces:
IAwarenessService
public class IntraVMAwarenessAgent extends java.lang.Object implements IAwarenessService
Implements passive awareness via shared memory.
-
-
Field Summary
Fields Modifier and Type Field Description protected IInternalAccess
agent
The agent.protected static java.util.concurrent.locks.ReadWriteLock
disclock
Read-write lock for discoveries map.protected static java.util.Map<IComponentIdentifier,IntraVMAwarenessAgent>
discoveries
The started discovery agents.
-
Constructor Summary
Constructors Constructor Description IntraVMAwarenessAgent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IFuture<java.util.List<TransportAddress>>
getPlatformAddresses(IComponentIdentifier platformid)
Gets the address for a platform ID using the awareness mechanism.IIntermediateFuture<IComponentIdentifier>
searchPlatforms()
Try to find other platforms and finish after timeout.void
shutdown()
At shutdown remove platform from list.void
start()
At startup add platform to list.
-
-
-
Field Detail
-
disclock
protected static final java.util.concurrent.locks.ReadWriteLock disclock
Read-write lock for discoveries map.
-
discoveries
protected static final java.util.Map<IComponentIdentifier,IntraVMAwarenessAgent> discoveries
The started discovery agents.
-
agent
protected IInternalAccess agent
The agent.
-
-
Method Detail
-
start
public void start() throws java.lang.Exception
At startup add platform to list.- Throws:
java.lang.Exception
-
shutdown
public void shutdown() throws java.lang.Exception
At shutdown remove platform from list.- Throws:
java.lang.Exception
-
getPlatformAddresses
public IFuture<java.util.List<TransportAddress>> getPlatformAddresses(IComponentIdentifier platformid)
Gets the address for a platform ID using the awareness mechanism.- Specified by:
getPlatformAddresses
in interfaceIAwarenessService
- Parameters:
platformid
- The platform ID.- Returns:
- The transport addresses or null if not available.
-
searchPlatforms
public IIntermediateFuture<IComponentIdentifier> searchPlatforms()
Try to find other platforms and finish after timeout. Immediately returns known platforms and concurrently issues a new search, waiting for replies until the timeout.- Specified by:
searchPlatforms
in interfaceIAwarenessService
-
-