- java.lang.Object
-
- swim.runtime.AbstractSwimRef
-
- swim.runtime.AbstractTierBinding
-
- swim.runtime.agent.AgentView
-
- All Implemented Interfaces:
AgentContext,DownlinkFactory,LaneFactory,SwimRef,Store,CellContext,TierBinding,TierContext,Log
public class AgentView extends AbstractTierBinding implements TierContext, AgentContext
-
-
Field Summary
Fields Modifier and Type Field Description protected Agentagentprotected Valueidprotected AgentModelnodeprotected Valueprops-
Fields inherited from class swim.runtime.AbstractTierBinding
CLOSED_PHASE, CLOSED_STATE, CLOSING_STATE, FAILED_STATE, FAILING_STATE, LOADED_PHASE, LOADED_STATE, LOADING_STATE, OPENED_PHASE, OPENED_STATE, OPENING_STATE, PHASE_MASK, PHASE_SHIFT, RECOVERING_STATE, STARTED_PHASE, STARTED_STATE, STARTING_STATE, STATE_MASK, status, STATUS, STOPPING_STATE, UNLOADING_STATE
-
-
Constructor Summary
Constructors Constructor Description AgentView(AgentModel node, Value id, Value props)
-
Method Summary
Modifier and Type Method Description Agentagent()ValueagentId()FingerTrieSeq<Agent>agents()StageasyncStage()The multi-threaded executionStageon which thisAgentContextcan run asynchronous operations.LinkBindingbindDownlink(Downlink downlink)NodeAddresscellAddress()voidcloseAgent(String name)voidcloseAgent(Value id)voidcloseDownlink(LinkBinding link)<V> CommandLane<V>commandLane()<A extends Agent>
AgentFactory<A>createAgentFactory(Class<? extends A> agentClass)voiddebug(Object message)Logs a debug-level message.<V> DemandLane<V>demandLane()<K,V>
DemandMapLane<K,V>demandMapLane()voiddidClose()voiddidFail(Throwable error)voiddidLoad()voiddidOpen()voiddidStart()voiddidStop()voiddidUnload()StringedgeName()voiderror(Object message)Logs an error-level message.voidfail(Object message)Logs an fail-level message.SpatialData<Value,R2Shape,Value>geospatialData(String name)SpatialData<Value,R2Shape,Value>geospatialData(Value name)<K,V>
SpatialLane<K,R2Shape,V>geospatialLane()<A extends Agent>
AgetAgent(Class<? extends A> agentClass)AgentgetAgent(String name)AgentgetAgent(Value id)LanegetLane(Uri laneUri)Returns theLanebelonging to theAgentmanaged by thisAgentContextthat is addressable bylaneUri, ornullif no suchLaneexists.ValuegetProp(String name)Returns the value ofnameinAgentContext.props().ValuegetProp(Value key)Returns the value ofkeyinAgentContext.props().UrihostUri()ThehostUriof theAgentmanaged by thisAgentContext.<V> HttpLane<V>httpLane()voidinfo(Object message)Logs an info-level message.<L,K,V>
JoinMapLane<L,K,V>joinMapLane()<K,V>
JoinValueLane<K,V>joinValueLane()Lanelane()Returns the currently executing lane, or null if not currently executing a lane or link callback.Linklink()Returns the currently executing link, or null if not currently executing a link callback.ListData<Value>listData(String name)ListData<Value>listData(Value name)<V> ListLane<V>listLane()MapData<Value,Value>mapData(String name)MapData<Value,Value>mapData(Value name)<K,V>
MapLane<K,V>mapLane()UrimeshUri()UrinodeUri()ThenodeUriof theAgentmanaged by thisAgentContext.<A extends Agent>
AopenAgent(String name, Class<? extends A> agentClass)<A extends Agent>
AopenAgent(String name, AgentFactory<A> agentFactory)<A extends Agent>
AopenAgent(Value id, Class<? extends A> agentClass)<A extends Agent>
AopenAgent(Value id, AgentFactory<A> agentFactory)<A extends Agent>
AopenAgent(Value id, Value props, Class<? extends A> agentClass)<A extends Agent>
AopenAgent(Value id, Value props, AgentFactory<A> agentFactory)voidopenDownlink(LinkBinding link)LaneopenLane(Uri laneUri, Lane lane)RegisterslanewithlaneUriand returnslane.voidopenMetaDownlink(LinkBinding downlink, NodeBinding metaDownlink)Policypolicy()Valueprops()ARecordthat maps every dynamic property inAgentContext.nodeUri(), as defined byAgentRoute.pattern(), to its value.voidpushDown(Push<?> push)voidreportDown(Metric metric)Scheduleschedule()TheSchedulethat thisAgentContextis bound to.<S> SpatialData<Value,S,Value>spatialData(String name, Z2Form<S> shapeForm)<S> SpatialData<Value,S,Value>spatialData(Value name, Z2Form<S> shapeForm)<K,S,V>
SpatialLane<K,S,V>spatialLane(Z2Form<S> shapeForm)Stagestage()The single-threaded executionStageon which thisAgentContextruns its application logic.StoreBindingstore()<V> SupplyLane<V>supplyLane()TierContexttierContext()voidtrace(Object message)Logs a trace-level message.<T> TunwrapNode(Class<T> nodeClass)ValueData<Value>valueData(String name)ValueData<Value>valueData(Value name)<V> ValueLane<V>valueLane()voidwarn(Object message)Logs a warn-level message.voidwillClose()voidwillLoad()voidwillOpen()voidwillStart()voidwillStop()voidwillUnload()<I,O>
WsLane<I,O>wsLane()-
Methods inherited from class swim.runtime.AbstractTierBinding
activate, close, isClosed, isLoaded, isOpened, isStarted, load, open, start, stop, unload
-
Methods inherited from class swim.runtime.AbstractSwimRef
command, command, command, command, command, command, command, command, command, command, command, command, command, command, command, command, downlink, downlinkHttp, downlinkList, downlinkMap, downlinkValue, downlinkWs, hostRef, hostRef, laneRef, laneRef, laneRef, laneRef, nodeRef, nodeRef, nodeRef, nodeRef
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface swim.api.downlink.DownlinkFactory
downlink, downlinkHttp, downlinkList, downlinkMap, downlinkValue, downlinkWs
-
Methods inherited from interface swim.api.ref.SwimRef
close, command, command, command, command, command, command, command, command, command, command, command, command, command, command, command, command, hostRef, hostRef, laneRef, laneRef, laneRef, laneRef, nodeRef, nodeRef, nodeRef, nodeRef
-
Methods inherited from interface swim.runtime.TierContext
close
-
-
-
-
Field Detail
-
node
protected final AgentModel node
-
id
protected final Value id
-
props
protected final Value props
-
agent
protected Agent agent
-
-
Constructor Detail
-
AgentView
public AgentView(AgentModel node, Value id, Value props)
-
-
Method Detail
-
agent
public final Agent agent()
-
tierContext
public TierContext tierContext()
- Specified by:
tierContextin interfaceTierBinding- Specified by:
tierContextin classAbstractTierBinding
-
unwrapNode
public <T> T unwrapNode(Class<T> nodeClass)
-
cellAddress
public NodeAddress cellAddress()
- Specified by:
cellAddressin interfaceCellContext
-
edgeName
public final String edgeName()
- Specified by:
edgeNamein interfaceCellContext
-
meshUri
public final Uri meshUri()
- Specified by:
meshUriin interfaceCellContext
-
hostUri
public final Uri hostUri()
Description copied from interface:AgentContextThehostUriof theAgentmanaged by thisAgentContext.- Specified by:
hostUriin interfaceAgentContext
-
nodeUri
public final Uri nodeUri()
Description copied from interface:AgentContextThenodeUriof theAgentmanaged by thisAgentContext.- Specified by:
nodeUriin interfaceAgentContext
-
agentId
public final Value agentId()
- Specified by:
agentIdin interfaceAgentContext
-
props
public final Value props()
Description copied from interface:AgentContextARecordthat maps every dynamic property inAgentContext.nodeUri(), as defined byAgentRoute.pattern(), to its value. An empty result indicates thatnodeUricontains no dynamic components.- Specified by:
propsin interfaceAgentContext
-
getProp
public Value getProp(Value key)
Description copied from interface:AgentContextReturns the value ofkeyinAgentContext.props().- Specified by:
getPropin interfaceAgentContext
-
getProp
public Value getProp(String name)
Description copied from interface:AgentContextReturns the value ofnameinAgentContext.props().- Specified by:
getPropin interfaceAgentContext
-
policy
public Policy policy()
- Specified by:
policyin interfaceCellContext
-
schedule
public Schedule schedule()
Description copied from interface:AgentContextTheSchedulethat thisAgentContextis bound to.- Specified by:
schedulein interfaceAgentContext- Specified by:
schedulein interfaceCellContext
-
stage
public Stage stage()
Description copied from interface:AgentContextThe single-threaded executionStageon which thisAgentContextruns its application logic.- Specified by:
stagein interfaceAgentContext- Specified by:
stagein interfaceCellContext
-
asyncStage
public Stage asyncStage()
Description copied from interface:AgentContextThe multi-threaded executionStageon which thisAgentContextcan run asynchronous operations.- Specified by:
asyncStagein interfaceAgentContext
-
store
public StoreBinding store()
- Specified by:
storein interfaceCellContext
-
lane
public Lane lane()
Description copied from interface:AgentContextReturns the currently executing lane, or null if not currently executing a lane or link callback.- Specified by:
lanein interfaceAgentContext
-
link
public Link link()
Description copied from interface:AgentContextReturns the currently executing link, or null if not currently executing a link callback.- Specified by:
linkin interfaceAgentContext
-
getLane
public Lane getLane(Uri laneUri)
Description copied from interface:AgentContextReturns theLanebelonging to theAgentmanaged by thisAgentContextthat is addressable bylaneUri, ornullif no suchLaneexists.- Specified by:
getLanein interfaceAgentContext
-
openLane
public Lane openLane(Uri laneUri, Lane lane)
Description copied from interface:AgentContextRegisterslanewithlaneUriand returnslane.- Specified by:
openLanein interfaceAgentContext
-
agents
public FingerTrieSeq<Agent> agents()
- Specified by:
agentsin interfaceAgentContext
-
getAgent
public Agent getAgent(Value id)
- Specified by:
getAgentin interfaceAgentContext
-
getAgent
public Agent getAgent(String name)
- Specified by:
getAgentin interfaceAgentContext
-
getAgent
public <A extends Agent> A getAgent(Class<? extends A> agentClass)
- Specified by:
getAgentin interfaceAgentContext
-
createAgentFactory
public <A extends Agent> AgentFactory<A> createAgentFactory(Class<? extends A> agentClass)
-
openAgent
public <A extends Agent> A openAgent(Value id, Value props, AgentFactory<A> agentFactory)
- Specified by:
openAgentin interfaceAgentContext
-
openAgent
public <A extends Agent> A openAgent(Value id, AgentFactory<A> agentFactory)
- Specified by:
openAgentin interfaceAgentContext
-
openAgent
public <A extends Agent> A openAgent(String name, AgentFactory<A> agentFactory)
- Specified by:
openAgentin interfaceAgentContext
-
openAgent
public <A extends Agent> A openAgent(Value id, Value props, Class<? extends A> agentClass)
- Specified by:
openAgentin interfaceAgentContext
-
openAgent
public <A extends Agent> A openAgent(Value id, Class<? extends A> agentClass)
- Specified by:
openAgentin interfaceAgentContext
-
openAgent
public <A extends Agent> A openAgent(String name, Class<? extends A> agentClass)
- Specified by:
openAgentin interfaceAgentContext
-
closeAgent
public void closeAgent(Value id)
- Specified by:
closeAgentin interfaceAgentContext
-
closeAgent
public void closeAgent(String name)
- Specified by:
closeAgentin interfaceAgentContext
-
commandLane
public <V> CommandLane<V> commandLane()
- Specified by:
commandLanein interfaceLaneFactory
-
demandLane
public <V> DemandLane<V> demandLane()
- Specified by:
demandLanein interfaceLaneFactory
-
demandMapLane
public <K,V> DemandMapLane<K,V> demandMapLane()
- Specified by:
demandMapLanein interfaceLaneFactory
-
httpLane
public <V> HttpLane<V> httpLane()
- Specified by:
httpLanein interfaceLaneFactory
-
joinMapLane
public <L,K,V> JoinMapLane<L,K,V> joinMapLane()
- Specified by:
joinMapLanein interfaceLaneFactory
-
joinValueLane
public <K,V> JoinValueLane<K,V> joinValueLane()
- Specified by:
joinValueLanein interfaceLaneFactory
-
listLane
public <V> ListLane<V> listLane()
- Specified by:
listLanein interfaceLaneFactory
-
mapLane
public <K,V> MapLane<K,V> mapLane()
- Specified by:
mapLanein interfaceLaneFactory
-
spatialLane
public <K,S,V> SpatialLane<K,S,V> spatialLane(Z2Form<S> shapeForm)
- Specified by:
spatialLanein interfaceLaneFactory
-
geospatialLane
public <K,V> SpatialLane<K,R2Shape,V> geospatialLane()
- Specified by:
geospatialLanein interfaceLaneFactory
-
supplyLane
public <V> SupplyLane<V> supplyLane()
- Specified by:
supplyLanein interfaceLaneFactory
-
valueLane
public <V> ValueLane<V> valueLane()
- Specified by:
valueLanein interfaceLaneFactory
-
wsLane
public <I,O> WsLane<I,O> wsLane()
- Specified by:
wsLanein interfaceLaneFactory
-
spatialData
public <S> SpatialData<Value,S,Value> spatialData(Value name, Z2Form<S> shapeForm)
- Specified by:
spatialDatain interfaceStore
-
spatialData
public <S> SpatialData<Value,S,Value> spatialData(String name, Z2Form<S> shapeForm)
- Specified by:
spatialDatain interfaceStore
-
geospatialData
public SpatialData<Value,R2Shape,Value> geospatialData(Value name)
- Specified by:
geospatialDatain interfaceStore
-
geospatialData
public SpatialData<Value,R2Shape,Value> geospatialData(String name)
- Specified by:
geospatialDatain interfaceStore
-
bindDownlink
public LinkBinding bindDownlink(Downlink downlink)
- Specified by:
bindDownlinkin interfaceCellContext
-
openDownlink
public void openDownlink(LinkBinding link)
- Specified by:
openDownlinkin interfaceCellContext
-
closeDownlink
public void closeDownlink(LinkBinding link)
- Specified by:
closeDownlinkin interfaceCellContext
-
pushDown
public void pushDown(Push<?> push)
- Specified by:
pushDownin interfaceCellContext
-
reportDown
public void reportDown(Metric metric)
- Specified by:
reportDownin interfaceCellContext
-
openMetaDownlink
public void openMetaDownlink(LinkBinding downlink, NodeBinding metaDownlink)
- Specified by:
openMetaDownlinkin interfaceCellContext
-
trace
public void trace(Object message)
Description copied from interface:LogLogs a trace-level message.
-
debug
public void debug(Object message)
Description copied from interface:LogLogs a debug-level message.
-
info
public void info(Object message)
Description copied from interface:LogLogs an info-level message.
-
warn
public void warn(Object message)
Description copied from interface:LogLogs a warn-level message.
-
error
public void error(Object message)
Description copied from interface:LogLogs an error-level message.
-
fail
public void fail(Object message)
Description copied from interface:LogLogs an fail-level message.
-
willOpen
public void willOpen()
- Specified by:
willOpenin interfaceTierContext- Overrides:
willOpenin classAbstractTierBinding
-
didOpen
public void didOpen()
- Specified by:
didOpenin interfaceTierContext- Overrides:
didOpenin classAbstractTierBinding
-
willLoad
public void willLoad()
- Specified by:
willLoadin interfaceTierContext- Overrides:
willLoadin classAbstractTierBinding
-
didLoad
public void didLoad()
- Specified by:
didLoadin interfaceTierContext- Overrides:
didLoadin classAbstractTierBinding
-
willStart
public void willStart()
- Specified by:
willStartin interfaceTierContext- Overrides:
willStartin classAbstractTierBinding
-
didStart
public void didStart()
- Specified by:
didStartin interfaceTierContext- Overrides:
didStartin classAbstractTierBinding
-
willStop
public void willStop()
- Specified by:
willStopin interfaceTierContext- Overrides:
willStopin classAbstractTierBinding
-
didStop
public void didStop()
- Specified by:
didStopin interfaceTierContext- Overrides:
didStopin classAbstractTierBinding
-
willUnload
public void willUnload()
- Specified by:
willUnloadin interfaceTierContext- Overrides:
willUnloadin classAbstractTierBinding
-
didUnload
public void didUnload()
- Specified by:
didUnloadin interfaceTierContext- Overrides:
didUnloadin classAbstractTierBinding
-
willClose
public void willClose()
- Specified by:
willClosein interfaceTierContext- Overrides:
willClosein classAbstractTierBinding
-
didClose
public void didClose()
- Specified by:
didClosein interfaceTierBinding- Overrides:
didClosein classAbstractTierBinding
-
didFail
public void didFail(Throwable error)
- Specified by:
didFailin interfaceTierBinding- Overrides:
didFailin classAbstractTierBinding
-
-