Creating App Server API

R

Robert M. Gary

I have a customer that is asking all his vendors to provide their
API's via a Web Container. My marketing guy seems to believe this
would be useful for other customers.
Much of the API can be provided to the customer in the form on session
bean, whereby I can provide the customer a bean that would then go out
to my network product and retrieve data.
However, another facet of our product is that the customer needs to be
able to be notified of network events. Typically this would be done in
an API but having them register an interface that I would call with
the data after I've done some processing on it.
However, I don't see any design patterns whereby I can provide that
funtionality in a container. Because I don't have control over the
lifetime of an enterprise bean in a container I can't (I don't think)
have a long lived bean that provides this service and then calls the
customer's interface for notification. I'm also not suppose to spawn
threads from an enterprise bean. I've also looked at just providing
the data via JMS. If I produce the JMS message within the container
though I still have the same problem of needing a long lived bean in
the container to listen on the socket, do the processing, and then
produce on the JMS. It doesn't appear I can produce the JMS message
from the remote network based process because of very specific
security requirements on the transport mechanism. some containers
offer some security but none of them appear to meet the requirements
imposed on me such that I can transport customer data across a network
with it.

So, I'm looking for other design pattern ideas whereby I can provide a
notification mechanism to a customer that runs in an App server.
Although I can't write this to a specific App Server (without limiting
what other customers may want) this particular customer is running
WebSphere.

-Robert
 
M

Mark Space

Robert said:
So, I'm looking for other design pattern ideas whereby I can provide a
notification mechanism to a customer that runs in an App server.
Although I can't write this to a specific App Server (without limiting
what other customers may want) this particular customer is running
WebSphere.

Maybe I'm being naive here but I think you should look into
javax.servlet.ServletContextListener for this. Install your network
widget in the contextInitialized() method and remove it when
contextDestroyed() is invoked.

If you're looking for a network API through the container, nothing comes
to mind. You might just have to use plain old Java for that. Or worst
case JNI. Which will definitely be non-portable with out a lot (!) of work.

What sort of network events are you trying to report on?
 
R

Robert M. Gary

Robert M. Gary wrote:
Maybe I'm being naive here but I think you should look into
javax.servlet.ServletContextListener for this.  Install your network
widget in the contextInitialized() method and remove it when
contextDestroyed() is invoked.

I think my challenge though is that I would need to have something
long lived in the App Server to generate this notification to my
clients. My code needs to listen on an SSL socket, do some
computation, and then notify the customer's (bean, JMS, whatever).
If you're looking for a network API through the container, nothing comes
to mind.  You might just have to use plain old Java for that.  Or worst
case JNI.  Which will definitely be non-portable with out a lot (!) of work.

What sort of network events are you trying to report on?

The events are already normalized by our remote traditional Java based
process running remote on the network. I'm really just trying to get
those events into something I can notify a customer's code in an App
Server on. Normally these events go into our own Rule's based engine
where the customer writes 3G rules based on the events. This
particular customer is asking for that same information to be provided
to his own Java code in an App Server.

-robert
 

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,989
Messages
2,570,207
Members
46,782
Latest member
ThomasGex

Latest Threads

Top