Author: gnodet
Date: Thu Mar 16 07:48:02 2006
New Revision: 386358

URL: http://svn.apache.org/viewcvs?rev=386358&view=rev
Log:
ODE-2: Patch fixing several issues for ServiceMix integration

Modified:
    incubator/ode/scratch/ode/bpelTests/build.xml
    
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/action/bpel/ExternalServiceAction.java
    
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/bped/unmanaged/EventDirectorSLImpl.java
    
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/context/nonpersistent/TransientContainer.java
    
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/context/nonpersistent/TransientContextService.java
    
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/context/resolver/ResolverVariableContext.java
    
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/correlation/unmanaged/CorrelationServiceSLImpl.java
    
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/deployment/bpel/BPELAttributes.java
    
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/deployment/bpel/BPELInvoke.java
    
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/deployment/bpel/BPELPick.java
    
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/deployment/bpel/BPELRepositoryHandler.java
    
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/deployment/bpel/ExtensibilityArtifacts.java
    
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/engine/ProcessService.java
    
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/util/BPEProperties.java

Modified: incubator/ode/scratch/ode/bpelTests/build.xml
URL: 
http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/bpelTests/build.xml?rev=386358&r1=386357&r2=386358&view=diff
==============================================================================
--- incubator/ode/scratch/ode/bpelTests/build.xml (original)
+++ incubator/ode/scratch/ode/bpelTests/build.xml Thu Mar 16 07:48:02 2006
@@ -51,9 +51,6 @@
                        <param name="jartest.num" value="10"/>
                </antcall>
                <antcall target="jartest">
-                       <param name="jartest.num" value="11"/>
-               </antcall>
-               <antcall target="jartest">
                        <param name="jartest.num" value="12"/>
                </antcall>
                <antcall target="jartest">

Modified: 
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/action/bpel/ExternalServiceAction.java
URL: 
http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/action/bpel/ExternalServiceAction.java?rev=386358&r1=386357&r2=386358&view=diff
==============================================================================
--- 
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/action/bpel/ExternalServiceAction.java
 (original)
+++ 
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/action/bpel/ExternalServiceAction.java
 Thu Mar 16 07:48:02 2006
@@ -73,6 +73,7 @@
        public static final String EXT_ACTION_PROPS = 
"external_action_properties";
        public static final String OPERATION_KEY ="operation_key";
        public static final String PARTNER_LINK = "partner_link";
+       public static final String INVOKE_ATTRIBUTES = "invoke_attributes";
 
        private IExternalAction action;
        private IURIResolver m_uriResolver;

Modified: 
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/bped/unmanaged/EventDirectorSLImpl.java
URL: 
http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/bped/unmanaged/EventDirectorSLImpl.java?rev=386358&r1=386357&r2=386358&view=diff
==============================================================================
--- 
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/bped/unmanaged/EventDirectorSLImpl.java
 (original)
+++ 
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/bped/unmanaged/EventDirectorSLImpl.java
 Thu Mar 16 07:48:02 2006
@@ -54,17 +54,17 @@
        // correlation service
        private CorrelationService correlationService;
        private LockingService lockingService;
-       private EventContext currentEventContext;
+       private ThreadLocal currentEventContext = new ThreadLocal();
        
        private UUIDService us;
        
        // The event director will use a stack to push and pop ProcessInstance
        // on the evaluation context. This will cause the engine to use depth
        // first evaluation of the process tree.
-       private Stack processInstanceStack = new Stack();
+       private ThreadLocal processInstanceStack = new ThreadLocal();
        
        // mark for dead current process 
-       private boolean dead;
+       private ThreadLocal dead = new ThreadLocal();
        
        /**
         * @see 
org.apache.ode.bpe.bped.IInternalEventDirector#init(BPEProperties, 
CorrelationService)
@@ -111,13 +111,21 @@
                        // member variable.  A better solution would be to
                        // pass the event context as a parameter through the
                        // call chain.
-                       EventContext previousEventContext = currentEventContext;
-                       currentEventContext = new EventContext();
+                       EventContext previousEventContext = getEventContext();
+                       setEventContext(new EventContext());
                        IResponseMessage responseMessage = 
this.getCorrelationService().correlateEvent(msg, sync, this);
-                       currentEventContext = previousEventContext;
+                       setEventContext(previousEventContext);
                        
                        return responseMessage;
        }
+       
+       private EventContext getEventContext() {
+    return (EventContext) currentEventContext.get();
+  }
+  
+  private void setEventContext(EventContext context) {
+    currentEventContext.set(context);
+  }
 
        /**
         * @see org.apache.ode.bpe.bped.IInternalEventDirector#activate(String)
@@ -163,28 +171,28 @@
         * @see org.apache.ode.bpe.bped.EventDirector#getReturnMessageMetadata()
         */
        public ReturnMessageLocatorHolder getReturnMessageMetadata() {
-               return currentEventContext.getReturnMessageMetadata();
+               return getEventContext().getReturnMessageMetadata();
        }
 
        /* (non-Javadoc)
         * @see org.apache.ode.bpe.bped.EventDirector#getMessageEvent()
         */
        public IRequestMessageEvent getMessageEvent() {
-               return currentEventContext.getMessageEvent();
+               return getEventContext().getMessageEvent();
        }
 
        /* (non-Javadoc)
         * @see 
org.apache.ode.bpe.bped.EventDirector#setReturnMessageMetadata(java.util.Collection)
         */
        public void setReturnMessageMetadata(ReturnMessageLocatorHolder rmlh) {
-               currentEventContext.setReturnMessageMetadata(rmlh);     
+               getEventContext().setReturnMessageMetadata(rmlh);       
        }
 
        /* (non-Javadoc)
         * @see 
org.apache.ode.bpe.bped.EventDirector#setMessageEvent(org.apache.ode.bpe.event.MessageEvent)
         */
        public void setMessageEvent(IRequestMessageEvent me) {
-               currentEventContext.setMessageEvent(me);
+               getEventContext().setMessageEvent(me);
                
        }
 
@@ -211,7 +219,7 @@
         */
        public void sendEvent(StateEvent me, boolean sync) throws BPException {
                logger.fine("Recieved state event.");
-               currentEventContext = new EventContext();
+               setEventContext(new EventContext());
                this.handleStateEvent(me, sync);
                
        }
@@ -228,50 +236,60 @@
         * @see 
org.apache.ode.bpe.bped.EventDirector#sendEvent(org.apache.ode.bpe.timerservice.IBPETimer)
         */
        public Fault sendEvent(IBPETimer me, boolean sync) throws BPException {
+    logger.fine("Recieved timer event.");
+    setEventContext(new EventContext());
                EventDirectorUtil.handleTimerEvent(this,me);
                return null;
        }
                        
+    private Stack getProcessInstanceStack() {
+        Stack stack = (Stack) processInstanceStack.get();
+        if (stack == null) {
+            stack = new Stack();
+            processInstanceStack.set(stack);
+        }
+        return stack;
+    }
+    
        /**
         * @see 
org.apache.ode.bpe.engine.IEvaluationContext#addProcessInstance(org.apache.ode.bpe.engine.ProcessInstance)
         */
        public void addProcessInstance(ProcessInstance pi) {
-               processInstanceStack.push(pi);
-
+        getProcessInstanceStack().push(pi);
        }
 
        /**
         * @see 
org.apache.ode.bpe.engine.IEvaluationContext#getNextProcessInstance()
         */
        public ProcessInstance getNextProcessInstance() {
-               return ( processInstanceStack.size() > 0 ) ? 
(ProcessInstance)processInstanceStack.pop() : null;
+               return ( getProcessInstanceStack().size() > 0 ) ? 
(ProcessInstance)getProcessInstanceStack().pop() : null;
        }
 
        /**
         * @see 
org.apache.ode.bpe.engine.IEvaluationContext#initProcessInstanceCollection()
         */
        public void initProcessInstanceCollection() {
-               processInstanceStack.clear();
+        getProcessInstanceStack().clear();
        }
        /**
         * @see 
org.apache.ode.bpe.engine.IEvaluationContext#hasMoreProcessInstances()
         */
        public boolean processInstanceCollectionIsEmpty() {
-               return processInstanceStack.isEmpty();
+               return getProcessInstanceStack().isEmpty();
        }
        
        /* (non-Javadoc)
         * @see org.apache.ode.bpe.engine.IEvaluationContext#setDeadProcess()
         */
        public void setDeadProcess(boolean mark) {
-               dead = mark;
+               dead.set(new Boolean(mark));
        }
 
        /* (non-Javadoc)
         * @see org.apache.ode.bpe.engine.IEvaluationContext#isDeadProcess()
         */
        public boolean isDeadProcess() {
-               return dead;
+               return ((Boolean) dead.get()).booleanValue();
        }
 
        /* (non-Javadoc)

Modified: 
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/context/nonpersistent/TransientContainer.java
URL: 
http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/context/nonpersistent/TransientContainer.java?rev=386358&r1=386357&r2=386358&view=diff
==============================================================================
--- 
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/context/nonpersistent/TransientContainer.java
 (original)
+++ 
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/context/nonpersistent/TransientContainer.java
 Thu Mar 16 07:48:02 2006
@@ -59,37 +59,37 @@
        // Implement the IContainer facade.  Polymorphic enhancements must be 
made in the
        // internal* methods, not the IContainer interface methods.
        
-       public IContainer createContainer( String iContainerLocator ) throws 
ContextServiceException
+       public synchronized IContainer createContainer( String 
iContainerLocator ) throws ContextServiceException
        {
                return internalCreateContainer( iContainerLocator );
        }
        
-       public IPart createPart( String iPartLocator ) throws 
ContextServiceException
+       public synchronized IPart createPart( String iPartLocator ) throws 
ContextServiceException
        {
                return internalCreatePart( iPartLocator );
        }
 
-       public INode findChild( String iChildLocator ) throws 
ContextServiceException 
+       public synchronized INode findChild( String iChildLocator ) throws 
ContextServiceException 
        {
                return internalFindChild( iChildLocator );
        }
 
-       public void removeChild( String iChildLocator ) throws 
ContextServiceException
+       public synchronized void removeChild( String iChildLocator ) throws 
ContextServiceException
        {
                internalRemoveChild( iChildLocator );
        }
 
-       public void moveNode( INode iSourceNode, String iTargetName ) throws 
ContextServiceException
+       public synchronized void moveNode( INode iSourceNode, String 
iTargetName ) throws ContextServiceException
        {
                internalMoveNode( iSourceNode, iTargetName );
        }
 
-       public void copyNode( INode iSourceNode, String iTargetName ) throws 
ContextServiceException
+       public synchronized void copyNode( INode iSourceNode, String 
iTargetName ) throws ContextServiceException
        {
                internalCopyNode( iSourceNode, iTargetName );
        }
        
-       public Collection getChildren() throws ContextServiceException
+       public synchronized Collection getChildren() throws 
ContextServiceException
        {
                return internalGetChildren();
        }

Modified: 
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/context/nonpersistent/TransientContextService.java
URL: 
http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/context/nonpersistent/TransientContextService.java?rev=386358&r1=386357&r2=386358&view=diff
==============================================================================
--- 
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/context/nonpersistent/TransientContextService.java
 (original)
+++ 
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/context/nonpersistent/TransientContextService.java
 Thu Mar 16 07:48:02 2006
@@ -53,7 +53,7 @@
        /**
         * @see org.apache.ode.bpe.context.IContextService#getRoot()
         */
-       public IContainer getRoot() throws ContextServiceException
+       public synchronized IContainer getRoot() throws ContextServiceException
        {
                if (m_root == null)
                {

Modified: 
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/context/resolver/ResolverVariableContext.java
URL: 
http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/context/resolver/ResolverVariableContext.java?rev=386358&r1=386357&r2=386358&view=diff
==============================================================================
--- 
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/context/resolver/ResolverVariableContext.java
 (original)
+++ 
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/context/resolver/ResolverVariableContext.java
 Thu Mar 16 07:48:02 2006
@@ -55,17 +55,17 @@
                                } else
                                {
                                        o = o.toString();
-                                       // See if we can turn this into 
Integer.  We unfortunately do not have any
+                                       // See if we can turn this into Double. 
 We unfortunately do not have any
                                        // type information.  The following 
xpath will not work if you do not
-                                       // return an integer.  So it seems we 
are stuck with the following solution.
+                                       // return an double.  So it seems we 
are stuck with the following solution.
                                        try{
-                                               Integer i = new 
Integer((String)o);
+                                               Double d = new 
Double((String)o);
                                                // if we got to here, it didn't 
throw
-                                               o = i;
+                                               o = d;
                                        }
                                        catch(java.lang.NumberFormatException e)
                                        {
-                                               //It threw an exception.  The 
contents of o are not an integer.
+                                               //It threw an exception.  The 
contents of o are not a number.
                                                //Don't need to do anything.
                                        }
                                }

Modified: 
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/correlation/unmanaged/CorrelationServiceSLImpl.java
URL: 
http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/correlation/unmanaged/CorrelationServiceSLImpl.java?rev=386358&r1=386357&r2=386358&view=diff
==============================================================================
--- 
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/correlation/unmanaged/CorrelationServiceSLImpl.java
 (original)
+++ 
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/correlation/unmanaged/CorrelationServiceSLImpl.java
 Thu Mar 16 07:48:02 2006
@@ -49,7 +49,7 @@
        /* (non-Javadoc)
         * @see 
org.apache.ode.bpe.correlation.CorrelationService#createRegistration(org.apache.ode.bpe.correlation.Registration)
         */
-       public void createRegistration(Registration regisration)
+       public synchronized void createRegistration(Registration regisration)
                throws CorrelationServiceException {
 
                // add to static key hash
@@ -104,7 +104,7 @@
        /* (non-Javadoc)
         * @see 
org.apache.ode.bpe.correlation.CorrelationService#getRegistrations(org.apache.ode.bpe.instance.service.IMPIProcess)
         */
-       public Collection getRegistrations(IPMIProcess key)
+       public synchronized Collection getRegistrations(IPMIProcess key)
                throws CorrelationServiceException {
                return (ArrayList) hashByProcId.get(key.getKey());
        }
@@ -112,7 +112,7 @@
        /* (non-Javadoc)
         * @see 
org.apache.ode.bpe.correlation.CorrelationService#getRegistrations(org.apache.ode.bpe.event.IStaticKey,
 java.util.Collection)
         */
-       public Collection getRegistrations(IStaticKey key, Collection keyValues)
+       public synchronized Collection getRegistrations(IStaticKey key, 
Collection keyValues)
                throws CorrelationServiceException {
                        
                        ArrayList regs = new ArrayList();               
@@ -140,16 +140,13 @@
                                }
                        }
                }
-                       
-                       return regs;
-                       
-                       
+               return regs;
        }
        
        /* (non-Javadoc)
         * @see 
org.apache.ode.bpe.correlation.CorrelationService#getRegistrations(org.apache.ode.bpe.event.IStaticKey)
         */
-       public Collection getRegistrations(IStaticKey key)
+       public synchronized Collection getRegistrations(IStaticKey key)
                throws CorrelationServiceException {
                        ArrayList regs = 
(ArrayList)hashByStaticKey.get(key.toString());
                        if ( regs == null ) {
@@ -194,7 +191,7 @@
        /* (non-Javadoc)
         * @see 
org.apache.ode.bpe.correlation.CorrelationService#getRegistrations(org.apache.ode.bpe.event.IStaticKey,
 java.lang.String)
         */
-       public Registration getRegistration(IStaticKey key, String operationId,
+       public synchronized Registration getRegistration(IStaticKey key, String 
operationId,
                String processId) throws CorrelationServiceException {
                HashMap opHash= 
(HashMap)hashByStaticKeyandOperationIdandProcId.get(key.toString());
                if ( opHash == null ) {
@@ -210,7 +207,7 @@
        /* (non-Javadoc)
         * @see 
org.apache.ode.bpe.correlation.CorrelationService#removeRegistration(org.apache.ode.bpe.correlation.Registration)
         */
-       public void removeRegistration(Registration registration) throws 
CorrelationServiceException {
+       public synchronized void removeRegistration(Registration registration) 
throws CorrelationServiceException {
                // remove from static key hash
                String key = registration.getStaticKeyValue();
                ArrayList regs = (ArrayList) hashByStaticKey.get(key);

Modified: 
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/deployment/bpel/BPELAttributes.java
URL: 
http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/deployment/bpel/BPELAttributes.java?rev=386358&r1=386357&r2=386358&view=diff
==============================================================================
--- 
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/deployment/bpel/BPELAttributes.java
 (original)
+++ 
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/deployment/bpel/BPELAttributes.java
 Thu Mar 16 07:48:02 2006
@@ -19,6 +19,8 @@
  */
 package org.apache.ode.bpe.deployment.bpel;
 
+import java.util.HashMap;
+import java.util.Map;
 import java.util.Properties;
 
 import javax.xml.namespace.QName;
@@ -40,10 +42,12 @@
        
        static final long serialVersionUID = 2362373868375195807L;
 
+  private Map uris;
        
        public BPELAttributes(Attributes attrs) {
                super();
                
+               uris = new HashMap();
                // attrs are owned by the SAX Parser therefore they should be 
copied into
                // the objects private collection. Attributes may be referenced 
                // accross element boundries and it appears the parser will 
reuse the
@@ -51,9 +55,14 @@
                int len = attrs.getLength();
                for (int i = 0; i < len; i++ ) {
                        put(attrs.getQName(i),attrs.getValue(i));
+                       uris.put(attrs.getQName(i),attrs.getURI(i));
                }       
        }
        
+       public String getURI(String attribute) {
+    return (String) uris.get(attribute);
+  }
+       
        public BPELAttributes() {
                super();
        }
@@ -173,14 +182,11 @@
                return (QName)get(BPELSchema.TYPE_ATTR.getValue());
        }
        
-       void setDataType(BPELNode context) {
-
-               try {
-                       QName ret = 
context.getQName(getProperty(BPELSchema.TYPE_ATTR.getValue()));
-                       put(BPELSchema.TYPE_ATTR.getValue(),ret);
-               } catch (DeploymentException e) {
+       void setDataType(BPELNode context) throws DeploymentException {
+               QName ret = 
context.getQName(getProperty(BPELSchema.TYPE_ATTR.getValue()));
+               if (ret != null) {
+                 put(BPELSchema.TYPE_ATTR.getValue(),ret);
                }
-
        }
        
        String getQueryLanguage() {

Modified: 
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/deployment/bpel/BPELInvoke.java
URL: 
http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/deployment/bpel/BPELInvoke.java?rev=386358&r1=386357&r2=386358&view=diff
==============================================================================
--- 
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/deployment/bpel/BPELInvoke.java
 (original)
+++ 
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/deployment/bpel/BPELInvoke.java
 Thu Mar 16 07:48:02 2006
@@ -144,6 +144,8 @@
                        
                        
ccact.addMetadata(EXT_ACTION_PROPS,act.getAction().getProps());
                        
+                       
ccact.addMetadata(org.apache.ode.bpe.action.bpel.ExternalServiceAction.INVOKE_ATTRIBUTES,getAttributes());
+                       
                        
ccact.addMetadata(org.apache.ode.bpe.action.bpel.ExternalServiceAction.PARTNER_LINK,getAttributes().getPartnerLink());
                        
                        if ( !ops.isEmpty() ) 
ccact.addMetadata(RegisterAction.OPERATIONS,ops);

Modified: 
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/deployment/bpel/BPELPick.java
URL: 
http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/deployment/bpel/BPELPick.java?rev=386358&r1=386357&r2=386358&view=diff
==============================================================================
--- 
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/deployment/bpel/BPELPick.java
 (original)
+++ 
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/deployment/bpel/BPELPick.java
 Thu Mar 16 07:48:02 2006
@@ -133,8 +133,10 @@
                for ( Iterator itr = m_eventHandlers.iterator(); itr.hasNext(); 
) {
                        
                        op = ((BPELEvent)itr.next()).getOperation(regAct,ccB);
-                       
getProcess().addNonInstanceCreatingStaticKey(op.getKey());
-                       if ( op != null ) ops.add( op );
+                       if ( op != null ) {
+        getProcess().addNonInstanceCreatingStaticKey(op.getKey());
+        ops.add( op );
+                       }
                }
                try {
                        regAct.addMetadata(RegisterAction.OPERATIONS,ops);

Modified: 
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/deployment/bpel/BPELRepositoryHandler.java
URL: 
http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/deployment/bpel/BPELRepositoryHandler.java?rev=386358&r1=386357&r2=386358&view=diff
==============================================================================
--- 
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/deployment/bpel/BPELRepositoryHandler.java
 (original)
+++ 
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/deployment/bpel/BPELRepositoryHandler.java
 Thu Mar 16 07:48:02 2006
@@ -76,19 +76,20 @@
 
        BPELRepositoryHandler(String docName, HashMap supportDoc, 
DefinitionService ds) throws DeploymentException {
                m_bpelName = docName;
-               m_props = new BPEProperties();
                
                try {
                        if ( ds == null ) {
+        m_props = new BPEProperties();                 
                                
m_props.setDefinitionServiceClass("org.apache.ode.bpe.definition.serialimpl.DefinitionService_SerImpl");
                                UUIDService us = 
UUIDServiceFactory.createUUIDService(m_props);
                                m_ds = 
DefinitionServiceFactory.createDefinitionService(m_props,us);
                        } else {
                                m_ds = ds;
+                               m_props = ds.getBPEProperties();
                        }
                        
                        // Create the object that manages the list of 
supporting documents
-                       m_artifacts = new ExtensibilityArtifacts(docName, 
supportDoc);
+                       m_artifacts = new ExtensibilityArtifacts(docName, 
supportDoc, m_props);
                        
                } catch (UUIDServiceException e) {
                        
BPELUtil.throwNewException(logger,Level.SEVERE,"BPEL_UUIDINVALID",null,e);
@@ -225,8 +226,12 @@
                // An alarm can only be held by a scope. The builder assumes 
the xml
                // parser will enforce this constraint using the BPEL XMLSchema.
 
-               testScope(); // make sure the current context is a scope
-               push( new BPELOnAlarm(m_context,attr) );
+    if ( m_context instanceof BPELPick ) {
+      push( new BPELOnAlarm(m_context,attr) );
+    } else {
+                 testScope(); // make sure the current context is a scope
+                 push( new BPELOnAlarm(m_context,attr) );
+               }
        }
        public void closeOnAlarm() throws DeploymentException {
                pop();

Modified: 
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/deployment/bpel/ExtensibilityArtifacts.java
URL: 
http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/deployment/bpel/ExtensibilityArtifacts.java?rev=386358&r1=386357&r2=386358&view=diff
==============================================================================
--- 
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/deployment/bpel/ExtensibilityArtifacts.java
 (original)
+++ 
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/deployment/bpel/ExtensibilityArtifacts.java
 Thu Mar 16 07:48:02 2006
@@ -68,6 +68,7 @@
 import org.apache.ode.bpe.binding.bpe.TBinding;
 import org.apache.ode.bpe.binding.bpe.TOperation;
 import org.apache.ode.bpe.binding.bpe.TSchema;
+import org.apache.ode.bpe.util.BPEProperties;
 import org.apache.ode.bpe.wsdl.extensions.BPEAction;
 import org.apache.ode.bpe.wsdl.extensions.BPEActionSerializer;
 import org.apache.ode.bpe.wsdl.extensions.BPEFault;
@@ -104,8 +105,6 @@
        // The perferred data type for BPEL variables and for params passed 
across
        // an IExternalAction interface.
        private static final String DEFAULT_TYPE = "";
-       // A default implementation of IExternalAction;
-       private static final String DEFAULT_IMPL = 
"org.apache.ode.bpe.action.bpel.external.WSIFAction";
 
        // The process holds namespace prefixes used in the BPEL document.
        private BPELProcess process;
@@ -124,10 +123,13 @@
        private TSchema bpeBinding;
        private HashMap activityBindingMap;
        
+       private BPEProperties properties;
        
-       public ExtensibilityArtifacts( String bpelDocName, HashMap artifacts ) 
throws DeploymentException {
+       
+       public ExtensibilityArtifacts( String bpelDocName, HashMap artifacts, 
BPEProperties props ) throws DeploymentException {
                rootDef = getRootWSDL(bpelDocName, artifacts);
                bpeBinding = getBPEBindings(bpelDocName, artifacts);
+               properties = props;
                
                Pattern bindingPattern = Pattern.compile(bpelDocName+".xml");
 
@@ -147,6 +149,10 @@
                }
        }
        
+       public BPEProperties getBPEProperties() {
+    return properties;
+  }
+       
 
        /**
         * Build a map of activity ID's to activity bindings.
@@ -479,13 +485,16 @@
 
                if ( bpeAction == null ) {
                   
+                 if (properties.getExternalActionDefaultImplementation() == 
null) {
+        // Temp fix for rob madden.
+        throw new RuntimeException("Could not find action binding for: pt = " 
+                                     + pt.getQName() + ", oper = " + 
opr.getName());
+                       }
+                       
                        // create a default action
                        bpeAction = new BPEAction();
-                       bpeAction.setImplementation(DEFAULT_IMPL);
-                       
-                       // Temp fix for rob madden.
-                       throw new RuntimeException("Could not find action 
binding for: pt = " 
-                                   + pt.getQName() + ", oper = " + 
opr.getName());
+                       
bpeAction.setBPEImplementation(properties.getExternalActionBPEImplementation());
+                       
bpeAction.setImplementation(properties.getExternalActionDefaultImplementation());
                }
                
                retVal.setAction(bpeAction);

Modified: 
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/engine/ProcessService.java
URL: 
http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/engine/ProcessService.java?rev=386358&r1=386357&r2=386358&view=diff
==============================================================================
--- 
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/engine/ProcessService.java
 (original)
+++ 
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/engine/ProcessService.java
 Thu Mar 16 07:48:02 2006
@@ -102,7 +102,7 @@
     * Creates a ProcessInstance from a RootDefinition key.
     * 
     * @param key - the unique identifier of a root definition */
-   public ProcessInstance createProcess(ProcessDefinitionKey key) throws 
BPException
+   public synchronized ProcessInstance createProcess(ProcessDefinitionKey key) 
throws BPException
    {
        IPMDRoot rootDefinition = 
is.getDefinitionService().getRootDefinition(key);
        if ( ! rootDefinition.isActive() )
@@ -115,7 +115,7 @@
               is.getDefinitionService().getRootDefinition(key)),this);
    }
    
-   public ProcessInstance createSubProcess(IPMIProcess ipmi, IPMDProcess ipmd) 
throws BPException
+   public synchronized ProcessInstance createSubProcess(IPMIProcess ipmi, 
IPMDProcess ipmd) throws BPException
    {
                return new ProcessInstance(ipmi.createSubProcess(ipmd),this);   
    }
@@ -127,7 +127,7 @@
     * @param key
     * 
     */
-   public ProcessInstance lookupProcess(String rootkey, String key) throws 
BPException
+   public synchronized ProcessInstance lookupProcess(String rootkey, String 
key) throws BPException
    {
       return new ProcessInstance(is.getInstance(rootkey, key),this);
    }
@@ -136,11 +136,11 @@
     * Get the InstanceService associated with this ProcessService.
     * @return InstanceService
     */
-   public InstanceService getInstanceService() {
+   public synchronized InstanceService getInstanceService() {
                return is;
    }
  
-   public IContextService getContextService(IPMIProcess rootkey) throws 
BPException  {
+   public synchronized IContextService getContextService(IPMIProcess rootkey) 
throws BPException  {
                return getContextService(rootkey.isStateless());        
    }
    
@@ -150,7 +150,7 @@
     * @return a context service
     * @throws BPException
     */
-   public IContextService getContextService(String rootkey) 
+   public synchronized IContextService getContextService(String rootkey) 
        throws BPException {
 
                IPMIProcess proc = is.getInstanceForContext(rootkey,rootkey);
@@ -162,7 +162,7 @@
                return getContextService(rootDef.getIsStateless());
        }
        
-       private IContextService getContextService(boolean isStateless) throws 
BPException {
+       private synchronized IContextService getContextService(boolean 
isStateless) throws BPException {
 
                IContextService ret = null;
                
@@ -219,7 +219,7 @@
     * @throws ScopeServiceException
     * @throws BPException
     */
-   public IScopeService getScopeService(IPMIProcess rootkey) 
+   public synchronized IScopeService getScopeService(IPMIProcess rootkey) 
        throws ScopeServiceException, BPException{
                IScopeService ss = 
(IScopeService)scopeServices.get(rootkey.getRootKey());
                if ( ss == null ) {
@@ -237,7 +237,7 @@
        * @throws ScopeServiceException
        * @throws BPException
        */
-   public IScopeService getScopeService(String rootkey) 
+   public synchronized IScopeService getScopeService(String rootkey) 
        throws ScopeServiceException, BPException{
                IScopeService ss = (IScopeService)scopeServices.get(rootkey);
                if ( ss == null ) {
@@ -255,7 +255,7 @@
         * @param pcb the process call back interface
         * @throws BPException
         */
-   public void update(String rootkey, IEvaluationContext ec,
+   public synchronized void update(String rootkey, IEvaluationContext ec,
        IProcessCallBack pcb)throws BPException{
                
        scopeServices.remove(rootkey);
@@ -267,13 +267,13 @@
     * Init the process service.
     *
     */
-   public void init(){
+   public synchronized void init(){
        ctxPersistent = null;
        is.init();
    }
 
    // this is for the in memory case only
-   public IContextService getTransientContextService() throws 
ContextServiceException {
+   public synchronized IContextService getTransientContextService() throws 
ContextServiceException {
           if ( ctxNonPersistent == null ) { 
                   BPEProperties props = new BPEProperties();
                ctxNonPersistent = 
ContextServiceFactory.createContextService(props,us,

Modified: 
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/util/BPEProperties.java
URL: 
http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/util/BPEProperties.java?rev=386358&r1=386357&r2=386358&view=diff
==============================================================================
--- 
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/util/BPEProperties.java
 (original)
+++ 
incubator/ode/scratch/ode/src/main/java/org/apache/ode/bpe/util/BPEProperties.java
 Thu Mar 16 07:48:02 2006
@@ -146,7 +146,10 @@
     public static final String EXTERNAL_INTERACTION_FACTORIES_DEFAULT =
         "";
 
-
+    // External actions
+    public static final String EXTERNAL_ACTION_BPE_IMPLEMENTATION_KEY = 
"EXTERNAL_ACTION_BPE_IMPLEMENTATION_KEY";
+    public static final String EXTERNAL_ACTION_BPE_IMPLEMENTATION_DEFAULT = 
"org.apache.ode.action.bpel.ExternalServiceAction";
+    public static final String EXTERNAL_ACTION_DEFAULT_IMPLEMENTATION_KEY = 
"EXTERNAL_ACTION_DEFAULT_IMPLEMENTATION_KEY";
 
     private Context jndiContext;
 
@@ -509,6 +512,20 @@
         return lookupString(
                 EXTERNAL_INTERACTION_FACTORIES_KEY,
                 EXTERNAL_INTERACTION_FACTORIES_DEFAULT );
+    }
+    
+    public String getExternalActionBPEImplementation()
+    {
+      return lookupString(
+                EXTERNAL_ACTION_BPE_IMPLEMENTATION_KEY,
+                EXTERNAL_ACTION_BPE_IMPLEMENTATION_DEFAULT );
+    }
+    
+    public String getExternalActionDefaultImplementation()
+    {
+      return lookupString(
+                EXTERNAL_ACTION_DEFAULT_IMPLEMENTATION_KEY,
+                null );
     }
 
     /**


Reply via email to