On Sun, 18 Feb 2001, Toby Allsopp wrote:
> Pretty much all I have in mind so far is that the EAR deployer doesn't
> want to keep a hard-coded list of the type of modules that it can
> deploy, although I'm not sure that that's even the best idea because it
> is pretty clearly specified what an EAR can contain.
>
> So, perhaps there needs to be a general deployer that knows how to
> deploy anything for which a deployer is registered. The EAR deplyer will
> be one of these and it can then pass the deployment of EJB-JARs, WARs,
> RARs and whatever else back to the general deployer.
I think you can definitely define a generic "deployer" interface,
but the problem is how to represent the thing to be deployed. I think the
only generic way to do it is as an InputStream or ClassLoader, though you
could always start with a JarFile... In any case, it's probably safe to
define the types or archives that an EAR may contain, but you could
definitely do as you suggest and use multiple instances of the same
"deployer" interface for the different archive types:
earDeployer.registerDeployer(".war", new WarDeployer());
earDeployer.registerDeployer(".jar", new EjbDeployer());
...
earDeployer.deploy(ear)
calls getDeployer(".war").deploy(war) for each WAR
getDeployer(".jar").deploy(jar) for each JAR
...
Aaron