You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by mi...@apache.org on 2009/01/29 04:50:11 UTC
svn commit: r738740 - in
/ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2:
SoapExternalService.java hooks/ODEAxisService.java
Author: midon
Date: Thu Jan 29 03:50:11 2009
New Revision: 738740
URL: http://svn.apache.org/viewvc?rev=738740&view=rev
Log:
ODE-415: make sure the modules mentioned in {$process}.axis2 are
engaged.
Modified:
ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/SoapExternalService.java
ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/hooks/ODEAxisService.java
Modified: ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/SoapExternalService.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/SoapExternalService.java?rev=738740&r1=738739&r2=738740&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/SoapExternalService.java (original)
+++ ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/SoapExternalService.java Thu Jan 29 03:50:11 2009
@@ -27,11 +27,9 @@
import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.context.ConfigurationContext;
import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.deployment.ServiceBuilder;
import org.apache.axis2.description.AxisService;
import org.apache.axis2.description.OutInAxisOperation;
import org.apache.axis2.description.OutOnlyAxisOperation;
-import org.apache.axis2.description.AxisModule;
import org.apache.axis2.engine.AxisConfiguration;
import org.apache.axis2.transport.jms.JMSConstants;
import org.apache.axis2.wsdl.WSDLConstants;
@@ -43,7 +41,6 @@
import org.apache.ode.bpel.epr.EndpointFactory;
import org.apache.ode.bpel.epr.MutableEndpoint;
import org.apache.ode.bpel.epr.WSAEndpoint;
-import org.apache.ode.bpel.epr.WSDL20Endpoint;
import org.apache.ode.bpel.iapi.BpelServer;
import org.apache.ode.bpel.iapi.Message;
import org.apache.ode.bpel.iapi.MessageExchange;
@@ -52,16 +49,11 @@
import org.apache.ode.bpel.iapi.ProcessConf;
import org.apache.ode.bpel.iapi.Scheduler;
import org.apache.ode.il.OMUtils;
-import org.apache.ode.utils.CollectionUtils;
-import org.apache.ode.utils.DOMUtils;
-import org.apache.ode.utils.Namespaces;
-import org.apache.ode.utils.WatchDog;
-import org.apache.ode.utils.GUID;
+import org.apache.ode.utils.*;
import org.apache.ode.utils.fs.FileUtils;
import org.apache.ode.utils.uuid.UUID;
import org.apache.ode.utils.wsdl.Messages;
import org.apache.rampart.RampartMessageData;
-import org.apache.derby.iapi.services.property.PersistentSet;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -90,8 +82,6 @@
private static final org.apache.ode.utils.wsdl.Messages msgs = Messages.getMessages(Messages.class);
- private static final int EXPIRE_SERVICE_CLIENT = 30000;
-
private static ThreadLocal<ServiceClient> _cachedClients = new ThreadLocal<ServiceClient>();
private WatchDog<Map, OptionsObserver> _axisOptionsWatchDog;
private WatchDog<Long, ServiceFileObserver> _axisServiceWatchDog;
@@ -531,30 +521,9 @@
// and load the new config.
init(); // create a new ServiceClient instance
try {
- InputStream ais = file.toURI().toURL().openStream();
- if (ais != null) {
- if (__log.isDebugEnabled()) __log.debug("Configuring service " + _serviceName + " using: " + file);
- try {
- ServiceBuilder builder = new ServiceBuilder(ais, _configContext, anonymousService);
- builder.populateService(builder.buildOM());
- } finally {
- ais.close();
- }
- // do not allow the service.xml file to change the service name
- anonymousService.setName(serviceName);
-
- // the service builder only updates the module list but do not engage them
- // module have to be engaged manually,
- for (int i = 0; i < anonymousService.getModules().size(); i++) {
- String moduleRef = (String) anonymousService.getModules().get(i);
- AxisModule module = _axisConfig.getModule(moduleRef);
- if (module != null) {
- anonymousService.engageModule(module);
- } else {
- throw new AxisFault("Unable to engage module : " + moduleRef);
- }
- }
- }
+ AxisUtils.configureService(_configContext, anonymousService, file.toURI().toURL());
+ // do not allow the service.xml file to change the service name
+ anonymousService.setName(serviceName);
} catch (Exception e) {
if (__log.isWarnEnabled()) __log.warn("Exception while configuring service: " + _serviceName, e);
throw new RuntimeException("Exception while configuring service: " + _serviceName, e);
Modified: ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/hooks/ODEAxisService.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/hooks/ODEAxisService.java?rev=738740&r1=738739&r2=738740&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/hooks/ODEAxisService.java (original)
+++ ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/hooks/ODEAxisService.java Thu Jan 29 03:50:11 2009
@@ -36,6 +36,7 @@
import javax.wsdl.Service;
import javax.wsdl.extensions.soap.SOAPAddress;
import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
import org.apache.axis2.AxisFault;
import org.apache.axis2.context.ConfigurationContext;
@@ -50,6 +51,7 @@
import org.apache.ode.axis2.util.Axis2UriResolver;
import org.apache.ode.axis2.util.Axis2WSDLLocator;
import org.apache.ode.bpel.iapi.ProcessConf;
+import org.apache.ode.utils.AxisUtils;
import org.apache.ws.commons.schema.XmlSchema;
import org.apache.ws.commons.schema.XmlSchemaCollection;
import org.w3c.dom.Element;
@@ -95,24 +97,14 @@
if (wsdlUrl != null) axisService.setFileName(wsdlUrl);
// axis2 service configuration
- URI axis2config = pconf.getBaseURI().resolve(wsdlServiceName.getLocalPart()+".axis2");
- LOG.debug("Looking for Axis2 service configuration file: "+axis2config.toURL());
+ URL service_file = pconf.getBaseURI().resolve(wsdlServiceName.getLocalPart()+".axis2").toURL();
+ LOG.debug("Looking for Axis2 service configuration file: "+service_file);
try {
- InputStream ais = axis2config.toURL().openStream();
- if (ais != null) {
- LOG.debug("Configuring service using: "+axis2config.toURL());
- try {
- ConfigurationContext configCtx = new ConfigurationContext(axisConfig);
- ServiceBuilder builder = new ServiceBuilder(ais, configCtx, axisService);
- builder.populateService(builder.buildOM());
- } finally {
- ais.close();
- }
- }
+ AxisUtils.configureService(axisService, service_file);
} catch (FileNotFoundException except) {
- LOG.debug("Axis2 service configuration not found: " + axis2config);
+ LOG.debug("Axis2 service configuration not found: " + service_file);
} catch (IOException except) {
- LOG.warn("Exception while configuring service: " + axis2config, except);
+ LOG.warn("Exception while configuring service: " + service_file, except);
}
// In doc/lit we need to declare a mapping between operations and message element names