public class AwarenessManagementAgent
extends java.lang.Object
implements jadex.commons.IPropertiesProvider, jadex.bridge.service.types.awareness.IAwarenessManagementService
Modifier and Type | Field and Description |
---|---|
protected jadex.bridge.service.types.address.TransportAddressBook |
addresses
The addresses.
|
protected jadex.bridge.IInternalAccess |
agent
The agent.
|
protected boolean |
autocreate
Flag indicating if proxies should be automatically created.
|
protected boolean |
autodelete
Flag indicating if proxies should be automatically deleted.
|
protected jadex.bridge.service.types.cms.IComponentManagementService |
cms
The cms, cached for speed.
|
protected long |
delay
The send delay.
|
protected java.util.Map<jadex.bridge.IComponentIdentifier,jadex.bridge.service.types.awareness.DiscoveryInfo> |
discovered
The discovered components.
|
protected java.util.List<java.lang.String> |
excludes
The excludes list.
|
protected boolean |
fast
Flag for enabling fast startup awareness (pingpong send behavior).
|
protected java.util.List<java.lang.String> |
includes
The includes list.
|
protected java.util.Set<jadex.commons.future.SubscriptionIntermediateDelegationFuture<jadex.bridge.service.types.awareness.DiscoveryInfo>> |
listeners
The discovery listeners.
|
protected jadex.bridge.ITransportComponentIdentifier |
root
The root component id.
|
protected java.util.Timer |
timer
The timer.
|
Constructor and Description |
---|
AwarenessManagementAgent() |
Modifier and Type | Method and Description |
---|---|
jadex.commons.future.IFuture<java.lang.Boolean> |
addAwarenessInfo(jadex.bridge.service.types.awareness.AwarenessInfo info)
Announce the discovered components.
|
jadex.commons.future.IFuture<java.lang.Void> |
agentCreated()
Called once after agent creation.
|
jadex.commons.future.IFuture<java.lang.Void> |
agentKilled()
Called just before the agent is removed from the platform.
|
void |
checkProxy(jadex.bridge.service.types.awareness.DiscoveryInfo dif)
Check if local proxy is still available.
|
jadex.commons.future.IFuture<jadex.bridge.IComponentIdentifier> |
createProxy(jadex.bridge.service.types.awareness.DiscoveryInfo dif)
Create a proxy using given settings.
|
jadex.commons.future.IFuture<java.lang.Void> |
deleteProxy(jadex.bridge.service.types.awareness.DiscoveryInfo dif)
Delete a proxy.
|
protected void |
doWaitFor(long delay,
jadex.bridge.IComponentStep<?> step)
Wait for impl.
|
jadex.commons.future.IFuture<java.lang.Void> |
executeBody()
Execute the functional body of the agent.
|
protected static java.lang.String[] |
extractNames(jadex.bridge.ITransportComponentIdentifier cid)
Extract names for matching to includes/excludes list.
|
protected long |
getClockTime()
Get the current time.
|
long |
getDelay()
Get the delay.
|
jadex.bridge.service.types.awareness.DiscoveryInfo |
getDiscoveryInfo(jadex.bridge.IComponentIdentifier cid)
Get a discovery info.
|
jadex.bridge.service.types.awareness.DiscoveryInfo[] |
getDiscoveryInfos()
Get the discovered.
|
java.lang.String[] |
getExcludes()
Get the excludes.
|
java.lang.String[] |
getIncludes()
Get the includes.
|
jadex.commons.future.IFuture<java.util.Collection<jadex.bridge.service.types.awareness.DiscoveryInfo>> |
getKnownPlatforms()
Get the currently known platforms.
|
jadex.commons.future.IFuture<jadex.bridge.service.types.awareness.DiscoveryInfo> |
getPlatformInfo(jadex.bridge.IComponentIdentifier cid)
Get the discovery info for a platform, if any.
|
jadex.commons.future.IFuture<jadex.commons.Properties> |
getProperties()
Write current state into properties.
|
protected void |
informListeners(jadex.bridge.service.types.awareness.DiscoveryInfo dif)
Inform listeners about a changed discovery info.
|
protected void |
initArguments()
Read arguments and set initial values.
|
boolean |
isAutoCreateProxy()
Get the autocreate.
|
boolean |
isAutoDeleteProxy()
Get the autodelete.
|
boolean |
isFastAwareness()
Get the fast startup awareness flag.
|
static boolean |
isIncluded(jadex.bridge.ITransportComponentIdentifier cid,
java.lang.String[] includes,
java.lang.String[] excludes)
Test if a platform is included and/or not excluded.
|
void |
setAutoCreateProxy(boolean autocreate)
Set the autocreate.
|
void |
setAutoDeleteProxy(boolean autodelete)
Set the autodelete.
|
void |
setDelay(long delay)
Set the delay.
|
void |
setExcludes(java.lang.String[] excludes)
Set the excludes.
|
void |
setFastAwareness(boolean fast)
Set the fast startup awareness flag
|
void |
setIncludes(java.lang.String[] includes)
Set the includes.
|
jadex.commons.future.IFuture<java.lang.Void> |
setProperties(jadex.commons.Properties props)
Update from given properties.
|
protected void |
startRemoveBehaviour()
Start removing discovered proxies.
|
jadex.commons.future.ISubscriptionIntermediateFuture<jadex.bridge.service.types.awareness.DiscoveryInfo> |
subscribeToPlatformList(boolean include_initial)
Retrieve information about platforms as they appear or vanish.
|
protected jadex.bridge.IInternalAccess agent
protected long delay
protected boolean fast
protected boolean autocreate
protected boolean autodelete
protected java.util.Map<jadex.bridge.IComponentIdentifier,jadex.bridge.service.types.awareness.DiscoveryInfo> discovered
protected java.util.Set<jadex.commons.future.SubscriptionIntermediateDelegationFuture<jadex.bridge.service.types.awareness.DiscoveryInfo>> listeners
protected java.util.Timer timer
protected jadex.bridge.ITransportComponentIdentifier root
protected java.util.List<java.lang.String> includes
protected java.util.List<java.lang.String> excludes
protected jadex.bridge.service.types.cms.IComponentManagementService cms
protected jadex.bridge.service.types.address.TransportAddressBook addresses
public jadex.commons.future.IFuture<java.lang.Void> agentCreated()
protected void initArguments()
public jadex.commons.future.IFuture<java.lang.Void> executeBody()
public jadex.commons.future.IFuture<java.lang.Void> agentKilled()
public jadex.commons.future.IFuture<java.lang.Boolean> addAwarenessInfo(jadex.bridge.service.types.awareness.AwarenessInfo info)
addAwarenessInfo
in interface jadex.bridge.service.types.awareness.IAwarenessManagementService
infos
- The infos.public jadex.commons.future.IFuture<jadex.bridge.service.types.awareness.DiscoveryInfo> getPlatformInfo(jadex.bridge.IComponentIdentifier cid)
getPlatformInfo
in interface jadex.bridge.service.types.awareness.IAwarenessManagementService
cid
- The platform id.public jadex.commons.future.IFuture<java.util.Collection<jadex.bridge.service.types.awareness.DiscoveryInfo>> getKnownPlatforms()
getKnownPlatforms
in interface jadex.bridge.service.types.awareness.IAwarenessManagementService
public jadex.commons.future.ISubscriptionIntermediateFuture<jadex.bridge.service.types.awareness.DiscoveryInfo> subscribeToPlatformList(boolean include_initial)
subscribeToPlatformList
in interface jadex.bridge.service.types.awareness.IAwarenessManagementService
include_initial
- If true, information about initially known platforms will be immediately posted to the caller.
Otherwise only changes that happen after the subscription will be posted.protected void informListeners(jadex.bridge.service.types.awareness.DiscoveryInfo dif)
public long getDelay()
public void setDelay(long delay)
delay
- The delay to set.public void setFastAwareness(boolean fast)
fast
- The fast awareness flag.public boolean isFastAwareness()
public boolean isAutoCreateProxy()
public void setAutoCreateProxy(boolean autocreate)
autocreate
- The autocreate to set.public boolean isAutoDeleteProxy()
public void setAutoDeleteProxy(boolean autodelete)
autodelete
- The autodelete to set.public java.lang.String[] getIncludes()
public void setIncludes(java.lang.String[] includes)
includes
- The includes to set.public void setExcludes(java.lang.String[] excludes)
excludes
- The excludes to set.public java.lang.String[] getExcludes()
public jadex.bridge.service.types.awareness.DiscoveryInfo[] getDiscoveryInfos()
protected void startRemoveBehaviour()
public void checkProxy(jadex.bridge.service.types.awareness.DiscoveryInfo dif)
dif
- The discovery info.public jadex.bridge.service.types.awareness.DiscoveryInfo getDiscoveryInfo(jadex.bridge.IComponentIdentifier cid)
cid
- The component id;public jadex.commons.future.IFuture<jadex.bridge.IComponentIdentifier> createProxy(jadex.bridge.service.types.awareness.DiscoveryInfo dif)
dif
- The discovery infopublic jadex.commons.future.IFuture<java.lang.Void> deleteProxy(jadex.bridge.service.types.awareness.DiscoveryInfo dif)
dif
- The discovery info.public static boolean isIncluded(jadex.bridge.ITransportComponentIdentifier cid, java.lang.String[] includes, java.lang.String[] excludes)
cid
- The platform id.includes
- The list of includes.excludes
- The list of excludes.protected static java.lang.String[] extractNames(jadex.bridge.ITransportComponentIdentifier cid)
protected long getClockTime()
protected void doWaitFor(long delay, jadex.bridge.IComponentStep<?> step)
public jadex.commons.future.IFuture<java.lang.Void> setProperties(jadex.commons.Properties props)
setProperties
in interface jadex.commons.IPropertiesProvider
public jadex.commons.future.IFuture<jadex.commons.Properties> getProperties()
getProperties
in interface jadex.commons.IPropertiesProvider