/** * Creates in instance of <code>AdminClient</code> and * invokes <code>process(args)</code>. * <p>Diagnostic output goes to <code>log.info</code>.</p> * @param args Commands to process */ public static void main (String[] args) { try { AdminClient admin = new AdminClient(); String result = admin.process(args); if (result != null) { System.out.println( StringUtils.unescapeNumericChar(result) ); } else { System.exit(1); } } catch (AxisFault ae) { System.err.println(Messages.getMessage("exception00") + " " + ae.dumpToString()); System.exit(1); } catch (Exception e) { System.err.println(Messages.getMessage("exception00") + " " + e.getMessage()); System.exit(1); } } }
/** * Creates in instance of <code>AdminClient</code> and * invokes <code>process(args)</code>. * <p>Diagnostic output goes to <code>log.info</code>.</p> * @param args Commands to process */ public static void main (String[] args) { try { AdminClient admin = new AdminClient(); String result = admin.process(args); if (result != null) { System.out.println( StringUtils.unescapeNumericChar(result) ); } else { System.exit(1); } } catch (AxisFault ae) { System.err.println(Messages.getMessage("exception00") + " " + ae.dumpToString()); System.exit(1); } catch (Exception e) { System.err.println(Messages.getMessage("exception00") + " " + e.getMessage()); System.exit(1); } } }
/** * Creates in instance of <code>AdminClient</code> and * invokes <code>process(args)</code>. * <p>Diagnostic output goes to <code>log.info</code>.</p> * @param args Commands to process */ public static void main (String[] args) { try { AdminClient admin = new AdminClient(); String result = admin.process(args); if (result != null) { System.out.println( StringUtils.unescapeNumericChar(result) ); } else { System.exit(1); } } catch (AxisFault ae) { System.err.println(Messages.getMessage("exception00") + " " + ae.dumpToString()); System.exit(1); } catch (Exception e) { System.err.println(Messages.getMessage("exception00") + " " + e.getMessage()); System.exit(1); } } }
protected void undeploy(JMXServiceURL address, Map environment) throws IOException { String path = address.getURLPath(); if (!path.endsWith("/")) path += "/"; String undeployPath = path + AXIS_DEPLOY_SERVICE; JMXServiceURL temp = new JMXServiceURL(address.getProtocol(), address.getHost(), address.getPort(), undeployPath); String undeployEndpoint = getEndpoint(temp, environment); try { AdminClient deployer = new AdminClient(); Options options = new Options(null); options.setDefaultURL(undeployEndpoint); InputStream wsdd = getClass().getResourceAsStream(SERVER_UNDEPLOY_WSDD); if (wsdd == null) throw new IOException("Could not find AXIS deployment descriptor " + SERVER_UNDEPLOY_WSDD); deployer.process(options, wsdd); } catch (Exception x) { Logger logger = getLogger(); if (logger.isEnabledFor(Logger.INFO)) logger.info("Exception while undeploying AXIS service", x); throw new IOException("Could not undeploy connector server " + x.toString()); } } }
protected void deploy(JMXServiceURL address, Map environment) throws IOException { String path = address.getURLPath(); if (!path.endsWith("/")) path += "/"; String deployPath = path + AXIS_DEPLOY_SERVICE; JMXServiceURL temp = new JMXServiceURL(address.getProtocol(), address.getHost(), address.getPort(), deployPath); String deployEndpoint = getEndpoint(temp, environment); try { AdminClient deployer = new AdminClient(); Options options = new Options(null); options.setDefaultURL(deployEndpoint); InputStream wsdd = getClass().getResourceAsStream(SERVER_DEPLOY_WSDD); if (wsdd == null) throw new IOException("Could not find AXIS deployment descriptor"); deployer.process(options, wsdd); } catch (RuntimeException x) { throw x; } catch (Exception x) { Logger logger = getLogger(); if (logger.isEnabledFor(Logger.INFO)) logger.info("Exception while deploying AXIS service", x); throw new IOException("Could not deploy connector server to AXIS " + x.toString()); } }
private void executeInCurrentVM(String[] args) { //now create a client and invoke it AdminClient admin = null; try { admin = new AdminClient(true); } catch (ServiceException e) { throw new BuildException("failed to start the axis engine", e); } String result = null; try { result = admin.process(args); if (result != null) { log(result); } else { logOrThrow(getTaskName() + " got a null response"); } } catch (AxisFault fault) { log(fault.dumpToString(), Project.MSG_ERR); traceParams(Project.MSG_ERR); logOrThrow(getTaskName() + " failed with " + fault.getFaultCode().toString() + " " + fault.getFaultString()); } catch (BuildException e) { //rethrow these throw e; } catch (Exception e) { throw new BuildException("Exception in " + getTaskName(), e); } }