Wow, that's a big topic :-) The first thing I'd suggest is to think
about using a full J2EE application server and packaging your
apps/modules as EARs/WARs/etc. J2EE already includes solutions to most
of the requirements you list below; in particular, you can use the app
server's deployment features to deploy new modules without re-deploying
BaseApp or any other modules. You can even deploy new modules without
restarting the server or any currently running apps/components.
Outside J2EE there is no 'standard' way of doing what you want. Neither
does Struts have any built-in support for doing so (though other
application frameworks may have their own ways to do this).
If you don't want to go the J2EE route, and you don't mind restarting
Tomcat when you deploy a new module, then all you really need is a way
to detect deployed modules at server startup time. Again, there's a
bunch of ways to do that. Some starting points for you to think about:
- have BaseApp look for per-module config files in some directory and
load modules dynamically based on what module config files exist
- package your modules as JARs, have BaseApp 'deploy' them like the app
server does a WAR file
- implement the Service Provider API (I think it's specified as part of
the JavaBeans spec? I can send you sample code if you want it); your
modules would just include an appropriate service provider config file
and BaseApp can find/load all installed modules with something like
Iterator modules = Service.providers(Module.class, true);
while (modules.hasNext()) {
Module m = (Module) modules.next();
m.initialize();
}
(where Module is a class or interface you define to represent a module).
I'm not sure what the problem is with authorization. As long as your
modules are written to work within the available
authentication/autorization framework, whatever that looks like, you
should be fine.
The upgrade issue is interesting since you'd presumably be deploying a
new BaseApp.war; any modules deployed 'inside' the old one would go
away. So, you either need to design a module deployment scheme that
stores modules somewhere outside the webapp itself, or make it a
requirement of the upgrade process that all modules be redeployed.
Like I said, it's a big topic, but that should be enough food for
thought for now ;-)
L.
Joe Bermann wrote:
Hi,
I’m looking for some advice on how to design a Struts-based webapp that
can accept dynamic plug-in components after deployment. I’ve searched
the archives and found some interesting posts about Struts Modules and
Single Sign On, but I didn’t find anything that addressed my situation
exactly.
I have a core webapp, let’s call it BaseApp, that contains a menu of
launch points to various features. After BaseApp is deployed and
running at a customer site, the time will come when I want to add a
launch point to a new feature there. In my current design I’ll need to
re-deploy an updated BaseApp that contains a new menu item and the new
feature. A much more flexible design would allow me “drop in” a new set
of files that the BaseApp would recognize and link to (after restarting
Tomcat). This way the BaseApp wouldn’t have to be updated,
re-qualified, or re-deployed (a huge savings at my company).
One of the problems is dealing with authorization issues – the users
should have to log in only once and should be automatically logged out
after a period of inactivity, regardless of where in the GUI they
click. Unfortunately the BaseApp has already been developed with custom
security code; container managed security was not used. After the
user’s password is authorized, a special object is stored in session
scope; the presence of that object indicates an authorized user.
Another problem is upgrading the software in the field. Eventually a
new version of the BaseApp will be released and the deployment in the
field needs to be upgraded. This means that any plug-ins need to be
upgraded too, or at least maintained (not wiped out).
I’ve thought of using separate webapps (i.e. the plug-in could be
packaged as a new webapp) with a dynamic menu in the BaseApp, but then
I’m faced with the authorization problems mentioned above.
Is there a standard pattern in Struts to satisfy these requirements
(will Struts Modules do what I need)? Is there some way to “drop in”
additional files into a pre-deployed webapp? Does anyone have
experience with these types of issues?
Thanks!
-- Joe
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]