1 24 25 package com.rift.coad.lib.thirdparty.axis; 27 28 import org.apache.axis.AxisEngine; 30 import org.apache.axis.server.AxisServer; 31 import org.apache.axis.management.ServiceAdmin; 32 import org.apache.axis.configuration.EngineConfigurationFactoryFinder; 33 import org.apache.axis.EngineConfiguration; 34 35 36 42 public class AxisManager { 43 44 private static AxisManager singleton = null; 46 47 private AxisServer server = null; 49 50 51 56 private AxisManager() throws AxisException { 57 try { 58 EngineConfiguration config = 59 EngineConfigurationFactoryFinder.newFactory(). 60 getServerEngineConfig(); 61 server = new AxisServer(config); 62 } catch (Exception ex) { 63 throw new AxisException("Failed to instanciate the Axis Manager: " 64 + ex.getMessage(),ex); 65 } 66 } 67 68 69 72 public static void init() throws AxisException { 73 if (singleton == null) { 74 singleton = new AxisManager(); 75 } 76 } 77 78 84 public static AxisManager getInstance() throws AxisException { 85 if (singleton == null) { 86 throw new AxisException( 87 "The Axis engine has not been initialized."); 88 } 89 return singleton; 90 } 91 92 93 98 public AxisServer getServer() { 99 return server; 100 } 101 } 102 | Popular Tags |