1 22 package org.objectweb.petals.tools.ant.managers; 23 24 import java.net.URL ; 25 26 import javax.management.MBeanServerConnection ; 27 28 import org.apache.tools.ant.BuildException; 29 import org.objectweb.petals.tools.ant.util.JBIJMXConnectorUtil; 30 31 37 public abstract class InstallerAntTaskAbstract extends JBIAntTaskAbstract { 38 39 42 protected static final String INSTALL_SHARED_LIBRARY = "installSharedLibrary"; 43 44 47 protected static final String LOAD_NEW_INSTALLED = "loadNewInstaller"; 48 49 52 protected String file; 53 54 61 protected Object performInstall(MBeanServerConnection connection, 62 String action) throws Exception { 63 if (file == null) { 64 throw new BuildException("Required attribute : file"); 65 } 66 new URL (file); 68 Object [] objects = new Object [1]; 69 objects[0] = file; 70 String [] strings = new String [1]; 71 strings[0] = "java.lang.String"; 72 Object result = connection.invoke(JBIJMXConnectorUtil 73 .getInstallationServiceMBeanName(connection), action, objects, 74 strings); 75 return result; 76 } 77 78 public void setFile(String file) { 79 this.file = file; 80 } 81 82 } 83 | Popular Tags |