ode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sean...@apache.org
Subject svn commit: r743133 - in /ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine: BpelEngineImpl.java BpelProcess.java BpelRuntimeContextImpl.java BpelServerImpl.java DebuggerSupport.java PartnerRoleMessageExchangeImpl.java
Date Tue, 10 Feb 2009 22:20:47 GMT
Author: seanahn
Date: Tue Feb 10 22:20:47 2009
New Revision: 743133

URL: http://svn.apache.org/viewvc?rev=743133&view=rev
Log:
ODE-481, Enable easier extensibility on ODE for custom implementation or simulation

Modified:
    ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelEngineImpl.java
    ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelProcess.java
    ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java
    ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelServerImpl.java
    ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/DebuggerSupport.java
    ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerRoleMessageExchangeImpl.java

Modified: ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelEngineImpl.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelEngineImpl.java?rev=743133&r1=743132&r2=743133&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelEngineImpl.java
(original)
+++ ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelEngineImpl.java
Tue Feb 10 22:20:47 2009
@@ -213,8 +213,7 @@
                 PortType ptype = plink.partnerRolePortType;
                 Operation op = plink.getPartnerRoleOperation(mexdao.getOperation());
                 // TODO: recover Partner's EPR
-                mex = new PartnerRoleMessageExchangeImpl(this, mexdao, ptype, op, null, plink.hasMyRole()
? process
-                        .getInitialMyRoleEPR(plink) : null, process.getPartnerRoleChannel(plink));
+                mex = createPartnerRoleMessageExchangeImpl(mexdao, ptype, op, plink, process);
             }
             break;
         case MessageExchangeDAO.DIR_PARTNER_INVOKES_MYROLE:
@@ -234,6 +233,13 @@
 
         return mex;
     }
+    
+    // enable extensibility
+    protected PartnerRoleMessageExchangeImpl createPartnerRoleMessageExchangeImpl(
+    		MessageExchangeDAO mexdao, PortType ptype, Operation op, OPartnerLink plink, BpelProcess
process) {
+    	return new PartnerRoleMessageExchangeImpl(this, mexdao, ptype, op, null, plink.hasMyRole()
? process
+                .getInitialMyRoleEPR(plink) : null, process.getPartnerRoleChannel(plink));
+    }
 
     BpelProcess unregisterProcess(QName process) {
         BpelProcess p = _activeProcesses.remove(process);

Modified: ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelProcess.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelProcess.java?rev=743133&r1=743132&r2=743133&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelProcess.java
(original)
+++ ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelProcess.java
Tue Feb 10 22:20:47 2009
@@ -162,6 +162,14 @@
         BpelRuntimeContextImpl processInstance = createRuntimeContext(instanceDAO, null,
null);
         processInstance.recoverActivity(channel, activityId, action, fault);
     }
+    
+    protected DebuggerSupport createDebuggerSupport() {
+    	return new DebuggerSupport(this);
+    }
+    
+    protected DebuggerSupport getDebuggerSupport() {
+    	return _debugger;
+    }
 
     static String generateMessageExchangeIdentifier(String partnerlinkName, String operationName)
{
         StringBuffer sb = new StringBuffer(partnerlinkName);
@@ -481,7 +489,7 @@
         }
     }
 
-    ProcessDAO getProcessDAO() {
+    protected ProcessDAO getProcessDAO() {
         return _pconf.isTransient() ? _engine._contexts.inMemDao.getConnection().getProcess(_pid)
: getEngine()._contexts.dao
                 .getConnection().getProcess(_pid);
     }
@@ -520,7 +528,7 @@
     void activate(BpelEngineImpl engine) {
         _engine = engine;
         _sharedEps = _engine.getSharedEndpoints();
-        _debugger = new DebuggerSupport(this);
+        _debugger = createDebuggerSupport();
 
         __log.debug("Activating " + _pid);
         // Activate all the my-role endpoints.
@@ -573,7 +581,7 @@
         return _pconf.isSharedService(endpoint.serviceName);
     }
 
-    EndpointReference getInitialPartnerRoleEPR(OPartnerLink link) {
+    protected EndpointReference getInitialPartnerRoleEPR(OPartnerLink link) {
         try {
             _hydrationLatch.latch(1);
             PartnerLinkPartnerRoleImpl prole = _partnerRoles.get(link);
@@ -585,7 +593,7 @@
         }
     }
 
-    Endpoint getInitialPartnerRoleEndpoint(OPartnerLink link) {
+    protected Endpoint getInitialPartnerRoleEndpoint(OPartnerLink link) {
         try {
             _hydrationLatch.latch(1);
             PartnerLinkPartnerRoleImpl prole = _partnerRoles.get(link);
@@ -597,7 +605,7 @@
         }
     }
 
-    EndpointReference getInitialMyRoleEPR(OPartnerLink link) {
+    protected EndpointReference getInitialMyRoleEPR(OPartnerLink link) {
         try {
             _hydrationLatch.latch(1);
             PartnerLinkMyRoleImpl myRole = _myRoles.get(link);
@@ -609,11 +617,11 @@
         }
     }
 
-    QName getPID() {
+    protected QName getPID() {
         return _pid;
     }
 
-    PartnerRoleChannel getPartnerRoleChannel(OPartnerLink partnerLink) {
+    protected PartnerRoleChannel getPartnerRoleChannel(OPartnerLink partnerLink) {
         try {
             _hydrationLatch.latch(1);
             PartnerLinkPartnerRoleImpl prole = _partnerRoles.get(partnerLink);
@@ -707,7 +715,7 @@
         }
     }
 
-    BpelEngineImpl getEngine() {
+    protected BpelEngineImpl getEngine() {
         return _engine;
     }
 
@@ -736,7 +744,7 @@
     }
 
     /** Create a version-appropriate runtime context. */
-    BpelRuntimeContextImpl createRuntimeContext(ProcessInstanceDAO dao, PROCESS template,
+    protected BpelRuntimeContextImpl createRuntimeContext(ProcessInstanceDAO dao, PROCESS
template,
                                                 MyRoleMessageExchangeImpl instantiatingMessageExchange)
{
         return new BpelRuntimeContextImpl(this, dao, template, instantiatingMessageExchange);
 

Modified: ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java?rev=743133&r1=743132&r2=743133&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java
(original)
+++ ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java
Tue Feb 10 22:20:47 2009
@@ -49,6 +49,7 @@
 import org.apache.ode.bpel.evt.ProcessMessageExchangeEvent;
 import org.apache.ode.bpel.evt.ProcessTerminationEvent;
 import org.apache.ode.bpel.evt.ScopeEvent;
+import org.apache.ode.bpel.iapi.BpelEngine;
 import org.apache.ode.bpel.iapi.BpelEngineException;
 import org.apache.ode.bpel.iapi.ContextException;
 import org.apache.ode.bpel.iapi.Endpoint;
@@ -94,7 +95,7 @@
 import org.w3c.dom.NodeList;
 import org.w3c.dom.Document;
 
-class BpelRuntimeContextImpl implements BpelRuntimeContext {
+protected class BpelRuntimeContextImpl implements BpelRuntimeContext {
 
     private static final Log __log = LogFactory.getLog(BpelRuntimeContextImpl.class);
 
@@ -711,11 +712,11 @@
         // (for callback mechanism).
         EndpointReference myRoleEndpoint = partnerLink.partnerLink.hasMyRole() ? _bpelProcess
                 .getInitialMyRoleEPR(partnerLink.partnerLink) : null;
-        PartnerRoleMessageExchangeImpl mex = new PartnerRoleMessageExchangeImpl(_bpelProcess._engine,
mexDao,
-                partnerLink.partnerLink.partnerRolePortType, operation, partnerEpr, myRoleEndpoint,
_bpelProcess
-                .getPartnerRoleChannel(partnerLink.partnerLink));
-
+        PartnerRoleMessageExchangeImpl mex = 
+        	createPartnerRoleMessageExchangeImpl(mexDao, partnerLink,
+        			operation, partnerEpr, myRoleEndpoint);
         List<BpelProcess> p2pProcesses = null;
+        
         Endpoint partnerEndpoint = _bpelProcess.getInitialPartnerRoleEndpoint(partnerLink.partnerLink);
         if (partnerEndpoint != null)
             p2pProcesses = _bpelProcess.getEngine().route(partnerEndpoint.serviceName, mex.getRequest());
@@ -797,6 +798,19 @@
 
         return mexDao.getMessageExchangeId();
     }
+    
+    // enable extensibility
+    protected PartnerRoleMessageExchangeImpl createPartnerRoleMessageExchangeImpl(MessageExchangeDAO
mexDao,
+        		PartnerLinkInstance partnerLink, Operation operation, EndpointReference partnerEpr,

+        		EndpointReference myRoleEndpoint) {
+    	return new PartnerRoleMessageExchangeImpl(getBpelProcess().getEngine(), mexDao,
+                partnerLink.partnerLink.partnerRolePortType, operation, partnerEpr, myRoleEndpoint,
+                getBpelProcess().getPartnerRoleChannel(partnerLink.partnerLink));
+    }
+    
+    protected BpelProcess getBpelProcess() {
+    	return _bpelProcess;
+    }
 
     private void scheduleInvokeCheck(PartnerRoleMessageExchangeImpl mex) {
         boolean isTwoWay = mex.getMessageExchangePattern() ==

Modified: ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelServerImpl.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelServerImpl.java?rev=743133&r1=743132&r2=743133&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelServerImpl.java
(original)
+++ ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelServerImpl.java
Tue Feb 10 22:20:47 2009
@@ -91,7 +91,7 @@
     private Properties _configProperties;
     
     BpelEngineImpl _engine;
-    BpelDatabase _db;
+    protected BpelDatabase _db;
 
     /**
      * Management lock for synchronizing management operations and preventing
@@ -212,13 +212,18 @@
             _db = new BpelDatabase(_contexts.dao, _contexts.scheduler);
             _state = State.INIT;
             
-            _engine = new BpelEngineImpl(_contexts);
+            _engine = createBpelEngineImpl(_contexts);
 
         } finally {
             _mngmtLock.writeLock().unlock();
         }
     }
 
+    // enable extensibility
+    protected BpelEngineImpl createBpelEngineImpl(Contexts contexts) {
+    	return new BpelEngineImpl(contexts);
+    }
+    
     public void shutdown() throws BpelEngineException {
         _mngmtLock.writeLock().lock();
         try {
@@ -278,7 +283,7 @@
 
             __log.debug("Registering process " + conf.getProcessId() + " with server.");
 
-            BpelProcess process = new BpelProcess(conf);
+            BpelProcess process = createBpelProcess(conf);
 
             _engine.registerProcess(process);
             _registeredProcesses.add(process);
@@ -290,6 +295,11 @@
         }
     }
 
+    // enable extensibility
+    protected BpelProcess createBpelProcess(ProcessConf conf) {
+    	return new BpelProcess(conf);
+    }
+    
     public void unregister(QName pid) throws BpelEngineException {
         if (__log.isTraceEnabled())
             __log.trace("unregister: " + pid);

Modified: ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/DebuggerSupport.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/DebuggerSupport.java?rev=743133&r1=743132&r2=743133&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/DebuggerSupport.java
(original)
+++ ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/DebuggerSupport.java
Tue Feb 10 22:20:47 2009
@@ -56,7 +56,7 @@
  *
  * @todo Need to revisit the whole stepping/suspend/resume mechanism.
  */
-class DebuggerSupport {
+public class DebuggerSupport {
 
     private static final Log __log = LogFactory.getLog(DebuggerSupport.class);
     private static final Messages __msgs = MessageBundle.getMessages(Messages.class);
@@ -78,7 +78,7 @@
      * Constructor.
      * @param db BPEL process database
      */
-    DebuggerSupport(BpelProcess process) {
+    protected DebuggerSupport(BpelProcess process) {
         _process = process;
         _db = new BpelProcessDatabase(_process._engine._contexts.dao,
                 _process._engine._contexts.scheduler,
@@ -86,28 +86,28 @@
 
     }
 
-    void enable(boolean enabled){
+    public void enable(boolean enabled){
         _enabled = enabled;
     }
 
-    Breakpoint[] getGlobalBreakpoints(){
+    public Breakpoint[] getGlobalBreakpoints(){
         return _globalBreakPoints;
     }
 
-    Breakpoint[] getBreakpoints(Long pid){
+    public Breakpoint[] getBreakpoints(Long pid){
         Breakpoint[] arr = _instanceBreakPoints.get(pid);
         return (arr == null)
                 ? EMPTY_BP
                 : arr;
     }
 
-    void addGlobalBreakpoint(Breakpoint breakpoint){
+    public void addGlobalBreakpoint(Breakpoint breakpoint){
         Collection<Breakpoint> c = CollectionUtils.makeCollection(ArrayList.class,
_globalBreakPoints);
         c.add(breakpoint);
         _globalBreakPoints = c.toArray(new Breakpoint[c.size()]);
     }
 
-    void addBreakpoint(Long pid, Breakpoint breakpoint){
+    public void addBreakpoint(Long pid, Breakpoint breakpoint){
         Breakpoint[] bpArr = _instanceBreakPoints.get(pid);
         if(bpArr == null) {
             bpArr = new Breakpoint[]{breakpoint};
@@ -120,13 +120,13 @@
         _instanceBreakPoints.put(pid, bpArr);
     }
 
-    void removeGlobalBreakpoint(Breakpoint breakpoint){
+    public void removeGlobalBreakpoint(Breakpoint breakpoint){
         Collection<Breakpoint> c = CollectionUtils.makeCollection(ArrayList.class,
_globalBreakPoints);
         c.remove(breakpoint);
         _globalBreakPoints = c.toArray(new Breakpoint[c.size()]);
     }
 
-    void removeBreakpoint(Long pid, Breakpoint breakpoint){
+    public void removeBreakpoint(Long pid, Breakpoint breakpoint){
         Breakpoint[] bpArr = _instanceBreakPoints.get(pid);
         if(bpArr != null){
             Collection<Breakpoint> c = CollectionUtils.makeCollection(ArrayList.class,
bpArr);

Modified: ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerRoleMessageExchangeImpl.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerRoleMessageExchangeImpl.java?rev=743133&r1=743132&r2=743133&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerRoleMessageExchangeImpl.java
(original)
+++ ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerRoleMessageExchangeImpl.java
Tue Feb 10 22:20:47 2009
@@ -34,14 +34,14 @@
 import javax.wsdl.PortType;
 import javax.xml.namespace.QName;
 
-class PartnerRoleMessageExchangeImpl extends MessageExchangeImpl implements PartnerRoleMessageExchange
{
+protected class PartnerRoleMessageExchangeImpl extends MessageExchangeImpl implements PartnerRoleMessageExchange
{
     private static final Log LOG = LogFactory.getLog(PartnerRoleMessageExchangeImpl.class);
 
     private PartnerRoleChannel _channel;
     private EndpointReference _myRoleEPR;
     private int responsesReceived;
     
-    PartnerRoleMessageExchangeImpl(BpelEngineImpl engine, MessageExchangeDAO dao, PortType
portType,
+    protected PartnerRoleMessageExchangeImpl(BpelEngineImpl engine, MessageExchangeDAO dao,
PortType portType,
             Operation operation, 
             EndpointReference epr,
             EndpointReference myRoleEPR,



Mime
View raw message