Package org.apache.activemq.web
Class PortfolioPublishServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- org.apache.activemq.web.MessageServletSupport
-
- org.apache.activemq.web.PortfolioPublishServlet
-
- All Implemented Interfaces:
Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig
public class PortfolioPublishServlet extends MessageServletSupport
A servlet which will publish dummy market data prices- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PortfolioPublishServlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringcreateStockText(String stock)protected voiddoGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)protected Stringescape(String text)protected intgetNumberOfMessages(javax.servlet.http.HttpServletRequest request)voidinit()protected doublemutatePrice(double price)protected voidsendMessage(WebClient client, String[] stocks)-
Methods inherited from class org.apache.activemq.web.MessageServletSupport
appendParametersToMessage, asBoolean, asBoolean, asDestination, asInt, asInteger, asLong, asLong, asString, getDestination, getDestination, getDestinationFromURI, getPostedMessageBody, getSelector, getSendPriority, getSendTimeToLive, init, isSendPersistent, isSync, isTopic
-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
-
-
-
-
Method Detail
-
init
public void init() throws javax.servlet.ServletException- Overrides:
initin classjavax.servlet.GenericServlet- Throws:
javax.servlet.ServletException
-
doGet
protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException- Overrides:
doGetin classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionIOException
-
sendMessage
protected void sendMessage(WebClient client, String[] stocks) throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
-
mutatePrice
protected double mutatePrice(double price)
-
getNumberOfMessages
protected int getNumberOfMessages(javax.servlet.http.HttpServletRequest request)
-
escape
protected String escape(String text) throws IOException
- Throws:
IOException
-
-