public class MonitoringService
extends java.lang.Object
implements jadex.bridge.service.types.monitoring.IMonitoringService
Modifier and Type | Field and Description |
---|---|
protected jadex.bridge.IInternalAccess |
agent
The agent.
|
protected java.util.List<jadex.bridge.service.types.monitoring.IMonitoringEvent> |
events
The list of events.
|
protected jadex.commons.IFilter<jadex.bridge.service.types.monitoring.IMonitoringEvent> |
filter
The event filter to filter out some events.
|
protected long |
max
The maximum number of events to keep, -1 for unrestricted.
|
protected java.util.Map<jadex.commons.future.SubscriptionIntermediateFuture<jadex.bridge.service.types.monitoring.IMonitoringEvent>,jadex.commons.IFilter<jadex.bridge.service.types.monitoring.IMonitoringEvent>> |
subscriptions
The subscriptions (subscription future -> subscription info).
|
Constructor and Description |
---|
MonitoringService()
Create a new MonitoringService.
|
MonitoringService(long max,
jadex.commons.IFilter<jadex.bridge.service.types.monitoring.IMonitoringEvent> filter)
Create a new MonitoringService.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addEvent(jadex.bridge.service.types.monitoring.IMonitoringEvent event)
Add a new event to the list.
|
protected void |
addSubscription(jadex.commons.future.SubscriptionIntermediateFuture<jadex.bridge.service.types.monitoring.IMonitoringEvent> future,
jadex.commons.IFilter<jadex.bridge.service.types.monitoring.IMonitoringEvent> filter)
Add a new subscription.
|
protected void |
forwardEvent(jadex.bridge.service.types.monitoring.IMonitoringEvent event)
Forward event to all currently registered subscribers.
|
protected void |
forwardEvent(jadex.bridge.service.types.monitoring.IMonitoringEvent event,
jadex.commons.future.SubscriptionIntermediateFuture<jadex.bridge.service.types.monitoring.IMonitoringEvent> sub)
Forward event to one subscribers.
|
jadex.commons.future.IFuture<java.lang.Void> |
publishEvent(jadex.bridge.service.types.monitoring.IMonitoringEvent event)
Publish a new event.
|
protected void |
removeSubscription(jadex.commons.future.SubscriptionIntermediateFuture<jadex.bridge.service.types.monitoring.IMonitoringEvent> fut)
Remove an existing subscription.
|
jadex.commons.future.IFuture<java.lang.Void> |
shutdown()
Notify subscribers that monitoring service is terminated.
|
jadex.commons.future.ISubscriptionIntermediateFuture<jadex.bridge.service.types.monitoring.IMonitoringEvent> |
subscribeToEvents(jadex.commons.IFilter<jadex.bridge.service.types.monitoring.IMonitoringEvent> filter)
Subscribe to monitoring events.
|
protected jadex.bridge.IInternalAccess agent
protected java.util.List<jadex.bridge.service.types.monitoring.IMonitoringEvent> events
protected long max
protected java.util.Map<jadex.commons.future.SubscriptionIntermediateFuture<jadex.bridge.service.types.monitoring.IMonitoringEvent>,jadex.commons.IFilter<jadex.bridge.service.types.monitoring.IMonitoringEvent>> subscriptions
protected jadex.commons.IFilter<jadex.bridge.service.types.monitoring.IMonitoringEvent> filter
public MonitoringService()
public MonitoringService(long max, jadex.commons.IFilter<jadex.bridge.service.types.monitoring.IMonitoringEvent> filter)
public jadex.commons.future.IFuture<java.lang.Void> shutdown()
public jadex.commons.future.IFuture<java.lang.Void> publishEvent(jadex.bridge.service.types.monitoring.IMonitoringEvent event)
publishEvent
in interface jadex.bridge.service.types.monitoring.IMonitoringService
event
- The event.public jadex.commons.future.ISubscriptionIntermediateFuture<jadex.bridge.service.types.monitoring.IMonitoringEvent> subscribeToEvents(jadex.commons.IFilter<jadex.bridge.service.types.monitoring.IMonitoringEvent> filter)
subscribeToEvents
in interface jadex.bridge.service.types.monitoring.IMonitoringService
filter
- An optional filter.protected void addEvent(jadex.bridge.service.types.monitoring.IMonitoringEvent event)
protected void addSubscription(jadex.commons.future.SubscriptionIntermediateFuture<jadex.bridge.service.types.monitoring.IMonitoringEvent> future, jadex.commons.IFilter<jadex.bridge.service.types.monitoring.IMonitoringEvent> filter)
future
- The subscription future.si
- The subscription info.protected void removeSubscription(jadex.commons.future.SubscriptionIntermediateFuture<jadex.bridge.service.types.monitoring.IMonitoringEvent> fut)
fut
- The subscription future to remove.protected void forwardEvent(jadex.bridge.service.types.monitoring.IMonitoringEvent event)
protected void forwardEvent(jadex.bridge.service.types.monitoring.IMonitoringEvent event, jadex.commons.future.SubscriptionIntermediateFuture<jadex.bridge.service.types.monitoring.IMonitoringEvent> sub)