Author: mriou
Date: Mon Jul 24 15:26:16 2006
New Revision: 425206
URL: http://svn.apache.org/viewvc?rev=425206&view=rev
Log:
Hot compile. When you deploy a process definition (bpel) into the process
deployment directory, it automatically compiles it before deploying (hence
removing the necessity to compile processes before deploying).
Added:
incubator/ode/scratch/pxe-iapi/axis2/src/main/java/com/fs/pxe/axis2/DUWsdlFinder.java
incubator/ode/scratch/pxe-iapi/axis2/src/main/java/com/fs/pxe/axis2/DUXsltFinder.java
Modified:
incubator/ode/scratch/pxe-iapi/axis2/src/main/java/com/fs/pxe/axis2/DeploymentPoller.java
incubator/ode/scratch/pxe-iapi/axis2/src/main/java/com/fs/pxe/axis2/DeploymentUnit.java
incubator/ode/scratch/pxe-iapi/axis2/src/main/java/com/fs/pxe/axis2/PXEServer.java
incubator/ode/scratch/pxe-iapi/axis2/src/main/java/com/fs/pxe/axis2/PXEService.java
incubator/ode/scratch/pxe-iapi/bpel-bom/src/main/java/com/fs/pxe/bom/impl/nodes/CorrelationImpl.java
incubator/ode/scratch/pxe-iapi/bpel-compiler/src/main/java/com/fs/pxe/bpel/compiler/BpelC.java
incubator/ode/scratch/pxe-iapi/bpel-compiler/src/main/java/com/fs/pxe/bpel/compiler/DefaultWsdlFinder.java
incubator/ode/scratch/pxe-iapi/bpel-compiler/src/main/java/com/fs/pxe/bpel/compiler/DefaultXsltFinder.java
Added:
incubator/ode/scratch/pxe-iapi/axis2/src/main/java/com/fs/pxe/axis2/DUWsdlFinder.java
URL:
http://svn.apache.org/viewvc/incubator/ode/scratch/pxe-iapi/axis2/src/main/java/com/fs/pxe/axis2/DUWsdlFinder.java?rev=425206&view=auto
==============================================================================
---
incubator/ode/scratch/pxe-iapi/axis2/src/main/java/com/fs/pxe/axis2/DUWsdlFinder.java
(added)
+++
incubator/ode/scratch/pxe-iapi/axis2/src/main/java/com/fs/pxe/axis2/DUWsdlFinder.java
Mon Jul 24 15:26:16 2006
@@ -0,0 +1,46 @@
+package com.fs.pxe.axis2;
+
+import com.fs.pxe.bom.wsdl.Definition4BPEL;
+import com.fs.pxe.bpel.compiler.WsdlFinder;
+
+import javax.wsdl.xml.WSDLReader;
+import javax.wsdl.WSDLException;
+import java.net.URI;
+import java.net.MalformedURLException;
+import java.io.File;
+import java.io.InputStream;
+import java.io.IOException;
+
+/**
+ * Finds WSDL documents within a deployment unit (no relative path shit,
+ * everything's in the same directory).
+ */
+public class DUWsdlFinder implements WsdlFinder {
+
+ private File _suDir;
+
+ public DUWsdlFinder() {
+ // no base URL
+ }
+
+ public DUWsdlFinder(File suDir) {
+ _suDir = suDir;
+ }
+
+ public void setBaseURI(URI u) {
+ _suDir = new File(u);
+ }
+
+ public Definition4BPEL loadDefinition(WSDLReader r, URI uri) throws
WSDLException {
+ // Eliminating whatever path has been provided, we always look into our SU
+ // deployment directory.
+ String strUri = uri.toString();
+ String filename = strUri.substring(strUri.lastIndexOf("/"),
strUri.length());
+ return (Definition4BPEL) r.readWSDL(new File(_suDir, filename).getPath());
+ }
+
+ public InputStream openResource(URI uri) throws MalformedURLException,
IOException {
+ return uri.toURL().openStream();
+ }
+
+}
Added:
incubator/ode/scratch/pxe-iapi/axis2/src/main/java/com/fs/pxe/axis2/DUXsltFinder.java
URL:
http://svn.apache.org/viewvc/incubator/ode/scratch/pxe-iapi/axis2/src/main/java/com/fs/pxe/axis2/DUXsltFinder.java?rev=425206&view=auto
==============================================================================
---
incubator/ode/scratch/pxe-iapi/axis2/src/main/java/com/fs/pxe/axis2/DUXsltFinder.java
(added)
+++
incubator/ode/scratch/pxe-iapi/axis2/src/main/java/com/fs/pxe/axis2/DUXsltFinder.java
Mon Jul 24 15:26:16 2006
@@ -0,0 +1,56 @@
+package com.fs.pxe.axis2;
+
+import com.fs.pxe.bpel.compiler.WsdlFinder;
+import com.fs.pxe.bpel.compiler.XsltFinder;
+import com.fs.pxe.bom.wsdl.Definition4BPEL;
+import com.fs.utils.StreamUtils;
+
+import javax.wsdl.xml.WSDLReader;
+import javax.wsdl.WSDLException;
+import java.io.File;
+import java.io.InputStream;
+import java.io.IOException;
+import java.io.FileInputStream;
+import java.net.URI;
+import java.net.MalformedURLException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Finds WSDL documents within a deployment unit (no relative path shit,
+ * everything's in the same directory).
+ */
+public class DUXsltFinder implements XsltFinder {
+
+ private static final Log __log = LogFactory.getLog(DUXsltFinder.class);
+
+ private File _suDir;
+
+ public DUXsltFinder() {
+ // no base URL
+ }
+
+ public DUXsltFinder(File suDir) {
+ _suDir = suDir;
+ }
+
+ public void setBaseURI(URI u) {
+ _suDir = new File(u);
+ }
+
+ public String loadXsltSheet(URI uri) {
+ // Eliminating whatever path has been provided, we always look into our SU
+ // deployment directory.
+ String strUri = uri.toString();
+ String filename = strUri.substring(strUri.lastIndexOf("/"),
strUri.length());
+ try {
+ return new String(StreamUtils.read(new FileInputStream(new File(_suDir,
filename))));
+ } catch (IOException e) {
+ if (__log.isDebugEnabled())
+ __log.debug("error obtaining resource '" + uri + "' from repository.",
e);
+ return null;
+ }
+ }
+
+}
Modified:
incubator/ode/scratch/pxe-iapi/axis2/src/main/java/com/fs/pxe/axis2/DeploymentPoller.java
URL:
http://svn.apache.org/viewvc/incubator/ode/scratch/pxe-iapi/axis2/src/main/java/com/fs/pxe/axis2/DeploymentPoller.java?rev=425206&r1=425205&r2=425206&view=diff
==============================================================================
---
incubator/ode/scratch/pxe-iapi/axis2/src/main/java/com/fs/pxe/axis2/DeploymentPoller.java
(original)
+++
incubator/ode/scratch/pxe-iapi/axis2/src/main/java/com/fs/pxe/axis2/DeploymentPoller.java
Mon Jul 24 15:26:16 2006
@@ -12,6 +12,7 @@
import java.io.FileNotFoundException;
import java.io.BufferedReader;
import java.util.HashSet;
+import java.util.HashMap;
/**
* Polls a directory for the deployment of a new deployment unit.
@@ -30,7 +31,7 @@
/**
* Set of [EMAIL PROTECTED] DeploymentUnit} objects regarding all deployment
units that have been inspected.
*/
- private final HashSet<DeploymentUnit> _inspectedFiles = new
HashSet<DeploymentUnit>();
+ private final HashMap<String,DeploymentUnit> _inspectedFiles = new
HashMap<String,DeploymentUnit>();
/** Filter accepting directories containing a .pxedd file. */
private static final FileFilter _fileFilter = new FileFilter(){
@@ -77,7 +78,7 @@
if (checkIsNew(new File(file, "deploy.xml"))) {
try {
DeploymentUnit du = new DeploymentUnit(file, _pxeServer);
- _inspectedFiles.add(du);
+ _inspectedFiles.put(file.getName(), du);
du.deploy(false);
__log.info("Deployment of artifact " + file.getName() + "
successful.");
} catch (Exception e) {
@@ -87,16 +88,17 @@
}
// Removing deployments that disappeared
- HashSet<DeploymentUnit> removed = new HashSet<DeploymentUnit>(2);
- for (DeploymentUnit du : _inspectedFiles) {
+ HashSet<String> removed = new HashSet<String>();
+ for (String duName : _inspectedFiles.keySet()) {
+ DeploymentUnit du = _inspectedFiles.get(duName);
if (!du.exists()) {
du.undeploy();
- removed.add(du);
+ removed.add(duName);
}
}
if (removed.size() > 0) {
- for (DeploymentUnit du : removed) {
- _inspectedFiles.remove(du);
+ for (String duName : removed) {
+ _inspectedFiles.remove(duName);
}
}
}
@@ -107,7 +109,7 @@
* @return <code>true</code> if new
*/
private boolean checkIsNew(File f){
- for (DeploymentUnit deployed : _inspectedFiles) {
+ for (DeploymentUnit deployed : _inspectedFiles.values()) {
if (deployed.matches(f))
return false;
}
@@ -158,10 +160,13 @@
while ((line = duStateReader.readLine()) != null) {
String filename = line.substring(0, line.indexOf("|"));
String timestamp = line.substring(line.indexOf("|") + 1 ,
line.length());
- DeploymentUnit du = new DeploymentUnit(new File(_deployDir,
filename), _pxeServer);
- du.setLastModified(Long.valueOf(timestamp));
- _inspectedFiles.add(du);
- du.deploy(true);
+ File duFile = new File(_deployDir, filename);
+ if (duFile.exists()) {
+ DeploymentUnit du = new DeploymentUnit(duFile, _pxeServer);
+ du.setLastModified(Long.valueOf(timestamp));
+ _inspectedFiles.put(duFile.getName(), du);
+ du.deploy(true);
+ }
}
} catch (FileNotFoundException e) {
// Shouldn't happen
@@ -179,7 +184,7 @@
try {
__log.debug("Writing current deployment state.");
FileWriter duStateWriter = new FileWriter(new File(_deployDir,
".state"), false);
- for (DeploymentUnit deploymentUnit : _inspectedFiles) {
+ for (DeploymentUnit deploymentUnit : _inspectedFiles.values()) {
// Somebody using pipe in their directory names don't deserve to
deploy anything
duStateWriter.write(deploymentUnit.getDuDirectory().getName());
duStateWriter.write("|");
Modified:
incubator/ode/scratch/pxe-iapi/axis2/src/main/java/com/fs/pxe/axis2/DeploymentUnit.java
URL:
http://svn.apache.org/viewvc/incubator/ode/scratch/pxe-iapi/axis2/src/main/java/com/fs/pxe/axis2/DeploymentUnit.java?rev=425206&r1=425205&r2=425206&view=diff
==============================================================================
---
incubator/ode/scratch/pxe-iapi/axis2/src/main/java/com/fs/pxe/axis2/DeploymentUnit.java
(original)
+++
incubator/ode/scratch/pxe-iapi/axis2/src/main/java/com/fs/pxe/axis2/DeploymentUnit.java
Mon Jul 24 15:26:16 2006
@@ -9,6 +9,7 @@
import com.fs.pxe.bom.wsdl.WSDLFactoryBPEL20;
import com.fs.pxe.bpel.o.OProcess;
import com.fs.pxe.bpel.o.Serializer;
+import com.fs.pxe.bpel.compiler.BpelC;
import org.apache.axis2.AxisFault;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -20,6 +21,7 @@
import java.io.FileFilter;
import java.io.FileInputStream;
import java.io.InputStream;
+import java.io.IOException;
import java.util.HashMap;
/**
@@ -49,6 +51,11 @@
return path.getName().endsWith(".cbp");
}
};
+ private static final FileFilter _bpelFilter = new FileFilter(){
+ public boolean accept(File path) {
+ return path.getName().endsWith(".bpel");
+ }
+ };
public DeploymentUnit(File dir, PXEServer pxeServer) {
File ddLocation = new File(dir, "deploy.xml");
@@ -69,25 +76,29 @@
throw new DeploymentException("Couldn't read WSDL document " +
file.getAbsolutePath(), e);
}
}
- File[] cbps = _duDirectory.listFiles(_cbpFilter);
_processes = new HashMap<QName, OProcess>();
- for (File file : cbps) {
- OProcess oprocess = loadProcess(file);
- _processes.put(new QName(oprocess.targetNamespace, oprocess.getName()),
oprocess);
- }
+
try {
_dd = DeployDocument.Factory.parse(ddLocation);
} catch (Exception e) {
throw new DeploymentException("Couldnt read deployment descriptor at
location " + ddLocation.getAbsolutePath(), e);
}
+
}
public void deploy(boolean activateOnly) {
+ // (Re)compile all bpel files if it's a "real" re-deployment, a simple
+ // activation doesn't need recompile.
+ if (!activateOnly) compileProcesses();
+ else loadProcessDefinitions();
+
+ // Going trough each process declared in the dd
for (TDeployment.Process processDD : _dd.getDeploy().getProcessList()) {
OProcess oprocess = _processes.get(processDD.getName());
if (oprocess == null) throw new DeploymentException("Could not find the
compiled process definition for a " +
"process referenced in the deployment descriptor: " +
processDD.getName());
try {
+ // We only need to activate, it's not a full re-deployment
if (activateOnly) {
_pxeServer.getBpelServer().activate(processDD.getName(), false);
} else {
@@ -95,15 +106,18 @@
_duDirectory.toURI(), oprocess,
_docRegistry.getDefinitions(), processDD);
}
+ // But we still need to declare our services internally
for (TProvide provide : processDD.getProvideList()) {
Definition4BPEL def = _docRegistry.getDefinition(
provide.getService().getName().getNamespaceURI());
- _pxeServer.createService(def, provide.getService().getName(),
provide.getService().getPort());
+ _pxeServer.createService(def, provide.getService().getName(),
+ provide.getService().getPort());
}
for (TInvoke invoke : processDD.getInvokeList()) {
Definition4BPEL def = _docRegistry.getDefinition(
invoke.getService().getName().getNamespaceURI());
- _pxeServer.createExternalService(def, invoke.getService().getName(),
invoke.getService().getPort());
+ _pxeServer.createExternalService(def, invoke.getService().getName(),
+ invoke.getService().getPort());
}
} catch (AxisFault axisFault) {
__log.error("Service deployment in Axis2 failed!", axisFault);
@@ -141,6 +155,39 @@
try {
if (is !=null) is.close();
} catch (Exception e) { }
+ }
+ }
+
+ /**
+ * Checking for each BPEL file if we have a corresponding compiled process.
If we
+ * don't, starts compilation. The force parameter just forces compilation,
whether
+ * a cbp file exists or not.
+ */
+ private void compileProcesses() {
+ File[] bpels = _duDirectory.listFiles(_bpelFilter);
+ for (File bpel : bpels) {
+ compile(bpel);
+ }
+ loadProcessDefinitions();
+ }
+
+ private void compile(File bpelFile) {
+ BpelC bpelc = BpelC.newBpelCompiler();
+ bpelc.setOutputDirectory(_duDirectory);
+ bpelc.setWsdlFinder(new DUWsdlFinder(_duDirectory));
+ bpelc.setXsltFinder(new DUXsltFinder(_duDirectory));
+ try {
+ bpelc.compile(bpelFile.toURL());
+ } catch (IOException e) {
+ __log.error("Couldn't compile process file!", e);
+ }
+ }
+
+ private void loadProcessDefinitions() {
+ File[] cbps = _duDirectory.listFiles(_cbpFilter);
+ for (File file : cbps) {
+ OProcess oprocess = loadProcess(file);
+ _processes.put(new QName(oprocess.targetNamespace, oprocess.getName()),
oprocess);
}
}
Modified:
incubator/ode/scratch/pxe-iapi/axis2/src/main/java/com/fs/pxe/axis2/PXEServer.java
URL:
http://svn.apache.org/viewvc/incubator/ode/scratch/pxe-iapi/axis2/src/main/java/com/fs/pxe/axis2/PXEServer.java?rev=425206&r1=425205&r2=425206&view=diff
==============================================================================
---
incubator/ode/scratch/pxe-iapi/axis2/src/main/java/com/fs/pxe/axis2/PXEServer.java
(original)
+++
incubator/ode/scratch/pxe-iapi/axis2/src/main/java/com/fs/pxe/axis2/PXEServer.java
Mon Jul 24 15:26:16 2006
@@ -154,33 +154,26 @@
}
}
- public void createService(Definition4BPEL def, QName serviceName, String
portName) {
- try {
- if (_axisConfig.getService(serviceName.getLocalPart()) != null) return;
- } catch (AxisFault axisFault) {
- // For some reason Axis throws an exception if we're requesting an
inactive service
- return;
+ public void createService(Definition4BPEL def, QName serviceName, String
portName) throws AxisFault {
+ if (_services.get(serviceName, portName) != null){
+ AxisService service = ((PXEService)_services.get(serviceName,
portName)).getAxisService();
+ _axisConfig.removeService(service.getName());
}
- try {
- AxisService axisService = PXEAxisService.createService(_axisConfig,
- def, serviceName, portName);
- PXEService pxeService = new PXEService(axisService, def, serviceName,
portName,
- _server, _jotm.getTransactionManager());
- _services.put(serviceName, portName, pxeService);
+ AxisService axisService = PXEAxisService.createService(_axisConfig,
+ def, serviceName, portName);
+ PXEService pxeService = new PXEService(axisService, def, serviceName,
portName,
+ _server, _jotm.getTransactionManager());
+ _services.put(serviceName, portName, pxeService);
- // Setting our new service on the receiver, the same receiver handles all
- // operations so the first one should fit them all
- AxisOperation firstOp =
(AxisOperation)axisService.getOperations().next();
-
((PXEMessageReceiver)firstOp.getMessageReceiver()).setService(pxeService);
-
((PXEMessageReceiver)firstOp.getMessageReceiver()).setExecutorService(_executorService);
+ // Setting our new service on the receiver, the same receiver handles all
+ // operations so the first one should fit them all
+ AxisOperation firstOp = (AxisOperation)axisService.getOperations().next();
+ ((PXEMessageReceiver)firstOp.getMessageReceiver()).setService(pxeService);
+
((PXEMessageReceiver)firstOp.getMessageReceiver()).setExecutorService(_executorService);
- // We're public!
- _axisConfig.addService(axisService);
- __log.debug("Created Axis2 service " + serviceName);
- } catch (AxisFault axisFault) {
- // TODO do something!
- axisFault.printStackTrace();
- }
+ // We're public!
+ _axisConfig.addService(axisService);
+ __log.debug("Created Axis2 service " + serviceName);
}
public void createExternalService(Definition4BPEL def, QName serviceName,
String portName) {
Modified:
incubator/ode/scratch/pxe-iapi/axis2/src/main/java/com/fs/pxe/axis2/PXEService.java
URL:
http://svn.apache.org/viewvc/incubator/ode/scratch/pxe-iapi/axis2/src/main/java/com/fs/pxe/axis2/PXEService.java?rev=425206&r1=425205&r2=425206&view=diff
==============================================================================
---
incubator/ode/scratch/pxe-iapi/axis2/src/main/java/com/fs/pxe/axis2/PXEService.java
(original)
+++
incubator/ode/scratch/pxe-iapi/axis2/src/main/java/com/fs/pxe/axis2/PXEService.java
Mon Jul 24 15:26:16 2006
@@ -225,6 +225,10 @@
}
}
+ public AxisService getAxisService() {
+ return _axisService;
+ }
+
class ResponseCallback {
private MyRoleMessageExchange _mmex;
private boolean _timedout;
Modified:
incubator/ode/scratch/pxe-iapi/bpel-bom/src/main/java/com/fs/pxe/bom/impl/nodes/CorrelationImpl.java
URL:
http://svn.apache.org/viewvc/incubator/ode/scratch/pxe-iapi/bpel-bom/src/main/java/com/fs/pxe/bom/impl/nodes/CorrelationImpl.java?rev=425206&r1=425205&r2=425206&view=diff
==============================================================================
---
incubator/ode/scratch/pxe-iapi/bpel-bom/src/main/java/com/fs/pxe/bom/impl/nodes/CorrelationImpl.java
(original)
+++
incubator/ode/scratch/pxe-iapi/bpel-bom/src/main/java/com/fs/pxe/bom/impl/nodes/CorrelationImpl.java
Mon Jul 24 15:26:16 2006
@@ -16,7 +16,7 @@
private String _correlationSetName;
private short _initiate;
- private short _pattern;
+ private short _pattern = Correlation.CORRPATTERN_IN;
public CorrelationImpl() {
}
Modified:
incubator/ode/scratch/pxe-iapi/bpel-compiler/src/main/java/com/fs/pxe/bpel/compiler/BpelC.java
URL:
http://svn.apache.org/viewvc/incubator/ode/scratch/pxe-iapi/bpel-compiler/src/main/java/com/fs/pxe/bpel/compiler/BpelC.java?rev=425206&r1=425205&r2=425206&view=diff
==============================================================================
---
incubator/ode/scratch/pxe-iapi/bpel-compiler/src/main/java/com/fs/pxe/bpel/compiler/BpelC.java
(original)
+++
incubator/ode/scratch/pxe-iapi/bpel-compiler/src/main/java/com/fs/pxe/bpel/compiler/BpelC.java
Mon Jul 24 15:26:16 2006
@@ -43,7 +43,7 @@
public class BpelC {
private static final Log __log = LogFactory.getLog(BpelC.class);
private static final CommonCompilationMessages __cmsgs =
- MessageBundle.getMessages(CommonCompilationMessages.class);
+ MessageBundle.getMessages(CommonCompilationMessages.class);
private BpelProcessBuilderFactory _bpelProcessBuilderFactory;
private CompileListener _compileListener;
@@ -230,7 +230,7 @@
logCompilationMessage(compilationMessage);
}
};
-
+
switch (process.getBpelVersion()) {
case Process.BPEL_V200:
compiler = new BpelCompiler20();
@@ -291,27 +291,27 @@
fileHeader.write(_outputStream);
fileHeader.writeOProcess(oprocess, _outputStream);
- if (_bpelUrl.toString().startsWith("file:") && _outputDir != null) {
- String filePath = _bpelUrl.getFile();
- filePath = filePath.substring(0, filePath.lastIndexOf(".")) + ".dd";
-
- DDHandler ddHandler;
- try {
- ddHandler = new DDHandler(new File(filePath));
- if (!ddHandler.exists()) __log.info("No deployment descriptor found,
one will be generated if needed.");
- boolean modified = ddHandler.validateAndEnhance(oprocess,
compiler.getWsdlDefinitions());
- if (ddHandler.exists() || modified)
- ddHandler.write(new File(_outputDir, oprocess.getName() + ".dd"));
- } catch (DDValidationException e) {
- CompilationMessage cm =
__cmsgs.errInvalidDeploymentDescriptor(e.getMessage());
- logCompilationMessage(cm);
- throw new CompilationException(cm);
- } catch (DDException e) {
-
logCompilationMessage(__cmsgs.errInvalidDeploymentDescriptor(e.getMessage()));
- }
- } else {
- __log.warn("Post-compilation using deployment descriptor deactivated
(compilation from url or stream).");
- }
+// if (_bpelUrl.toString().startsWith("file:") && _outputDir != null) {
+// String filePath = _bpelUrl.getFile();
+// filePath = filePath.substring(0, filePath.lastIndexOf(".")) + ".dd";
+//
+// DDHandler ddHandler;
+// try {
+// ddHandler = new DDHandler(new File(filePath));
+// if (!ddHandler.exists()) __log.info("No deployment descriptor
found, one will be generated if needed.");
+// boolean modified = ddHandler.validateAndEnhance(oprocess,
compiler.getWsdlDefinitions());
+// if (ddHandler.exists() || modified)
+// ddHandler.write(new File(_outputDir, oprocess.getName() +
".dd"));
+// } catch (DDValidationException e) {
+// CompilationMessage cm =
__cmsgs.errInvalidDeploymentDescriptor(e.getMessage());
+// logCompilationMessage(cm);
+// throw new CompilationException(cm);
+// } catch (DDException e) {
+//
logCompilationMessage(__cmsgs.errInvalidDeploymentDescriptor(e.getMessage()));
+// }
+// } else {
+// __log.warn("Post-compilation using deployment descriptor deactivated
(compilation from url or stream).");
+// }
} finally {
// close & mark myself invalid
this.invalidate();
Modified:
incubator/ode/scratch/pxe-iapi/bpel-compiler/src/main/java/com/fs/pxe/bpel/compiler/DefaultWsdlFinder.java
URL:
http://svn.apache.org/viewvc/incubator/ode/scratch/pxe-iapi/bpel-compiler/src/main/java/com/fs/pxe/bpel/compiler/DefaultWsdlFinder.java?rev=425206&r1=425205&r2=425206&view=diff
==============================================================================
---
incubator/ode/scratch/pxe-iapi/bpel-compiler/src/main/java/com/fs/pxe/bpel/compiler/DefaultWsdlFinder.java
(original)
+++
incubator/ode/scratch/pxe-iapi/bpel-compiler/src/main/java/com/fs/pxe/bpel/compiler/DefaultWsdlFinder.java
Mon Jul 24 15:26:16 2006
@@ -9,6 +9,7 @@
import java.io.IOException;
import java.io.InputStream;
+import java.io.File;
import java.net.MalformedURLException;
import java.net.URI;
@@ -25,11 +26,16 @@
}
public DefaultWsdlFinder(URI u) {
- _base = u;
+ setBaseURI(u);
}
public void setBaseURI(URI u) {
- _base = u;
+ File f = new File(u);
+ if (f.exists() && f.isFile()) {
+ _base = f.getParentFile().toURI();
+ } else {
+ _base = u;
+ }
}
public Definition4BPEL loadDefinition(WSDLReader r, URI uri) throws
WSDLException {
Modified:
incubator/ode/scratch/pxe-iapi/bpel-compiler/src/main/java/com/fs/pxe/bpel/compiler/DefaultXsltFinder.java
URL:
http://svn.apache.org/viewvc/incubator/ode/scratch/pxe-iapi/bpel-compiler/src/main/java/com/fs/pxe/bpel/compiler/DefaultXsltFinder.java?rev=425206&r1=425205&r2=425206&view=diff
==============================================================================
---
incubator/ode/scratch/pxe-iapi/bpel-compiler/src/main/java/com/fs/pxe/bpel/compiler/DefaultXsltFinder.java
(original)
+++
incubator/ode/scratch/pxe-iapi/bpel-compiler/src/main/java/com/fs/pxe/bpel/compiler/DefaultXsltFinder.java
Mon Jul 24 15:26:16 2006
@@ -3,6 +3,7 @@
import com.fs.utils.StreamUtils;
import java.net.URI;
import java.io.IOException;
+import java.io.File;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -18,11 +19,16 @@
}
public DefaultXsltFinder(URI u) {
- _base = u;
+ setBaseURI(u);
}
public void setBaseURI(URI u) {
- _base = u;
+ File f = new File(u);
+ if (f.exists() && f.isFile()) {
+ _base = f.getParentFile().toURI();
+ } else {
+ _base = u;
+ }
}
public String loadXsltSheet(URI uri) {