Hello, Jbossers
It seems that for the benefit of the wider audience I'll start with the
deployment scripting idea. For those interested in what drove me to the
idea, see below in the security part (I am sure people will have their
own use-cases for this stuff, I remember discussions from before)
For my project I need to be able not only to deploy/undeploy services on
the fly but, sometimes this is insufficient, I also need to stich them
together after deploy, unstich before undeploy, say by invoking a bunch
of methods on a bunch of MBeans.
This is clearly a deployment issue, perhaps, there is a need to move
from 'Slackware'-style packaging to 'Debian'-style packaging for
components (or at least, add extensions people can use). To explain the
analogy:
Slackware used plain old tgz's for its packages which one would just
untar and that's it. This works for simple things but when the system
grows and packages become more dependent on other packages and
versioning info, etc., this does not cut it anymore.
Debian uses a sophisticated package format with a whole bunch of stuff
packed into the package, like dependency information, pre-/post-
-installation/-configuration/-removal scripts that can modify/unmodify
various config files, etc. Obviously, in the simplest form a .deb can be
do as little as a .tgz does.
The simplest scripting tool which would be suitable for quick jobs like
the one I need, would be something based on Apache Jelly.
Let's say, the *-service.xml is not really a descriptor (though it
appears as such, we don't need to change old descriptors either) but,
say the JBoss DeployerMBean, instead of treating it as plain XML
interprets it as a Jelly script. JBoss provides a standard JBoss tag
library that interprets the tags for the *-service.xml, say, <mbean> tag
deploys the MBean specified by the tag's attributes and configures it
appropriately. So, a simple deployment descriptor would not notice any
difference. But, say you add another attributed to the <mbean> tag, say,
'referenceVar' which specifies the name of the variable under which the
object name of the newly created bean will be stored in the JellyContext
in which this script is running. Then, one can simply add a scripting
section at the end of *-service.xml which manipulates the initialized
variables, e.g. through custom jelly tags locate and invoke methods on
MBeans specified by variables from the JellyContext:
<mbean code="xxx" name="yyy" refVar="mbeanX"/>
<jmxinvoke targetObj="${mbeanX}" method=${methodDesc} args="${args}" />
where jmxinvoke is a custom Jelly tag which takes a target object name,
method description object and arguments array and does the invocation.
Obviously this is very similar to the jsp tags, which is exactly the
point of Jelly. So, with properly defined tags for invocation, exception
handling, etc, one can do simple meta-programming of MBeans during
deployment.
At the end, the DeployerMBean which processes this script, checks for
exceptions coming from the script execution and deals with them
according to the convention: calls the cleanup section of the script or
whatever. (By clean-up section I mean that the *-service.xml can be made
of sections which the deployer 'executes' depending on whether previous
stages succeed/fail)
This is the end of deployment issue/proposal. Now the security question.
Here is the problem setting:
I need to be able to have deploy any JBoss service, possibly multiple
instances, simultaneously on the same server. For that I have an
infrastructure for reconfiguring JBoss descriptors of services. For
example, for JBossMQ, I make sure that all MBeans that comprise JBossMQ
have unique object IDs, all JNDI objects exported by the service are
also uniquefied, that all cross-references are correct, etc. It turns
out that this is not enough. One aspect (yeah that 'a'-word again) of
deploying JBossMQ is completely separated from jbossmq-service.xml and
cannot be folded into *-service.xml. Namely, it is configuring security
for this particular JBossMQ instance.
It turns out (as for 3.0.4) that login-conf.xml contains an application
policy for 'jbossmq' which has a reference to a particular JBossMQ
MBean, namely StateManager. Since I always change the object name of
this MBean, I need to be able to deploy the login-config on the fly. It
would seem that ideally, one should be able to deploy the JBossMQ
service together with specification of its security domain.
My thought was, well, I'll just create my custom login-conf.xml with an
entry for just JBossMQ that I am deploying and would utilize the
XMLLoginConfig MBean, which I would deploy together with MQ. As it turns
out, this is not sufficient (silly me). After looking further into
security architecture, I can only fully replace the current
Configuration with a new one. My idea was to allow changes to the
current configuration. Is this idea crazy or not?
Well if it is not crazy, then, the best solution would be to deploy the
XMLLoginConfig together with JBossMQ beans and then have a deployment
scripting facility invoke appropriate methods to register the new
LoginConfig with the SecurityConfig MBean so it appropriately ammends
the current config. This is how I came to the deployment scripting facility.
-- Anatoly.
-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development
- Re: [JBoss-dev] deployment scripts + extending Configurat... Anatoly Akkerman
- Re: [JBoss-dev] deployment scripts + extending Confi... David Jencks
- Re: [JBoss-dev] deployment scripts + extending C... Anatoly Akkerman
- Re: [JBoss-dev] deployment scripts + extending C... Adam Heath
- Re: [JBoss-dev] deployment scripts + extending Confi... Scott M Stark
- Re: [JBoss-dev] deployment scripts + extending C... Anatoly Akkerman
- Re: [JBoss-dev] deployment scripts + extendi... Scott M Stark
- Re: [JBoss-dev] deployment scripts + ext... Peter Antman
- Re: [JBoss-dev] deployment scripts + extending Confi... Adam Heath
