Is it possible to deploy an application to a GlassFish app server that would behave more like a daemon than a web app? I'd like to set up some sort of daemon app that would relay requests to an API that only allows for one connection at a time.
This way I could have multiple servlet instances that could simply submit API requests through the daemon and avoid ever needing more than one connection to the API.
I'm fairly new to Java-based web apps, so I'm not entirely certain what to search for, or if this kind of functionality is available in, say, the Java-EE development kit. Any help appreciated!
Updates/Ideas:
GlassFish v3 supports EJB 3.1 Singleton Beans:
A Singleton Bean could be used to implement the requirement "relay requests to an API that only allows for one connection at a time".
By default, all Singleton methods are made thread-safe and transactional. This means that all multithreaded access to the bean is serialized (...)