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 [16/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/client/IOperation.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/IOperation.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/IOperation.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/IOperation.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,48 @@
+/*
+* 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.client;
+
+import com.sybase.bpe.client.exceptions.BPEUserException;
+import com.sybase.bpe.client.result.IResult;
+
+/**
+ * Represents an operation exposed by a business process.
+ */
+public interface IOperation
+{
+ public static final String PORT_TYPE = "port.type";
+ public static final String OPERATION = "operation";
+ public static final String PORT_TYPE_NAMESPACE = "target.name.space";
+ /**
+ * Send a synchronous request to the BPE.
+ *
+ * @param request
+ * Request message.
+ * @return
+ * Result of the Request
+ * @throws BPEUserException
+ */
+ public IResult invoke(
+ IBPEMessage request )
+ throws BPEUserException;
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/IValueDescription.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/IValueDescription.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/IValueDescription.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/IValueDescription.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.client;
+
+import java.util.Properties;
+
+
+
+public interface IValueDescription
+{
+ public Class getValueClass();
+ public IFormat getValueFormat();
+ public Properties getContentType();
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/exceptions/BPEClientInstantiationException.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/exceptions/BPEClientInstantiationException.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/exceptions/BPEClientInstantiationException.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/exceptions/BPEClientInstantiationException.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.client.exceptions;
+
+
+/**
+ * An exception of this type indicates that the client
+ * was unable to instantiate its implementation.
+ */
+public class BPEClientInstantiationException extends BPEUserException
+{
+ static final long serialVersionUID = -4150885544671044717L;
+
+ public BPEClientInstantiationException( Exception e )
+ {
+ super(e);
+ }
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/exceptions/BPEUserException.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/exceptions/BPEUserException.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/exceptions/BPEUserException.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/exceptions/BPEUserException.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,58 @@
+/*
+* 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.client.exceptions;
+
+import java.util.Properties;
+/**
+ * This is the base class for all exceptions thrown by the
+ * BPE client interface.
+ */
+public class BPEUserException extends Exception
+{
+ static final long serialVersionUID = -2888469780780690129L;
+
+ protected Properties m_props;
+
+ protected BPEUserException()
+ {
+ }
+
+ protected BPEUserException( Exception e )
+ {
+ super( e );
+ }
+
+ protected BPEUserException( String cause)
+ {
+ super(cause);
+ }
+
+ public void setProperties(Properties props)
+ {
+ m_props = props;
+ }
+
+ public Properties getProperties()
+ {
+ return m_props;
+ }
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/exceptions/InvalidTargetException.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/exceptions/InvalidTargetException.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/exceptions/InvalidTargetException.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/exceptions/InvalidTargetException.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,41 @@
+/*
+* 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.client.exceptions;
+
+/**
+ * The BPE throws an exception of this type when a suitable
+ * target is not available to consume the request. This
+ * exception is different from the ITargetNotReady result
+ * which indicates that the request may have arrived out of
+ * order and may be consumed at some point in the future.
+ *
+ * This exception may be thrown if the BPE can not find
+ * an instance which is ready to consume the event at the
+ * current time and the instance is not configured to consume
+ * out of sequence requests.
+ */
+public class InvalidTargetException extends BPEUserException
+{
+ static final long serialVersionUID = 7692656540454047158L;
+
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/exceptions/SystemException.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/exceptions/SystemException.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/exceptions/SystemException.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/exceptions/SystemException.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,50 @@
+/*
+* 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.client.exceptions;
+
+
+/**
+ * The BPE throws an exception of this type when it encounters an
+ * unexpected exception such as one of the following:
+ *
+ * ClassCastException
+ * NullPointerException
+ * ClassNotFoundException
+ * NamingException
+ * ConnectionFailure
+ * others...
+ *
+ * The exception contains a reference to the low level exception
+ * which caused the problem.
+ *
+ */
+public class SystemException
+ extends BPEUserException
+{
+ static final long serialVersionUID = 7132578244522570446L;
+
+
+ public SystemException( String iCause)
+ {
+ super(iCause);
+ }
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/exceptions/TargetDefinitionPausedException.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/exceptions/TargetDefinitionPausedException.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/exceptions/TargetDefinitionPausedException.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/exceptions/TargetDefinitionPausedException.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,55 @@
+/*
+* 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.client.exceptions;
+
+/**
+ * The BPE client throws an exception of this type if the target
+ * definition is in a paused state. The exception contains
+ * the target definition id.
+ *
+ * The client which handles this request may choose to save
+ * the request so that it can be resubmitted when the process
+ * definition resumes.
+*/
+public class TargetDefinitionPausedException
+ extends BPEUserException
+{
+ static final long serialVersionUID = -4780849624194293843L;
+
+ private String m_definitionID;
+ private String m_definitionName;
+ public TargetDefinitionPausedException(
+ String iDefinitionID,
+ String iDefintionName )
+ {
+ m_definitionID = iDefinitionID;
+ m_definitionName = iDefintionName;
+ }
+ public String getDefinitionID()
+ {
+ return m_definitionID;
+ }
+ public String getDefinitionName()
+ {
+ return m_definitionName;
+ }
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/exceptions/TargetInstancePausedException.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/exceptions/TargetInstancePausedException.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/exceptions/TargetInstancePausedException.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/exceptions/TargetInstancePausedException.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,49 @@
+/*
+* 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.client.exceptions;
+
+/**
+ * The BPE throws and exception of this type if the target
+ * process instance is in a paused state. The exception
+ * contains the id of the paused instance.
+ *
+ * The client application which handles this exception
+ * may choose to save the request and resubmit it when
+ * the process instance resumes.
+ */
+public class TargetInstancePausedException
+ extends BPEUserException
+{
+ static final long serialVersionUID = 2369203027761479450L;
+
+
+ private String m_instanceID;
+ public TargetInstancePausedException( String iInstanceID )
+ {
+ m_instanceID = iInstanceID;
+ }
+ public String getInstanceID()
+ {
+ return m_instanceID;
+ }
+
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/exceptions/UnknownRequestException.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/exceptions/UnknownRequestException.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/exceptions/UnknownRequestException.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/exceptions/UnknownRequestException.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,37 @@
+/*
+* 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.client.exceptions;
+
+
+/**
+ * An exception this type indicates that the BPE could not
+ * identify a possible consumer of the event. The BPE
+ * throws this exception if it does not recognize the
+ * static key contained in the request.
+ */
+public class UnknownRequestException
+ extends BPEUserException
+{
+ static final long serialVersionUID = -7059334972420522416L;
+
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/formats/AtomicFormat.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/formats/AtomicFormat.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/formats/AtomicFormat.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/formats/AtomicFormat.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,57 @@
+/*
+* 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.client.formats;
+
+import com.sybase.bpe.client.IFormat;
+
+
+/**
+* This format indicates data which can not be drilled into or modified in part.
+* Data in this format may be opaque to the BPE or it may be a simple
+* type which can be converted to a string and used in a conditional evaluation.
+*/
+class AtomicFormat implements INativeFormat
+{
+ static final long serialVersionUID = -5763679245311857446L;
+
+ AtomicFormat()
+ {
+ }
+
+ public boolean isSameFormat(IFormat format)
+ {
+ if ( format instanceof AtomicFormat )
+ {
+ return true;
+ }
+ return false;
+ }
+
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ public boolean equals(Object obj) {
+ return obj instanceof AtomicFormat;
+ }
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/formats/INativeFormat.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/formats/INativeFormat.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/formats/INativeFormat.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/formats/INativeFormat.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,37 @@
+/*
+* 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.client.formats;
+
+import com.sybase.bpe.client.IFormat;
+
+
+public interface INativeFormat extends IFormat
+{
+ static final long serialVersionUID = 5662454797021906703L;
+
+
+ // Enumerated formats understood natively by the BPE.
+ public static final IFormat ATOMIC = new AtomicFormat();
+ public static final IFormat XML = new XMLFormat();
+
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/formats/XMLFormat.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/formats/XMLFormat.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/formats/XMLFormat.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/formats/XMLFormat.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,51 @@
+/*
+* 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.client.formats;
+
+import com.sybase.bpe.client.IFormat;
+
+/**
+ * Data in this format is held a buffer which contains an
+ * XML document.
+ */
+public class XMLFormat implements INativeFormat
+{
+
+ static final long serialVersionUID = 1693383337342530213L;
+
+ XMLFormat()
+ {
+ }
+
+ public boolean isSameFormat(IFormat type)
+ {
+ if ( type instanceof XMLFormat )
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/IInternalMessage.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/IInternalMessage.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/IInternalMessage.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/IInternalMessage.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,35 @@
+/*
+* 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.client.impl;
+
+import java.io.Serializable;
+import java.util.Map;
+
+
+public interface IInternalMessage extends Serializable
+{
+ static final long serialVersionUID = -4014012840029262085L;
+
+ public Map getParts();
+ public void setParts( Map parts );
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/IInternalMessageAdapter.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/IInternalMessageAdapter.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/IInternalMessageAdapter.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/IInternalMessageAdapter.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,52 @@
+/*
+* 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.client.impl;
+
+import com.sybase.bpe.event.IRequestMessageEvent;
+import com.sybase.bpe.event.IResponseMessage;
+
+/**
+ * Converts messages client messages to/from
+ * an engine consumable format.
+ *
+ */
+public interface IInternalMessageAdapter
+{
+ /**
+ * Create an internal message from a response message
+ * produced by the BPE.
+ * @param response
+ * @return
+ */
+ public IInternalMessage createInternalMessage(
+ IResponseMessage response );
+
+ /**
+ * Create a request message from an internal
+ * message.
+ * @param internalMessage
+ * @return
+ */
+ public IRequestMessageEvent createRequestMessage(
+ IInternalMessage internalMessage);
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/IInternalRequestConsumer.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/IInternalRequestConsumer.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/IInternalRequestConsumer.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/IInternalRequestConsumer.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.client.impl;
+
+import com.sybase.bpe.event.IStaticKey;
+
+
+public interface IInternalRequestConsumer
+{
+ public IInternalResult
+ sendRequest(IStaticKey staticKey, IInternalMessage internalRequest);
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/IInternalResult.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/IInternalResult.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/IInternalResult.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/IInternalResult.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,65 @@
+/*
+* 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.client.impl;
+
+import java.io.Serializable;
+import java.util.Properties;
+
+
+public interface IInternalResult extends Serializable
+{
+ static final long serialVersionUID = -2941113714302271666L;
+
+ public static final int
+ FAULT_RESULT = 1;
+ public static final int
+ SUCCESS_RESULT = 2;
+ public static final int
+ SUCCESS_WITH_RESPONSE_RESULT = 3;
+ public static final int
+ TARGET_NOT_READY_RESULT = 4;
+ public static final int
+ EXCEPTION_RESULT = 5;
+
+ public static final int SYSTEM_EXCEPTION = 100;
+ public static final int TARGET_DEF_PAUSED_EXCEPTION = 101;
+ public static final int TARGET_INST_PAUSED_EXCEPTION = 102;
+ public static final int INVALID_TARGET_EXCEPTION = 103;
+ public static final int UNKNOWN_REQUEST_EXCEPTION = 104;
+ public static final int PAUSED_TARGET_INSTANCE_EXCEPTION = 105;
+ public static final int DEACTIVATED_TARGET_DEFINITION_EXCEPTION = 106;
+
+ public int getResultType();
+ public IInternalMessage getSuccessfulResponse();
+ public IInternalMessage getFaultMessage();
+ public String getFaultName();
+ public String getFaultNamespace();
+ public String getID();
+ public void setID(String id);
+ public String getDefinitionName();
+ public void setDefinitionName(String definitionName );
+
+ public String getExceptionName();
+ public StackTraceElement[] getExceptionStackTrace();
+ public String getExceptionString();
+ public Properties getExceptionProperties();
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/MessageConverter.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/MessageConverter.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/MessageConverter.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/MessageConverter.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,252 @@
+/*
+* 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.client.impl;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import com.sybase.bpe.client.DescribedValue;
+import com.sybase.bpe.client.IDescribedValue;
+import com.sybase.bpe.client.IFormattableValue;
+import com.sybase.bpe.client.impl.def.InternalMessage;
+import com.sybase.bpe.client.impl.def.InternalResult;
+import com.sybase.bpe.client.spi.interaction.ISPIInteraction;
+import com.sybase.bpe.engine.InactiveDefinitionException;
+import com.sybase.bpe.engine.ProcessInstancePausedException;
+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.SimpleRequestMessageEvent;
+import com.sybase.bpe.interaction.IInteraction;
+import com.sybase.bpe.interaction.spiadapter.SPIAdapterInteraction;
+import com.sybase.bpe.interaction.spiimpl.MasterInteractionFactory;
+import com.sybase.bpe.scope.service.BPRuntimeException;
+import com.sybase.bpe.util.BPException;
+import com.sybase.bpe.action.external.ActionSystemException;
+
+/**
+ * @author blorenz
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+public class MessageConverter
+{
+
+ public IRequestMessageEvent createRequest(IStaticKey key, IInternalMessage internalRequest)
+ {
+ SimpleRequestMessageEvent srm = new SimpleRequestMessageEvent();
+ srm.setStaticKey(key);
+ Map requestParts = internalRequest.getParts();
+ Iterator iter = requestParts.entrySet().iterator();
+ while (iter.hasNext())
+ {
+ Entry entry = (Entry) iter.next();
+ String name = (String)( entry.getKey());
+ IDescribedValue dv = (IDescribedValue) entry.getValue();
+ ISPIInteraction spi = MasterInteractionFactory.newInstance()
+ .createInteraction(dv);
+ SPIAdapterInteraction spiai =
+ new SPIAdapterInteraction( spi );
+ try
+ {
+ srm.setPart( name, spiai );
+ } catch (BPException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+ return srm;
+ }
+
+ static IInternalMessage createInternalMessage(Map parts)
+ {
+ InternalMessage im = new InternalMessage();
+ Iterator iter = parts.entrySet().iterator();
+ HashMap internalParts = new HashMap();
+ while (iter.hasNext())
+ {
+ Entry entry = (Entry) (iter.next());
+ String name = (String) (entry.getKey());
+ Object value = entry.getValue();
+ IFormattableValue fv = null;
+ if (value instanceof IInteraction)
+ {
+ IInteraction interaction = null;
+ interaction = (IInteraction) (entry.getValue());
+
+ if (interaction != null
+ && interaction instanceof SPIAdapterInteraction)
+ {
+ fv = ((SPIAdapterInteraction) (interaction)).getUserValue();
+ }
+ }
+ else
+ {
+ IDescribedValue describedValue = null;
+ if ( value instanceof IDescribedValue )
+ {
+ describedValue = ( IDescribedValue)( value );
+ }
+ else
+ {
+ describedValue = new DescribedValue( value );
+ }
+ ISPIInteraction interaction =
+ MasterInteractionFactory.newInstance().createInteraction( describedValue );
+ fv = interaction.getValue();
+ }
+ internalParts.put(name, fv);
+ }
+ im.setParts(internalParts);
+ return im;
+ }
+
+ public IInternalResult createResult(IResponseMessage response)
+ {
+ Map map = response.getParts();
+
+ InternalResult iresult = new InternalResult();
+ Fault fault;
+ Exception faultException = null;
+ try
+ {
+ fault = response.getFault();
+ if ( fault != null )
+ {
+ faultException = fault.getFaultException();
+ }
+ } catch (BPException e)
+ {
+ throw new RuntimeException(e);
+ }
+
+ /*
+ * catch( ProcessInstancePausedException pipe )
+ {
+ InternalResult internalResult = new InternalResult();
+ MessageConverter.PopulatePausedInstanceException(
+ internalResult, pipe);
+ iresult = internalResult;
+ }
+ catch( InactiveDefinitionException iade )
+ {
+ InternalResult internalResult = new InternalResult();
+ MessageConverter.PopulateInactiveDefinitionException(
+ internalResult, iade );
+ iresult = internalResult;
+ }
+ *
+ *
+ *
+ */
+ if (faultException != null )
+ {
+ if (faultException instanceof BPRuntimeException)
+ {
+ PopulateBusinessProcessFaultResult( iresult,
+ ( BPRuntimeException )( faultException ));
+ }
+ else if( faultException instanceof ProcessInstancePausedException )
+ {
+ PopulatePausedInstanceException(iresult,
+ (ProcessInstancePausedException)faultException);
+ }
+ else if( faultException instanceof InactiveDefinitionException)
+ {
+ PopulateInactiveDefinitionException( iresult,
+ (InactiveDefinitionException)faultException);
+ }
+ else
+ {
+ PopulateSystemExceptionResult( iresult, faultException );
+ }
+ }
+ else
+ {
+ IInternalMessage im = createInternalMessage( map );
+ iresult.setSuccessfulResponse(im);
+ iresult.setResultType(IInternalResult.SUCCESS_WITH_RESPONSE_RESULT);
+ }
+
+
+ return iresult;
+ }
+
+ /**
+ * @param iresult
+ * @param faultException
+ */
+ public static void PopulateSystemExceptionResult(InternalResult iresult, Exception faultException)
+ {
+ iresult.setResultType(IInternalResult.SYSTEM_EXCEPTION);
+ iresult.setExceptionName( faultException.getClass().getName());
+ iresult.setExceptionStackTrace( faultException.getStackTrace());
+ iresult.setExceptionString( faultException.toString());
+ if (faultException instanceof ActionSystemException)
+ {
+ iresult.setExceptionProperties( ((ActionSystemException)faultException).getProperties());
+ }
+
+ }
+
+ /**
+ * @param internalResult
+ * @param bpre
+ */
+ public static void PopulateBusinessProcessFaultResult(InternalResult internalResult, BPRuntimeException bpre)
+ {
+
+ HashMap faultParts = bpre.getMessageParts();
+ IInternalMessage im = createInternalMessage(faultParts);
+ internalResult.setFaultName(bpre.getName());
+ internalResult.setFaultNamespace(bpre.getNameSpace());
+ internalResult.setResultType( IInternalResult.FAULT_RESULT );
+ internalResult.setFaultMessage( im );
+ }
+
+ public static void PopulatePausedInstanceException(
+ InternalResult internalResult,
+ ProcessInstancePausedException pipe)
+ {
+ internalResult.setResultType(
+ IInternalResult.PAUSED_TARGET_INSTANCE_EXCEPTION);
+ internalResult.setID(
+ pipe.getRootInstanceID() );
+ internalResult.setExceptionStackTrace(pipe.getStackTrace());
+ }
+
+ public static void PopulateInactiveDefinitionException(
+ InternalResult internalResult,
+ InactiveDefinitionException iade)
+ {
+ internalResult.setResultType(
+ IInternalResult.DEACTIVATED_TARGET_DEFINITION_EXCEPTION);
+ internalResult.setID( iade.getRootDefinitionID());
+ internalResult.setDefinitionName( iade.getProcessName());
+ internalResult.setExceptionStackTrace(iade.getStackTrace());
+ }
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/def/BPEClientDefaultImpl.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/def/BPEClientDefaultImpl.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/def/BPEClientDefaultImpl.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/def/BPEClientDefaultImpl.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,130 @@
+/*
+* 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.client.impl.def;
+
+import java.util.Properties;
+
+import com.sybase.bpe.bped.EventDirectorFactory;
+import com.sybase.bpe.bped.EventDirector;
+import com.sybase.bpe.client.IBPEClient;
+import com.sybase.bpe.client.IBPEMessage;
+import com.sybase.bpe.client.IBPEMessagePart;
+import com.sybase.bpe.client.IDescribedValue;
+import com.sybase.bpe.client.IFormattableValue;
+import com.sybase.bpe.client.IOperation;
+import com.sybase.bpe.client.exceptions.BPEClientInstantiationException;
+import com.sybase.bpe.client.exceptions.BPEUserException;
+//import com.sybase.bpe.client.impl.IInternalMessageAdapter;
+import com.sybase.bpe.interaction.spiimpl.CannedFormattableValue;
+import com.sybase.bpe.util.BPException;
+import com.sybase.uo.util.ApplicationLocalStore;
+
+
+public class BPEClientDefaultImpl implements IBPEClient
+{
+// private String m_iFactoryName;
+// private IInternalMessageAdapter messageAdapter;
+ private EventDirector eventDirector;
+
+ public BPEClientDefaultImpl( Properties spec ) throws BPEUserException
+ {
+ try
+ {
+ String pkgName = spec.getProperty(PACKAGE_NAME);
+ boolean remote = true;
+
+ String val = System.getProperty(EventDirectorFactory.JNFI);
+ if (val != null && val.compareTo(EventDirectorFactory.IMJNFI) == 0)
+ remote = false;
+
+ if (remote)
+ {
+ if ( pkgName != null ) {
+ if ( spec.getProperty(BPED_LOCAL) == null ) {
+ eventDirector =
+ EventDirectorFactory.createRemoteEventDirector(pkgName);
+ } else {
+ eventDirector =
+ getLocalEventDirector(pkgName);
+ }
+ } else {
+ eventDirector = EventDirectorFactory.createRemoteEventDirector();
+ }
+ }
+ else
+ {
+ eventDirector = EventDirectorFactory.createEventDirectorCached();
+ }
+
+ } catch (BPException e)
+ {
+ throw new BPEClientInstantiationException(e);
+ }
+ }
+
+ private EventDirector getLocalEventDirector( String packageName )
+ throws BPException
+ {
+ String key = "BPED local interface for package " + packageName +
+ " with thread hashcode " + Thread.currentThread().hashCode();
+ EventDirector returnValue =
+ (EventDirector)(ApplicationLocalStore.get(key));
+ if( returnValue == null )
+ {
+ returnValue =
+ EventDirectorFactory.createRemoteEventDirector(packageName, true);
+ ApplicationLocalStore.set(key, returnValue);
+ }
+ return returnValue;
+ }
+
+ public IBPEMessage createMessage()
+ {
+ return new Message( this );
+ }
+
+ public IFormattableValue createFormattableValue(IDescribedValue describedValue)
+ {
+ return new CannedFormattableValue( describedValue );
+ }
+
+ public IOperation createOperation(Properties spec)
+ {
+ Operation returnValue =
+ new Operation(this, eventDirector, spec );
+ return returnValue;
+ }
+
+ public IBPEMessagePart createPart(String name, IDescribedValue value)
+ {
+ return new Part( this, name, value );
+ }
+
+ public IBPEMessagePart createPart(String name, IFormattableValue value )
+ {
+ return new Part( (IBPEClient)this, name, value );
+ }
+
+
+}
+
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/def/ClientObject.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/def/ClientObject.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/def/ClientObject.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/def/ClientObject.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,39 @@
+/*
+* 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.client.impl.def;
+
+import com.sybase.bpe.client.IBPEClient;
+
+
+public abstract class ClientObject
+{
+ private IBPEClient m_client;
+ public ClientObject( IBPEClient client)
+ {
+ m_client = client;
+ }
+ public IBPEClient getClient()
+ {
+ return m_client;
+ }
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/def/DefaultBPEClientFactory.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/def/DefaultBPEClientFactory.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/def/DefaultBPEClientFactory.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/def/DefaultBPEClientFactory.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,47 @@
+/*
+* 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.client.impl.def;
+
+import java.io.Serializable;
+import java.util.Properties;
+
+import com.sybase.bpe.client.IBPEClient;
+import com.sybase.bpe.client.exceptions.BPEUserException;
+import com.sybase.bpe.client.spi.IBPEClientFactory;
+
+
+public class DefaultBPEClientFactory
+ implements IBPEClientFactory, Serializable
+{
+ static final long serialVersionUID = 4344269224482525761L;
+
+ public DefaultBPEClientFactory()
+ {
+
+ }
+ public IBPEClient createBPEClient(Properties spec)
+ throws BPEUserException
+ {
+ return new BPEClientDefaultImpl( spec );
+ }
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/def/FaultResult.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/def/FaultResult.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/def/FaultResult.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/def/FaultResult.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,111 @@
+/*
+* 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.client.impl.def;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+
+import com.sybase.bpe.cc.util.SerializationContext;
+import com.sybase.bpe.client.IBPEMessage;
+import com.sybase.bpe.client.result.IFaultResult;
+
+
+public class FaultResult implements IFaultResult
+{
+ private String faultName;
+ private String faultNamespace;
+ private IBPEMessage faultMessage;
+
+ public FaultResult( String faultName, String faultNamespace,
+ IBPEMessage faultMessage )
+ {
+ this.faultName = faultName;
+ this.faultNamespace = faultNamespace;
+ this.faultMessage = faultMessage;
+ }
+ /* (non-Javadoc)
+ * @see com.sybase.bpe.client.result.IFaultResult#getFaultMessage()
+ */
+ public IBPEMessage getFaultMessage()
+ {
+ return faultMessage;
+ }
+ /* (non-Javadoc)
+ * @see com.sybase.bpe.client.result.IFaultResult#getFaultName()
+ */
+ public String getFaultName()
+ {
+ return faultName;
+ }
+ /* (non-Javadoc)
+ * @see com.sybase.bpe.client.result.IFaultResult#getFaultNamespace()
+ */
+ public String getFaultNamespace()
+ {
+ return faultNamespace;
+ }
+
+ public void dump( SerializationContext sc )
+ {
+ sc.startTag("FaultResult", null, null );
+
+ sc.startEndTag("FaultNamespace",
+ this.getFaultNamespace());
+
+ sc.startEndTag("FaultName",
+ this.getFaultName());
+
+ Message message = ( Message ) this.getFaultMessage();
+
+ message.dump( sc );
+
+ sc.endTag("FaultResult");
+ }
+
+ public String toString()
+ {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ SerializationContext sc = new SerializationContext( baos );
+ this.dump( sc );
+ try
+ {
+ baos.close();
+ } catch (IOException e)
+ {
+ throw new RuntimeException(e);
+ }
+ return baos.toString();
+
+ /*
+ StringBuffer buf = new StringBuffer("Fault Result:\n");
+ buf.append("Fault Namespace: " + this.getFaultNamespace() + "\n");
+ buf.append("Fault Name: " + this.getFaultName() + "\n");
+
+ buf.append("Fault Message: ");
+ IBPEMessage faultMessage = this.getFaultMessage();
+ buf.append( faultMessage + "\n");
+
+ return buf.toString();
+ */
+ }
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/def/InternalMessage.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/def/InternalMessage.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/def/InternalMessage.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/def/InternalMessage.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,43 @@
+/*
+* 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.client.impl.def;
+
+import java.util.Map;
+
+import com.sybase.bpe.client.impl.IInternalMessage;
+
+
+public class InternalMessage implements IInternalMessage
+{
+ static final long serialVersionUID = 3831727989426495555L;
+
+ private Map m_parts;
+ public Map getParts()
+ {
+ return m_parts;
+ }
+ public void setParts( Map parts )
+ {
+ m_parts = parts;
+ }
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/def/InternalResult.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/def/InternalResult.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/def/InternalResult.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/def/InternalResult.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,185 @@
+/*
+* 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.client.impl.def;
+
+import java.util.Properties;
+
+import com.sybase.bpe.client.impl.IInternalMessage;
+import com.sybase.bpe.client.impl.IInternalResult;
+
+
+public class InternalResult implements IInternalResult
+{
+
+ static final long serialVersionUID = 6504944946244358937L;
+
+ private int resultType;
+ private IInternalMessage successfulResponse;
+ private IInternalMessage faultMessage;
+ private String faultName;
+ private String faultNamespace;
+ private String exceptionString;
+ private StackTraceElement[] exceptionStackTrace;
+ private String exceptionName;
+ private String m_id;
+ private String m_definitionName;
+ private Properties m_exceptionProps;
+
+
+ public int getResultType()
+ {
+ return resultType;
+ }
+
+ public IInternalMessage getSuccessfulResponse()
+ {
+ return successfulResponse;
+ }
+
+ public IInternalMessage getFaultMessage()
+ {
+ return faultMessage;
+ }
+
+ public String getFaultName()
+ {
+ return faultName;
+ }
+
+ public String getFaultNamespace()
+ {
+ return faultNamespace;
+ }
+
+ public void setFaultName( String faultName )
+ {
+ this.faultName = faultName;
+ }
+
+ public void setFaultNamespace( String faultNamespace )
+ {
+ this.faultNamespace = faultNamespace;
+ }
+
+ public void setSuccessfulResponse(IInternalMessage successfulresult)
+ {
+ successfulResponse = successfulresult;
+
+ }
+
+ public void setFaultMessage( IInternalMessage faultMessage )
+ {
+ this.faultMessage = faultMessage;
+ }
+
+ public void setResultType(int i)
+ {
+ resultType=i;
+
+ }
+
+ /**
+ * @param string
+ */
+ public void setExceptionName(String systemExceptionName)
+ {
+ this.exceptionName = systemExceptionName;
+
+ }
+
+ /**
+ * @param elements
+ */
+ public void setExceptionStackTrace(StackTraceElement[] elements)
+ {
+ this.exceptionStackTrace = elements;
+
+ }
+
+ /**
+ * @param string
+ */
+ public void setExceptionString(String exceptionString)
+ {
+ this.exceptionString = exceptionString;
+
+ }
+
+
+
+
+ /**
+ * @return Returns the systemExceptionName.
+ */
+ public String getExceptionName()
+ {
+ return exceptionName;
+ }
+ /**
+ * @return Returns the systemExceptionStackTrace.
+ */
+ public StackTraceElement[] getExceptionStackTrace()
+ {
+ return exceptionStackTrace;
+ }
+ /**
+ * @return Returns the systemExceptionString.
+ */
+ public String getExceptionString()
+ {
+ return exceptionString;
+ }
+
+ public String getID()
+ {
+ return m_id;
+ }
+
+ public void setID(String id)
+ {
+ m_id = id;
+ }
+
+ public String getDefinitionName()
+ {
+ return m_definitionName;
+ }
+
+ public void setDefinitionName(String definitionName)
+ {
+ m_definitionName = definitionName;
+
+ }
+
+ public Properties getExceptionProperties()
+ {
+ return m_exceptionProps;
+ }
+
+ public void setExceptionProperties(Properties props)
+ {
+ m_exceptionProps = props;
+ }
+
+
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/def/Message.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/def/Message.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/def/Message.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/def/Message.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,85 @@
+/*
+* 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.client.impl.def;
+
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+
+import com.sybase.bpe.cc.util.SerializationContext;
+import com.sybase.bpe.client.IBPEClient;
+import com.sybase.bpe.client.IBPEMessage;
+import com.sybase.bpe.client.IBPEMessagePart;
+
+
+public class Message extends ClientObject implements IBPEMessage, Serializable
+{
+ static final long serialVersionUID = -7249857989518908491L;
+
+ public Message(IBPEClient client)
+ {
+ super(client);
+
+ }
+ HashMap m_parts = new HashMap();
+
+ public Collection getParts()
+ {
+ return m_parts.values();
+ }
+ public IBPEMessagePart getPart(String name)
+ {
+ IBPEMessagePart returnValue = ( IBPEMessagePart )( m_parts.get( name ));
+ return returnValue;
+ }
+ public void removePart( String iName )
+ {
+ m_parts.remove(iName);
+ }
+
+ public void addPart(IBPEMessagePart part)
+ {
+ m_parts.put( part.getName(), part );
+
+ }
+ /**
+ * @param sc
+ */
+ public void dump(SerializationContext sc)
+ {
+
+ IBPEMessage rmessage = this;
+ Iterator it = rmessage.getParts().iterator();
+ if (it.hasNext())
+ {
+ sc.startTag("Message");
+ while (it.hasNext())
+ {
+ Part part = (Part) (it.next());
+ part.dump(sc);
+ }
+ sc.endTag("Message");
+ }
+ }
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/def/Operation.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/def/Operation.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/def/Operation.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/def/Operation.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,173 @@
+/*
+* 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.client.impl.def;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Properties;
+import java.util.Map.Entry;
+
+import com.sybase.bpe.client.IBPEClient;
+import com.sybase.bpe.client.IBPEMessage;
+import com.sybase.bpe.client.IBPEMessagePart;
+import com.sybase.bpe.client.IFormattableValue;
+import com.sybase.bpe.client.IOperation;
+import com.sybase.bpe.client.exceptions.BPEUserException;
+import com.sybase.bpe.client.exceptions.SystemException;
+import com.sybase.bpe.client.exceptions.TargetDefinitionPausedException;
+import com.sybase.bpe.client.exceptions.TargetInstancePausedException;
+import com.sybase.bpe.client.impl.IInternalMessage;
+import com.sybase.bpe.client.impl.IInternalRequestConsumer;
+import com.sybase.bpe.client.impl.IInternalResult;
+import com.sybase.bpe.client.result.IResult;
+import com.sybase.bpe.event.BPELStaticKey;
+
+public class Operation extends ClientObject implements IOperation
+{
+ private IInternalRequestConsumer requestConsumer;
+ private Properties spec;
+
+
+ public Operation(IBPEClient client,
+ IInternalRequestConsumer requestConsumer,
+ Properties spec)
+ {
+ super( client );
+ this.requestConsumer = requestConsumer;
+ this.spec = spec;
+ }
+
+ public IResult invoke(IBPEMessage request) throws BPEUserException
+ {
+ String operationName =
+ spec.getProperty( IOperation.OPERATION );
+ String portType =
+ spec.getProperty( IOperation.PORT_TYPE );
+ String portTypeNamespace =
+ spec.getProperty( IOperation.PORT_TYPE_NAMESPACE);
+
+ BPELStaticKey bpsk = new BPELStaticKey();
+ bpsk.setOperation( operationName );
+ bpsk.setPortType(portType);
+ bpsk.setTargetNamespace(portTypeNamespace);
+
+ IInternalMessage internalRequest = createInternalRequest(request);
+ IInternalResult result = requestConsumer.sendRequest(bpsk,
+ internalRequest);
+
+ IResult clientResult = createClientResult(result);
+ return clientResult;
+ }
+
+ protected IInternalMessage createInternalRequest(IBPEMessage request)
+ {
+ InternalMessage im = new InternalMessage();
+ HashMap internalParts = new HashMap();
+ Iterator iter = request.getParts().iterator();
+ while( iter.hasNext())
+ {
+ Part part = ( Part ) ( iter.next() );
+ internalParts.put( part.getName(), part.
+ getDescribedValue());
+ }
+ im.setParts(internalParts);
+ return im;
+
+ }
+
+ protected IResult createClientResult(IInternalResult internalResult)
+ throws BPEUserException
+ {
+ IResult returnValue = null;
+ switch( internalResult.getResultType() )
+ {
+ case( IInternalResult.SUCCESS_WITH_RESPONSE_RESULT ):
+ {
+ returnValue = new SucessWithResponse(
+ createResponseMessage(
+ internalResult.getSuccessfulResponse()));
+ break;
+ }
+ case( IInternalResult.FAULT_RESULT):
+ {
+ IBPEMessage faultMessage =
+ createResponseMessage( internalResult.getFaultMessage());
+
+ returnValue = new FaultResult( internalResult.getFaultName(),
+ internalResult.getFaultNamespace(), faultMessage);
+
+ break;
+ }
+ case( IInternalResult.SYSTEM_EXCEPTION ):
+ {
+ SystemException e = new SystemException(
+ internalResult.getExceptionString());
+
+ e.setStackTrace( internalResult.getExceptionStackTrace());
+ e.setProperties( internalResult.getExceptionProperties() );
+
+ throw e;
+
+ }
+ case( IInternalResult.DEACTIVATED_TARGET_DEFINITION_EXCEPTION):
+ {
+ TargetDefinitionPausedException tdpe =
+ new TargetDefinitionPausedException(
+ internalResult.getID(),
+ internalResult.getDefinitionName());
+ tdpe.setStackTrace( internalResult.getExceptionStackTrace());
+ throw tdpe;
+ }
+ case( IInternalResult.PAUSED_TARGET_INSTANCE_EXCEPTION):
+ {
+ TargetInstancePausedException tipe =
+ new TargetInstancePausedException(
+ internalResult.getID() );
+ tipe.setStackTrace( internalResult.getExceptionStackTrace());
+ throw tipe;
+ }
+ //TODO: code up the rest of the cases
+ }
+ return returnValue;
+ }
+
+ private IBPEMessage createResponseMessage(IInternalMessage message)
+ {
+ Message returnValue = ( Message )getClient().createMessage();
+ Iterator iter = message.getParts().entrySet().iterator();
+ while( iter.hasNext() )
+ {
+ Entry entry = ( Entry ) ( iter.next() );
+ IFormattableValue fv = ( IFormattableValue )
+ ( entry.getValue () );
+ String name = (String) entry.getKey();
+ IBPEMessagePart part =
+ (( BPEClientDefaultImpl)getClient()).createPart(name, fv );
+ returnValue.addPart(part);
+ }
+
+ return returnValue;
+ }
+
+
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/def/Part.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/def/Part.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/def/Part.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/def/Part.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,93 @@
+/*
+* 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.client.impl.def;
+
+import java.util.HashMap;
+
+import com.sybase.bpe.cc.util.SerializationContext;
+import com.sybase.bpe.client.IBPEClient;
+import com.sybase.bpe.client.IBPEMessagePart;
+import com.sybase.bpe.client.IDescribedValue;
+import com.sybase.bpe.client.IFormattableValue;
+import com.sybase.bpe.interaction.spiimpl.CannedFormattableValue;
+
+
+public class Part extends ClientObject implements IBPEMessagePart
+{
+ public String m_name;
+ private IDescribedValue m_describedValue;
+ private IFormattableValue m_formattableValue;
+
+ public Part(IBPEClient client,
+ IDescribedValue describedValue)
+ {
+ super( client);
+ m_describedValue = describedValue;
+ }
+
+ public Part(IBPEClient client, String name, IDescribedValue value)
+ {
+ super(client);
+ m_name=name;
+ m_describedValue = value;
+ }
+
+ public Part(IBPEClient client, String name, IFormattableValue value)
+ {
+ super(client);
+ m_name=name;
+ m_formattableValue = value;
+ }
+
+ public String getName()
+ {
+ return m_name;
+ }
+
+ public IFormattableValue getFormattableValue()
+ {
+ if ( m_formattableValue == null )
+ {
+ m_formattableValue =
+ new CannedFormattableValue( m_describedValue );
+ }
+ return m_formattableValue;
+ }
+
+ public IDescribedValue getDescribedValue()
+ {
+ return m_describedValue;
+ }
+
+ /**
+ * @param sc
+ */
+ public void dump(SerializationContext sc)
+ {
+ HashMap props = new HashMap();
+ props.put( "name", getName());
+
+ sc.startEndTag( "Part", props, getFormattableValue().toString());
+
+ }
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/def/SucessWithResponse.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/def/SucessWithResponse.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/def/SucessWithResponse.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/impl/def/SucessWithResponse.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,83 @@
+/*
+* 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 May 26, 2004
+ *
+ * TODO To change the template for this generated file go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+package com.sybase.bpe.client.impl.def;
+
+import java.util.Iterator;
+
+import com.sybase.bpe.client.IBPEMessage;
+import com.sybase.bpe.client.IBPEMessagePart;
+import com.sybase.bpe.client.result.IResult;
+import com.sybase.bpe.client.result.ISuccessWithResponse;
+
+/**
+ * @author blorenz
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+public class SucessWithResponse implements IResult, ISuccessWithResponse
+{
+ IBPEMessage message;
+
+ public SucessWithResponse(IBPEMessage message)
+ {
+ this.message = message;
+ }
+
+ public IBPEMessage getResponse()
+ {
+ return message;
+ }
+
+ public String toString()
+ {
+ ISuccessWithResponse swrresult = this;
+ IBPEMessage rmessage = swrresult.getResponse();
+ StringBuffer buf = new StringBuffer("Fault Message:" + null + "\n");
+ Iterator it = rmessage.getParts().iterator();
+ while (it.hasNext())
+ {
+ IBPEMessagePart part = (IBPEMessagePart) (it.next());
+ String name = part.getName();
+ try
+ {
+ buf.append("Part \""
+ + name
+ + "\" value: "
+ + rmessage.getPart(name).getFormattableValue()
+ .toString() + "\n");
+ } catch (Exception e)
+ {
+ buf.append("Part \"" + name + "\" value: "
+ + e.getLocalizedMessage());
+ }
+ }
+ return buf.toString();
+ }
+
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/result/IFaultResult.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/result/IFaultResult.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/result/IFaultResult.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/result/IFaultResult.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.client.result;
+
+import com.sybase.bpe.client.IBPEMessage;
+
+
+/**
+ * The request was successfully routed, but the business process
+ * which consumed the request produced a fault. The fault
+ * contains a fault name and a fault message.
+ */
+public interface IFaultResult extends IResult
+{
+ public IBPEMessage getFaultMessage();
+ public String getFaultName();
+ public String getFaultNamespace();
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/result/IResult.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/result/IResult.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/result/IResult.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/result/IResult.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.client.result;
+
+
+/**
+ * Base interface for all results returned from sendEvent().
+ */
+public interface IResult
+{
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/result/ISuccessResult.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/result/ISuccessResult.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/result/ISuccessResult.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/result/ISuccessResult.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.client.result;
+
+
+/**
+ * Results of this type indicate that the request
+ * was processed successfully.
+ */
+public interface ISuccessResult extends IResult
+{
+
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/result/ISuccessWithResponse.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/result/ISuccessWithResponse.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/result/ISuccessWithResponse.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/result/ISuccessWithResponse.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,35 @@
+/*
+* 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.client.result;
+
+import com.sybase.bpe.client.IBPEMessage;
+
+
+/**
+ * Results of this type indicate that the request was processed
+ * correctly and that a response was generated. The response
+ * is attached to the result.
+ */
+public interface ISuccessWithResponse extends ISuccessResult
+{
+ public IBPEMessage getResponse();
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/result/ITargetNotReady.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/result/ITargetNotReady.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/result/ITargetNotReady.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/result/ITargetNotReady.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.client.result;
+
+import java.util.Collection;
+
+
+
+/**
+ * A result of this type indicates that the target process instance
+ * may exist but it is not yet ready to consume the request. The
+ * result contains a collection of possible dynamic keys. These
+ * keys can be used by a holding mechanism to index held events.
+*/
+public interface ITargetNotReady extends IResult
+{
+ Collection getPossibleDynamicKeys();
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/spi/IBPEClientFactory.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/spi/IBPEClientFactory.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/spi/IBPEClientFactory.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/spi/IBPEClientFactory.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,45 @@
+/*
+* 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.client.spi;
+
+import java.util.Properties;
+
+import com.sybase.bpe.client.IBPEClient;
+import com.sybase.bpe.client.exceptions.BPEUserException;
+
+
+/**
+ * It may be useful to provide different client
+ * implementations depending on the mode of interaction
+ * with the BPE engine. This factory provides
+ * a means of supplying new factory implementions.
+ *
+ * The BPEClient will construct its implementation
+ * from a factory which implements the following interface.
+ */
+public interface IBPEClientFactory
+{
+
+ public IBPEClient createBPEClient( Properties spec )
+ throws BPEUserException;
+}
Added: incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/spi/interaction/ISPIFormattableValue.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/spi/interaction/ISPIFormattableValue.java?rev=381686&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/spi/interaction/ISPIFormattableValue.java (added)
+++ incubator/ode/scratch/bpe/src/main/java/com/sybase/bpe/client/spi/interaction/ISPIFormattableValue.java Tue Feb 28 08:02:48 2006
@@ -0,0 +1,72 @@
+/*
+* 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.client.spi.interaction;
+
+import com.sybase.bpe.client.IDescribedValue;
+import com.sybase.bpe.client.IFormat;
+import com.sybase.bpe.client.exceptions.BPEUserException;
+
+
+public interface ISPIFormattableValue
+{
+ /**
+ * Get the value in the requested representation.
+ * The format provides further specificity if the supplied
+ * class parameter leaves ambiguity. For example a
+ * byte[] specifier for the class type leaves many possiblities
+ * for the contents of the byte array.
+ * @return
+ * @throws BPEUserException
+ */
+ public Object getValueAs( Class clazz, IFormat format );
+
+ public Object getValueAs( Class clazz );
+
+ /**
+ * Inquire if the specified representation is supported.
+ * @return
+ */
+ public boolean supportsGetValueAs(
+ Class clazz, IFormat format );
+
+ public boolean supportsGetValueAs(
+ Class clazz);
+
+ /**
+ * Get the contained value in it's current format.
+ */
+ public IDescribedValue getDescribedValue();
+
+ /**
+ * Convert the wrapped content into a string representation.
+ *
+ * If the wrapped object is a simple type the string returned
+ * should be the format returned from
+ * Double.toString(), Integer.toString(), Boolean.toString(),
+ * Short.toString(), Byte.toString()
+ *
+ * If the wrapped content is a complex datatype the string
+ * returned should be an xml document.
+ */
+ public String toString();
+}