You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by mr...@apache.org on 2008/06/05 19:14:12 UTC

svn commit: r663664 - in /incubator/tuscany/java/sca/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel: ode/EmbeddedODEServer.java provider/BPELInvoker.java

Author: mriou
Date: Thu Jun  5 10:14:11 2008
New Revision: 663664

URL: http://svn.apache.org/viewvc?rev=663664&view=rev
Log:
Logging for custering deactivation.

Modified:
    incubator/tuscany/java/sca/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/EmbeddedODEServer.java
    incubator/tuscany/java/sca/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/provider/BPELInvoker.java

Modified: incubator/tuscany/java/sca/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/EmbeddedODEServer.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/EmbeddedODEServer.java?rev=663664&r1=663663&r2=663664&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/EmbeddedODEServer.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/EmbeddedODEServer.java Thu Jun  5 10:14:11 2008
@@ -76,8 +76,6 @@
 
     private BpelServerImpl _bpelServer;
 
-    protected ProcessStore store;
-
     private Scheduler _scheduler;
     
     protected ExecutorService _executorService;
@@ -91,8 +89,10 @@
     public void init() throws ODEInitializationException {
         Properties p = System.getProperties();
         p.put("derby.system.home", "target");
-        
-        _config = new OdeConfigProperties(new Properties(), "ode-sca");
+
+        Properties confProps = new Properties();
+        confProps.put("openjpa.jdbc.SynchronizeMappings", "buildSchema(ForeignKeys=false)");
+        _config = new OdeConfigProperties(confProps, "ode-sca");
 
         // Setting work root as the directory containing our database (wherever in the classpath)
         URL dbLocation = getClass().getClassLoader().getResource("jpadb");
@@ -166,21 +166,6 @@
             _bpelServer.setDehydrationPolicy(dehy);
         }
 
-        store = new ProcessStoreImpl(_db.getDataSource(), "jpa", true);
-        store.registerListener(new ProcessStoreListener() {
-            public void onProcessStoreEvent(ProcessStoreEvent event) {
-                // bounce the process
-                _bpelServer.unregister(event.pid);
-                if (event.type != ProcessStoreEvent.Type.UNDEPLOYED) {
-                    ProcessConf conf = (ProcessConf) store.getProcessConfiguration(event.pid);
-                    // Test processes always run with in-mem DAOs
-                    // conf.setTransient(true);  //FIXME: what should we use for ProcessConfImpl
-                    _bpelServer.register(conf);
-                    
-                } // end if
-            } // end onProcessStoreEvent
-        });
-
         _bpelServer.init();
     } // end InitBpelServer
 
@@ -205,16 +190,6 @@
             }
         }
         
-        if(store != null) {
-            try {
-                __log.debug("Stopping store");
-                ((ProcessStoreImpl)store).shutdown();
-                store = null;
-            } catch (Exception ex) {
-                __log.debug("Error stopping store");
-            }
-        }
-        
         if(_daoCF != null) {
             try {
                 __log.debug("Stopping DAO");
@@ -270,28 +245,16 @@
 
     // Updated by Mike Edwards, 23/05/2008
     public void deploy(ODEDeployment d, BPELImplementation implementation) {
-    	
         try {
-        	// old code - using the ODE store
-        	// Generate the required ODE deploy.xml file "on the fly" - it is required by the ODE
-        	// store - this code avoids the need for the programmer to create this file manually.
-        	BPELODEDeployFile deployFile = new BPELODEDeployFile( implementation );
-        	deployFile.writeDeployfile();
-        	store.deploy(d.deployDir);
-        	//System.out.println("Completed calling old Process deployment code...");
-        	
-        	// Code for doing deployment directly from Tuscany without using the ODE store
-        	// - disabled for the present due to issues with the ODE engine when used in this
-        	// mode - Mike Edwards 29/05/2008
-        	//TuscanyProcessConfImpl processConf = new TuscanyProcessConfImpl( implementation );
-        	//_bpelServer.register(processConf);
-        	//System.out.println("Completed calling new Process deployment code...");
+        	TuscanyProcessConfImpl processConf = new TuscanyProcessConfImpl( implementation );
+        	_bpelServer.register(processConf);
+        	System.out.println("Completed calling new Process deployment code...");
         } catch (Exception ex) {
             String errMsg = ">>> DEPLOY: Unexpected exception: " + ex.getMessage();
             __log.debug(errMsg, ex);
             throw new ODEDeploymentException(errMsg,ex);
-        } // end try
-    } // end deploy
+        }
+    }
 
     public void undeploy(ODEDeployment d) {
         //TODO

Modified: incubator/tuscany/java/sca/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/provider/BPELInvoker.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/provider/BPELInvoker.java?rev=663664&r1=663663&r2=663664&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/provider/BPELInvoker.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/provider/BPELInvoker.java Thu Jun  5 10:14:11 2008
@@ -82,7 +82,7 @@
     
     private void initializeInvocation() {
       
-        if(__log.isDebugEnabled()){
+        if(true){
             __log.debug("Initializing BPELInvoker");
         }
         Interface interfaze = operation.getInterface();
@@ -121,8 +121,8 @@
             throw new InvocationTargetException(null,"Unsupported service contract");
         }
         
-        if(__log.isDebugEnabled()) {
-            __log.debug("Invoking bpel component : " + bpelServiceName + "#" + bpelOperationName);
+        if(true) {
+            System.out.println("Invoking bpel component : " + bpelServiceName + "#" + bpelOperationName);
         }
         
         org.apache.ode.bpel.iapi.MyRoleMessageExchange mex = null;
@@ -134,12 +134,6 @@
             mex = odeServer.getBpelServer().getEngine().createMessageExchange(new GUID().toString(),
                                                                               bpelServiceName,
                                                                               bpelOperationName);
-            /*
-            if(__log.isDebugEnabled()) {
-                Element invocationRequest = mex.getRequest().getMessage();
-                __log.debug(">>>Request:\n" + DOMUtils.domToString(invocationRequest));
-                
-            }*/
             
             onhold = mex.invoke(createInvocationMessage(mex, args));
             
@@ -170,12 +164,13 @@
             // be sure we have the "freshest" one.
             mex = (MyRoleMessageExchange)odeServer.getBpelServer().getEngine().getMessageExchange(mex.getMessageExchangeId());
 
-            if(__log.isDebugEnabled()) {
+            if(true) {
                 Status status = mex.getStatus();
                 Element invocationResponse = mex.getResponse().getMessage();
 
-                __log.debug(">>>Invocation status:" + status.name());
-                __log.debug(">>>Response:\n" + DOMUtils.domToString(invocationResponse));
+                System.out.println(">>>Invocation status:" + status.name());
+                System.out.println(">>>Response:\n" + DOMUtils.domToString(invocationResponse));
+                System.out.println(">>>Response:\n" + DOMUtils.domToString(invocationResponse));
             }
             //process the method invocation result
             response = processResponse(mex.getResponse().getMessage());
@@ -225,10 +220,10 @@
         contentMessage.appendChild(contentPart);
         dom.appendChild(contentMessage);
         
-        if(__log.isDebugEnabled()) {
-            __log.debug("Creating invocation message:");
-            __log.debug(">> args.....: " + DOMUtils.domToString(payload));
-            __log.debug(">> message..:" + DOMUtils.domToString(dom.getDocumentElement()));
+        if(true) {
+            System.out.println("Creating invocation message:");
+            System.out.println(">> args.....: " + DOMUtils.domToString(payload));
+            System.out.println(">> message..:" + DOMUtils.domToString(dom.getDocumentElement()));
         }
 
         org.apache.ode.bpel.iapi.Message request = mex.createMessage(new QName("", ""));