net.sf.emarket.trade.service
Class MatchingEngineServiceImpl

java.lang.Object
  extended by net.sf.emarket.trade.service.MatchingEngineServiceImpl

public class MatchingEngineServiceImpl
extends java.lang.Object

See Also:
Serialized Form

Constructor Summary
MatchingEngineServiceImpl()
           
 
Method Summary
 void execute(Order order)
           check whether the order is already registered in receievedOrders table? register the order received obtain the lock for the order book for the symbol if it is LIMIT order, update the order book load the order book for the symbol send a quote if there is a change in quote check whether any match is found in the book. if a match is found update then create an order match record the match update order book send a quote, if changed release the lock on order book for the symbol
 void setQuoteManagerService(IQuoteManagerService svc)
           
 void setTradingService(net.sf.emarket.trade.service.ITradingService svc)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MatchingEngineServiceImpl

public MatchingEngineServiceImpl()
Method Detail

setTradingService

public void setTradingService(net.sf.emarket.trade.service.ITradingService svc)

setQuoteManagerService

public void setQuoteManagerService(IQuoteManagerService svc)

execute

public void execute(Order order)
  1. check whether the order is already registered in receievedOrders table?
  2. register the order received
  3. obtain the lock for the order book for the symbol
  4. if it is LIMIT order,
    1. update the order book
  5. load the order book for the symbol
  6. send a quote if there is a change in quote
  7. check whether any match is found in the book.
  8. if a match is found
    1. update then create an order match
    2. record the match
    3. update order book
    4. send a quote, if changed
  9. release the lock on order book for the symbol



Copyright © 2009. All Rights Reserved.