es.upv.dsic.gti_ia.trace
Class TraceManager

java.lang.Object
  extended by es.upv.dsic.gti_ia.core.BaseAgent
      extended by es.upv.dsic.gti_ia.trace.TraceManager
All Implemented Interfaces:
Runnable

public class TraceManager
extends BaseAgent

Trace Manager entity definition. The trace manager entity is an agent in charge of coordinating and managing the event trace process. Tracing entities have to interact with the trace manager through ACL messages in order to publish/unpublish their tracing service and in order to subscribe/unsubscribe from tracing services.

Author:
L Burdalo (lburdalo@dsic.upv.es)

Field Summary
 
Fields inherited from class es.upv.dsic.gti_ia.core.BaseAgent
logger, session, traceSession
 
Constructor Summary
TraceManager(AgentID aid)
          Constructor which creates and initializes a TraceManager with the monitorization flag set to 'false'.
TraceManager(AgentID aid, boolean monitorizable)
          Constructor which creates and initializes a TraceManager.
 
Method Summary
protected  void onMessage(ACLMessage msg)
          Requests to the trace manager are sent via ACL messages which are processed in this method
 void onTraceEvent(TraceEvent tEvent)
          Function that will be executed when the agent gets a trace event.
 
Methods inherited from class es.upv.dsic.gti_ia.core.BaseAgent
activateTraceService, changeIdentity, deactivateTraceService, execute, finalize, getAid, getName, init, run, send, sendTraceEvent, start, terminate
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TraceManager

public TraceManager(AgentID aid)
             throws Exception
Constructor which creates and initializes a TraceManager with the monitorization flag set to 'false'.

Initialization tasks are internally performed by invoking the private method initialize(). These tasks are the following:

1) Creation of empty Tracing Entities, Tracing Service Providers, Tracing Service Subscribers and Tracing Services lists.

2) Add the trace manager to the Tracing Entities List.

3) Initialize the Tracing Services list with DI tracing services and add the trace manager as provider of those tracing services which are mandatory and requestable.

4) Subscribe to NEW_AGENT and AGENT_DESTROYED tracing services in order to be able to register tracing entities in the system

Parameters:
aid - AgentID which will be used to create the agent
Throws:
Exception
See Also:
TracingService

TraceManager

public TraceManager(AgentID aid,
                    boolean monitorizable)
             throws Exception
Constructor which creates and initializes a TraceManager.

Initialization tasks are internally performed by invoking the private method initialize(). These tasks are the following:

1) Creation of empty Tracing Entities, Tracing Service Providers, Tracing Service Subscribers and Tracing Services lists.

2) Add the trace manager to the Tracing Entities List.

3) Initialize the Tracing Services list with DI tracing services and add the trace manager as provider of those tracing services which are mandatory and requestable.

4) Subscribe to NEW_AGENT and AGENT_DESTROYED tracing services in order to be able to register tracing entities in the system

Parameters:
aid - AgentID which will be used to create the agent
monitorizable - Value to which the monitorizable attribute of the class will be set
Throws:
Exception
See Also:
initialize()
Method Detail

onMessage

protected void onMessage(ACLMessage msg)
Requests to the trace manager are sent via ACL messages which are processed in this method

Overrides:
onMessage in class BaseAgent
Parameters:
msg - Message received

onTraceEvent

public void onTraceEvent(TraceEvent tEvent)
Description copied from class: BaseAgent
Function that will be executed when the agent gets a trace event. The user has to write his/her code here

Overrides:
onTraceEvent in class BaseAgent


Copyright © 2012 GTI-IA. All Rights Reserved.