Author: deepal
Date: Thu Sep  1 00:23:21 2005
New Revision: 265666

URL: http://svn.apache.org/viewcvs?rev=265666&view=rev
Log:
applying Chathuras' patch on GOC

Modified:
    
webservices/axis2/trunk/archive/java/scratch/jmx-front/src/org/apache/axis2/management/manager/JMXAdmin.java
    
webservices/axis2/trunk/archive/java/scratch/jmx-front/src/org/apache/axis2/management/manager/JMXManager.java
    
webservices/axis2/trunk/archive/java/scratch/jmx-front/src/org/apache/axis2/management/mbeans/Axis2Manager.java

Modified: 
webservices/axis2/trunk/archive/java/scratch/jmx-front/src/org/apache/axis2/management/manager/JMXAdmin.java
URL: 
http://svn.apache.org/viewcvs/webservices/axis2/trunk/archive/java/scratch/jmx-front/src/org/apache/axis2/management/manager/JMXAdmin.java?rev=265666&r1=265665&r2=265666&view=diff
==============================================================================
--- 
webservices/axis2/trunk/archive/java/scratch/jmx-front/src/org/apache/axis2/management/manager/JMXAdmin.java
 (original)
+++ 
webservices/axis2/trunk/archive/java/scratch/jmx-front/src/org/apache/axis2/management/manager/JMXAdmin.java
 Thu Sep  1 00:23:21 2005
@@ -1,9 +1,15 @@
 package org.apache.axis2.management.manager;

 

 import org.apache.axis2.context.ConfigurationContext;

-import org.apache.axis2.engine.AxisFault;

+import org.apache.axis2.AxisFault;

 import org.apache.axis2.management.mbeans.Axis2Manager;

 

+/**

+ * JMXAdmin creates necessary MBeans and registers them using the JMXManager. 
It is assumed that all

+ * MBean registrations will be done in this class. Currently Axis2 has only a 
single MBean to wrap

+ * its management functionality.

+ *

+ */

 public class JMXAdmin{

 

        /**

@@ -17,11 +23,11 @@
                try{

 

                        // Create MBeans

-                       String axis2ManagerName = 
"Axis2:type=management.Manager,index=1";

+                       String axis2ManagerName = 
"Axis2:type=management.Manager";

                        Axis2Manager axis2Manager = new 
Axis2Manager(configContext.getAxisConfiguration());

 

                        // Register MBeans using JMXManager

-                       JMXManagerR jmxManager = JMXManagerR.getJMXManagerR();

+                       JMXManager jmxManager = JMXManager.getJMXManager();

                        jmxManager.registerMBean(axis2Manager, 
axis2ManagerName);

 

 

@@ -31,4 +37,4 @@
 

        }

 

-}
\ No newline at end of file
+}


Modified: 
webservices/axis2/trunk/archive/java/scratch/jmx-front/src/org/apache/axis2/management/manager/JMXManager.java
URL: 
http://svn.apache.org/viewcvs/webservices/axis2/trunk/archive/java/scratch/jmx-front/src/org/apache/axis2/management/manager/JMXManager.java?rev=265666&r1=265665&r2=265666&view=diff
==============================================================================
--- 
webservices/axis2/trunk/archive/java/scratch/jmx-front/src/org/apache/axis2/management/manager/JMXManager.java
 (original)
+++ 
webservices/axis2/trunk/archive/java/scratch/jmx-front/src/org/apache/axis2/management/manager/JMXManager.java
 Thu Sep  1 00:23:21 2005
@@ -1,26 +1,37 @@
 package org.apache.axis2.management.manager;

 

-import org.apache.axis2.engine.AxisFault;

+import org.apache.axis2.AxisFault;

 

 import java.rmi.registry.LocateRegistry;

-import org.apache.commons.modeler.Registry;

+import java.util.Map;

 

-import javax.management.MBeanServer;

-import javax.management.MBeanServerFactory;

-import javax.management.ObjectName;

-import javax.management.remote.JMXConnectorServer;

-import javax.management.remote.JMXConnectorServerFactory;

-import javax.management.remote.JMXServiceURL;

+import java.lang.reflect.Method;

+import java.lang.reflect.Constructor;

+import java.lang.reflect.InvocationTargetException;

 

+

+/**

+ * JMXManager manages everything related to registering and publishing MBeans. 
It is not aware about

+ * the MBeans it is going to publish. Instead it provides a set of methods to 
register and publish any

+ * object as an MBean. Currently only JMXAdmin uses this to publish MBeans. 
But this can be used by any module

+ * to publish objects for management. This is a singleton class and the users 
should use the "getJMXManager"

+ * factory method to obtain an instance of this.

+ *

+ */

 public class JMXManager{

 

-       private Registry registry;

        private static JMXManager jmxManager = null;

-       private MBeanServer mbs = null;

-

-       JMXConnectorServer cs;

 

-       public static JMXManager getJMXManager(){

+       private Class registryClass = null;

+       private Object registry = null;

+       private Method registerComponent = null;

+

+       /**

+        * This is a factory method to create a JMXManager. Only one JMXManager 
instance is allowed.

+        *

+        * @throws AxisFault

+     */

+       public static JMXManager getJMXManager() throws AxisFault{

 

                if(jmxManager != null){

                        return jmxManager;

@@ -32,77 +43,138 @@
 

        }

 

-       private JMXManager(){

+

+       /**

+        * Initializes the modeler and publishes the MBeanServer in RMI.

+        *

+        * @throws AxisFault

+     */

+       private JMXManager() throws AxisFault{

 

                try{

-                       initMBeanServer();

+                       initModeler();

                        publishRMI();

                }catch(Exception e){

+                       throw AxisFault.makeFault(e);

                }

-       }

-

-

-       public void startMBeanServer() throws AxisFault{

-

-

-                try{

-                       //initMBeans();

-                }catch(Exception e){

-                       throw new AxisFault(e.getMessage());

-                }

 

        }

 

 

+       /**

+        * This method initializes the modeler registry. An MBeanServer is 
created if it was not alrady

+        * created.

+        *

+        * @throws AxisFault

+     */

+       public boolean initModeler() throws Exception{

 

-       public void initModeler() throws Exception{

-

-               Registry registry = Registry.getRegistry(null, null);

-               mbs = registry.getMBeanServer();

-

-       }

-

+               try {

+                       registryClass = 
Class.forName("org.apache.commons.modeler.Registry");

+               } catch (ClassNotFoundException e) {

+                       registry = null;

+                       return false;

+               }

 

-       public void registerModelerMBeans(Object mbean, String mbeanName) 
throws Exception{

+               try {

+                       Class[] getRegistryArgs = new Class[]{Object.class, 
Object.class,};

+                       Method getRegistry = 
registryClass.getMethod("getRegistry", getRegistryArgs);

+                       Object[] getRegistryOptions = new Object[]{null, null};

+                       registry = getRegistry.invoke(null, getRegistryOptions);

+

+                       Class[] registerComponentArgs = new 
Class[]{Object.class, String.class, String.class};

+                       registerComponent = 
registryClass.getMethod("registerComponent", registerComponentArgs);

+

+               } catch (IllegalAccessException e) {

+                       throw e;

+               } catch (IllegalArgumentException e) {

+                       throw e;

+               } catch (InvocationTargetException e) {

+                       throw e;

+               } catch (NoSuchMethodException e) {

+                       throw e;

+               }

 

-               registry.registerComponent(mbean, mbeanName, "Axis2Manager");

+               return true;

        }

 

 

-       private void initMBeanServer() throws Exception{

-

-                       // try to find existing MBeanServers. If there are no 
MBeanServers create a new one for Axis2

-                       if (MBeanServerFactory.findMBeanServer(null).size() > 
0) {

-                               mbs = (MBeanServer) 
MBeanServerFactory.findMBeanServer(null).get(0);

+       /**

+        * This method is used to register MBeans. It registers any object 
provided to it as an MBean.

+        * All public fields and methods of the object will be exposed for 
management.

+        *

+        * @param mbean

+        * @param mbeanName

+        * @throws AxisFault

+     */

+       public boolean registerMBean(Object mbean, String mbeanName) throws 
Exception{

+

+                       String context = "Axis2";

+

+                       if (registry != null) {

+                               Object args[] = new Object[]{mbean, mbeanName, 
context};

+                               try {

+                                       registerComponent.invoke(registry, 
args);

+                               } catch (IllegalAccessException e) {

+                                       return false;

+                               } catch (IllegalArgumentException e) {

+                                       return false;

+                               } catch (InvocationTargetException e) {

+                                       return false;

+                               }

+                               return true;

                        } else {

-                               mbs = MBeanServerFactory.createMBeanServer();

+                               return false;

                        }

-

-       }

+        }

 

 

-       public void registerMBean(Object mbean, String mbeanName) throws 
Exception{

 

-               ObjectName mbeanObjectName = ObjectName.getInstance(mbeanName);

-               mbs.registerMBean(mbean, mbeanObjectName);

-       }

+       /**

+        * Publishes the MBeanServer in RMI. Currently this method is called in 
the constructor, so that the

+        * MBeanServer is always published. But it is yet to be decided whether 
to make this optional. In such

+        * case JMXAdmin admin may call this, if it is activated by the 
adminstrator.

+        *

+        * @throws AxisFault

+     */

+       public void publishRMI() throws Exception{

 

+                       java.rmi.registry.Registry reg=null;    // RMI registry

 

-       public void publishRMI() throws Exception{

+                       // create RMI registry on port 9995

+                       try {

+                               if( reg==null )

+                                       reg=LocateRegistry.createRegistry(9995);

+                        } catch(Exception e) {

+                                       throw new AxisFault(e.getMessage());

+                        }

+

+                       // Retreive the MBeanServer used by the modeler

+                       Method getMBeanServer = 
registryClass.getMethod("getMBeanServer", null);

+                       Object mbs = getMBeanServer.invoke(registry, null);

+

+                       // create an JMXServiceURL object with the service URL

+                       Class jmxServiceURLClass = 
Class.forName("javax.management.remote.JMXServiceURL");

+                       Class[] constructorArgs = new Class[]{String.class};

+                       Constructor jmxServiceURLConstructor = 
jmxServiceURLClass.getConstructor(constructorArgs);

+

+                       String serviceURL = 
"service:jmx:rmi:///jndi/rmi://localhost:9995/axis2";

+                       Object jmxServiceURL = 
jmxServiceURLConstructor.newInstance(new String[]{serviceURL});

+

+                       // Create and start a JMXConnector server

+                       Class mbeanServerClass = 
Class.forName("javax.management.MBeanServer");

+                       Class jmxConnectorServerFactoryClass = 
Class.forName("javax.management.remote.JMXConnectorServerFactory");

+                       Class[] newJMXConnectorServerArgsTypes = new 
Class[]{jmxServiceURLClass, Map.class, mbeanServerClass};

+                       Method newJMXConnectorServer = 
jmxConnectorServerFactoryClass.getMethod("newJMXConnectorServer", 
newJMXConnectorServerArgsTypes);

+

+                       Object[] newJMXConnectorServerArgs = {jmxServiceURL, 
null, mbs};

+                       Object jmxConnectorServer = 
newJMXConnectorServer.invoke(null, newJMXConnectorServerArgs);

+

+                       Class jmxConnectorServerClass = 
Class.forName("javax.management.remote.JMXConnectorServer");

+                       Method start = 
jmxConnectorServerClass.getMethod("start", null);

+                       start.invoke(jmxConnectorServer, null);

 

-               // RMI registry

-               java.rmi.registry.Registry reg=null;

+               }

 

-               try {

-                       if( reg==null )

-                               reg=LocateRegistry.createRegistry(9995);

-                } catch(Exception e) {

-                               throw new AxisFault(e.getMessage());

-                }

-

-               JMXServiceURL url = new 
JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:9995/axis2");

-               cs = JMXConnectorServerFactory.newJMXConnectorServer(url, null, 
mbs);

-               cs.start();

-       }

 

-}
\ No newline at end of file
+}


Modified: 
webservices/axis2/trunk/archive/java/scratch/jmx-front/src/org/apache/axis2/management/mbeans/Axis2Manager.java
URL: 
http://svn.apache.org/viewcvs/webservices/axis2/trunk/archive/java/scratch/jmx-front/src/org/apache/axis2/management/mbeans/Axis2Manager.java?rev=265666&r1=265665&r2=265666&view=diff
==============================================================================
--- 
webservices/axis2/trunk/archive/java/scratch/jmx-front/src/org/apache/axis2/management/mbeans/Axis2Manager.java
 (original)
+++ 
webservices/axis2/trunk/archive/java/scratch/jmx-front/src/org/apache/axis2/management/mbeans/Axis2Manager.java
 Thu Sep  1 00:23:21 2005
@@ -6,19 +6,325 @@
 import org.apache.axis2.description.ModuleDescription;

 import org.apache.axis2.description.OperationDescription;

 import org.apache.axis2.engine.Phase;

-import org.apache.axis2.engine.AxisFault;

+import org.apache.axis2.AxisFault;

+import org.apache.axis2.description.Parameter;

+import org.apache.axis2.description.TransportInDescription;

+import org.apache.axis2.description.TransportOutDescription;

+

+import org.apache.wsdl.impl.WSDLServiceImpl;

 

 import javax.xml.namespace.QName;

 import java.util.*;

 

-public class Axis2Manager implements Axis2ManagerMBean{

+public class Axis2Manager{

 

        private AxisConfiguration axisConfig;

 

+

        public Axis2Manager(AxisConfiguration axisConfig){

                this.axisConfig = axisConfig;

        }

 

+

+       public String[] getGlobalParameters(){

+

+               String[] paramters = null;

+

+               try{

+                       ArrayList paramList = axisConfig.getParameters();

+                       paramters = new String[paramList.size()];

+

+                       for (int i = 0; i < paramList.size(); i++) {

+                                Parameter parameter = 
(Parameter)paramList.get(i);

+                                paramters[i] = parameter.getName() + ":" + 
parameter.getValue();

+                        }

+

+               }catch(Exception e){

+                       e.printStackTrace();

+               }

+

+               return paramters;

+       }

+

+

+       public String editGlobalParameter(String name, String value) {

+

+               String info = "";

+

+               try{

+                       Parameter parameter = axisConfig.getParameter(name);

+                       if(parameter == null)

+                               throw new Exception("Parameter: " + name + " 
not found.");

+

+                       parameter.setValue(value);

+                       info = "Parameter changed successfully.";

+               }catch(Exception e){

+                       info = e.getMessage();

+               }

+

+               return info;

+       }

+

+

+       public String[] getModuleParameters(String moduleName){

+

+               String[] paramters = null;

+

+               try{

+                       ModuleDescription moduleDesc = axisConfig.getModule(new 
QName(moduleName));

+                       ArrayList paramList = moduleDesc.getParameters();

+                       paramters = new String[paramList.size()];

+

+                       for (int i = 0; i < paramList.size(); i++) {

+                                Parameter parameter = 
(Parameter)paramList.get(i);

+                                paramters[i] = parameter.getName() + ":" + 
parameter.getValue();

+                        }

+

+               }catch(Exception e){

+                       e.printStackTrace();

+               }

+

+               return paramters;

+       }

+

+

+       public String editModuleParameter(String moduleName, String 
parameterName, String value) {

+

+               String info = "";

+

+               try{

+

+                       ModuleDescription moduleDesc = axisConfig.getModule(new 
QName(moduleName));

+                       Parameter parameter = 
moduleDesc.getParameter(parameterName);

+                       if(parameter == null)

+                               throw new Exception("Parameter: " + 
parameterName + " not found.");

+

+                       parameter.setValue(value);

+                       info = "Paramter changed successfully.";

+

+               }catch(Exception e){

+                       info = e.getMessage();

+               }

+

+               return info;

+       }

+

+

+       public String[] getTransportInParameters(String transportInName){

+

+               String[] paramters = null;

+

+               try{

+                       TransportInDescription transportInDesc = 
axisConfig.getTransportIn(new QName(transportInName));

+                       ArrayList paramList = transportInDesc.getParameters();

+                       paramters = new String[paramList.size()];

+

+                       for (int i = 0; i < paramList.size(); i++) {

+                                Parameter parameter = 
(Parameter)paramList.get(i);

+                                paramters[i] = parameter.getName() + ":" + 
parameter.getValue();

+                        }

+

+               }catch(Exception e){

+                       e.printStackTrace();

+               }

+

+               return paramters;

+       }

+

+

+       public String editTransportInParameter(String transportInName, String 
parameterName, String value) {

+

+               String info = "";

+

+               try{

+

+                       TransportInDescription transportInDesc = 
axisConfig.getTransportIn(new QName(transportInName));

+                       Parameter parameter = 
transportInDesc.getParameter(parameterName);

+                       if(parameter == null)

+                               throw new Exception("Parameter: " + 
parameterName + " not found.");

+

+                       parameter.setValue(value);

+                       info = "Paramter changed successfully.";

+

+               }catch(Exception e){

+                       info = e.getMessage();

+               }

+

+               return info;

+       }

+

+

+       public String[] getTransportOutParameters(String transportOutName){

+

+               String[] paramters = null;

+

+               try{

+                       TransportOutDescription transportOutDesc = 
axisConfig.getTransportOut(new QName(transportOutName));

+                       ArrayList paramList = transportOutDesc.getParameters();

+                       paramters = new String[paramList.size()];

+

+                       for (int i = 0; i < paramList.size(); i++) {

+                                Parameter parameter = 
(Parameter)paramList.get(i);

+                                paramters[i] = parameter.getName() + ":" + 
parameter.getValue();

+                        }

+

+               }catch(Exception e){

+                       e.printStackTrace();

+               }

+

+               return paramters;

+       }

+

+

+       public String editTransportOutParameter(String transportOutName, String 
parameterName, String value) {

+

+               String info = "";

+

+               try{

+

+                       TransportOutDescription transportOutDesc = 
axisConfig.getTransportOut(new QName(transportOutName));

+                       Parameter parameter = 
transportOutDesc.getParameter(parameterName);

+                       if(parameter == null)

+                               throw new Exception("Parameter: " + 
parameterName + " not found.");

+

+                       parameter.setValue(value);

+                       info = "Paramter changed successfully.";

+

+               }catch(Exception e){

+                       info = e.getMessage();

+               }

+

+               return info;

+       }

+

+

+       public String[] getServiceParameters(String serviceName){

+

+               String[] paramters = null;

+

+               try{

+                       ServiceDescription serviceDesc = 
axisConfig.getService(new QName(serviceName));

+                       ArrayList paramList = serviceDesc.getParameters();

+                       paramters = new String[paramList.size()];

+

+                       for (int i = 0; i < paramList.size(); i++) {

+                                Parameter parameter = 
(Parameter)paramList.get(i);

+                                paramters[i] = parameter.getName() + ":" + 
parameter.getValue();

+                        }

+

+               }catch(Exception e){

+                       e.printStackTrace();

+               }

+

+               return paramters;

+       }

+

+

+       public String editServiceParameter(String serviceName, String 
parameterName, String value) {

+

+               String info = "";

+

+               try{

+

+                       ServiceDescription serviceDesc = 
axisConfig.getService(new QName(serviceName));

+                       Parameter parameter = 
serviceDesc.getParameter(parameterName);

+                       if(parameter == null)

+                               throw new Exception("Parameter: " + 
parameterName + " not found.");

+

+                       parameter.setValue(value);

+                       info = "Paramter changed successfully.";

+

+               }catch(Exception e){

+                       info = e.getMessage();

+               }

+

+               return info;

+       }

+

+

+       public String[] getOperationParameters(String serviceName, String 
operationName){

+

+               String[] paramters = null;

+

+               try{

+                       ServiceDescription serviceDesc = 
axisConfig.getService(new QName(serviceName));

+                       OperationDescription operationDesc = 
serviceDesc.getOperation(new QName(operationName));

+                       ArrayList paramList = operationDesc.getParameters();

+                       paramters = new String[paramList.size()];

+

+                       for (int i = 0; i < paramList.size(); i++) {

+                                Parameter parameter = 
(Parameter)paramList.get(i);

+                                paramters[i] = parameter.getName() + ":" + 
parameter.getValue();

+                        }

+

+               }catch(Exception e){

+                       e.printStackTrace();

+               }

+

+               return paramters;

+       }

+

+

+       public String editOperationParameter(String serviceName, String 
operationName, String parameterName, String value) {

+

+               String info = "";

+

+               try{

+

+                       ServiceDescription serviceDesc = 
axisConfig.getService(new QName(serviceName));

+                       OperationDescription operationDesc = 
serviceDesc.getOperation(new QName(operationName));

+                       Parameter parameter = 
operationDesc.getParameter(parameterName);

+                       if(parameter == null)

+                               throw new Exception("Parameter: " + 
parameterName + " not found.");

+

+                       parameter.setValue(value);

+                       info = "Parameter changed successfully.";

+

+               }catch(Exception e){

+                       info = e.getMessage();

+               }

+

+               return info;

+       }

+

+

+       public String turnoffOperation(String serviceName, String 
operationName){

+

+               String info = "";

+

+               try{

+

+                       ServiceDescription serviceDesc = 
axisConfig.getService(new QName(serviceName));

+                       OperationDescription operationDesc = 
serviceDesc.getOperation(operationName);

+                       serviceDesc.removeOperation(operationDesc);

+

+                       info = "operation: " + operationName + " was turned off 
from the service: " + serviceName;

+

+               }catch(Exception e){

+                       info = e.getMessage();

+               }

+

+               return info;

+       }

+

+

+       public String removeService(String serviceName){

+

+               String info = "";

+

+               try{

+

+                       axisConfig.removeService(new QName(serviceName));

+                       info = "Service: " + serviceName + " removed 
successfully.";

+

+               }catch(Exception e){

+                       info = e.getMessage();

+               }

+

+               return info;

+       }

+

+

        public String[] getServices(){

 

                String[] services = null;

@@ -94,6 +400,58 @@
        }

 

 

+       public String[] getTransportIns(){

+

+               String[] transportIns = null;

+               ArrayList transportInList = new ArrayList();

+

+               // get the transportIn list

+               HashMap transportInMap = 
((AxisConfigurationImpl)axisConfig).getTransportsIn();

+               if(transportInMap!=null && !transportInMap.isEmpty()){

+                       Collection transportInCollection = 
transportInMap.values();

+

+                       transportIns = new String[transportInCollection.size()];

+                       int i=0;

+                       for(Iterator iterator=transportInCollection.iterator(); 
iterator.hasNext();){

+                               TransportInDescription axisTransportIn = 
(TransportInDescription)iterator.next();

+                               String transportInName = 
axisTransportIn.getName().getLocalPart();

+

+                               transportIns[i] = transportInName;

+                               i++;

+                       }

+

+               }

+

+               return transportIns;

+       }

+

+

+       public String[] getTransportOuts(){

+

+               String[] transportOuts = null;

+               ArrayList transportOutList = new ArrayList();

+

+               // get the transportOut list

+               HashMap transportOutMap = 
((AxisConfigurationImpl)axisConfig).getTransportsOut();

+               if(transportOutMap!=null && !transportOutMap.isEmpty()){

+                       Collection transportOutCollection = 
transportOutMap.values();

+

+                       transportOuts = new 
String[transportOutCollection.size()];

+                       int i=0;

+                       for(Iterator 
iterator=transportOutCollection.iterator(); iterator.hasNext();){

+                               TransportOutDescription axisTransportOut = 
(TransportOutDescription)iterator.next();

+                               String transportOutName = 
axisTransportOut.getName().getLocalPart();

+

+                               transportOuts[i] = transportOutName;

+                               i++;

+                       }

+

+               }

+

+               return transportOuts;

+       }

+

+

        public String[] getFaultyModules(){

 

                String[] faultyModules = null;

@@ -186,7 +544,23 @@
                        info = "Module: " + moduleName + " globally enagaged 
successfully.";

                }

                catch(AxisFault axisFault){

-                       info = "Module: " + moduleName + " failed to engage 
globally.";

+                       info = "Module: " + moduleName + " failed to engage 
globally.\n" + axisFault.getMessage();

+               }

+

+               return info;

+       }

+

+

+       public String disengageModuleGlobally(String moduleName){

+

+               String info = "";

+

+               try{

+                       axisConfig.disengageModule(new QName(moduleName));

+                       info = "Module: " + moduleName + " globally disenagaged 
successfully.";

+               }

+               catch(AxisFault axisFault){

+                       info = "Module: " + moduleName + " failed to disengage 
globally.\n" + axisFault.getMessage();

                }

 

                return info;

@@ -201,12 +575,12 @@
 

                        try {

 

-                               axisConfig.getService(new 
QName(serviceName)).engageModule(axisConfig.getModule(new QName(moduleName)));

+                               axisConfig.getService(new 
QName(serviceName)).engageModule(axisConfig.getModule(new QName(moduleName)), 
axisConfig);

                                info = "Module " + moduleName + " is 
successfully engaged to the service " + serviceName;

 

                        } catch (AxisFault axisFault) {

 

-                               info = "Failed to engage the module " + 
moduleName + " to the service " + serviceName;

+                               info = "Failed to engage the module " + 
moduleName + " to the service " + serviceName + "\n" + axisFault.getMessage();;

                        }

         }

 

@@ -214,6 +588,27 @@
        }

 

 

+       public String disengageModuleFromService(String moduleName, String 
serviceName){

+

+                       String info = "";

+

+                       if ( moduleName != null && serviceName != null) {

+

+                               try {

+

+                                       axisConfig.getService(new 
QName(serviceName)).disengageModule(axisConfig.getModule(new 
QName(moduleName)));

+                                       info = "Module " + moduleName + " is 
successfully disengaged from the service " + serviceName;

+

+                               } catch (AxisFault axisFault) {

+

+                                       info = "Failed to disengage the module 
" + moduleName + " from the service " + serviceName + "\n" + 
axisFault.getMessage();

+                               }

+               }

+

+                       return info;

+       }

+

+

        public String engageModuleToOperation(String moduleName, String 
serviceName, String operationName){

 

                String info = "";

@@ -226,14 +621,32 @@
                                info = moduleName + " module engaged to the 
operation Successfully";

 

                        } catch (AxisFault axisFault) {

-                               info = info = "Failed to engage the module " + 
moduleName + " to the operation " + operationName;

+                               info = info = "Failed to engage the module " + 
moduleName + " to the operation " + operationName + "\n" + 
axisFault.getMessage();

                        }

         }

 

                return info;

-

        }

 

 

+       public String disengageModuleFromOperation(String moduleName, String 
serviceName, String operationName){

+

+                       String info = "";

+

+                       if ( moduleName != null && serviceName != null && 
operationName != null) {

+                               try {

+                                       OperationDescription operation = 
axisConfig.getService(new QName(serviceName)).getOperation(new 
QName(operationName));

+                                       
operation.disengageModule(axisConfig.getModule(new QName(moduleName)));

+

+                                       info = moduleName + " module disengaged 
from the operation Successfully";

+

+                               } catch (AxisFault axisFault) {

+                                       info = info = "Failed to disengage the 
module " + moduleName + " from the operation " + operationName + "\n" + 
axisFault.getMessage();

+                               }

+               }

+

+                       return info;

+       }

+

 

-}
\ No newline at end of file
+}



Reply via email to