1 22 package org.objectweb.petals.tools.ant; 23 24 import javax.management.MBeanServerConnection ; 25 import javax.management.remote.JMXConnector ; 26 27 import org.apache.tools.ant.BuildException; 28 import org.objectweb.petals.tools.ant.managers.InstallerAntTaskAbstract; 29 import org.objectweb.petals.tools.ant.util.JBIJMXConnectorUtil; 30 31 36 public class InstallSharedLibTask extends InstallerAntTaskAbstract { 37 38 public InstallSharedLibTask() { 39 super(); 40 } 41 42 47 public void execute() throws BuildException { 48 try { 49 JMXConnector connector = JBIJMXConnectorUtil.getConnection(host, 50 port, username, password); 51 MBeanServerConnection connection = connector 52 .getMBeanServerConnection(); 53 Object [] objects = new Object [1]; 54 objects[0] = file; 55 String [] strings = new String [1]; 56 strings[0] = "java.lang.String"; 57 Object result = performInstall(connection, INSTALL_SHARED_LIBRARY); 58 if (result instanceof String ) { 59 try { 60 log("Installed shared library name : " + (String ) result); 61 } catch (NullPointerException e) { 62 } 64 } 65 connector.close(); 66 } catch (Exception e) { 67 if (Boolean.parseBoolean(failOnError)) { 68 throw new BuildException(e.getMessage(), e.getCause()); 69 } 70 } 71 } 72 } 73 | Popular Tags |