com.lmax.api.profile
Class Timer

java.lang.Object
  extended by com.lmax.api.profile.Timer

public class Timer
extends java.lang.Object

Factory class to construct timers for callback methods.


Constructor Summary
Timer()
           
 
Method Summary
static ExecutionEventListener create(ExecutionEventListener listener, java.lang.String name, TimingListener timingListener)
          Construct a timer for execution events.
static InstructionRejectedEventListener create(InstructionRejectedEventListener listener, java.lang.String name, TimingListener timingListener)
          Construct a timer for instruction rejected events.
static OrderBookEventListener create(OrderBookEventListener listener, java.lang.String name, TimingListener timingListener)
          Construct a timer for order book events.
static OrderEventListener create(OrderEventListener listener, java.lang.String name, TimingListener timingListener)
          Construct a timer for order events.
static ExecutionEventListener forExecutionEvents(ExecutionEventListener listener)
          Construct an MBean based timer for execution events.
static InstructionRejectedEventListener forInstructionRejectedEvents(InstructionRejectedEventListener listener)
          Construct an MBean based timer for instruction rejected events.
static OrderBookEventListener forOrderBookEvents(OrderBookEventListener listener)
          Construct an MBean based timer for order book events.
static OrderEventListener forOrderEvents(OrderEventListener listener)
          Construct an MBean based timer for order events.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Timer

public Timer()
Method Detail

create

public static OrderEventListener create(OrderEventListener listener,
                                        java.lang.String name,
                                        TimingListener timingListener)
Construct a timer for order events.

Parameters:
listener - The real listener to delegate events to.
name - The name associated to this timer.
timingListener - The callback for timing events.
Returns:
A listener that will time call to the real listener.

forOrderEvents

public static OrderEventListener forOrderEvents(OrderEventListener listener)
Construct an MBean based timer for order events.

Parameters:
listener - The real listener to delgate too.
Returns:
A listener that will time call to the real listener.

create

public static InstructionRejectedEventListener create(InstructionRejectedEventListener listener,
                                                      java.lang.String name,
                                                      TimingListener timingListener)
Construct a timer for instruction rejected events.

Parameters:
listener - The real listener to delegate events to.
name - The name associated to this timer.
timingListener - The callback for timing events.
Returns:
A listener that will time call to the real listener.

forInstructionRejectedEvents

public static InstructionRejectedEventListener forInstructionRejectedEvents(InstructionRejectedEventListener listener)
Construct an MBean based timer for instruction rejected events.

Parameters:
listener - The real listener to delgate too.
Returns:
A listener that will time call to the real listener.

create

public static OrderBookEventListener create(OrderBookEventListener listener,
                                            java.lang.String name,
                                            TimingListener timingListener)
Construct a timer for order book events.

Parameters:
listener - The real listener to delegate events to.
name - The name associated to this timer.
timingListener - The callback for timing events.
Returns:
A listener that will time call to the real listener.

forOrderBookEvents

public static OrderBookEventListener forOrderBookEvents(OrderBookEventListener listener)
Construct an MBean based timer for order book events.

Parameters:
listener - The real listener to delgate too.
Returns:
A listener that will time call to the real listener.

create

public static ExecutionEventListener create(ExecutionEventListener listener,
                                            java.lang.String name,
                                            TimingListener timingListener)
Construct a timer for execution events.

Parameters:
listener - The real listener to delegate events to.
name - The name associated to this timer.
timingListener - The callback for timing events.
Returns:
A listener that will time call to the real listener.

forExecutionEvents

public static ExecutionEventListener forExecutionEvents(ExecutionEventListener listener)
Construct an MBean based timer for execution events.

Parameters:
listener - The real listener to delgate too.
Returns:
A listener that will time call to the real listener.