Package org.rioproject.gnostic.service.test

Source Code of org.rioproject.gnostic.service.test.ExecutionNodeServiceImpl

package org.rioproject.gnostic.service.test;

import org.rioproject.servicebean.ServiceBeanContext;
import org.rioproject.impl.watch.CounterWatch;

/**
* Test service implementation
*/
public class ExecutionNodeServiceImpl implements ExecutionNodeService {
    private CounterWatch kSessionCounter;
    private Long instanceID;

    public void setServiceBeanContext(ServiceBeanContext context) {
        instanceID = context.getServiceBeanConfig().getInstanceID();
        //loadWatch = new GaugeWatch("load");
        kSessionCounter = new CounterWatch("kSessionCounter");
        // context.getWatchRegistry().register(loadWatch);
        context.getWatchRegistry().register(kSessionCounter);
        instanceID = context.getServiceBeanConfig().getInstanceID();
    }


    public void incrementSessionCounter() {
        double last = kSessionCounter.getLastCalculableValue();
        kSessionCounter.increment();       
    }
}
TOP

Related Classes of org.rioproject.gnostic.service.test.ExecutionNodeServiceImpl

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.