Class ValuationHandler
java.lang.Object
net.finmath.smartcontract.valuation.service.websocket.handler.ValuationHandler
- All Implemented Interfaces:
org.springframework.web.socket.WebSocketHandler
public class ValuationHandler
extends Object
implements org.springframework.web.socket.WebSocketHandler
Simple ValuationHandler based on a live market data feed for a Websocket-Connection
Firste: As inbound message an xml will trigger a connect to market data adapter Second: A valuation observable will connect on the continous market data feed Third: A consumer subscribes to the valuation observable and sending test messages over the websocket connection - For Demo Purposes may also implement for RandomMarketDataFeed - marketDataWebSocketAdapter should be a single instance shared across several handlers - parse subscription settings out of product XML (i.e. settlement frequency) - Add other handlers
- Author:
- Peter Kohl-Landgraf
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterConnectionClosed(org.springframework.web.socket.WebSocketSession session, org.springframework.web.socket.CloseStatus status)voidafterConnectionEstablished(org.springframework.web.socket.WebSocketSession session)voidhandleMessage(org.springframework.web.socket.WebSocketSession session, org.springframework.web.socket.WebSocketMessage<?> message)voidhandleTransportError(org.springframework.web.socket.WebSocketSession session, Throwable exception)boolean
-
Constructor Details
-
ValuationHandler
public ValuationHandler()
-
-
Method Details
-
handleMessage
public void handleMessage(org.springframework.web.socket.WebSocketSession session, org.springframework.web.socket.WebSocketMessage<?> message) throws Exception- Specified by:
handleMessagein interfaceorg.springframework.web.socket.WebSocketHandler- Throws:
Exception
-
handleTransportError
public void handleTransportError(org.springframework.web.socket.WebSocketSession session, Throwable exception) throws Exception- Specified by:
handleTransportErrorin interfaceorg.springframework.web.socket.WebSocketHandler- Throws:
Exception
-
supportsPartialMessages
public boolean supportsPartialMessages()- Specified by:
supportsPartialMessagesin interfaceorg.springframework.web.socket.WebSocketHandler
-
afterConnectionEstablished
public void afterConnectionEstablished(org.springframework.web.socket.WebSocketSession session) throws Exception- Specified by:
afterConnectionEstablishedin interfaceorg.springframework.web.socket.WebSocketHandler- Throws:
Exception
-
afterConnectionClosed
public void afterConnectionClosed(org.springframework.web.socket.WebSocketSession session, org.springframework.web.socket.CloseStatus status) throws Exception- Specified by:
afterConnectionClosedin interfaceorg.springframework.web.socket.WebSocketHandler- Throws:
Exception
-