diff options
Diffstat (limited to 'sca-java-2.x/trunk/modules/implementation-bpel-runtime')
4 files changed, 42 insertions, 43 deletions
diff --git a/sca-java-2.x/trunk/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/EmbeddedODEServer.java b/sca-java-2.x/trunk/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/EmbeddedODEServer.java index d29e682f36..7c71ab3cbc 100644 --- a/sca-java-2.x/trunk/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/EmbeddedODEServer.java +++ b/sca-java-2.x/trunk/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/EmbeddedODEServer.java @@ -147,38 +147,37 @@ public class EmbeddedODEServer { * @throws ODEInitializationException * @throws URISyntaxException */ - private File getDatabaseLocationAsFile() throws ODEInitializationException, - URISyntaxException { - File locationFile = null; - URL dbLocation = null; - - // An environment variable to set the path to the DB - String dbFile = System.getenv("TUSCANY_IMPL_BPEL_DBLOCATION"); - if( dbFile != null ) { - try { - locationFile = new File(dbFile).getParentFile(); - } catch (Exception e ) { - System.out.println("Environment variable TUSCANY_IMPL_BPEL_LOCATION has the wrong format: " + dbFile); - System.out.println("Exception is: " + e.getClass().toString() + " " + e.getMessage()); - } // end try - } else { - dbLocation = getClass().getClassLoader().getResource("jpadb"); - if (dbLocation == null) { - throw new ODEInitializationException("Couldn't find database in the classpath:" + - " try setting the TUSCANY_IMPL_BPEL_LOCATION environment variable"); - } - // Handle OSGI bundle case - if( dbLocation.getProtocol() == "bundleresource" ) { - try { - dbLocation = FileLocator.toFileURL( dbLocation ); - } catch (Exception ce ) { - throw new ODEInitializationException("Couldn't find database in the OSGi bundle"); - } // end try - } // end if - locationFile = new File(dbLocation.toURI()).getParentFile(); - } // end if - - return locationFile; + private File getDatabaseLocationAsFile() throws ODEInitializationException, URISyntaxException { + File locationFile = null; + URL dbLocation = null; + + // An environment variable to set the path to the DB + String dbFile = System.getenv("TUSCANY_IMPL_BPEL_DBLOCATION"); + if( dbFile != null ) { + try { + locationFile = new File(dbFile).getParentFile(); + } catch (Exception e ) { + System.out.println("Environment variable TUSCANY_IMPL_BPEL_LOCATION has the wrong format: " + dbFile); + System.out.println("Exception is: " + e.getClass().toString() + " " + e.getMessage()); + } // end try + } else { + dbLocation = getClass().getClassLoader().getResource("jpadb"); + if (dbLocation == null) { + throw new ODEInitializationException("Couldn't find database in the classpath:" + + " try setting the TUSCANY_IMPL_BPEL_LOCATION environment variable"); + } + // Handle OSGI bundle case + if( dbLocation.getProtocol() == "bundleresource" ) { + try { + dbLocation = FileLocator.toFileURL( dbLocation ); + } catch (Exception ce ) { + throw new ODEInitializationException("Couldn't find database in the OSGi bundle"); + } // end try + } // end if + locationFile = new File(dbLocation.toURI()).getParentFile(); + } // end if + + return locationFile; } // end method getDatabaseLocationAsFile private void initTxMgr() { diff --git a/sca-java-2.x/trunk/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEEndpointReference.java b/sca-java-2.x/trunk/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEEndpointReference.java index 079a0f96f5..700443d9b7 100644 --- a/sca-java-2.x/trunk/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEEndpointReference.java +++ b/sca-java-2.x/trunk/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEEndpointReference.java @@ -31,10 +31,10 @@ import org.w3c.dom.Element; */ public class ODEEndpointReference implements EndpointReference { - - private Document doc = DOMUtils.newDocument(); + + private Document doc = DOMUtils.newDocument(); private Element serviceref; - + /** * Private constructor for the EndpointReference */ diff --git a/sca-java-2.x/trunk/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELImplementationProvider.java b/sca-java-2.x/trunk/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELImplementationProvider.java index 91028e0523..7d43f379ec 100644 --- a/sca-java-2.x/trunk/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELImplementationProvider.java +++ b/sca-java-2.x/trunk/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELImplementationProvider.java @@ -159,9 +159,9 @@ public class BPELImplementationProvider implements ImplementationProvider { throw new RuntimeException("BPEL Component Type Implementation : Error initializing embedded ODE server " + inite.getMessage(), inite); } catch(Exception e) { throw new RuntimeException("BPEL Component Type Implementation initialization failure : " + e.getMessage(), e); - } finally { - // Restore the TCCL if we changed it - if( tccl != null ) Thread.currentThread().setContextClassLoader(tccl); + } finally { + // Restore the TCCL if we changed it + if( tccl != null ) Thread.currentThread().setContextClassLoader(tccl); } // end try } // end method start() diff --git a/sca-java-2.x/trunk/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELInvoker.java b/sca-java-2.x/trunk/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELInvoker.java index c0d85bb327..4a99fe705c 100644 --- a/sca-java-2.x/trunk/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELInvoker.java +++ b/sca-java-2.x/trunk/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELInvoker.java @@ -58,7 +58,7 @@ import org.w3c.dom.Element; * @version $Rev$ $Date$ */ public class BPELInvoker implements Invoker { - private final static long TIME_OUT = 10000L; + private final static long TIME_OUT = 10000L; protected final Log __log = LogFactory.getLog(getClass()); @@ -114,10 +114,10 @@ public class BPELInvoker implements Invoker { public Message invoke(Message msg) { try { - if( isCallback ) { - // Extract the callback endpoint metadata - callbackEPR = msg.getFrom(); - } // end if + if( isCallback ) { + // Extract the callback endpoint metadata + callbackEPR = msg.getFrom(); + } // end if Object[] args = msg.getBody(); Object resp = doTheWork(args); msg.setBody(resp); |