org.marketcetera.ors
Class SimpleOrderInfoCache

java.lang.Object
  extended by org.marketcetera.ors.SimpleOrderInfoCache
All Implemented Interfaces:
OrderInfoCache

public class SimpleOrderInfoCache
extends Object
implements OrderInfoCache

A cache of order information. Cache entries are instances of SimpleOrderInfo.

WARNING: certain cache entries may be maintained forever. This may happen if, for example, a broker response is expected (because an order has been sent to the broker), but the response is never received. Or if the ORS cannot persist the actor/viewer of an order. This behavior can leak to ORS memory leaks over extended periods of time and under scenarios of frequent faulty conditions.

Since:
2.1.0
Version:
$Id: SimpleOrderInfoCache.java 16154 2012-07-14 16:34:05Z colin $
Author:
tlerios@marketcetera.com

Constructor Summary
SimpleOrderInfoCache()
           
 
Method Summary
 SimpleOrderInfo get(OrderID orderID)
          Returns the receiver's entry for the order with the given ID.
 SimpleOrderInfo put(OrderID orderID, OrderID origOrderID, UserID actorID)
          Adds (and returns) a new entry to the receiver for an order with the given self and parent IDs, and the given actor ID.
 void remove(OrderID orderID)
          Removes the receiver's entry for the order with the given ID.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleOrderInfoCache

public SimpleOrderInfoCache()
Method Detail

remove

public void remove(OrderID orderID)
Removes the receiver's entry for the order with the given ID.

Parameters:
orderID - The order ID.

put

public SimpleOrderInfo put(OrderID orderID,
                           OrderID origOrderID,
                           UserID actorID)
Description copied from interface: OrderInfoCache
Adds (and returns) a new entry to the receiver for an order with the given self and parent IDs, and the given actor ID.

Specified by:
put in interface OrderInfoCache
Parameters:
orderID - The order ID.
origOrderID - The parent order ID. It may be null for orders that are chain roots.
actorID - The actor ID.
Returns:
The new entry.

get

public SimpleOrderInfo get(OrderID orderID)
Description copied from interface: OrderInfoCache
Returns the receiver's entry for the order with the given ID.

Specified by:
get in interface OrderInfoCache
Parameters:
orderID - The order ID.
Returns:
The entry. It may be null if the received has no such entry.


Copyright © 2012. All Rights Reserved.