Author: ruwan Date: Wed Dec 3 02:15:53 2008 New Revision: 25633 URL: http://wso2.org/svn/browse/wso2?view=rev&revision=25633
Log: Hide the __SynapseService using the ESBActivator Modified: trunk/esb/java/modules/core/src/main/java/org/wso2/esb/core/ESBActivator.java Modified: trunk/esb/java/modules/core/src/main/java/org/wso2/esb/core/ESBActivator.java URL: http://wso2.org/svn/browse/wso2/trunk/esb/java/modules/core/src/main/java/org/wso2/esb/core/ESBActivator.java?rev=25633&r1=25632&r2=25633&view=diff ============================================================================== --- trunk/esb/java/modules/core/src/main/java/org/wso2/esb/core/ESBActivator.java (original) +++ trunk/esb/java/modules/core/src/main/java/org/wso2/esb/core/ESBActivator.java Wed Dec 3 02:15:53 2008 @@ -1,8 +1,12 @@ package org.wso2.esb.core; +import org.apache.axis2.AxisFault; import org.apache.axis2.context.ConfigurationContext; +import org.apache.axis2.description.AxisServiceGroup; import org.apache.axis2.description.Parameter; import org.apache.axis2.engine.AxisConfiguration; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.synapse.ServerManager; import org.apache.synapse.Startup; import org.apache.synapse.SynapseConstants; @@ -20,6 +24,8 @@ BundleContext bundleContext; + private static final Log log = LogFactory.getLog(ESBActivator.class); + public void start(BundleContext bundleContext) throws Exception { this.bundleContext = bundleContext; bundleContext.addBundleListener(this); @@ -46,11 +52,17 @@ } if (event.getType() == BundleEvent.STARTED) { - initESB(); + try { + initESB(); + } catch (Exception e) { + String message = "Couldn't initialize the ESB..."; + log.fatal(message, e); + throw new RuntimeException(message); + } } } - private void initESB() { + private void initESB() throws AxisFault { SynapseConfiguration synConfig = null; ServiceReference ref = bundleContext.getServiceReference(ConfigurationContextService.class.getName()); Object serviceObject = bundleContext.getService(ref); @@ -58,6 +70,11 @@ ConfigurationContext configContext = ((ConfigurationContextService) serviceObject).getServerConfigContext(); AxisConfiguration axisConf = configContext.getAxisConfiguration(); + + AxisServiceGroup serviceGroup = axisConf.getServiceGroup(SynapseConstants.SYNAPSE_SERVICE_NAME); + serviceGroup.addParameter("adminService", "true"); + serviceGroup.addParameter("DoAuthentication", "false"); + Parameter synEnv = axisConf.getParameter(SynapseConstants.SYNAPSE_ENV); Parameter synCfg _______________________________________________ Esb-java-dev mailing list [email protected] https://wso2.org/cgi-bin/mailman/listinfo/esb-java-dev
