Hi Marshall, There are several things you can do here. What's best may depend on quite a few factors including how heavily loaded this service is going to be and how you want to configure it.
The most javaee way to approach this is to write an inbound j2ca resource adapter that listens on the socket, retrieves messages, and feeds them to an MDB (possibly with a custom message listener interface). Then your mdb will receive the message in an object and can get access to jpa, jta, jdbc connection pools, etc etc in the standard javaee fashion. The ee container will supply the thread pooling etc for your service. If you are happy handling thread pooling for requests yourself, you can just write a gbean service and configure it in your geronimo web app plan. In this case if you want to use connection pools you will have to look them up in global jndi, there is no java:comp context for gbeans. The global jndi names for connection pools are printed in the geronimo log as they are set up. If you are being extremely adventurous and working with geronimo 3 you could alternatively set up your service under osgi perhaps using blueprint and find the datasource in the osgi services registry. thanks david jencks On May 6, 2010, at 7:12 AM, Marshall Crocker wrote: > Not to hijack this thread but I was wondering the same thing. > > In my web app, I want to be able to receive TCP data on a socket. That data > will then be parsed and saved to a DB. Clients would connect directly to the > TCP socket and transfer the raw data. > > Currently the way clients pass data is through the URL such as > http://website.com/Servlet?var1=0&var2=1... Since these are mobile devices > transmitting using GPRS, I want to eliminate all the http overhead and move > to a straight TCP connection. > > Any thoughts? > > Thanks, > Marshall > >>>> David Jencks <[email protected]> 5/5/2010 12:45 PM >>> > You can definitely run it in geronimo (he says with unwarranted > overconfidence :-) > > You probably want to start it differently than you do as a standalone server. > To give advice I'd need to know more about your server including... > > -- how do it's clients connect to it > -- what geronimo services you want it to use. > -- what setup happens when you start it now > > For future-proofing this at the risk of having more uncertainty now you might > want to consider packaging your server as an osgi bundle and starting it with > an activator (or assembling it with osgi blueprint) and using geronimo 3 > (still definitely under development) or if you don't need significant > geronimo services felix karaf. > > thanks > david jencks > > On May 5, 2010, at 10:10 AM, Kevin Winterton wrote: > >> Hi, >> >> I have designed a Java application that runs like its own server and has php >> websites communicating directly with it. I was just wondering if there was >> any way I could use Geronimo to run this application on Geronimo, and if so >> were I should put it. It was designed in eclipse just as a Java Project, >> and when exported is made into a JAR file. Is it possible to use Geronimo >> to host an application like this, or can it only be used for things like >> servlets, JSP and EJBs. >> >> Please let me know if you need more information, I've already tried loading >> the JAR through the Console and it was placed in the App Clients section. >> >> Thanks, >> Kevin >> > >
