Hi,

I have submitted a patch converting ConfigurationService into a Deployer. 
This allows you to add and remove configuration "sets" specified in jcml
files while the server is running.  For instance, you can add and remove
ConnectionFactories or DataSources, a feature that has been requested
several times.

There are two ways to use this at present, by deploying an URL to a .jcml
file or by using the autodeployer and copying the .jcml file into a deploy
directory.

An obvious extension, not yet implemented, is to modify the J2EE deployer
to deploy .jcml files it finds in archives it is deploying.  I will
undertake this if asked.

This introduces some slight modifications in the behavior and interface of
ServiceControl, and fixes a bug in ServiceControl (unregister did not
work).

Here is the readme from the patch:

This modification changes the ConfigurationService mbean into a Deployer.

This allows you to deploy and undeploy jboss.jcml-format files containing
any mbeans you want, such as resource adapters or connection factories.

The test program demonstrates deploying and undeploying a datasource from a
.jcml file contained in a jar file.

By modifying the AutoDeployer entry to: 

  <!-- ====================================================================
-->
  <!-- Auto deployment                                                     
-->
  <!-- ====================================================================
-->
  <mbean code="org.jboss.ejb.AutoDeployer" name="EJB:service=AutoDeployer">
    <attribute name="Deployers">
      J2EE:service=J2eeDeployer;
      JCA:service=RARDeployer;
      DefaultDomain:service=Configuration
    </attribute>
    <attribute name="URLs">../deploy,../deploy/lib</attribute>
  </mbean>

xxx.jcml files may be autodeployed by dropping them into/removing them from
the deploy directories.


IMPORTANT NOTE:

In order to assure undeployability, each deployed .jcml file should include
an mbean of the form

  <mbean code="org.jboss.util.ServiceControl"
name="Test:service=ServiceControl,servicecontrolname=Test"/>

where the servicecontrolname should be unique.

This ServiceControl is used to init, start, stop, and destroy the mbeans
specified in the rest of the file.

MODIFICATION TO PREVIOUS JBOSS BEHAVIOR:

Previously the unregister method of ServiceControl did not appear to work,
since the proxies from the mbean server apparently couldn't tell if they
were equal so they could be removed from the ArrayList.  I have replaced
the mbean ArrayList with two, for ObjectName and Service, using the
ObjectName to identify the services.

As a more substantial alteration, I have made the destroy method on
ServiceControl unregister the destroyed mbeans from the mbean server.

FUTURE WORK:

Modify the J2EE deployer to deploy .jcml files found within an archive it
is deploying.

Extend the test class to test that all service mbeans can be started and
stopped repeatedly.

Thanks

David Jencks

[EMAIL PROTECTED]


_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to