Search in sources :

Example 1 with ManagedAgentLifeCycle

use of com.navercorp.pinpoint.collector.util.ManagedAgentLifeCycle in project pinpoint by naver.

the class AgentLifeCycleChangeEventHandler method eventPerformed.

@Override
public void eventPerformed(PinpointServer pinpointServer, SocketStateCode stateCode) throws Exception {
    ManagedAgentLifeCycle managedAgentLifeCycle = ManagedAgentLifeCycle.getManagedAgentLifeCycleByStateCode(stateCode);
    if (managedAgentLifeCycle == STATE_NOT_MANAGED) {
        return;
    } else {
        logger.info("{} eventPerformed(). pinpointServer:{}, code:{}", this.getClass().getSimpleName(), pinpointServer, stateCode);
        long eventTimestamp = System.currentTimeMillis();
        AgentLifeCycleState agentLifeCycleState = managedAgentLifeCycle.getMappedState();
        this.agentLifeCycleHandler.handleLifeCycleEvent(pinpointServer, eventTimestamp, agentLifeCycleState, managedAgentLifeCycle.getEventCounter());
        AgentEventType agentEventType = managedAgentLifeCycle.getMappedEvent();
        this.agentEventHandler.handleEvent(pinpointServer, eventTimestamp, agentEventType);
    }
}
Also used : AgentEventType(com.navercorp.pinpoint.common.server.util.AgentEventType) ManagedAgentLifeCycle(com.navercorp.pinpoint.collector.util.ManagedAgentLifeCycle) AgentLifeCycleState(com.navercorp.pinpoint.common.server.util.AgentLifeCycleState)

Aggregations

ManagedAgentLifeCycle (com.navercorp.pinpoint.collector.util.ManagedAgentLifeCycle)1 AgentEventType (com.navercorp.pinpoint.common.server.util.AgentEventType)1 AgentLifeCycleState (com.navercorp.pinpoint.common.server.util.AgentLifeCycleState)1