[jboss-dev-forums] [Design of POJO Server] - BSH script from client

alesj do-not-reply at jboss.com
Wed Nov 7 12:52:08 EST 2007


I've ported the old BSH deployer to our new deployers - splitting it in two: parsing and real BeanShellScript deployer.

The thing that I haven't ported is this:

  |    public URL createScriptDeployment(String bshScript, String scriptName)
  |       throws DeploymentException
  |    {
  |       try
  |       {
  |          File scriptFile = File.createTempFile(scriptName, ".bsh");
  |          FileWriter fw = new FileWriter(scriptFile);
  |          try
  |          {
  |             fw.write(bshScript);
  |          }
  |          finally
  |          {
  |             fw.close();
  |          }
  | 
  |          URL scriptURL = scriptFile.toURL();
  |          mainDeployer.deploy(scriptURL);
  |          return scriptURL;
  |       }
  |       catch(IOException e)
  |       {
  |          throw new DeploymentException("Failed to deploy: "+scriptName, e);
  |       }
  |    }
  | 

Since with the new aspectized deployers all we need to do is to create BeanShellScript instance and put it in deployment attachments, where it will be picked-up by the bsh-script aspect deployer.

Where/how is the best place to put this - if we still need it?
Registering a separate (m)bean, which holds a ref to main deployer and creates new deployment on the fly with just the script instance attached?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4102641#4102641

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4102641



More information about the jboss-dev-forums mailing list