Class StrategyLockManager
java.lang.Object
com.caplin.motif.fx.ret.orders.strategy.StrategyLockManager
The StrategyLockManager maintains a record of the locks held for strategies.
-
Constructor Summary
ConstructorDescriptionStrategyLockManager
(com.caplin.ret.trapi.fx.order.OrderMonitorService orderManager) -
Method Summary
Modifier and TypeMethodDescriptionboolean
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
acquireLockForOrder
(String orderId) Attempts to acquire the strategy lock for the specified order ID.com.caplin.ret.trapi.fx.FXOrder
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
releaseLockForOrder
(String orderId) Attempts to release the strategy lock for the specified order ID.
-
Constructor Details
-
StrategyLockManager
public StrategyLockManager(com.caplin.ret.trapi.fx.order.OrderMonitorService orderManager)
-
-
Method Details
-
acquireLockForOrder
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
-
acquireLock
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
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
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.
-