Class StrategyLockManager


  • public class StrategyLockManager
    extends java.lang.Object
    The StrategyLockManager maintains a record of the locks held for strategies.
    • Constructor Summary

      Constructors 
      Constructor Description
      StrategyLockManager​(com.caplin.ret.trapi.fx.order.OrderMonitorService orderManager)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean acquireLock​(com.caplin.ret.trapi.fx.FXOrder order)
      Attempts to acquire the strategy lock for the specified order.
      boolean acquireLock​(java.lang.String strategyId)
      Attempts to acquire the strategy lock for the specified strategy ID.
      boolean acquireLockForOrder​(java.lang.String orderId)
      Attempts to acquire the strategy lock for the specified order ID.
      com.caplin.ret.trapi.fx.FXOrder getOrder​(java.lang.String orderId)  
      boolean releaseLock​(com.caplin.ret.trapi.fx.FXOrder order)
      Attempts to release the strategy lock for the specified order.
      boolean releaseLock​(java.lang.String strategyId)
      Attempts to release the strategy lock for the specified strategy ID.
      boolean releaseLockForOrder​(java.lang.String orderId)
      Attempts to release the strategy lock for the specified order ID.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StrategyLockManager

        public StrategyLockManager​(com.caplin.ret.trapi.fx.order.OrderMonitorService orderManager)
    • Method Detail

      • acquireLockForOrder

        public boolean acquireLockForOrder​(java.lang.String orderId)
        Attempts to acquire the strategy lock for the specified order ID.
        Parameters:
        orderId - The order ID.
        Returns:
        True if the lock was successfully acquired. False if an order was not found or the lock has already been acquired for the order.
      • getOrder

        public com.caplin.ret.trapi.fx.FXOrder getOrder​(java.lang.String orderId)
      • acquireLock

        public boolean acquireLock​(java.lang.String strategyId)
        Attempts to acquire the strategy lock for the specified strategy ID.
        Parameters:
        strategyId - The strategy ID.
        Returns:
        True if the lock was successfully acquired. False if the lock has already been acquired.
      • acquireLock

        public boolean acquireLock​(com.caplin.ret.trapi.fx.FXOrder order)
        Attempts to acquire the strategy lock for the specified order.
        Parameters:
        order - The order.
        Returns:
        True if the lock was successfully acquired. False if the lock has already been acquired.
      • releaseLockForOrder

        public boolean releaseLockForOrder​(java.lang.String orderId)
        Attempts to release the strategy lock for the specified order ID.
        Parameters:
        orderId - The order ID.
        Returns:
        True if the lock was successfully released. False if the order was not found or if no lock is being held.
      • releaseLock

        public boolean releaseLock​(com.caplin.ret.trapi.fx.FXOrder order)
        Attempts to release the strategy lock for the specified order.
        Parameters:
        order - The order.
        Returns:
        True if the lock was successfully released. False if the order was not found or if no lock is being held.
      • releaseLock

        public boolean releaseLock​(java.lang.String strategyId)
        Attempts to release the strategy lock for the specified strategy ID.
        Parameters:
        strategyId - The strategy ID.
        Returns:
        True if the lock was successfully released. False no lock is being held.