public abstract class BaseMatcherEndpoint extends BaseAgent implements MatcherEndpoint
Modifier and Type | Class and Description |
---|---|
static class |
BaseMatcherEndpoint.Connected
The
BaseMatcherEndpoint.Connected object describes the current status and configuration of an BaseMatcherEndpoint . |
class |
BaseMatcherEndpoint.RateLimitedBidPublisher |
Agent.Status
Modifier and Type | Field and Description |
---|---|
static Agent.Status |
NOT_CONNECTED |
Constructor and Description |
---|
BaseMatcherEndpoint() |
Modifier and Type | Method and Description |
---|---|
void |
agentEndpointDisconnected(Session session)
|
AggregatedBid |
aggregate() |
void |
configure(MarketBasis marketBasis,
java.lang.String clusterId,
long minTimeBetweenUpdates) |
void |
connectToAgent(Session session)
Connects this
MatcherEndpoint instance to an AgentEndpoint . |
java.lang.String |
getAgentId() |
Agent.Status |
getStatus() |
void |
handleBidUpdate(Session session,
BidUpdate bidUpdate)
|
protected void |
init(java.lang.String agentId)
This method should always be called during activation of the agent.
|
protected abstract void |
performUpdate(AggregatedBid aggregatedBid) |
void |
publishPrice(Price price,
AggregatedBid aggregatedBid) |
void |
unconfigure() |
addObserver, now, publishEvent, removeObserver, setContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setContext
public static final Agent.Status NOT_CONNECTED
public java.lang.String getAgentId()
getAgentId
in interface Agent
Agent
.public Agent.Status getStatus()
getStatus
in interface Agent
Agent.Status
of the Agent
. This returns a snapshot of the state that won't change.
If used at a later time, the snapshot should be refreshed.protected void init(java.lang.String agentId)
init(String)
method, so that call is no longer needed.agentId
- The agentId that should be used by this Agent
. This will be returned when the
getStatus()
is called.java.lang.IllegalArgumentException
- when either the agentId or the desiredParentId is null or is an empty string.public void configure(MarketBasis marketBasis, java.lang.String clusterId, long minTimeBetweenUpdates)
public void unconfigure()
public void connectToAgent(Session session)
MatcherEndpoint
MatcherEndpoint
instance to an AgentEndpoint
.connectToAgent
in interface MatcherEndpoint
session
- the Session
that will link this AgentEndpoint
with a MatcherEndpoint
.public void agentEndpointDisconnected(Session session)
MatcherEndpoint
agentEndpointDisconnected
in interface MatcherEndpoint
session
- the Session
that used to link this MatcherEndpoint
with an AgentEndpoint
.public void publishPrice(Price price, AggregatedBid aggregatedBid)
public final AggregatedBid aggregate()
protected abstract void performUpdate(AggregatedBid aggregatedBid)
public void handleBidUpdate(Session session, BidUpdate bidUpdate)
MatcherEndpoint
handleBidUpdate
in interface MatcherEndpoint
session
- The session linking this MatcherEndpoint
with a specific AgentEndpoint
instance.bidUpdate
- The new BidUpdate
.