Package jadex.platform.service.awareness
Class LocalHostAwarenessAgent
- java.lang.Object
- 
- jadex.platform.service.awareness.LocalHostAwarenessAgent
 
- 
- All Implemented Interfaces:
- IAwarenessService
 
 public class LocalHostAwarenessAgent extends java.lang.Object implements IAwarenessService Uses the filesystem to find other platforms on the same host.
- 
- 
Field SummaryFields Modifier and Type Field Description protected IInternalAccessagentThe agent access.protected static java.io.FileDISCOVERY_DIRThe discovery directory.protected booleandoscanDo scan flag.protected java.io.FilelastpostedfileThe last awareness file that has been posted.protected java.util.Map<IComponentIdentifier,java.util.List<TransportAddress>>platformsThe internal catalog.protected ITransportAddressServicetasprotected java.nio.file.WatchServicewatchserviceThe directory watch service.
 - 
Constructor SummaryConstructors Constructor Description LocalHostAwarenessAgent()Creates the agent empty.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description IFuture<java.lang.Void>end(java.lang.Exception e)Implements the start.IFuture<java.util.List<TransportAddress>>getPlatformAddresses(IComponentIdentifier platformid)Gets the address for a platform ID using the awareness mechanism.protected voidpostInfo()Post awareness info via file system.protected voidscan()Scans for new local awareness infos.IIntermediateFuture<IComponentIdentifier>searchPlatforms()Try to find other platforms and finish after timeout.voidstart()Implements the start.
 
- 
- 
- 
Field Detail- 
DISCOVERY_DIRprotected static final java.io.File DISCOVERY_DIR The discovery directory.
 - 
agentprotected IInternalAccess agent The agent access.
 - 
tasprotected ITransportAddressService tas 
 - 
platformsprotected java.util.Map<IComponentIdentifier,java.util.List<TransportAddress>> platforms The internal catalog.
 - 
lastpostedfileprotected java.io.File lastpostedfile The last awareness file that has been posted.
 - 
watchserviceprotected java.nio.file.WatchService watchservice The directory watch service.
 - 
doscanprotected boolean doscan Do scan flag.
 
- 
 - 
Method Detail- 
startpublic void start() Implements the start.
 - 
endpublic IFuture<java.lang.Void> end(java.lang.Exception e) Implements the start.
 - 
postInfoprotected void postInfo() Post awareness info via file system.
 - 
searchPlatformspublic 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:
- searchPlatformsin interface- IAwarenessService
 
 - 
getPlatformAddressespublic IFuture<java.util.List<TransportAddress>> getPlatformAddresses(IComponentIdentifier platformid) Gets the address for a platform ID using the awareness mechanism.- Specified by:
- getPlatformAddressesin interface- IAwarenessService
- Parameters:
- platformid- The platform ID.
- Returns:
- The transport addresses or null if not available.
 
 - 
scanprotected void scan() Scans for new local awareness infos.
 
- 
 
-