You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by ad...@apache.org on 2006/02/28 17:05:47 UTC
svn commit: r381686 [13/40] - in /incubator/ode/scratch/bpe: ./ bpelTests/
bpelTests/probeService/ bpelTests/test1/ bpelTests/test10/
bpelTests/test12/ bpelTests/test13/ bpelTests/test14/ bpelTests/test15/
bpelTests/test16/ bpelTests/test17/ bpelTests/...
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/bped/managed/EventDirectorEjbImpl.java.keep
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/bped/managed/EventDirectorEjbImpl.java.keep?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/bped/managed/EventDirectorEjbImpl.java.keep (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/bped/managed/EventDirectorEjbImpl.java.keep Tue Feb 28 08:02:48 2006
@@ -0,0 +1,362 @@
+package com.sybase.bpe.bped.ejbimpl;
+
+import java.util.Stack;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import com.sybase.bpe.bped.DeployTypeEnum;
+import com.sybase.bpe.bped.EventDirector;
+import com.sybase.bpe.bped.EventDirectorException;
+import com.sybase.bpe.bped.EventDirectorUtil;
+import com.sybase.bpe.bped.IDeployer;
+import com.sybase.bpe.bped.IInternalEventDirector;
+import com.sybase.bpe.client.impl.IInternalMessage;
+import com.sybase.bpe.client.impl.IInternalResult;
+import com.sybase.bpe.correlation.CorrelationService;
+import com.sybase.bpe.correlation.CorrelationServiceException;
+import com.sybase.bpe.correlation.ejbimpl.CorrelationServiceEjbImpl;
+import com.sybase.bpe.definition.service.DefinitionService;
+import com.sybase.bpe.engine.ProcessInstance;
+import com.sybase.bpe.engine.ProcessService;
+import com.sybase.bpe.engine.ReturnMessageLocatorHolder;
+import com.sybase.bpe.event.Fault;
+import com.sybase.bpe.event.IRequestMessageEvent;
+import com.sybase.bpe.event.IResponseMessage;
+import com.sybase.bpe.event.IStaticKey;
+import com.sybase.bpe.event.LoadDefinitionEvent;
+import com.sybase.bpe.event.StateEvent;
+import com.sybase.bpe.locking.LockingService;
+import com.sybase.bpe.timerservice.IBPETimer;
+import com.sybase.bpe.util.BPEProperties;
+import com.sybase.bpe.util.BPException;
+import com.sybase.bpe.uuid.UUIDService;
+
+/**
+ * An EJB implementation of EventDirector.
+ *
+ */
+public class EventDirectorEjbImpl implements IInternalEventDirector, EventDirector {
+
+ private static Logger logger =
+ Logger.getLogger(EventDirectorEjbImpl.class.getName());
+
+ private ReturnMessageLocatorHolder rmlh;
+ private IRequestMessageEvent me;
+ private UUIDService us;
+ private ProcessService processService;
+ // correlation service
+ private CorrelationService correlationService;
+ private LockingService lockingService;
+ private DefinitionService definitionService;
+
+
+ // 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();
+
+ // mark for dead current process
+ private boolean dead;
+
+ public void clearState() {
+ if (correlationService instanceof CorrelationServiceEjbImpl)
+ {
+ CorrelationServiceEjbImpl csei = (CorrelationServiceEjbImpl) (correlationService);
+ csei.clearState();
+ }
+ }
+ private void preSendEvent(){
+ if (correlationService instanceof CorrelationServiceEjbImpl)
+ {
+ CorrelationServiceEjbImpl csei = (CorrelationServiceEjbImpl) (correlationService);
+ csei.incNestedCorrelation();
+ }
+ }
+ private void postSendEvent() throws CorrelationServiceException {
+ if (correlationService instanceof CorrelationServiceEjbImpl)
+ {
+ CorrelationServiceEjbImpl csei = (CorrelationServiceEjbImpl) (correlationService);
+ if ( csei.decNestedCorrelation() == 0 ) {
+ csei.persistRegistrationChanges();
+ }
+ }
+ }
+
+ /**
+ * @see com.sybase.bpe.bped.IInternalEventDirector#init(BPEProperties, CorrelationService)
+ */
+ public void init(BPEProperties props, ProcessService ps, CorrelationService cs, UUIDService us, LockingService ls)
+ throws BPException {
+
+ try {
+
+ InitialContext context = new InitialContext();
+
+ // get process service
+ props = new BPEProperties(true,context);
+ this.us = us;
+ processService = ps;
+ correlationService = cs;
+ lockingService = ls;
+
+
+ } catch ( NamingException e) {
+ BPException bpx = new BPException("NATIVE_EXCEPTION",new Object[] {"NamingException"},e);
+ bpx.log(logger,Level.SEVERE);
+ throw bpx;
+ }
+ }
+
+ /**
+ * @see com.sybase.bpe.bped.IInternalEventDirector#getCorrelationService()
+ */
+ public CorrelationService getCorrelationService() {
+ return correlationService;
+ }
+
+ /**
+ * @see com.sybase.bpe.bped.IInternalEventDirector#getLockingService()
+ */
+ public LockingService getLockingService() {
+ return lockingService;
+ }
+
+ /**
+ * @see com.sybase.bpe.bped.IInternalEventDirector#getProcessService()
+ */
+ public ProcessService getProcessService() {
+
+ return processService;
+
+ }
+
+ /* (non-Javadoc)
+ * @see com.sybase.bpe.bped.EventDirector#getReturnMessageMetadata()
+ */
+ public ReturnMessageLocatorHolder getReturnMessageMetadata() {
+
+ return this.rmlh;
+ }
+
+ /* (non-Javadoc)
+ * @see com.sybase.bpe.bped.EventDirector#setReturnMessageMetadata(java.util.Collection)
+ */
+ public void setReturnMessageMetadata(ReturnMessageLocatorHolder rmlh) {
+ this.rmlh = rmlh;
+
+ }
+
+ /* (non-Javadoc)
+ * @see com.sybase.bpe.bped.EventDirector#getMessageEvent()
+ */
+ public IRequestMessageEvent getMessageEvent() {
+
+ return this.me;
+ }
+
+ /* (non-Javadoc)
+ * @see com.sybase.bpe.bped.EventDirector#setMessageEvent(com.sybase.bpe.event.MessageEvent)
+ */
+ public void setMessageEvent(IRequestMessageEvent me) {
+ this.me =me;
+
+ }
+
+ /* (non-Javadoc)
+ * @see com.sybase.bpe.engine.IEvaluationContext#release()
+ */
+ public void release() {
+ try {
+ us.close();
+ } catch ( Exception e ) {
+ // log a warning if the uuid service doesn't close properly
+ logger.log(Level.WARNING,"",e);
+ }
+ processService.getInstanceService().getDefinitionService().releaseExternalActions();
+ }
+
+ /**
+ * @see com.sybase.bpe.bped.IInternalEventDirector#sendEvent(IRequestMessageEvent, boolean)
+ * @ejb:interface-method
+ */
+ public IResponseMessage sendEvent(IRequestMessageEvent msg, boolean sync)
+ throws BPException
+ {
+
+ IResponseMessage er = null;
+ logger.fine("Received message event.");
+ preSendEvent();
+
+ //Let the definition service know that the definition load
+ //phase has completed and we are now sending service requests.
+ //This is needed for the definitionService optimization caching.
+ getDefinitionService().prepare();
+ er = correlationService.correlateEvent((IRequestMessageEvent) msg,
+ sync, this);
+
+ postSendEvent();
+ return er;
+ }
+
+ private DefinitionService getDefinitionService() throws BPException
+ {
+ if ( definitionService == null )
+ {
+ definitionService = this.correlationService.
+ getProcessService().getInstanceService().getDefinitionService();
+ }
+ return definitionService;
+ }
+
+ /**
+ * @see com.sybase.bpe.bped.IInternalEventDirector#activate(String)
+ */
+ public void activate(String rootKey, String procKey) throws BPException {
+
+ try {
+ EventDirectorUtil.activate(this,rootKey,procKey);
+ } catch ( EventDirectorException ede ) {
+ logger.log(Level.SEVERE,"",ede);
+ throw ede;
+ }
+ }
+
+ /**
+ * @see com.sybase.bpe.bped.IInternalEventDirector#terminate(String)
+ */
+
+ public void terminate(String rootKey,String procKey) throws BPException {
+
+ try
+ {
+ EventDirectorUtil.terminate(this,rootKey,procKey);
+ } catch ( EventDirectorException ede ) {
+ logger.log(Level.SEVERE,"",ede);
+ throw ede;
+ }
+
+ }
+
+
+ /**
+ * @see com.sybase.bpe.bped.IInternalEventDirector#pause(String)
+ */
+ public void pause(String rootKey, String procKey) throws BPException {
+ EventDirectorUtil.pause(this,rootKey,procKey);
+ }
+
+ /* (non-Javadoc)
+ * @see com.sybase.bpe.bped.IEventDirector#getDeployer(com.sybase.bpe.bped.DeployTypeEnum)
+ */
+ public IDeployer getDeployer(DeployTypeEnum type) {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see com.sybase.bpe.bped.EventDirector#sendEvent(com.sybase.bpe.event.StateEvent, boolean)
+ */
+ public void sendEvent(StateEvent me, boolean sync) throws BPException
+ {
+ preSendEvent();
+
+ try {
+ EventDirectorUtil.handleStateEvent(this, processService, me);
+ } catch ( BPException e ) {
+ clearState();
+ throw e;
+ } catch ( Exception e2 ) {
+ clearState();
+ throw new BPException(e2);
+ }
+
+ postSendEvent();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.sybase.bpe.bped.EventDirector#sendEvent(com.sybase.bpe.event.LoadDefinitionEvent,
+ * boolean)
+ */
+ public void sendEvent(LoadDefinitionEvent me, boolean sync) throws BPException {
+
+ EventDirectorUtil.handleLoadDefintionEvent(this,me);
+
+ }
+
+ /* (non-Javadoc)
+ * @see com.sybase.bpe.bped.EventDirector#sendEvent(com.sybase.bpe.timerservice.IBPETimer, boolean)
+ */
+ public Fault sendEvent(IBPETimer me, boolean sync) throws BPException {
+ preSendEvent();
+ try {
+ EventDirectorUtil.handleTimerEvent(this,me);
+ } catch (Exception e) {
+ clearState();
+ logger.log(Level.SEVERE,"",e);
+ return null;
+ }
+ postSendEvent();
+ return null;
+ }
+
+ /**
+ * @see com.sybase.bpe.engine.IEvaluationContext#addProcessInstance(com.sybase.bpe.engine.ProcessInstance)
+ */
+ public void addProcessInstance(ProcessInstance pi) {
+ processInstanceStack.push(pi);
+
+ }
+
+ /**
+ * @see com.sybase.bpe.engine.IEvaluationContext#getNextProcessInstance()
+ */
+ public ProcessInstance getNextProcessInstance() {
+ return ( processInstanceStack.size() > 0 ) ? (ProcessInstance)processInstanceStack.pop() : null;
+ }
+
+ /**
+ * @see com.sybase.bpe.engine.IEvaluationContext#initProcessInstanceCollection()
+ */
+ public void initProcessInstanceCollection() {
+ processInstanceStack.clear();
+ }
+ /**
+ * @see com.sybase.bpe.engine.IEvaluationContext#hasMoreProcessInstances()
+ */
+ public boolean processInstanceCollectionIsEmpty() {
+ return processInstanceStack.isEmpty();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sybase.bpe.engine.IEvaluationContext#setDeadProcess()
+ */
+ public void setDeadProcess(boolean mark) {
+ dead = mark;
+ }
+
+ /* (non-Javadoc)
+ * @see com.sybase.bpe.engine.IEvaluationContext#isDeadProcess()
+ */
+ public boolean isDeadProcess() {
+ return dead;
+ }
+
+ public IInternalResult sendRequest(IStaticKey staticKey, IInternalMessage internalRequest)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+ /* (non-Javadoc)
+ * @see com.sybase.bpe.bped.EventDirector#getIInternalEventDirector()
+ */
+ public IInternalEventDirector getIInternalEventDirector() {
+ return this;
+ }
+
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/bped/managed/EventDirectorLocal.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/bped/managed/EventDirectorLocal.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/bped/managed/EventDirectorLocal.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/bped/managed/EventDirectorLocal.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,101 @@
+/*
+* Confidential property of Sybase, Inc.
+*
+* Copyright 1987 - 2006.
+*
+* Sybase, Inc. All rights reserved.
+*
+* Unpublished rights reserved under U.S. copyright laws.
+*
+* This software contains confidential and trade secret information
+* of Sybase, Inc. Use, duplication or disclosure of the software and
+* documentation by the U.S. Government is subject to restrictions
+* set forth in a license agreement between the Government and Sybase,
+* Inc. or other written agreement specifying the Government's rights
+* to use the software and any applicable FAR provisions, for example,
+* FAR 52.227-19.
+*
+* Sybase, Inc. One Sybase Drive, Dublin, CA 94568, USA
+*
+* http://www.sybase.com
+*/
+/*
+ * Created on Aug 16, 2003
+ *
+ */
+package com.sybase.bpe.bped.managed;
+
+//import java.util.logging.Logger;
+
+import com.sybase.bpe.bped.DeployTypeEnum;
+import com.sybase.bpe.bped.EventDirector;
+import com.sybase.bpe.bped.IDeployer;
+import com.sybase.bpe.bped.IInternalEventDirector;
+import com.sybase.bpe.bped.managed.BPEventDirectorLocal;
+import com.sybase.bpe.client.impl.IInternalMessage;
+import com.sybase.bpe.client.impl.IInternalResult;
+import com.sybase.bpe.definition.service.managed.ProcessDefinition;
+import com.sybase.bpe.event.IRequestMessageEvent;
+import com.sybase.bpe.event.IResponseMessage;
+import com.sybase.bpe.event.IStaticKey;
+import com.sybase.bpe.event.StateEvent;
+import com.sybase.bpe.util.BPException;
+
+/**
+ * @author charper
+ *
+ */
+public class EventDirectorLocal implements EventDirector {
+
+// private static Logger logger =
+// Logger.getLogger(EventDirectorLocal.class.getName());
+
+ private BPEventDirectorLocal bped;
+ private ProcessDefinition pd;
+ /**
+ * @param bped
+ * @param pd
+ */
+ public EventDirectorLocal(BPEventDirectorLocal bped, ProcessDefinition pd) {
+ this.bped = bped;
+ this.pd = pd;
+ }
+
+ /* (non-Javadoc)
+ * @see com.sybase.bpe.bped.IEventDirector#getDeployer(com.sybase.bpe.bped.DeployTypeEnum)
+ */
+ public IDeployer getDeployer(DeployTypeEnum type) {
+ if ( type.equals(DeployTypeEnum.BPEL)) {
+ return new BPELDeployerRemote(pd);
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see com.sybase.bpe.bped.ISendEvent#sendEvent(com.sybase.bpe.event.Event, boolean)
+ */
+ public IResponseMessage sendEvent(IRequestMessageEvent msg, boolean sync) throws BPException {
+ return bped.sendEvent(msg,sync);
+ }
+
+ public IInternalResult sendRequest(IStaticKey staticKey,
+ IInternalMessage internalRequest)
+ {
+ return bped.sendRequest(staticKey, internalRequest );
+ }
+
+ /* (non-Javadoc)
+ * @see com.sybase.bpe.bped.ISendEvent#sendEvent(com.sybase.bpe.event.StateEvent, boolean)
+ */
+ public void sendEvent(StateEvent me, boolean sync) throws BPException {
+ bped.sendEvent(me,sync);
+ }
+
+ /* (non-Javadoc)
+ * @see com.sybase.bpe.bped.EventDirector#getIInternalEventDirector()
+ */
+ public IInternalEventDirector getIInternalEventDirector() {
+ return bped.getIInternalEventDirector();
+ }
+
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/bped/managed/EventDirectorRemote.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/bped/managed/EventDirectorRemote.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/bped/managed/EventDirectorRemote.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/bped/managed/EventDirectorRemote.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,127 @@
+/*
+* Confidential property of Sybase, Inc.
+*
+* Copyright 1987 - 2006.
+*
+* Sybase, Inc. All rights reserved.
+*
+* Unpublished rights reserved under U.S. copyright laws.
+*
+* This software contains confidential and trade secret information
+* of Sybase, Inc. Use, duplication or disclosure of the software and
+* documentation by the U.S. Government is subject to restrictions
+* set forth in a license agreement between the Government and Sybase,
+* Inc. or other written agreement specifying the Government's rights
+* to use the software and any applicable FAR provisions, for example,
+* FAR 52.227-19.
+*
+* Sybase, Inc. One Sybase Drive, Dublin, CA 94568, USA
+*
+* http://www.sybase.com
+*/
+/*
+ * Created on Aug 16, 2003
+ *
+ */
+package com.sybase.bpe.bped.managed;
+
+import java.rmi.RemoteException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import com.sybase.bpe.bped.DeployTypeEnum;
+import com.sybase.bpe.bped.EventDirector;
+import com.sybase.bpe.bped.IDeployer;
+import com.sybase.bpe.bped.IInternalEventDirector;
+import com.sybase.bpe.bped.managed.BPEventDirector;
+import com.sybase.bpe.client.impl.IInternalMessage;
+import com.sybase.bpe.client.impl.IInternalResult;
+import com.sybase.bpe.definition.service.managed.ProcessDefinition;
+import com.sybase.bpe.event.IRequestMessageEvent;
+import com.sybase.bpe.event.IResponseMessage;
+import com.sybase.bpe.event.IStaticKey;
+import com.sybase.bpe.event.StateEvent;
+import com.sybase.bpe.util.BPException;
+
+/**
+ * @author charper
+ *
+ */
+public class EventDirectorRemote implements EventDirector {
+
+ private static Logger logger =
+ Logger.getLogger(EventDirectorRemote.class.getName());
+
+ private BPEventDirector bped;
+ private ProcessDefinition pd;
+ /**
+ * @param bped
+ * @param pd
+ */
+ public EventDirectorRemote(BPEventDirector bped, ProcessDefinition pd) {
+ this.bped = bped;
+ this.pd = pd;
+ }
+
+ /* (non-Javadoc)
+ * @see com.sybase.bpe.bped.IEventDirector#getDeployer(com.sybase.bpe.bped.DeployTypeEnum)
+ */
+ public IDeployer getDeployer(DeployTypeEnum type) {
+ if ( type.equals(DeployTypeEnum.BPEL)) {
+ return new BPELDeployerRemote(pd);
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see com.sybase.bpe.bped.ISendEvent#sendEvent(com.sybase.bpe.event.Event, boolean)
+ */
+ public IResponseMessage sendEvent(IRequestMessageEvent msg, boolean sync) throws BPException {
+ try {
+ return bped.sendEvent(msg,sync);
+ } catch (RemoteException e) {
+ BPException bpx = new BPException("NATIVE_EXCEPTION",new Object[] {"RemoteException"},e);
+ bpx.log(logger,Level.SEVERE);
+ throw bpx;
+
+ }
+ }
+
+ public IInternalResult sendRequest(IStaticKey staticKey,
+ IInternalMessage internalRequest)
+ {
+ IInternalResult result = null;
+ try
+ {
+ result =
+ bped.sendRequest(staticKey, internalRequest );
+ } catch (RemoteException e)
+ {
+ throw new RuntimeException(e);
+ }
+
+ return result;
+ }
+
+ /* (non-Javadoc)
+ * @see com.sybase.bpe.bped.ISendEvent#sendEvent(com.sybase.bpe.event.StateEvent, boolean)
+ */
+ public void sendEvent(StateEvent me, boolean sync) throws BPException {
+ try {
+ bped.sendEvent(me,sync);
+ } catch (RemoteException e) {
+ BPException bpx = new BPException("NATIVE_EXCEPTION",new Object[] {"RemoteException"},e);
+ bpx.log(logger,Level.SEVERE);
+ throw bpx;
+
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see com.sybase.bpe.bped.EventDirector#getIInternalEventDirector()
+ */
+ public IInternalEventDirector getIInternalEventDirector() {
+ throw new UnsupportedOperationException();
+ }
+
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/bped/unmanaged/BPELDeployerSLImpl.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/bped/unmanaged/BPELDeployerSLImpl.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/bped/unmanaged/BPELDeployerSLImpl.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/bped/unmanaged/BPELDeployerSLImpl.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,135 @@
+/*
+* Confidential property of Sybase, Inc.
+*
+* Copyright 1987 - 2006.
+*
+* Sybase, Inc. All rights reserved.
+*
+* Unpublished rights reserved under U.S. copyright laws.
+*
+* This software contains confidential and trade secret information
+* of Sybase, Inc. Use, duplication or disclosure of the software and
+* documentation by the U.S. Government is subject to restrictions
+* set forth in a license agreement between the Government and Sybase,
+* Inc. or other written agreement specifying the Government's rights
+* to use the software and any applicable FAR provisions, for example,
+* FAR 52.227-19.
+*
+* Sybase, Inc. One Sybase Drive, Dublin, CA 94568, USA
+*
+* http://www.sybase.com
+*/
+/*
+ * Created on Aug 13, 2003
+ *
+ */
+package com.sybase.bpe.bped.unmanaged;
+
+
+import java.io.InputStream;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import com.sybase.bpe.bped.IDeployer;
+import com.sybase.bpe.bped.IInternalEventDirector;
+import com.sybase.bpe.definition.IPMDRoot;
+import com.sybase.bpe.definition.service.DefinitionService;
+import com.sybase.bpe.definition.service.DefinitionServiceException;
+import com.sybase.bpe.deployment.DefinitionKey;
+import com.sybase.bpe.deployment.ResourceDeployer;
+import com.sybase.bpe.deployment.bpel.BPELDeploy;
+import com.sybase.bpe.deployment.bpel.DeploymentException;
+import com.sybase.bpe.engine.ProcessDefinitionKey;
+import com.sybase.bpe.event.LoadDefinitionEvent;
+import com.sybase.bpe.util.BPException;
+
+/**
+ * @author charper
+ *
+ */
+public class BPELDeployerSLImpl implements IDeployer {
+
+ private static Logger logger =
+ Logger.getLogger(BPELDeployerSLImpl.class.getName());
+
+ private DefinitionService ds;
+ private IInternalEventDirector ed;
+
+ protected BPELDeployerSLImpl(IInternalEventDirector ed){
+ this.ed = ed;
+ this.ds = ed.getProcessService().getInstanceService().getDefinitionService();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sybase.bpe.bped.IDeployer#loadDefinition(java.lang.String, boolean)
+ */
+ public Collection loadDefinition(String resource, boolean validating) throws BPException {
+
+ ResourceDeployer rd = new ResourceDeployer(new BPELDeploy(ds));
+ Collection keys = null ;
+ keys = rd.deployResource(resource, validating, null);
+ loadKeys(keys);
+ return keys;
+ }
+
+ /* (non-Javadoc)
+ * @see com.sybase.bpe.bped.IDeployer#loadDefintion(java.io.InputStream, java.lang.String, boolean)
+ */
+ public Collection loadDefinition(InputStream is, boolean validating) throws BPException {
+
+ Collection keys = null ;
+ BPELDeploy deployer = new BPELDeploy(ds);
+ keys = deployer.deployJar(is, validating, null);
+ loadKeys(keys);
+ return keys;
+ }
+
+ private void loadKeys(Collection keys) {
+ try {
+ // load all the defs
+ Iterator it = keys.iterator();
+ while ( it.hasNext() ) {
+
+ DefinitionKey defkey = (DefinitionKey)it.next();
+ IPMDRoot rootDef = ds.getRootDefinition(new ProcessDefinitionKey(defkey.getKey()));
+ // load the keys
+ ed.sendEvent(
+ new LoadDefinitionEvent(
+ rootDef.getProcess().getKey().getValue()),
+ true);
+
+ }
+
+
+ } catch (DeploymentException e) {
+ logger.log(Level.SEVERE,"",e);
+ } catch (DefinitionServiceException e) {
+ logger.log(Level.SEVERE,"",e);
+ } catch (BPException e) {
+ logger.log(Level.SEVERE,"",e);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see com.sybase.bpe.bped.IDeployer#removeDefinition(java.lang.String)
+ */
+ public void removeDefinition(String defID) {
+ try {
+ ds.deleteDefinition(new ProcessDefinitionKey(defID));
+ } catch (BPException e) {
+ logger.log(Level.SEVERE,"",e);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see com.sybase.bpe.bped.IDeployer#setStateless(java.lang.String)
+ */
+ public void setStateless(String defID) throws BPException {
+ IPMDRoot root = ds.getRootDefinition(new ProcessDefinitionKey(defID));
+ root.setIsStateless(true);
+ }
+
+
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/bped/unmanaged/EventDirectorSLImpl.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/bped/unmanaged/EventDirectorSLImpl.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/bped/unmanaged/EventDirectorSLImpl.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/bped/unmanaged/EventDirectorSLImpl.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,289 @@
+/*
+* Confidential property of Sybase, Inc.
+*
+* Copyright 1987 - 2006.
+*
+* Sybase, Inc. All rights reserved.
+*
+* Unpublished rights reserved under U.S. copyright laws.
+*
+* This software contains confidential and trade secret information
+* of Sybase, Inc. Use, duplication or disclosure of the software and
+* documentation by the U.S. Government is subject to restrictions
+* set forth in a license agreement between the Government and Sybase,
+* Inc. or other written agreement specifying the Government's rights
+* to use the software and any applicable FAR provisions, for example,
+* FAR 52.227-19.
+*
+* Sybase, Inc. One Sybase Drive, Dublin, CA 94568, USA
+*
+* http://www.sybase.com
+*/
+package com.sybase.bpe.bped.unmanaged;
+
+
+import java.util.Stack;
+import java.util.logging.Logger;
+
+import com.sybase.bpe.bped.DeployTypeEnum;
+import com.sybase.bpe.bped.EventContext;
+import com.sybase.bpe.bped.EventDirectorUtil;
+import com.sybase.bpe.bped.ExternalEventDirectorBase;
+import com.sybase.bpe.bped.IDeployer;
+import com.sybase.bpe.bped.IInternalEventDirector;
+import com.sybase.bpe.correlation.CorrelationService;
+import com.sybase.bpe.engine.ProcessInstance;
+import com.sybase.bpe.engine.ProcessService;
+import com.sybase.bpe.engine.ReturnMessageLocatorHolder;
+import com.sybase.bpe.event.Fault;
+import com.sybase.bpe.event.IRequestMessageEvent;
+import com.sybase.bpe.event.IResponseMessage;
+import com.sybase.bpe.event.LoadDefinitionEvent;
+import com.sybase.bpe.event.StateEvent;
+import com.sybase.bpe.lang.ResourceGetter;
+import com.sybase.bpe.locking.LockingService;
+import com.sybase.bpe.timerservice.IBPETimer;
+import com.sybase.bpe.util.BPEProperties;
+import com.sybase.bpe.util.BPException;
+import com.sybase.bpe.uuid.UUIDService;
+
+/**
+ * A stateless implementation of EventDirector.
+ */
+public class EventDirectorSLImpl extends ExternalEventDirectorBase
+ implements IInternalEventDirector {
+
+ private static Logger logger =
+ Logger.getLogger(EventDirectorSLImpl.class.getName());
+
+ private ProcessService processService;
+ // correlation service
+ private CorrelationService correlationService;
+ private LockingService lockingService;
+ private EventContext currentEventContext;
+
+ 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();
+
+ // mark for dead current process
+ private boolean dead;
+
+ /**
+ * @see com.sybase.bpe.bped.IInternalEventDirector#init(BPEProperties, CorrelationService)
+ */
+ public void init(BPEProperties props, ProcessService ps, CorrelationService cs, UUIDService us, LockingService ls)
+ throws BPException {
+ correlationService = cs;
+ this.us = us;
+ processService = ps;
+ lockingService = ls;
+ }
+
+ /**
+ * @see com.sybase.bpe.bped.IInternalEventDirector#getCorrelationService()
+ */
+ public CorrelationService getCorrelationService() {
+ return correlationService;
+ }
+
+ /**
+ * @see com.sybase.bpe.bped.IInternalEventDirector#getLockingService()
+ */
+ public LockingService getLockingService() {
+ return lockingService;
+ }
+
+ /**
+ * @see com.sybase.bpe.bped.IInternalEventDirector#getProcessService()
+ */
+ public ProcessService getProcessService() {
+ return processService;
+ }
+
+ /**
+ * @see com.sybase.bpe.bped.IInternalEventDirector#sendEvent(IRequestMessageEvent, boolean)
+ */
+ public IResponseMessage sendEvent(IRequestMessageEvent msg, boolean sync)
+ throws BPException {
+
+ logger.fine("Received message event.");
+
+
+ // Create stack-like behaviour for the eventContext
+ // 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();
+ IResponseMessage responseMessage = this.getCorrelationService().correlateEvent(msg, sync, this);
+ currentEventContext = previousEventContext;
+
+ return responseMessage;
+ }
+
+ /**
+ * @see com.sybase.bpe.bped.IInternalEventDirector#activate(String)
+ */
+ public void activate(String rootKey, String procKey) throws BPException {
+
+ EventDirectorUtil.activate(this,rootKey,procKey);
+ }
+
+ /**
+ * @see com.sybase.bpe.bped.IInternalEventDirector#terminate(String)
+ */
+ public void terminate(String rootKey,String procKey)
+ throws BPException {
+ EventDirectorUtil.terminate(this,rootKey,procKey);
+ }
+
+ /**
+ * @see com.sybase.bpe.bped.IInternalEventDirector#pause(String)
+ */
+ public void pause(String rootKey,String procKey) throws BPException {
+ EventDirectorUtil.pause(this,rootKey,procKey);
+ }
+
+ /**
+ * Handle status events.
+ * @param ae The admin event.
+ * @return A WorkFlowEventResult.
+ */
+ private void handleStateEvent ( StateEvent se, boolean sync )
+ throws BPException {
+ if ( ! sync ) {
+ // if this StateEvent is sent syncronously log and error
+ // since this EventDirector implementation does not start
+ // new threads
+ logger.severe(ResourceGetter.getString("ED_ED_SMT"));
+ }
+ EventDirectorUtil.handleStateEvent(this,
+ processService,se);
+ }
+
+ /* (non-Javadoc)
+ * @see com.sybase.bpe.bped.EventDirector#getReturnMessageMetadata()
+ */
+ public ReturnMessageLocatorHolder getReturnMessageMetadata() {
+ return currentEventContext.getReturnMessageMetadata();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sybase.bpe.bped.EventDirector#getMessageEvent()
+ */
+ public IRequestMessageEvent getMessageEvent() {
+ return currentEventContext.getMessageEvent();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sybase.bpe.bped.EventDirector#setReturnMessageMetadata(java.util.Collection)
+ */
+ public void setReturnMessageMetadata(ReturnMessageLocatorHolder rmlh) {
+ currentEventContext.setReturnMessageMetadata(rmlh);
+ }
+
+ /* (non-Javadoc)
+ * @see com.sybase.bpe.bped.EventDirector#setMessageEvent(com.sybase.bpe.event.MessageEvent)
+ */
+ public void setMessageEvent(IRequestMessageEvent me) {
+ currentEventContext.setMessageEvent(me);
+
+ }
+
+ /* (non-Javadoc)
+ * @see com.sybase.bpe.engine.IEvaluationContext#release()
+ */
+ public void release() {
+ us.close();
+ processService.getInstanceService().getDefinitionService().releaseExternalActions();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sybase.bpe.bped.IEventDirector#getDeployer(com.sybase.bpe.bped.DeployTypeEnum)
+ */
+ public IDeployer getDeployer(DeployTypeEnum type) {
+ if ( type.equals(DeployTypeEnum.BPEL)) {
+ return new BPELDeployerSLImpl(this);
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see com.sybase.bpe.bped.EventDirector#sendEvent(com.sybase.bpe.event.StateEvent)
+ */
+ public void sendEvent(StateEvent me, boolean sync) throws BPException {
+ logger.fine("Recieved state event.");
+ currentEventContext = new EventContext();
+ this.handleStateEvent(me, sync);
+
+ }
+
+ /* (non-Javadoc)
+ * @see com.sybase.bpe.bped.EventDirector#sendEvent(com.sybase.bpe.event.LoadDefinitionEvent)
+ */
+ public void sendEvent(LoadDefinitionEvent me, boolean sync) throws BPException {
+ EventDirectorUtil.handleLoadDefintionEvent(this,me);
+
+ }
+
+ /* (non-Javadoc)
+ * @see com.sybase.bpe.bped.EventDirector#sendEvent(com.sybase.bpe.timerservice.IBPETimer)
+ */
+ public Fault sendEvent(IBPETimer me, boolean sync) throws BPException {
+ EventDirectorUtil.handleTimerEvent(this,me);
+ return null;
+ }
+
+ /**
+ * @see com.sybase.bpe.engine.IEvaluationContext#addProcessInstance(com.sybase.bpe.engine.ProcessInstance)
+ */
+ public void addProcessInstance(ProcessInstance pi) {
+ processInstanceStack.push(pi);
+
+ }
+
+ /**
+ * @see com.sybase.bpe.engine.IEvaluationContext#getNextProcessInstance()
+ */
+ public ProcessInstance getNextProcessInstance() {
+ return ( processInstanceStack.size() > 0 ) ? (ProcessInstance)processInstanceStack.pop() : null;
+ }
+
+ /**
+ * @see com.sybase.bpe.engine.IEvaluationContext#initProcessInstanceCollection()
+ */
+ public void initProcessInstanceCollection() {
+ processInstanceStack.clear();
+ }
+ /**
+ * @see com.sybase.bpe.engine.IEvaluationContext#hasMoreProcessInstances()
+ */
+ public boolean processInstanceCollectionIsEmpty() {
+ return processInstanceStack.isEmpty();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sybase.bpe.engine.IEvaluationContext#setDeadProcess()
+ */
+ public void setDeadProcess(boolean mark) {
+ dead = mark;
+ }
+
+ /* (non-Javadoc)
+ * @see com.sybase.bpe.engine.IEvaluationContext#isDeadProcess()
+ */
+ public boolean isDeadProcess() {
+ return dead;
+ }
+
+ /* (non-Javadoc)
+ * @see com.sybase.bpe.bped.EventDirector#getIInternalEventDirector()
+ */
+ public IInternalEventDirector getIInternalEventDirector() {
+ return this;
+ }
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/base/CCServiceBase.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/base/CCServiceBase.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/base/CCServiceBase.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/base/CCServiceBase.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,505 @@
+/*
+* Confidential property of Sybase, Inc.
+*
+* Copyright 1987 - 2006.
+*
+* Sybase, Inc. All rights reserved.
+*
+* Unpublished rights reserved under U.S. copyright laws.
+*
+* This software contains confidential and trade secret information
+* of Sybase, Inc. Use, duplication or disclosure of the software and
+* documentation by the U.S. Government is subject to restrictions
+* set forth in a license agreement between the Government and Sybase,
+* Inc. or other written agreement specifying the Government's rights
+* to use the software and any applicable FAR provisions, for example,
+* FAR 52.227-19.
+*
+* Sybase, Inc. One Sybase Drive, Dublin, CA 94568, USA
+*
+* http://www.sybase.com
+*/
+
+package com.sybase.bpe.cc.base;
+
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.Properties;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import com.sybase.bpe.bped.EventDirector;
+import com.sybase.bpe.bped.EventDirectorFactory;
+import com.sybase.bpe.bped.IInternalEventDirector;
+import com.sybase.bpe.cc.client.CCException;
+import com.sybase.bpe.cc.client.IBundle;
+import com.sybase.bpe.cc.data.DefinitionData;
+import com.sybase.bpe.cc.data.EngineData;
+import com.sybase.bpe.cc.data.InstanceData;
+import com.sybase.bpe.cc.data.PartData;
+import com.sybase.bpe.cc.data.ScopeData;
+import com.sybase.bpe.cc.data.VariableData;
+import com.sybase.bpe.cc.service.ICCService;
+import com.sybase.bpe.definition.IPMDRoot;
+import com.sybase.bpe.definition.service.DefinitionService;
+import com.sybase.bpe.engine.StateEnum;
+import com.sybase.bpe.enginestate.service.EngineStateFactory;
+import com.sybase.bpe.enginestate.service.IEngineState;
+import com.sybase.bpe.event.StateEvent;
+import com.sybase.bpe.instance.IPMIProcess;
+import com.sybase.bpe.instance.service.InstanceService;
+import com.sybase.bpe.util.BPException;
+
+
+public class CCServiceBase implements ICCService
+{
+
+ private static Logger logger =
+ Logger.getLogger(CCServiceBase.class.getName());
+
+ private transient IEngineState m_engineStateService = null;
+ //private transient String m_engineName = EngineStateFactory.ENGINE_NAME;
+ public transient EventDirector eventDirector;
+ public transient IInternalEventDirector m_intED;
+
+ public CCServiceBase () {
+ }
+
+ public CCServiceBase(Properties props) {
+ eventDirector = (EventDirector)props.get(EventDirector.class.getName());
+ if ( eventDirector == null ) {
+ try {
+ eventDirector = EventDirectorFactory.createEventDirector();
+ } catch (BPException e) {
+ logger.log(Level.SEVERE,"",e);
+ }
+ }
+ m_intED = eventDirector.getIInternalEventDirector();
+ }
+
+ protected DefinitionService getDefinitionService()
+ {
+ DefinitionService definitionService =
+ m_intED.getProcessService().
+ getInstanceService().
+ getDefinitionService();
+
+ return definitionService;
+ }
+
+ protected InstanceService getInstanceService()
+ {
+ InstanceService instanceService =
+ m_intED.
+ getProcessService().
+ getInstanceService();
+
+ return instanceService;
+ }
+
+
+ protected IEngineState getSS() throws CCException
+ {
+ if ( m_engineStateService == null)
+ {
+ try
+ {
+ m_engineStateService =
+ EngineStateFactory.getEngineState("BPE_ENGINE_"+ eventDirector.hashCode() );
+ } catch (BPException e)
+ {
+ throw new CCException(e);
+ }
+ }
+
+ return m_engineStateService;
+ }
+ /**
+ * @ejb:interface-method
+ */
+ public Collection getDefinitionData() throws CCException
+ {
+ Collection defs;
+ Collection defData;
+ try
+ {
+ defs =
+ getDefinitionService().
+ getRootDefinitions();
+
+ defData =
+ DataExtractor.getDefinitionData(defs);
+ }
+ catch( BPException e)
+ {
+ throw new CCException( e );
+ }
+ return defData;
+ }
+ /**
+ * @ejb:interface-method
+ */
+ public Collection getInstancesData(String iBPDefinitionID)
+ throws CCException
+ {
+ Collection returnCollection;
+ try
+ {
+ Collection instances =
+ getInstanceService().
+ getRootInstances(iBPDefinitionID);
+
+ returnCollection =
+ DataExtractor.getInstanceData( instances );
+ } catch (BPException e)
+ {
+ throw new CCException( e );
+ }
+ if ( returnCollection == null )
+ {
+ return new LinkedList();
+ }
+ else
+ {
+ return returnCollection;
+ }
+ }
+ /**
+ * @ejb:interface-method
+ */
+ public void cleanupNow() throws CCException
+ {
+ // TODO Auto-generated method stub
+ }
+ /**
+ * @ejb:interface-method
+ */
+ public void cleanCompletedSince(Date iDate) throws CCException
+ {
+ // TODO Auto-generated method stub
+ }
+ /**
+ * @ejb:interface-method
+ */
+ public void pauseEngine() throws CCException
+ {
+ // TODO Auto-generated method stub
+ }
+ /**
+ * @ejb:interface-method
+ */
+ public void resumeEngine() throws CCException
+ {
+ // TODO Auto-generated method stub
+ }
+ /**
+ * @ejb:interface-method
+ */
+ public Collection deployBundle(IBundle source)
+ throws CCException
+ {
+ return null;
+ }
+ /**
+ * @ejb:interface-method
+ */
+ public InstanceData getInstanceData(String instanceID) throws CCException
+ {
+ try
+ {
+ IPMIProcess instance =
+ getInstanceService().getRootInstance(instanceID);
+
+ InstanceData instanceData =
+ DataExtractor.getInstanceData( instance );
+
+ return instanceData;
+
+ } catch (BPException e)
+ {
+ throw new CCException(e);
+ }
+ }
+ /**
+ * @ejb:interface-method
+ */
+ public DefinitionData getDefinitionData(String definitionID)
+ throws CCException
+ {
+ return null;
+ }
+ /**
+ * @ejb:interface-method
+ */
+ public void deactivateDefinition(DefinitionData data) throws CCException
+ {
+ try
+ {
+ getDefinitionService().
+ deactivateDefinition( data.getID() );
+
+ } catch (BPException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+ /**
+ * @ejb:interface-method
+ */
+ public void activateDefinition(DefinitionData data) throws CCException
+ {
+ try
+ {
+ getDefinitionService().
+ activateDefinition( data.getID() );
+
+ } catch (BPException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+ /**
+ * @ejb:interface-method
+ */
+ public void removeDefinition(DefinitionData data) throws CCException
+ {
+ try
+ {
+ getDefinitionService().deleteDefinition( data.getID() );
+ } catch (BPException e)
+ {
+ throw new CCException(e);
+ }
+ }
+ /**
+ * @ejb:interface-method
+ */
+
+ public EngineData getEngineData() throws CCException
+ {
+ try {
+ return DataExtractor.getEngineData(getSS());
+ } catch (BPException e) {
+ throw new CCException(e);
+ }
+ }
+ /**
+ * @ejb:interface-method
+ */
+ public DefinitionData getDefinitionForInstance(String instanceID)
+ throws CCException
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+ /**
+ * @ejb:interface-method
+ */
+ public void pauseInstance(InstanceData data) throws CCException
+ {
+ try
+ {
+ getInstanceService().pauseRootInstance( data.getID());
+ } catch (BPException e)
+ {
+ throw new CCException( e );
+ }
+ }
+ /**
+ * @ejb:interface-method
+ */
+ public void terminateInstance(InstanceData data) throws CCException
+ {
+
+ if ( logger.isLoggable(Level.FINE)) {
+ logger.fine("Terminating process:"+data.getID());
+ }
+ StateEvent se = new StateEvent(data.getID(),data.getID(),StateEnum.TERMINATED);
+ try {
+ eventDirector.sendEvent(se,true);
+ } catch (BPException e) {
+ throw new CCException( e );
+ }
+ }
+ /**
+ * @ejb:interface-method
+ */
+ public void resumeInstance(InstanceData data) throws CCException
+ {
+ try
+ {
+ getInstanceService().resumeRootInstance(data.getID());
+ } catch (BPException e)
+ {
+ throw new CCException(e);
+ }
+ }
+ /**
+ * @ejb:interface-method
+ */
+ public void removeInstance(InstanceData data) throws CCException
+ {
+ // TODO Auto-generated method stub
+ }
+ /**
+ * @ejb:interface-method
+ */
+ public ScopeData getContextScopeData(InstanceData data) throws CCException
+ {
+ return null;
+
+ }
+ /**
+ * @ejb:interface-method
+ */
+ public Collection getChildScopes(ScopeData data) throws CCException
+ {
+
+ return new LinkedList();
+ }
+ /**
+ * @ejb:interface-method
+ */
+ public Collection getVariables(ScopeData data) throws CCException
+ {
+ return new LinkedList();
+ }
+ /**
+ * @ejb:interface-method
+ */
+ public Collection getRegistrations(InstanceData data) throws CCException
+ {
+ return new LinkedList();
+ /*
+ try
+ {
+ LinkedList returnRegistrations = new LinkedList();
+ IPMIProcess pi = m_intED.getProcessService().getInstanceService().getRootInstance(data.getID());
+ Collection pendingRegistrations = m_intED.getCorrelationService().getRegistrations(pi);
+
+ Iterator iter = pendingRegistrations.iterator();
+ while( iter.hasNext() )
+ {
+ IRegistration reg =
+ ( IRegistration ) ( iter.next() );
+
+ String opid = reg.getOpId();
+ //String defid = reg.getDefId();
+ String defid = data.getDefinitionID();
+
+ IPMDRoot pmdRoot = m_intED.getProcessService().getInstanceService().getDefinitionService().getRootDefinition(defid);
+
+ IPMDOperation pmdOperation = pmdRoot.getOperation(opid);
+ IStaticKey staticKey = pmdOperation.getKey();
+
+ String registrationName = null;
+ String opName = null;
+ String pType = null;
+ String namespace = null;
+ String dynamicKey = reg.getKeyValue();
+
+ if ( staticKey instanceof BPELStaticKey )
+ {
+ BPELStaticKey bpelStaticKey = ( BPELStaticKey ) ( staticKey );
+ opName = bpelStaticKey.getOperation();
+ registrationName = opName;
+ pType = bpelStaticKey.getPortType();
+ namespace = bpelStaticKey.getTargetNamespace();
+ }
+
+ RegistrationData rd = new RegistrationData( data, registrationName,
+ opName, pType, namespace, dynamicKey );
+ returnRegistrations.add( rd );
+ }
+ return returnRegistrations;
+
+ } catch (BPException e)
+ {
+ throw new CCException( e );
+ }
+ */
+
+ }
+ /**
+ * @ejb:interface-method
+ */
+ public Collection getPartData(VariableData data) throws CCException
+ {
+ return new LinkedList();
+ }
+ /**
+ * @ejb:interface-method
+ */
+ public void cleanup(Date completionDate) throws CCException
+ {
+ // TODO Auto-generated method stub
+ }
+ /**
+ * @ejb:interface-method
+ */
+ public Object getPartValue(PartData data) throws CCException
+ {
+ return null;
+ }
+ /**
+ * @ejb:interface-method
+ */
+ public void setAutomaticCleanup(boolean automaticCleanup) throws CCException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+
+ /**
+ * @ejb:interface-method
+ */
+ public Map getDefinitionStatistics(DefinitionData data) throws CCException
+ {
+ return new HashMap();
+ }
+ /**
+ * @ejb:interface-method
+ */
+ public Map getEngineStatistics(EngineData data) throws CCException
+ {
+ return new HashMap();
+ }
+ /**
+ * @ejb:interface-method
+ */
+ public Map getInstanceStatistics(InstanceData data) throws CCException
+ {
+ return new HashMap();
+ }
+
+ /**
+ * @ejb:interface-method
+ */
+ public Collection getProcessCreatingOperations(DefinitionData data)
+ throws CCException
+ {
+ Collection operationData = null;
+ try
+ {
+ IPMDRoot root = getDefinitionService().getRootDefinition( data.getID());
+ if ( root != null )
+ {
+ Collection operations = root.getInstanceCreatingOperations();
+ operationData = DataExtractor.createOperationData(operations);
+ }
+ } catch (BPException e)
+ {
+ throw new CCException(e);
+ }
+
+ if ( operationData == null )
+ {
+ operationData = new LinkedList();
+ }
+ return operationData;
+ }
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/base/DataExtractor.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/base/DataExtractor.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/base/DataExtractor.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/base/DataExtractor.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,170 @@
+/*
+* Confidential property of Sybase, Inc.
+*
+* Copyright 1987 - 2006.
+*
+* Sybase, Inc. All rights reserved.
+*
+* Unpublished rights reserved under U.S. copyright laws.
+*
+* This software contains confidential and trade secret information
+* of Sybase, Inc. Use, duplication or disclosure of the software and
+* documentation by the U.S. Government is subject to restrictions
+* set forth in a license agreement between the Government and Sybase,
+* Inc. or other written agreement specifying the Government's rights
+* to use the software and any applicable FAR provisions, for example,
+* FAR 52.227-19.
+*
+* Sybase, Inc. One Sybase Drive, Dublin, CA 94568, USA
+*
+* http://www.sybase.com
+*/
+package com.sybase.bpe.cc.base;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.LinkedList;
+
+import com.sybase.bpe.cc.client.DefinitionState;
+import com.sybase.bpe.cc.client.EngineState;
+import com.sybase.bpe.cc.client.InstanceState;
+import com.sybase.bpe.cc.data.DefinitionData;
+import com.sybase.bpe.cc.data.EngineData;
+import com.sybase.bpe.cc.data.InstanceData;
+import com.sybase.bpe.cc.data.OperationData;
+import com.sybase.bpe.definition.IPMDOperation;
+import com.sybase.bpe.definition.IPMDRoot;
+import com.sybase.bpe.enginestate.service.IEngineState;
+import com.sybase.bpe.event.BPELStaticKey;
+import com.sybase.bpe.instance.IPMIProcess;
+import com.sybase.bpe.util.BPException;
+public class DataExtractor
+{
+ public static Collection getDefinitionData(Collection defs)
+ throws BPException
+ {
+ Collection dataCollection = new LinkedList();
+ Iterator iter = defs.iterator();
+ while (iter.hasNext())
+ {
+ IPMDRoot rootDef = (IPMDRoot) (iter.next());
+ DefinitionData dd = getDefinitionData( rootDef );
+ dataCollection.add( dd );
+ }
+ return dataCollection;
+ }
+ public static DefinitionData getDefinitionData(IPMDRoot def)
+ throws BPException
+ {
+ DefinitionData dd = new DefinitionData();
+ dd.setID(def.getProcess().getKey().getValue());
+ dd.setName(def.getLabel());
+ DefinitionState defState = createDefinitionState(def.getState());
+ dd.setState( defState );
+ return dd;
+ }
+ public static DefinitionState createDefinitionState(int iState)
+ {
+ if (DefinitionState.ACTIVE.intValue() == iState)
+ {
+ return DefinitionState.ACTIVE;
+ } else if (DefinitionState.INACTIVE.intValue() == iState)
+ {
+ return DefinitionState.INACTIVE;
+ }
+ return DefinitionState.UNKNOWN;
+ }
+ public static Collection getInstanceData(Collection instances) throws BPException
+ {
+ Iterator iter = instances.iterator();
+ LinkedList returnValue = new LinkedList();
+ while( iter.hasNext() )
+ {
+ IPMIProcess instance = ( IPMIProcess ) ( iter.next() );
+ InstanceData instanceData = getInstanceData( instance );
+ returnValue.add(instanceData);
+ }
+ return returnValue;
+ }
+
+ public static InstanceData getInstanceData( IPMIProcess instance ) throws BPException
+ {
+ InstanceData instanceData = new InstanceData();
+ String id = instance.getKey();
+ instanceData.setID( id );
+ instanceData.setState( createInstanceState( instance.getState() ) );
+ return instanceData;
+ }
+
+ public static EngineData getEngineData( IEngineState engine ) throws BPException
+ {
+ EngineData engineData = new EngineData();
+ String id = engine.getId();
+ engineData.setID( id );
+ engineData.setState( createEngineState( engine.getState() ) );
+ return engineData;
+ }
+
+ public static InstanceState createInstanceState(int state)
+ {
+ switch( state )
+ {
+ case( InstanceState.FINISHED_CONST):
+ {
+ return InstanceState.FINISHED;
+ }
+ case( InstanceState.STARTED_CONST):
+ {
+ return InstanceState.STARTED;
+ }
+ case( InstanceState.PAUSED_CONST):
+ {
+ return InstanceState.PAUSED;
+ }
+ case( InstanceState.RUNNING_CONST):
+ {
+ return InstanceState.RUNNING;
+ }
+ case( InstanceState.TERMINATED_CONST):
+ {
+ return InstanceState.TERMINATED;
+ }
+ default:
+ {
+ return InstanceState.UNKNOWN;
+ }
+ }
+
+ }
+
+ public static EngineState createEngineState(String state)
+ {
+ if (EngineState.PAUSED.equals(state))
+ {
+ return EngineState.PAUSED;
+ } else
+ {
+ return EngineState.RUNNING;
+ }
+
+ }
+ public static Collection createOperationData(Collection operations)
+ {
+ Iterator iter = operations.iterator();
+ LinkedList returnCollection = new LinkedList();
+ while( iter.hasNext() )
+ {
+ IPMDOperation pmdOperation = ( IPMDOperation )( iter.next() );
+ returnCollection.add( createOperationData( pmdOperation ));
+ }
+ return returnCollection;
+ }
+
+ public static OperationData createOperationData( IPMDOperation operation )
+ {
+ BPELStaticKey key = ( BPELStaticKey )( operation.getKey() );
+ OperationData data = new OperationData(key.getTargetNamespace(),
+ key.getPortType(), key.getOperation(), key.toString() );
+ return data;
+
+ }
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/BPELBundle.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/BPELBundle.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/BPELBundle.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/BPELBundle.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,77 @@
+/*
+* Confidential property of Sybase, Inc.
+*
+* Copyright 1987 - 2006.
+*
+* Sybase, Inc. All rights reserved.
+*
+* Unpublished rights reserved under U.S. copyright laws.
+*
+* This software contains confidential and trade secret information
+* of Sybase, Inc. Use, duplication or disclosure of the software and
+* documentation by the U.S. Government is subject to restrictions
+* set forth in a license agreement between the Government and Sybase,
+* Inc. or other written agreement specifying the Government's rights
+* to use the software and any applicable FAR provisions, for example,
+* FAR 52.227-19.
+*
+* Sybase, Inc. One Sybase Drive, Dublin, CA 94568, USA
+*
+* http://www.sybase.com
+*/
+
+package com.sybase.bpe.cc.client;
+
+import java.io.InputStream;
+import java.io.Serializable;
+//import java.util.logging.Logger;
+
+
+public class BPELBundle implements IBPELBundle, Serializable
+{
+
+ static final long serialVersionUID = -7999904011331733849L;
+
+// private static Logger logger =
+// Logger.getLogger(BPELBundle.class.getName());
+
+ private String name;
+ private String resourcePath;
+ private InputStream jarStream;
+
+ public BPELBundle()
+ {
+ }
+
+ public BPELBundle( String name, InputStream file)
+ {
+ this.name = name;
+ this.jarStream = file;
+
+ }
+
+ public BPELBundle( String name, String resourcePath)
+ {
+ this.name = name;
+ this.resourcePath = resourcePath;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public InputStream getAsInputStream()
+ {
+ return jarStream;
+ }
+
+ public boolean isStream() {
+ return resourcePath == null;
+ }
+
+ public String getResourcePath() {
+ return resourcePath;
+ }
+
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/CCClient.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/CCClient.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/CCClient.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/CCClient.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,46 @@
+/*
+* Confidential property of Sybase, Inc.
+*
+* Copyright 1987 - 2006.
+*
+* Sybase, Inc. All rights reserved.
+*
+* Unpublished rights reserved under U.S. copyright laws.
+*
+* This software contains confidential and trade secret information
+* of Sybase, Inc. Use, duplication or disclosure of the software and
+* documentation by the U.S. Government is subject to restrictions
+* set forth in a license agreement between the Government and Sybase,
+* Inc. or other written agreement specifying the Government's rights
+* to use the software and any applicable FAR provisions, for example,
+* FAR 52.227-19.
+*
+* Sybase, Inc. One Sybase Drive, Dublin, CA 94568, USA
+*
+* http://www.sybase.com
+*/
+
+package com.sybase.bpe.cc.client;
+
+import java.util.HashMap;
+
+import com.sybase.bpe.cc.client.impl.EngineFactory;
+
+
+public class CCClient implements ICCClient
+{
+ public CCClient() throws CCException
+ {
+
+ }
+ public IEngine getEngine() throws CCException
+ {
+ HashMap config = new HashMap();
+ return getEngine(config);
+ }
+ public IEngine getEngine(HashMap config) throws CCException
+ {
+ IEngine engine = EngineFactory.createEngine( config );
+ return engine;
+ }
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/CCException.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/CCException.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/CCException.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/CCException.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,38 @@
+/*
+* Confidential property of Sybase, Inc.
+*
+* Copyright 1987 - 2006.
+*
+* Sybase, Inc. All rights reserved.
+*
+* Unpublished rights reserved under U.S. copyright laws.
+*
+* This software contains confidential and trade secret information
+* of Sybase, Inc. Use, duplication or disclosure of the software and
+* documentation by the U.S. Government is subject to restrictions
+* set forth in a license agreement between the Government and Sybase,
+* Inc. or other written agreement specifying the Government's rights
+* to use the software and any applicable FAR provisions, for example,
+* FAR 52.227-19.
+*
+* Sybase, Inc. One Sybase Drive, Dublin, CA 94568, USA
+*
+* http://www.sybase.com
+*/
+
+package com.sybase.bpe.cc.client;
+
+import java.io.Serializable;
+
+public class CCException extends Exception implements Serializable
+{
+ static final long serialVersionUID = 7888638787959868908L;
+
+ public CCException()
+ {
+ }
+ public CCException( Exception e )
+ {
+ super(e);
+ }
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/DefinitionQuery.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/DefinitionQuery.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/DefinitionQuery.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/DefinitionQuery.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,40 @@
+/*
+* Confidential property of Sybase, Inc.
+*
+* Copyright 1987 - 2006.
+*
+* Sybase, Inc. All rights reserved.
+*
+* Unpublished rights reserved under U.S. copyright laws.
+*
+* This software contains confidential and trade secret information
+* of Sybase, Inc. Use, duplication or disclosure of the software and
+* documentation by the U.S. Government is subject to restrictions
+* set forth in a license agreement between the Government and Sybase,
+* Inc. or other written agreement specifying the Government's rights
+* to use the software and any applicable FAR provisions, for example,
+* FAR 52.227-19.
+*
+* Sybase, Inc. One Sybase Drive, Dublin, CA 94568, USA
+*
+* http://www.sybase.com
+*/
+
+package com.sybase.bpe.cc.client;
+
+import java.util.Properties;
+
+
+public class DefinitionQuery implements IDefinitionQuery
+{
+ private Properties queryProperties;
+ public DefinitionQuery(Properties queryProperties )
+ {
+ this.queryProperties = queryProperties;
+ }
+
+ public Properties getQueryProperties()
+ {
+ return queryProperties;
+ }
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/DefinitionState.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/DefinitionState.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/DefinitionState.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/DefinitionState.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,86 @@
+/*
+* Confidential property of Sybase, Inc.
+*
+* Copyright 1987 - 2006.
+*
+* Sybase, Inc. All rights reserved.
+*
+* Unpublished rights reserved under U.S. copyright laws.
+*
+* This software contains confidential and trade secret information
+* of Sybase, Inc. Use, duplication or disclosure of the software and
+* documentation by the U.S. Government is subject to restrictions
+* set forth in a license agreement between the Government and Sybase,
+* Inc. or other written agreement specifying the Government's rights
+* to use the software and any applicable FAR provisions, for example,
+* FAR 52.227-19.
+*
+* Sybase, Inc. One Sybase Drive, Dublin, CA 94568, USA
+*
+* http://www.sybase.com
+*/
+
+package com.sybase.bpe.cc.client;
+
+import java.io.ObjectStreamException;
+import java.io.Serializable;
+
+
+/**
+ * Represents enumerated states of the process definition.
+ */
+public class DefinitionState implements Serializable
+{
+
+ static final long serialVersionUID = -8196810743841034766L;
+
+ private final String m_state;
+ private final int m_intState;
+ private DefinitionState( String iState, int iIntState )
+ {
+ m_state = iState;
+ m_intState = iIntState;
+ }
+
+ public String toString()
+ {
+ return m_state;
+ }
+
+ public int intValue()
+ {
+ return m_intState;
+ }
+
+ private static final int ACTIVE_CONST = 0;
+ private static final int INACTIVE_CONST = 1;
+ private static final int UNKNOWN_CONST = 2;
+
+ public static final DefinitionState ACTIVE =
+ new DefinitionState( "Active", ACTIVE_CONST);
+ public static final DefinitionState INACTIVE =
+ new DefinitionState("Inactive", INACTIVE_CONST);
+ public static final DefinitionState UNKNOWN =
+ new DefinitionState("Unknown", UNKNOWN_CONST);
+
+ private Object readResolve() throws
+ ObjectStreamException
+ {
+ switch( m_intState )
+ {
+ case(ACTIVE_CONST):
+ {
+ return ACTIVE;
+ }
+ case(INACTIVE_CONST):
+ {
+ return INACTIVE;
+ }
+ case(UNKNOWN_CONST):
+ {
+ return UNKNOWN;
+ }
+ }
+ return UNKNOWN;
+ }
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/EngineState.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/EngineState.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/EngineState.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/EngineState.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,63 @@
+/*
+* Confidential property of Sybase, Inc.
+*
+* Copyright 1987 - 2006.
+*
+* Sybase, Inc. All rights reserved.
+*
+* Unpublished rights reserved under U.S. copyright laws.
+*
+* This software contains confidential and trade secret information
+* of Sybase, Inc. Use, duplication or disclosure of the software and
+* documentation by the U.S. Government is subject to restrictions
+* set forth in a license agreement between the Government and Sybase,
+* Inc. or other written agreement specifying the Government's rights
+* to use the software and any applicable FAR provisions, for example,
+* FAR 52.227-19.
+*
+* Sybase, Inc. One Sybase Drive, Dublin, CA 94568, USA
+*
+* http://www.sybase.com
+*/
+
+package com.sybase.bpe.cc.client;
+
+import java.io.ObjectStreamException;
+import java.io.Serializable;
+
+
+/**
+ * Represents enumerated states of the process engine.
+ */
+public class EngineState implements Serializable
+{
+ static final long serialVersionUID = 2782690805200091637L;
+
+ private final String m_state;
+ private EngineState( String iState )
+ {
+ m_state = iState;
+ }
+
+ public String toString()
+ {
+ return m_state;
+ }
+
+ public static final EngineState RUNNING =
+ new EngineState( "Running");
+ public static final EngineState PAUSED =
+ new EngineState("Paused");
+
+ private Object readResolve() throws ObjectStreamException
+ {
+
+ if (m_state.equals("Running"))
+ {
+ return RUNNING;
+ }
+
+ return PAUSED;
+
+ }
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IBPELBundle.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IBPELBundle.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IBPELBundle.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IBPELBundle.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,36 @@
+/*
+* Confidential property of Sybase, Inc.
+*
+* Copyright 1987 - 2006.
+*
+* Sybase, Inc. All rights reserved.
+*
+* Unpublished rights reserved under U.S. copyright laws.
+*
+* This software contains confidential and trade secret information
+* of Sybase, Inc. Use, duplication or disclosure of the software and
+* documentation by the U.S. Government is subject to restrictions
+* set forth in a license agreement between the Government and Sybase,
+* Inc. or other written agreement specifying the Government's rights
+* to use the software and any applicable FAR provisions, for example,
+* FAR 52.227-19.
+*
+* Sybase, Inc. One Sybase Drive, Dublin, CA 94568, USA
+*
+* http://www.sybase.com
+*/
+
+package com.sybase.bpe.cc.client;
+
+import java.io.InputStream;
+
+
+public interface IBPELBundle extends IBundle
+{
+
+ static final long serialVersionUID = -3166595740402622949L;
+
+ public boolean isStream();
+ public InputStream getAsInputStream();
+ public String getResourcePath();
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IBundle.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IBundle.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IBundle.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IBundle.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,33 @@
+/*
+* Confidential property of Sybase, Inc.
+*
+* Copyright 1987 - 2006.
+*
+* Sybase, Inc. All rights reserved.
+*
+* Unpublished rights reserved under U.S. copyright laws.
+*
+* This software contains confidential and trade secret information
+* of Sybase, Inc. Use, duplication or disclosure of the software and
+* documentation by the U.S. Government is subject to restrictions
+* set forth in a license agreement between the Government and Sybase,
+* Inc. or other written agreement specifying the Government's rights
+* to use the software and any applicable FAR provisions, for example,
+* FAR 52.227-19.
+*
+* Sybase, Inc. One Sybase Drive, Dublin, CA 94568, USA
+*
+* http://www.sybase.com
+*/
+
+package com.sybase.bpe.cc.client;
+
+import java.io.Serializable;
+
+
+public interface IBundle extends Serializable
+{
+ static final long serialVersionUID = -5646689444725258493L;
+
+ public String getName();
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/ICCClient.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/ICCClient.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/ICCClient.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/ICCClient.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,31 @@
+/*
+* Confidential property of Sybase, Inc.
+*
+* Copyright 1987 - 2006.
+*
+* Sybase, Inc. All rights reserved.
+*
+* Unpublished rights reserved under U.S. copyright laws.
+*
+* This software contains confidential and trade secret information
+* of Sybase, Inc. Use, duplication or disclosure of the software and
+* documentation by the U.S. Government is subject to restrictions
+* set forth in a license agreement between the Government and Sybase,
+* Inc. or other written agreement specifying the Government's rights
+* to use the software and any applicable FAR provisions, for example,
+* FAR 52.227-19.
+*
+* Sybase, Inc. One Sybase Drive, Dublin, CA 94568, USA
+*
+* http://www.sybase.com
+*/
+package com.sybase.bpe.cc.client;
+
+import java.util.HashMap;
+
+
+public interface ICCClient
+{
+ public IEngine getEngine() throws CCException;
+ public IEngine getEngine(HashMap env) throws CCException;
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IChildScope.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IChildScope.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IChildScope.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IChildScope.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,34 @@
+/*
+* Confidential property of Sybase, Inc.
+*
+* Copyright 1987 - 2006.
+*
+* Sybase, Inc. All rights reserved.
+*
+* Unpublished rights reserved under U.S. copyright laws.
+*
+* This software contains confidential and trade secret information
+* of Sybase, Inc. Use, duplication or disclosure of the software and
+* documentation by the U.S. Government is subject to restrictions
+* set forth in a license agreement between the Government and Sybase,
+* Inc. or other written agreement specifying the Government's rights
+* to use the software and any applicable FAR provisions, for example,
+* FAR 52.227-19.
+*
+* Sybase, Inc. One Sybase Drive, Dublin, CA 94568, USA
+*
+* http://www.sybase.com
+*/
+
+package com.sybase.bpe.cc.client;
+
+
+public interface IChildScope extends IScope
+{
+ /**
+ * Get a handle to the parent scope.
+ * @return
+ * @throws CCException
+ */
+ public IScope getParentScope() throws CCException;
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IDefinition.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IDefinition.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IDefinition.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IDefinition.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,89 @@
+/*
+* Confidential property of Sybase, Inc.
+*
+* Copyright 1987 - 2006.
+*
+* Sybase, Inc. All rights reserved.
+*
+* Unpublished rights reserved under U.S. copyright laws.
+*
+* This software contains confidential and trade secret information
+* of Sybase, Inc. Use, duplication or disclosure of the software and
+* documentation by the U.S. Government is subject to restrictions
+* set forth in a license agreement between the Government and Sybase,
+* Inc. or other written agreement specifying the Government's rights
+* to use the software and any applicable FAR provisions, for example,
+* FAR 52.227-19.
+*
+* Sybase, Inc. One Sybase Drive, Dublin, CA 94568, USA
+*
+* http://www.sybase.com
+*/
+package com.sybase.bpe.cc.client;
+
+import java.util.Collection;
+
+/**
+ * Exposes business process definition level command
+ * and control operations.
+ */
+public interface IDefinition extends IStatistical
+{
+ /**
+ * Deactivate the definition. Deactivated definitions
+ * do not create new bp instances.
+ * @throws CCException
+ */
+ public void deactivate() throws CCException;
+ /**
+ * Activate the definition.
+ * @throws CCException
+ */
+ public void activate() throws CCException;
+ /**
+ * Remove the business process definition.
+ * @throws CCException
+ */
+ public void remove() throws CCException;
+ /**
+ * Get the state of the business process definition.
+ * @return
+ * @throws CCException
+ */
+ public DefinitionState getState() throws CCException;
+ /**
+ * Get the active business process instances spawned from
+ * this definition.
+ * @return
+ * The state of the definition.
+ * @throws CCException
+ */
+ public Collection getInstances() throws CCException;
+ /**
+ * Get the human readable name of the definition.
+ * @return
+ * @throws CCException
+ */
+ public String getName() throws CCException;
+ /**
+ * Get the definition id.
+ * @return
+ * @throws CCException
+ */
+ public String getID() throws CCException;
+ /**
+ * Get a handle to the engine which contains the definition.
+ * @return
+ * A handle to the engine.
+ * @throws CCException
+ */
+ public IEngine getEngine() throws CCException;
+
+ /**
+ * Get a collection of IProcessCreatingOperations
+ * @return
+ * A collection of IProcessCreatingOperations.
+ * @throws CCException
+ */
+ public Collection getProcessCreatingOperations() throws CCException;
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IDefinitionQuery.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IDefinitionQuery.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IDefinitionQuery.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IDefinitionQuery.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,32 @@
+/*
+* Confidential property of Sybase, Inc.
+*
+* Copyright 1987 - 2006.
+*
+* Sybase, Inc. All rights reserved.
+*
+* Unpublished rights reserved under U.S. copyright laws.
+*
+* This software contains confidential and trade secret information
+* of Sybase, Inc. Use, duplication or disclosure of the software and
+* documentation by the U.S. Government is subject to restrictions
+* set forth in a license agreement between the Government and Sybase,
+* Inc. or other written agreement specifying the Government's rights
+* to use the software and any applicable FAR provisions, for example,
+* FAR 52.227-19.
+*
+* Sybase, Inc. One Sybase Drive, Dublin, CA 94568, USA
+*
+* http://www.sybase.com
+*/
+
+package com.sybase.bpe.cc.client;
+
+import java.util.Properties;
+
+
+public interface IDefinitionQuery
+{
+ public static final String DEFINITION_NAME = "DefinitionName";
+ public Properties getQueryProperties();
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IEngine.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IEngine.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IEngine.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IEngine.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,125 @@
+/*
+* Confidential property of Sybase, Inc.
+*
+* Copyright 1987 - 2006.
+*
+* Sybase, Inc. All rights reserved.
+*
+* Unpublished rights reserved under U.S. copyright laws.
+*
+* This software contains confidential and trade secret information
+* of Sybase, Inc. Use, duplication or disclosure of the software and
+* documentation by the U.S. Government is subject to restrictions
+* set forth in a license agreement between the Government and Sybase,
+* Inc. or other written agreement specifying the Government's rights
+* to use the software and any applicable FAR provisions, for example,
+* FAR 52.227-19.
+*
+* Sybase, Inc. One Sybase Drive, Dublin, CA 94568, USA
+*
+* http://www.sybase.com
+*/
+package com.sybase.bpe.cc.client;
+
+import java.util.Collection;
+import java.util.Date;
+
+
+/**
+ * Exposes engine level command and control operations.
+ */
+public interface IEngine extends IStatistical
+{
+ /**
+ * Key into the config HashMap to find the engine name.
+ */
+ public final String ENGINE_NAME = "ENGINE_NAME";
+ /**
+ * Pause the engine instance.
+ * @throws CCException
+ */
+ public void pause() throws CCException;
+ /**
+ * Unpause the engine instance.
+ * @throws CCException
+ */
+ public void resume() throws CCException;
+ /**
+ * Get the state of the engine instance ( running, paused, etc. )
+ * @return
+ * The engine state.
+ * @throws CCException
+ */
+ public EngineState getState() throws CCException;
+ /**
+ * Get a collection of the defintions deployed to the engine instance.
+ * @return
+ * @throws CCException
+ */
+ public Collection getDefinitions() throws CCException;
+
+ public void deployBundle(IBundle bundle) throws CCException;
+
+ public void cleanup( Date completionDate ) throws CCException;
+ /**
+ * Cleanup all complete business process objects now.
+ * @throws CCException
+ */
+ public void cleanupNow() throws CCException;
+ /**
+ * Get a handle to a business process instanced based on a supplied id.
+ * @param iInstanceID
+ * Business process instance id
+ * @return
+ * Handle to a business process instance useful for instance level
+ * command and control.
+ * @throws CCException
+ */
+ public IInstance getInstance( String instanceID ) throws CCException;
+ /**
+ * Get a handle to a deployed business process definition based on a supplied
+ * id.
+ * @param iDefinitionID
+ * Business process definition id.
+ * @return
+ * Handle to a business process definition.
+ * @throws CCException
+ */
+ public IDefinition getDefinition( IDefinitionQuery query ) throws CCException;
+ /**
+ * Get the engine's human readable name.
+ * @return
+ * The name of the engine.
+ * @throws CCException
+ */
+ public String getName() throws CCException;
+ /**
+ * Get the engine's unique id.
+ * @return
+ * The engine's unique id.
+ * @throws CCException
+ */
+ public String getID() throws CCException;
+
+ /**
+ * Specify whether or not the engine should automatically
+ * clean up completed instance data.
+ * @param iAutomaticCleanup
+ */
+ public void setAutomaticCleanup( boolean automaticCleanup )
+ throws CCException;
+
+ /**
+ * Get the engine's automatic cleanup flag.
+ * @return
+ */
+ public boolean getAutomaticCleanup();
+
+ /**
+ * Returns true if the engine has already undergone
+ * the bootstrapping process.
+ * @throws CCException
+ */
+ public boolean isBootstrapped() throws CCException;
+
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IInstance.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IInstance.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IInstance.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IInstance.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,99 @@
+/*
+* Confidential property of Sybase, Inc.
+*
+* Copyright 1987 - 2006.
+*
+* Sybase, Inc. All rights reserved.
+*
+* Unpublished rights reserved under U.S. copyright laws.
+*
+* This software contains confidential and trade secret information
+* of Sybase, Inc. Use, duplication or disclosure of the software and
+* documentation by the U.S. Government is subject to restrictions
+* set forth in a license agreement between the Government and Sybase,
+* Inc. or other written agreement specifying the Government's rights
+* to use the software and any applicable FAR provisions, for example,
+* FAR 52.227-19.
+*
+* Sybase, Inc. One Sybase Drive, Dublin, CA 94568, USA
+*
+* http://www.sybase.com
+*/
+
+package com.sybase.bpe.cc.client;
+
+import java.util.Collection;
+
+
+
+/**
+ * @author blorenz
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+/**
+ * Exposes business process instance level command
+ * and control operations.
+ */
+public interface IInstance extends IStatistical
+{
+ /**
+ * Pause the business process instance.
+ * @throws CCException
+ */
+ public void pause() throws CCException;
+ /**
+ * Terminate the business process instance.
+ * @throws CCException
+ */
+ public void terminate() throws CCException;
+ /**
+ * Unpause the business process instance.
+ * @throws CCException
+ */
+ public void resume() throws CCException;
+ /**
+ * Remove the business process instance.
+ * @throws CCException
+ */
+ public void remove() throws CCException;
+ /**
+ * Get the state of the business process instance.
+ * @return
+ * The state of the bp instance.
+ * @throws CCException
+ */
+ public InstanceState getState() throws CCException;
+
+ /**
+ * Get the business process instnace id.
+ * @return
+ * @throws CCException
+ */
+ public String getID() throws CCException;
+ /**
+ * Get the instance's associated definition.
+ * @return
+ * @throws CCException
+ */
+ public IDefinition getDefinition() throws CCException;
+
+ /**
+ * Get the business process instance's context.
+ * @return
+ * A handle to the process context.
+ * @throws CCException
+ */
+ public IScope getRootContext() throws CCException;
+
+ /**
+ * Get the instance's active registrations.
+ *
+ * @return
+ * @throws CCException
+ */
+ public Collection getRegistrations() throws CCException;
+
+
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IProcessCreatingOperation.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IProcessCreatingOperation.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IProcessCreatingOperation.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IProcessCreatingOperation.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,31 @@
+/*
+* Confidential property of Sybase, Inc.
+*
+* Copyright 1987 - 2006.
+*
+* Sybase, Inc. All rights reserved.
+*
+* Unpublished rights reserved under U.S. copyright laws.
+*
+* This software contains confidential and trade secret information
+* of Sybase, Inc. Use, duplication or disclosure of the software and
+* documentation by the U.S. Government is subject to restrictions
+* set forth in a license agreement between the Government and Sybase,
+* Inc. or other written agreement specifying the Government's rights
+* to use the software and any applicable FAR provisions, for example,
+* FAR 52.227-19.
+*
+* Sybase, Inc. One Sybase Drive, Dublin, CA 94568, USA
+*
+* http://www.sybase.com
+*/
+
+package com.sybase.bpe.cc.client;
+
+public interface IProcessCreatingOperation
+{
+ public String getPortType();
+ public String getOperationName();
+ public String getPortTypeNamespace();
+ public String getStaticKey();
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IRegistration.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IRegistration.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IRegistration.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IRegistration.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,34 @@
+/*
+* Confidential property of Sybase, Inc.
+*
+* Copyright 1987 - 2006.
+*
+* Sybase, Inc. All rights reserved.
+*
+* Unpublished rights reserved under U.S. copyright laws.
+*
+* This software contains confidential and trade secret information
+* of Sybase, Inc. Use, duplication or disclosure of the software and
+* documentation by the U.S. Government is subject to restrictions
+* set forth in a license agreement between the Government and Sybase,
+* Inc. or other written agreement specifying the Government's rights
+* to use the software and any applicable FAR provisions, for example,
+* FAR 52.227-19.
+*
+* Sybase, Inc. One Sybase Drive, Dublin, CA 94568, USA
+*
+* http://www.sybase.com
+*/
+
+package com.sybase.bpe.cc.client;
+
+
+public interface IRegistration
+{
+ public String getPortType();
+ public String getOperation();
+ public String getTargetNamespace();
+ public String getDynamicKey();
+ public String getName();
+ public IInstance getInstance();
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IScope.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IScope.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IScope.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IScope.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,62 @@
+/*
+* Confidential property of Sybase, Inc.
+*
+* Copyright 1987 - 2006.
+*
+* Sybase, Inc. All rights reserved.
+*
+* Unpublished rights reserved under U.S. copyright laws.
+*
+* This software contains confidential and trade secret information
+* of Sybase, Inc. Use, duplication or disclosure of the software and
+* documentation by the U.S. Government is subject to restrictions
+* set forth in a license agreement between the Government and Sybase,
+* Inc. or other written agreement specifying the Government's rights
+* to use the software and any applicable FAR provisions, for example,
+* FAR 52.227-19.
+*
+* Sybase, Inc. One Sybase Drive, Dublin, CA 94568, USA
+*
+* http://www.sybase.com
+*/
+
+package com.sybase.bpe.cc.client;
+
+import java.util.Collection;
+
+
+/**
+ *Exposes context level command and control operations.
+ */
+public interface IScope
+{
+ /**
+ * Get a collection of child scopes.
+ * @return
+ * A collection of child scope handles.
+ * @throws CCException
+ */
+ public Collection getChildScopes() throws CCException;
+ /**
+ * Get handles to the variables contained in this scope.
+ * @return
+ * A collection of variable handles.
+ * @throws CCException
+ */
+ public Collection getVariables() throws CCException;
+
+ /**
+ * Get a handle to the bp instance that contains the scope.
+ * @return
+ * Handle to the bp instance that contains the scope.
+ * @throws CCException
+ */
+ public IInstance getBPInstance() throws CCException;
+ /**
+ * Get the name of the scope.
+ * @return
+ * The name of the scope.
+ * @throws CCException
+ */
+ public String getName()throws CCException;
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IStatistical.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IStatistical.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IStatistical.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/cc/client/IStatistical.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,34 @@
+/*
+* Confidential property of Sybase, Inc.
+*
+* Copyright 1987 - 2006.
+*
+* Sybase, Inc. All rights reserved.
+*
+* Unpublished rights reserved under U.S. copyright laws.
+*
+* This software contains confidential and trade secret information
+* of Sybase, Inc. Use, duplication or disclosure of the software and
+* documentation by the U.S. Government is subject to restrictions
+* set forth in a license agreement between the Government and Sybase,
+* Inc. or other written agreement specifying the Government's rights
+* to use the software and any applicable FAR provisions, for example,
+* FAR 52.227-19.
+*
+* Sybase, Inc. One Sybase Drive, Dublin, CA 94568, USA
+*
+* http://www.sybase.com
+*/
+
+package com.sybase.bpe.cc.client;
+
+import java.util.Map;
+
+/**
+ * Objects which implement this interface have statistics
+ * which can be harvested.
+ */
+public interface IStatistical
+{
+ public Map getStatistics() throws CCException;
+}