Hi guys
I am new to this great technology, what I want to do is simply create an adapter that will listen for HTTP requests, clients will connect to the server send some data like a ordinary web browser and server. It is along the ideas covered in this forum.
9969285
I have created my adapter extending from HttpServlet implementing StreamSource. I cannot figure out which url on my localhost should i connect to, as i am getting
HTTP ERROR 404
Problem accessing /ForexRates/ticks. Reason:
NOT_FOUND
Application name is: ForexRates.
My adapter code:
@SuppressWarnings("serial")
public class HttpServletAdapter extends HttpServlet implements StreamSource{
private HttpService httpService=null;
private StreamSender eventSender;
@Override
public void init(ServletConfig config) throws ServletException {
super.init(config);
try {
config.getServletContext().log("Initialising HTTP Servlet Adapter....");
httpService.registerServlet("/ticks", this, null, null);
} catch (NamespaceException nex) {
throw new ServletException(nex);
}
}
public void setHttpService(HttpService httpService) {
this.httpService = httpService;
}
my context xml file
[xml]
<osgi:reference id="jetty" interface="org.osgi.service.http.HttpService"/>
<!-- Incoming Forex Rates Adapter -->
<wlevs:adapter id="ratesFeedAdapter" class="com.....HttpServletAdapter" advertise="true">
<wlevs:instance-property name="httpService" ref="jetty"/>
</wlevs:adapter>
[xml]
it got me thinking, isn't there a service/adapter out of the box that I can use, configure the server context path, add a converter for requests received or simply assign a java class to grab the request where name/value pairs match the bean properties. If there is such an adapter how do i configure it?