Class StrategyLockManager

java.lang.Object
com.caplin.motif.fx.ret.orders.strategy.StrategyLockManager

public class StrategyLockManager extends 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

    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(String strategyId)
    Attempts to acquire the strategy lock for the specified strategy ID.
    boolean
    Attempts to acquire the strategy lock for the specified order ID.
    com.caplin.ret.trapi.fx.FXOrder
    getOrder(String orderId)
     
    boolean
    releaseLock(com.caplin.ret.trapi.fx.FXOrder order)
    Attempts to release the strategy lock for the specified order.
    boolean
    releaseLock(String strategyId)
    Attempts to release the strategy lock for the specified strategy ID.
    boolean
    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 Details

    • StrategyLockManager

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

    • acquireLockForOrder

      public boolean acquireLockForOrder(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(String orderId)
    • acquireLock

      public boolean acquireLock(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(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(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.