I would like to embed Jetty into a server app that I am writing. The Embbeded Jetty engine will be used to host various web apps that will directly integrate with the server applications internals. I would like to package the web apps into separate WAR files and write them so they are independent of the server. Sharing only the code that they use in common with the server.
How can a configure each ServletContext with the objects from the server without the Web App needing to know how to acquire them from the process Jetty is embedded in?
Example Outline of Server process life cycle:
- Boot and load config
- Setup internal objects that live for the entire process
- Create handles the web apps can use to access internal state
- Launch Embedded Jetty Engine
- Expose the handles that the web app has requested via some form of configuration. (how can i do this??)
- Handle incoming connections
- Wait for termination/shutdown single
- Clean up resources
- Exit
The idea is to deploy the web apps in Jetty. When the web apps are initialized the server will read some config for the web app and then expose the handles need to access the data they are interested in.
The problem is that the server is not a J2EE application so EJB's are out.
Aucun commentaire:
Enregistrer un commentaire