A J2EE syslog server?

B

Bogus Exception

If I'm using a J2EE container, how can I write a server like a UDP
port 515 syslog server that would run in the container? I am guessing
a servlet might be needed, but I don't know how to write a servlet as
a stateless bean.

And besides, a pool of beans all listening to the same port doesn't
sound feasible, either! :)

So do I need to write a J2SE app that points to a stateless bean, or
use JCA, or? The server and container would be on the same machine, so
I'm hoping to find an elegant example. Perhaps the solution is to find
a way to tell the container to ensure one-and only one-instance are
running at a time?

There are lots of examples of web services, but nothing I've found
(books or online) shows how to accomplish this utilizing J2EE.

If it helps, EJB3 and JBoss....

TIA!
 
P

Philipp Taprogge

Hi!

Thus spake Bogus Exception on 05/10/2007 06:11 PM:
a servlet might be needed, but I don't know how to write a servlet as
a stateless bean.

Other conciderations aside, that's simply because you don't.
Normally, a JEE application consists of servlets servicing clients
and session beans that contain the business login. When a request is
received, the servlet will acquire a session bean (usually through
JNDI) and call some methods on it, generating a respons for the
client in the process.

I am not certain, however, if a servlet container can bind a servlet
to a udp port at all...
So do I need to write a J2SE app that points to a stateless bean, or
use JCA, or?

That depends on what exactly you have in mind...
The server and container would be on the same machine, so
I'm hoping to find an elegant example. Perhaps the solution is to find
a way to tell the container to ensure one-and only one-instance are
running at a time?

That would be a Singleton. Whether or not that will solve your
problem again depends on what you are aiming.
There are lots of examples of web services, but nothing I've found
(books or online) shows how to accomplish this utilizing J2EE.

Well, at least I have never heard of anything to interface syslog
and a JEE application...

Regards,

Phil
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

Bogus said:
If I'm using a J2EE container, how can I write a server like a UDP
port 515 syslog server that would run in the container? I am guessing
a servlet might be needed, but I don't know how to write a servlet as
a stateless bean.

To listen to UDP on a given port you should use a JCA inbound adapter.

Arne
 
B

Bogus Exception

Phil,

Thanks for writing!

I am not certain, however, if a servlet container can bind a servlet
to a udp port at all...

My point, exactly. If I can't create an app in the container that can
service clients on a specific port, then I'll need to use an external
one, then point it to a stateless session bean.
That depends on what exactly you have in mind...

What I have in mind is to create a syslog server. I am shooting for a
100% container-based application, though, without having to tie in
other applications on the server.
Well, at least I have never heard of anything to interface syslog
and a JEE application...

A syslog server application is the most basic example. Other examples
include a telnet server, or other applications communicating on other
ports, using either UDP or TCP.

If the answer is that you cannot put the (network) server part of the
application in the app server, then that is the answer I was looking
for.

Thanks again!
 
B

Bogus Exception

To listen to UDP on a given port you should use a JCA inbound adapter.

Arne

Arne,

Thanks for writing. So I'll need to write the (network) server
component separate from the app server, then call a server component/
bean, right?

Thanks!
 
P

Philipp Taprogge

Hi!

Thus spake Bogus Exception on 05/11/2007 07:51 PM:
If the answer is that you cannot put the (network) server part of the
application in the app server, then that is the answer I was looking
for.

Well, I think, you cannot. In JEE, the network interaction tier is
part of the container, i.e. appserver, not the application inside.
You could, however integrate your custom components into the
container if it's OpenSource. That way you will still have to write
and deploy it separately from the application, but you will at least
have all components living inside the same server and share the same
VM and JNDI realm.

Regards,

Phil
 
B

Bogus Exception

Phil,

Interesting idea. I wonder what would be needed to enable the app
server to handle non-WS network traffic as you describe.

Main reason to have things simple: I'm trying to make something easy
to deploy.

Failing to do that, I need to learn how to do it otherwise!

Thanks for writing!
 
P

Philipp Taprogge

Hi!

Thus spake Bogus Exception on 05/11/2007 10:20 PM:
Interesting idea. I wonder what would be needed to enable the app
server to handle non-WS network traffic as you describe.

In the case of JBoss, you'd have to roll your own connector and add
it to the embedded tomcat to handle the udp syslog traffic. That
will require delving deeply into the guts of the server itself.
Whether it's worth it, is for you to decide.

Regards,

Phil
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

Thanks for writing. So I'll need to write the (network) server
component separate from the app server, then call a server component/
bean, right?

Not really.

You write your JCA adapter, package it in a .rar file, deploy
that to the app server and the JCA adapter calls a MDB deployed
like any other EJB and that MDB can call whatever code is needed.

Arne
 
B

Bogus Exception

Phil,

Thanks for writing, and continuing the thread. I'm sure it seems
tedious to you! :)

I don't see having the app server ensuring the (JCA) connector is
running as a problem. I'm curious about the code running in a separate
thread that is the actual UDP server, though. In a perfect world, the
app server could keep tabs on the UDP network server code
(singleton?).

It would be an odd restriction to have so many components of the
solution outside the container. What would you say is the most logical
design pattern for ease of deployment, and higher application
availability?

TIA!
 
B

Bogus Exception

Arne,

Thank you for writing. This covers the JCA connector in a way that is
still not controlled/monitored by the container. And the actual UDP
server code would also be a Tomcat servlet, right?

If so, is there no way to make the system more reliable?

TIA!
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

Bogus said:
Thank you for writing. This covers the JCA connector in a way that is
still not controlled/monitored by the container.
Wrong.

And the actual UDP
server code would also be a Tomcat servlet, right?

Wrong.

Try read about JCA.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top