-
1. Re: J2SE application, non J2EE
jimdwyer Mar 11, 2005 11:04 AM (in response to jimdwyer)BTW,
I am going to use this as a front end for a realtime box. There is no database. I need security, naming. I will probably be controlling a C program if I can. I need a long lived connection on TCP. I will be doing streaming out of a UDP. I know this is outside of the normal for JBoss but I know it will work. Just need a jump start on some things.
Jim -
2. Re: J2SE application, non J2EE
juha Mar 11, 2005 11:46 AM (in response to jimdwyer)Trail: Custom Networking
-
3. Re: J2SE application, non J2EE
jimdwyer Mar 11, 2005 12:19 PM (in response to jimdwyer)Thanks Juha. I will look at that. I need to review my networking.
What I don't understand is what type of object (bean I guess) I need to create for such a service. All of the examples show how to build J2EE Session and Entity Beans. Would I wrap the TCP connection into a J2EE session bean? J2EE seems to be a bit of overkill without a database. Does JBoss manage the socket connections to such primative services? Any suggestions would be appreciated.
Jim -
4. Re: J2SE application, non J2EE
juha Mar 11, 2005 12:30 PM (in response to jimdwyer)You should wrap it as an MBean, as it is an extension to the server itself.
There's examples on how to write MBeans and deploy them on JBoss at docs.jboss.org. -
5. Re: J2SE application, non J2EE
jimdwyer Mar 11, 2005 12:32 PM (in response to jimdwyer)Excellent!
I am all over it like spilt coffee! -
6. Re: J2SE application, non J2EE
jimdwyer Mar 16, 2005 4:23 PM (in response to jimdwyer)JBossers,
Are there any good examples of this type of server available? I created an MBean already but am not sure where to put the ServerSocket piece.
Does it go right in the MBean? I guess I am a little confused about how JBoss deals with ports and such.
I was looking at the naming server source and it appears to be a stand alone server with a Main. Is this the way it runs within JBoss? As a standalone? Should I do the same?
This is a bit frustrating as I can't imagine it is that hard but I can't seem to see the light on how to construct this one.
Any help is appreciated.
Jim -
7. Re: J2SE application, non J2EE
kevliang Mar 17, 2005 2:22 PM (in response to jimdwyer)i also have similar interest in this....
i have legacy clients writing payload on long lived tcp connections....
the old server sits on a port and forks threads for each connection to that port.......
i would like to use jboss to replace this, but i dont know where to start looking....
if serviceMBean is the solution, would the MBean be forking threads for handling all connections as well?
can i hook invokers to this?
some direction would be appreciated!
thanks -
8. Re: J2SE application, non J2EE
jimdwyer Mar 17, 2005 4:57 PM (in response to jimdwyer)Kevliang,
I got mine working somewhat. Still lots of work to do.
First create an empty MBean and get that installed and working in JBoss.
Then inside the start method of the MBean create a Thread that creates a ServerSocket or ServerSocketChannel. Then inside the MBean.start method use the Thread.start method to kick off the newly created Thread.
You should then have a working MBean that is a server.
Let me know if you need some help. I can shot you am email.
Jim -
9. Re: J2SE application, non J2EE
kevliang Mar 17, 2005 7:12 PM (in response to jimdwyer)hey Jim,
yes, if you can, please shoot me an email, kevliang@amazon.com.
i would be interested in seeing what you have... after reading through many threads, i figured serverMBean would be the best, but i still have a few questions if you dont mind... =)
thanks! -
10. Re: J2SE application, non J2EE
juha Mar 18, 2005 2:31 PM (in response to jimdwyer)I recommend JBoss for Advanced J2EE Developers for this. Answers all your questions on how to do this, with hands-on exercise.
Take care,