[jbosstools-dev] Deploying a .ds (or any resource)

Rob Stryker rob.stryker at redhat.com
Wed Aug 8 18:02:30 EDT 2007


Here is some example code I've thrown together. The code below should 
work, except that the publisher is *not* yet ready to handle it. 
However, the APIs will work.

             // get a path somehow. you can also use resource. Look at 
SingleDeployableFactory's static methods
                    IPath p = new Path("/abc/1.txt");

// mark this path or resource deployable.
                    SingleDeployableFactory.makeDeployable(p);

// get the actual module object from the factory
                    IModule module = SingleDeployableFactory.findModule(p);
                   
                    IServer s = someServer // wherever you get your 
server from

// convert it to a DeployableServer instance
                    Object o = 
s.loadAdapter(DeployableServerBehavior.class, null);

// if its not null, the adaptation worked.
                    if( o != null )

// custom API to deploy / publish only one module.                     
    ((DeployableServerBehavior)o).publishOneModule(IServer.PUBLISH_FULL, 
new IModule[] {module}, ServerBehaviourDelegate.ADDED, new 
NullProgressMonitor());




If there are any questions ask me. Again, the last step will not yet 
work because the publisher is not ready to handle these, but the factory 
should be up and running.

- Rob Stryker



More information about the jbosstools-dev mailing list