riftsaw SVN: r619 - in branches/ODE/ODE-1.x: agents/src/main/java/org/apache/ode/agents/memory and 21 other directories.
by riftsaw-commits@lists.jboss.org
Author: kurtstam
Date: 2010-04-14 11:43:12 -0400 (Wed, 14 Apr 2010)
New Revision: 619
Added:
branches/ODE/ODE-1.x/.project
Modified:
branches/ODE/ODE-1.x/agents/src/main/java/org/apache/ode/agents/memory/SizingAgent.java
branches/ODE/ODE-1.x/axis2-war/src/test/java/org/apache/ode/axis2/hydration/InstanceCountTest.java
branches/ODE/ODE-1.x/axis2-war/src/test/java/org/apache/ode/axis2/hydration/ProcessCountTest.java
branches/ODE/ODE-1.x/axis2-war/src/test/java/org/apache/ode/axis2/hydration/ProcessSizeTest.java
branches/ODE/ODE-1.x/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/AssignGeneratorMessages.java
branches/ODE/ODE-1.x/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/FlowGeneratorMessages.java
branches/ODE/ODE-1.x/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/InvokeGeneratorMessages.java
branches/ODE/ODE-1.x/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/PickGeneratorMessages.java
branches/ODE/ODE-1.x/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ReplyGeneratorMessages.java
branches/ODE/ODE-1.x/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WaitGeneratorMessages.java
branches/ODE/ODE-1.x/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/CompilationMessageBundle.java
branches/ODE/ODE-1.x/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xquery10/compiler/XQuery10BpelFunctions.java
branches/ODE/ODE-1.x/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xquery10/compiler/XQuery10ExpressionCompilerBPEL20.java
branches/ODE/ODE-1.x/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler/CompilationMessageTest.java
branches/ODE/ODE-1.x/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler/CompilationTestMessages.java
branches/ODE/ODE-1.x/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler/CompilationTestMessages_de.java
branches/ODE/ODE-1.x/bpel-epr/src/main/java/org/apache/ode/bpel/common/evt/DebugBpelEventListener.java
branches/ODE/ODE-1.x/bpel-obj/src/main/java/org/apache/ode/bpel/elang/xquery10/o/OXQuery10ExpressionBPEL20.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/Compiler.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/ValidationException.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/AbstractCMPEvaluator.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/AbstractConjunction.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/AbstractContainer.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/AbstractDisjunction.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/AbstractEqualityEvaluator.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/CMPEvaluator.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/CommandContainer.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/CommandEvaluator.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/ConjunctionEvaluator.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/DisjunctionEvaluator.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/EqualityEvaluator.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/GEEvaluator.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/GreaterEvaluator.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/INEvaluator.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/Identified.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/LEEvaluator.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/LessEvaluator.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/LikeEvaluator.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/LogicEvaluator.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/NestedCommandEvaluator.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/OrderByEvaluator.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/jcc/ASTField.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/jcc/ASTLimit.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/jcc/ASTOrderBy.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/jcc/ASTOrderType.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/jcc/ASTProperty.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/jcc/ASTValue.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/jcc/Parser.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/jcc/TreeBuilder.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/Builder.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/BuilderFactory.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/AbstractLogicExpr.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Conjunction.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Disjunction.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Equality.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Field.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/GE.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Greater.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Identifier.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/IdentifierToValueCMP.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/In.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/LE.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Less.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Like.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Limit.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/LogicExprNode.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/LogicNode.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Node.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/OrderBy.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/OrderByElement.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/OrderByType.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Property.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Query.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Value.java
branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/ValuesHelper.java
branches/ODE/ODE-1.x/bpel-ql/src/test/java/org/apache/ode/ql/SyntaxTest.java
branches/ODE/ODE-1.x/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath20/runtime/XPath20ExpressionModifier.java
branches/ODE/ODE-1.x/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xquery10/runtime/XQuery10BpelFunctions.java
branches/ODE/ODE-1.x/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xquery10/runtime/XQuery10ExpressionRuntime.java
branches/ODE/ODE-1.x/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/MexDaoUtil.java
branches/ODE/ODE-1.x/bpel-runtime/src/main/java/org/apache/ode/bpel/intercept/InstanceCountThrottler.java
branches/ODE/ODE-1.x/bpel-runtime/src/main/java/org/apache/ode/bpel/intercept/ProcessCountThrottler.java
branches/ODE/ODE-1.x/bpel-runtime/src/main/java/org/apache/ode/bpel/intercept/ProcessSizeThrottler.java
branches/ODE/ODE-1.x/bpel-test/src/main/java/org/apache/ode/test/MessageExchangeContextImpl.java
branches/ODE/ODE-1.x/bpel-test/src/main/java/org/apache/ode/test/PartnerRoleChannelImpl.java
branches/ODE/ODE-1.x/bpel-test/src/test/java/org/apache/ode/test/DataHandling20Test.java
branches/ODE/ODE-1.x/bpel-test/src/test/java/org/apache/ode/test/MessageRouting20Test.java
branches/ODE/ODE-1.x/dao-jpa/src/main/java/org/apache/ode/dao/jpa/ActivityRecoveryDAOImpl.java
branches/ODE/ODE-1.x/dao-jpa/src/main/java/org/apache/ode/dao/jpa/ProcessInstanceDAOImpl.java
branches/ODE/ODE-1.x/utils/src/main/java/org/apache/ode/utils/CronExpression.java
branches/ODE/ODE-1.x/utils/src/main/java/org/apache/ode/utils/InternPool.java
Log:
changing line endings to unix
Added: branches/ODE/ODE-1.x/.project
===================================================================
--- branches/ODE/ODE-1.x/.project (rev 0)
+++ branches/ODE/ODE-1.x/.project 2010-04-14 15:43:12 UTC (rev 619)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>ODE-1.x</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ </natures>
+</projectDescription>
Modified: branches/ODE/ODE-1.x/agents/src/main/java/org/apache/ode/agents/memory/SizingAgent.java
===================================================================
--- branches/ODE/ODE-1.x/agents/src/main/java/org/apache/ode/agents/memory/SizingAgent.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/agents/src/main/java/org/apache/ode/agents/memory/SizingAgent.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -17,189 +17,189 @@
* under the License.
*/
-package org.apache.ode.agents.memory;
-
-import java.lang.instrument.Instrumentation;
-import java.lang.reflect.Array;
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-import java.util.Calendar;
-import java.util.IdentityHashMap;
-import java.util.Map;
-import java.util.Stack;
-
-
-/**
- * Class
- *
- * @author $author$
- * @version $Revision$
- */
-public class SizingAgent {
- private static Instrumentation instrumentation;
-
- /**
- * $method$
- *
- * @param options options
- * @param instrumentation instrumentation
- */
- public static void premain(String options, Instrumentation instrumentation) {
- SizingAgent.instrumentation = instrumentation;
- Class[] loaded = instrumentation.getAllLoadedClasses();
- }
-
- /**
- * $method$
- *
- * @param args args
- */
- public static void main(String[] args) {
- System.out.println("Size of Object: " + sizeOf(new Object()));
- System.out.println("Size of direct subclass: " + sizeOf(new SizingAgent()));
- System.out.println("Size of Calendar: " +
- sizeOf(Calendar.getInstance()));
- }
-
- /**
- * Returns object size.
- */
- public static long sizeOf(Object obj) {
- if (instrumentation == null) {
- return 0;
- }
-
- if (isSharedFlyweight(obj)) {
- return 0;
- }
-
- return instrumentation.getObjectSize(obj);
- }
-
- /**
- * Returns deep size of object, recursively iterating over its
- * fields and superclasses.
- */
- public static long deepSizeOf(Object obj) {
- if (instrumentation == null) {
- return 0;
- }
-
- Map visited = new IdentityHashMap();
- Stack stack = new Stack();
- stack.push(obj);
-
- long result = 0;
-
- do {
- result += internalSizeOf(stack.pop(), stack, visited);
- } while (!stack.isEmpty());
-
- return result;
- }
-
- /**
- * Returns true if this is a well-known shared flyweight. For
- * example, interned Strings, Booleans and Number objects
- */
- private static boolean isSharedFlyweight(Object obj) {
- // optimization - all of our flyweights are Comparable
- if (obj instanceof Comparable) {
- if (obj instanceof Enum) {
- return true;
- } else if (obj instanceof String) {
- return (obj == ((String) obj).intern());
- } else if (obj instanceof Boolean) {
- return ((obj == Boolean.TRUE) || (obj == Boolean.FALSE));
- } else if (obj instanceof Integer) {
- return (obj == Integer.valueOf((Integer) obj));
- } else if (obj instanceof Short) {
- return (obj == Short.valueOf((Short) obj));
- } else if (obj instanceof Byte) {
- return (obj == Byte.valueOf((Byte) obj));
- } else if (obj instanceof Long) {
- return (obj == Long.valueOf((Long) obj));
- } else if (obj instanceof Character) {
- return (obj == Character.valueOf((Character) obj));
- }
- }
-
- return false;
- }
-
- /**
- * $method$
- *
- * @param obj obj
- * @param visited visited
- *
- * @return type
- */
- private static boolean skipObject(Object obj, Map visited) {
- return (obj == null) || visited.containsKey(obj) ||
- isSharedFlyweight(obj);
- }
-
- /**
- * $method$
- *
- * @param obj obj
- * @param stack stack
- * @param visited visited
- *
- * @return type
- */
- private static long internalSizeOf(Object obj, Stack stack, Map visited) {
- if (skipObject(obj, visited)) {
- return 0;
- }
-
- Class clazz = obj.getClass();
-
- if (clazz.isArray()) {
- addArrayElementsToStack(clazz, obj, stack);
- } else {
- // add all non-primitive fields to the stack
- while (clazz != null) {
- Field[] fields = clazz.getDeclaredFields();
-
- for (Field field : fields) {
- if (!Modifier.isStatic(field.getModifiers()) &&
- !field.getType().isPrimitive()) {
- field.setAccessible(true);
-
- try {
- stack.add(field.get(obj));
- } catch (IllegalAccessException ex) {
- throw new RuntimeException(ex);
- }
- }
- }
-
- clazz = clazz.getSuperclass();
- }
- }
-
- visited.put(obj, null);
-
- return sizeOf(obj);
- }
-
- /**
- * $method$
- *
- * @param clazz clazz
- * @param obj obj
- * @param stack stack
- */
- private static void addArrayElementsToStack(Class clazz, Object obj,
- Stack stack) {
- if (!clazz.getComponentType().isPrimitive()) {
- int length = Array.getLength(obj);
-
- for (int i = 0; i < length; i++) {
- stack.add(Array.get(obj, i));
- }
- }
- }
-}
+package org.apache.ode.agents.memory;
+
+import java.lang.instrument.Instrumentation;
+import java.lang.reflect.Array;
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+import java.util.Calendar;
+import java.util.IdentityHashMap;
+import java.util.Map;
+import java.util.Stack;
+
+
+/**
+ * Class
+ *
+ * @author $author$
+ * @version $Revision$
+ */
+public class SizingAgent {
+ private static Instrumentation instrumentation;
+
+ /**
+ * $method$
+ *
+ * @param options options
+ * @param instrumentation instrumentation
+ */
+ public static void premain(String options, Instrumentation instrumentation) {
+ SizingAgent.instrumentation = instrumentation;
+ Class[] loaded = instrumentation.getAllLoadedClasses();
+ }
+
+ /**
+ * $method$
+ *
+ * @param args args
+ */
+ public static void main(String[] args) {
+ System.out.println("Size of Object: " + sizeOf(new Object()));
+ System.out.println("Size of direct subclass: " + sizeOf(new SizingAgent()));
+ System.out.println("Size of Calendar: " +
+ sizeOf(Calendar.getInstance()));
+ }
+
+ /**
+ * Returns object size.
+ */
+ public static long sizeOf(Object obj) {
+ if (instrumentation == null) {
+ return 0;
+ }
+
+ if (isSharedFlyweight(obj)) {
+ return 0;
+ }
+
+ return instrumentation.getObjectSize(obj);
+ }
+
+ /**
+ * Returns deep size of object, recursively iterating over its
+ * fields and superclasses.
+ */
+ public static long deepSizeOf(Object obj) {
+ if (instrumentation == null) {
+ return 0;
+ }
+
+ Map visited = new IdentityHashMap();
+ Stack stack = new Stack();
+ stack.push(obj);
+
+ long result = 0;
+
+ do {
+ result += internalSizeOf(stack.pop(), stack, visited);
+ } while (!stack.isEmpty());
+
+ return result;
+ }
+
+ /**
+ * Returns true if this is a well-known shared flyweight. For
+ * example, interned Strings, Booleans and Number objects
+ */
+ private static boolean isSharedFlyweight(Object obj) {
+ // optimization - all of our flyweights are Comparable
+ if (obj instanceof Comparable) {
+ if (obj instanceof Enum) {
+ return true;
+ } else if (obj instanceof String) {
+ return (obj == ((String) obj).intern());
+ } else if (obj instanceof Boolean) {
+ return ((obj == Boolean.TRUE) || (obj == Boolean.FALSE));
+ } else if (obj instanceof Integer) {
+ return (obj == Integer.valueOf((Integer) obj));
+ } else if (obj instanceof Short) {
+ return (obj == Short.valueOf((Short) obj));
+ } else if (obj instanceof Byte) {
+ return (obj == Byte.valueOf((Byte) obj));
+ } else if (obj instanceof Long) {
+ return (obj == Long.valueOf((Long) obj));
+ } else if (obj instanceof Character) {
+ return (obj == Character.valueOf((Character) obj));
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * $method$
+ *
+ * @param obj obj
+ * @param visited visited
+ *
+ * @return type
+ */
+ private static boolean skipObject(Object obj, Map visited) {
+ return (obj == null) || visited.containsKey(obj) ||
+ isSharedFlyweight(obj);
+ }
+
+ /**
+ * $method$
+ *
+ * @param obj obj
+ * @param stack stack
+ * @param visited visited
+ *
+ * @return type
+ */
+ private static long internalSizeOf(Object obj, Stack stack, Map visited) {
+ if (skipObject(obj, visited)) {
+ return 0;
+ }
+
+ Class clazz = obj.getClass();
+
+ if (clazz.isArray()) {
+ addArrayElementsToStack(clazz, obj, stack);
+ } else {
+ // add all non-primitive fields to the stack
+ while (clazz != null) {
+ Field[] fields = clazz.getDeclaredFields();
+
+ for (Field field : fields) {
+ if (!Modifier.isStatic(field.getModifiers()) &&
+ !field.getType().isPrimitive()) {
+ field.setAccessible(true);
+
+ try {
+ stack.add(field.get(obj));
+ } catch (IllegalAccessException ex) {
+ throw new RuntimeException(ex);
+ }
+ }
+ }
+
+ clazz = clazz.getSuperclass();
+ }
+ }
+
+ visited.put(obj, null);
+
+ return sizeOf(obj);
+ }
+
+ /**
+ * $method$
+ *
+ * @param clazz clazz
+ * @param obj obj
+ * @param stack stack
+ */
+ private static void addArrayElementsToStack(Class clazz, Object obj,
+ Stack stack) {
+ if (!clazz.getComponentType().isPrimitive()) {
+ int length = Array.getLength(obj);
+
+ for (int i = 0; i < length; i++) {
+ stack.add(Array.get(obj, i));
+ }
+ }
+ }
+}
Modified: branches/ODE/ODE-1.x/axis2-war/src/test/java/org/apache/ode/axis2/hydration/InstanceCountTest.java
===================================================================
--- branches/ODE/ODE-1.x/axis2-war/src/test/java/org/apache/ode/axis2/hydration/InstanceCountTest.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/axis2-war/src/test/java/org/apache/ode/axis2/hydration/InstanceCountTest.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -17,166 +17,166 @@
* under the License.
*/
-package org.apache.ode.axis2.hydration;
-
-import static org.testng.Assert.assertTrue;
-import static org.testng.Assert.fail;
-
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.om.OMText;
-import org.apache.axiom.om.util.Base64;
-
-import org.apache.ode.axis2.Axis2TestBase;
-import org.apache.ode.axis2.DummyService;
-import org.apache.ode.axis2.service.ServiceClientUtil;
-import org.apache.ode.tools.sendsoap.cline.HttpSoapSender;
-import org.apache.ode.utils.Namespaces;
-
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-
-import java.net.URL;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-
-import javax.xml.namespace.QName;
-
-
-/**
- * Test the limit on the number of process instances.
- *
- * @author $author$
- * @version $Revision$
- */
-public class InstanceCountTest extends Axis2TestBase {
- private OMFactory _factory;
- private DateFormat xsdDF = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm");
- private ServiceClientUtil _client;
- private String _deployedName;
-
- /**
- * test case set up
- *
- * @throws Exception Exception
- */
- @BeforeMethod
- protected void setUp() throws Exception {
- super.setUp();
-
- // Create a factory
- _factory = OMAbstractFactory.getOMFactory();
- _client = new ServiceClientUtil();
-
- // Just making sure the instance starts
- Thread.sleep(1000);
- }
-
- /**
- * test case tear down
- *
- * @throws Exception Exception
- */
- @AfterMethod
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- /**
- * Tests rendezvous
- *
- * @throws Exception
- */
- String firstResponse, secondResponse;
- boolean secondStarted;
-
- @Test(dataProvider="configs")
- public void testCorrelationJoin() throws Exception {
- final String bundleName = "TestCorrelationJoin";
-
- firstResponse = secondResponse = null;
- secondStarted = true;
-
- server.getODEServer().getBpelServer().setInstanceThrottledMaximumCount(1);
- // deploy the required service
- server.deployService(DummyService.class.getCanonicalName());
- if (server.isDeployed(bundleName)) server.undeployProcess(bundleName);
- server.deployProcess(bundleName);
-
- new Thread() {
- public void run() {
- try {
- Thread.sleep(3000);
- server.sendRequestFile("http://localhost:8888/processes/correlationMultiTest",
- bundleName, "testRequest2.soap");
- } catch( Exception e ) {
- fail(e.getMessage());
- }
- }
- }.start();
-
- Thread processOne = new Thread() {
- public void run() {
- try {
- firstResponse = server.sendRequestFile("http://localhost:8888/processes/correlationMultiTest",
- bundleName, "testRequest.soap");
- System.out.println("=>\n" + firstResponse);
- } catch (Exception e) {
- fail(e.getMessage());
- }
- }
- };
- processOne.start();
-
- Thread processTwo = new Thread() {
- public void run() {
- try {
- Thread.sleep(3000);
- secondResponse = server.sendRequestFile("http://localhost:8888/processes/correlationMultiTest",
- bundleName, "testRequest.soap");
- } catch( Exception e ) {
- fail(e.getMessage());
- }
- }
- };
- processTwo.start();
- processTwo.join();
-
- try {
- assertTrue(secondResponse.contains("tooManyInstances"));
- } catch (Exception e) {
- server.undeployProcess(bundleName);
- fail("The second instance was allowed to start");
- }
-
- new Thread() {
- public void run() {
- try {
- Thread.sleep(6000);
- server.sendRequestFile("http://localhost:8888/processes/correlationMultiTest",
- bundleName, "testRequest3.soap");
- } catch( Exception e ) {
- fail(e.getMessage());
- }
- }
- }.start();
-
- try {
- processOne.join();
- assertTrue(firstResponse.contains(">1;2;3;<"));
- } finally {
- server.undeployProcess(bundleName);
- }
- }
-
- public String getODEConfigDir() {
- return getClass().getClassLoader().getResource("webapp").getFile() + "/WEB-INF/conf.jpa-derby";
- }
-}
+package org.apache.ode.axis2.hydration;
+
+import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.fail;
+
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.om.OMText;
+import org.apache.axiom.om.util.Base64;
+
+import org.apache.ode.axis2.Axis2TestBase;
+import org.apache.ode.axis2.DummyService;
+import org.apache.ode.axis2.service.ServiceClientUtil;
+import org.apache.ode.tools.sendsoap.cline.HttpSoapSender;
+import org.apache.ode.utils.Namespaces;
+
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+
+import java.net.URL;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+
+import javax.xml.namespace.QName;
+
+
+/**
+ * Test the limit on the number of process instances.
+ *
+ * @author $author$
+ * @version $Revision$
+ */
+public class InstanceCountTest extends Axis2TestBase {
+ private OMFactory _factory;
+ private DateFormat xsdDF = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm");
+ private ServiceClientUtil _client;
+ private String _deployedName;
+
+ /**
+ * test case set up
+ *
+ * @throws Exception Exception
+ */
+ @BeforeMethod
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ // Create a factory
+ _factory = OMAbstractFactory.getOMFactory();
+ _client = new ServiceClientUtil();
+
+ // Just making sure the instance starts
+ Thread.sleep(1000);
+ }
+
+ /**
+ * test case tear down
+ *
+ * @throws Exception Exception
+ */
+ @AfterMethod
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ /**
+ * Tests rendezvous
+ *
+ * @throws Exception
+ */
+ String firstResponse, secondResponse;
+ boolean secondStarted;
+
+ @Test(dataProvider="configs")
+ public void testCorrelationJoin() throws Exception {
+ final String bundleName = "TestCorrelationJoin";
+
+ firstResponse = secondResponse = null;
+ secondStarted = true;
+
+ server.getODEServer().getBpelServer().setInstanceThrottledMaximumCount(1);
+ // deploy the required service
+ server.deployService(DummyService.class.getCanonicalName());
+ if (server.isDeployed(bundleName)) server.undeployProcess(bundleName);
+ server.deployProcess(bundleName);
+
+ new Thread() {
+ public void run() {
+ try {
+ Thread.sleep(3000);
+ server.sendRequestFile("http://localhost:8888/processes/correlationMultiTest",
+ bundleName, "testRequest2.soap");
+ } catch( Exception e ) {
+ fail(e.getMessage());
+ }
+ }
+ }.start();
+
+ Thread processOne = new Thread() {
+ public void run() {
+ try {
+ firstResponse = server.sendRequestFile("http://localhost:8888/processes/correlationMultiTest",
+ bundleName, "testRequest.soap");
+ System.out.println("=>\n" + firstResponse);
+ } catch (Exception e) {
+ fail(e.getMessage());
+ }
+ }
+ };
+ processOne.start();
+
+ Thread processTwo = new Thread() {
+ public void run() {
+ try {
+ Thread.sleep(3000);
+ secondResponse = server.sendRequestFile("http://localhost:8888/processes/correlationMultiTest",
+ bundleName, "testRequest.soap");
+ } catch( Exception e ) {
+ fail(e.getMessage());
+ }
+ }
+ };
+ processTwo.start();
+ processTwo.join();
+
+ try {
+ assertTrue(secondResponse.contains("tooManyInstances"));
+ } catch (Exception e) {
+ server.undeployProcess(bundleName);
+ fail("The second instance was allowed to start");
+ }
+
+ new Thread() {
+ public void run() {
+ try {
+ Thread.sleep(6000);
+ server.sendRequestFile("http://localhost:8888/processes/correlationMultiTest",
+ bundleName, "testRequest3.soap");
+ } catch( Exception e ) {
+ fail(e.getMessage());
+ }
+ }
+ }.start();
+
+ try {
+ processOne.join();
+ assertTrue(firstResponse.contains(">1;2;3;<"));
+ } finally {
+ server.undeployProcess(bundleName);
+ }
+ }
+
+ public String getODEConfigDir() {
+ return getClass().getClassLoader().getResource("webapp").getFile() + "/WEB-INF/conf.jpa-derby";
+ }
+}
Modified: branches/ODE/ODE-1.x/axis2-war/src/test/java/org/apache/ode/axis2/hydration/ProcessCountTest.java
===================================================================
--- branches/ODE/ODE-1.x/axis2-war/src/test/java/org/apache/ode/axis2/hydration/ProcessCountTest.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/axis2-war/src/test/java/org/apache/ode/axis2/hydration/ProcessCountTest.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -17,128 +17,128 @@
* under the License.
*/
-package org.apache.ode.axis2.hydration;
-
-import static org.testng.Assert.assertTrue;
-import static org.testng.Assert.fail;
-import static org.testng.AssertJUnit.assertTrue;
-
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.om.OMText;
-import org.apache.axiom.om.util.Base64;
-
-import org.apache.ode.axis2.Axis2TestBase;
-import org.apache.ode.axis2.DummyService;
-import org.apache.ode.axis2.service.ServiceClientUtil;
-import org.apache.ode.tools.sendsoap.cline.HttpSoapSender;
-import org.apache.ode.utils.DOMUtils;
-import org.apache.ode.utils.Namespaces;
-
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-import org.w3c.dom.Element;
-
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-
-import java.net.URL;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-
-import javax.xml.namespace.QName;
-
-
-/**
- * Test the limit on the number of process instances.
- *
- * @author $author$
- * @version $Revision$
- */
-public class ProcessCountTest extends Axis2TestBase {
- private OMFactory _factory;
- private DateFormat xsdDF = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm");
- private ServiceClientUtil _client;
- private String _deployedName;
-
- /**
- * test case set up
- *
- * @throws Exception Exception
- */
- @BeforeMethod
- protected void setUp() throws Exception {
- super.setUp();
-
- // Create a factory
- _factory = OMAbstractFactory.getOMFactory();
- _client = new ServiceClientUtil();
-
- // Just making sure the instance starts
- Thread.sleep(1000);
- }
-
- /**
- * test case tear down
- *
- * @throws Exception Exception
- */
- @AfterMethod
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- /**
- * Tests rendezvous
- *
- * @throws Exception
- */
- String firstResponse, secondResponse;
- boolean secondStarted;
- String nsAttr;
-
- @Test(dataProvider="configs")
- public void testCorrelationJoin() throws Exception {
- final String bundleOne = "TestCorrelationJoin", bundleTwo = "TestAttributeNamespaces";
-
- firstResponse = secondResponse = null;
- secondStarted = true;
-
- server.getODEServer().getBpelServer().setProcessThrottledMaximumCount(0);
-
- // deploy the first service
- server.deployService(DummyService.class.getCanonicalName());
- if (server.isDeployed(bundleOne)) server.undeployProcess(bundleOne);
- server.deployProcess(bundleOne);
-
- Thread processOne = new Thread() {
- public void run() {
- try {
- firstResponse = server.sendRequestFile("http://localhost:8888/processes/correlationMultiTest",
- bundleOne, "testRequest.soap");
- System.out.println("=>\n" + firstResponse);
- } catch (Exception e) {
- fail(e.getMessage());
- }
- }
- };
- processOne.start();
- processOne.join();
-
- try {
- processOne.join();
- assertTrue(firstResponse.contains("tooManyProcesses"), firstResponse);
- } finally {
- server.undeployProcess(bundleOne);
- }
-
- }
-
- public String getODEConfigDir() {
- return getClass().getClassLoader().getResource("webapp").getFile() + "/WEB-INF/conf.jpa-derby";
- }
-}
+package org.apache.ode.axis2.hydration;
+
+import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.fail;
+import static org.testng.AssertJUnit.assertTrue;
+
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.om.OMText;
+import org.apache.axiom.om.util.Base64;
+
+import org.apache.ode.axis2.Axis2TestBase;
+import org.apache.ode.axis2.DummyService;
+import org.apache.ode.axis2.service.ServiceClientUtil;
+import org.apache.ode.tools.sendsoap.cline.HttpSoapSender;
+import org.apache.ode.utils.DOMUtils;
+import org.apache.ode.utils.Namespaces;
+
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+import org.w3c.dom.Element;
+
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+
+import java.net.URL;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+
+import javax.xml.namespace.QName;
+
+
+/**
+ * Test the limit on the number of process instances.
+ *
+ * @author $author$
+ * @version $Revision$
+ */
+public class ProcessCountTest extends Axis2TestBase {
+ private OMFactory _factory;
+ private DateFormat xsdDF = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm");
+ private ServiceClientUtil _client;
+ private String _deployedName;
+
+ /**
+ * test case set up
+ *
+ * @throws Exception Exception
+ */
+ @BeforeMethod
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ // Create a factory
+ _factory = OMAbstractFactory.getOMFactory();
+ _client = new ServiceClientUtil();
+
+ // Just making sure the instance starts
+ Thread.sleep(1000);
+ }
+
+ /**
+ * test case tear down
+ *
+ * @throws Exception Exception
+ */
+ @AfterMethod
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ /**
+ * Tests rendezvous
+ *
+ * @throws Exception
+ */
+ String firstResponse, secondResponse;
+ boolean secondStarted;
+ String nsAttr;
+
+ @Test(dataProvider="configs")
+ public void testCorrelationJoin() throws Exception {
+ final String bundleOne = "TestCorrelationJoin", bundleTwo = "TestAttributeNamespaces";
+
+ firstResponse = secondResponse = null;
+ secondStarted = true;
+
+ server.getODEServer().getBpelServer().setProcessThrottledMaximumCount(0);
+
+ // deploy the first service
+ server.deployService(DummyService.class.getCanonicalName());
+ if (server.isDeployed(bundleOne)) server.undeployProcess(bundleOne);
+ server.deployProcess(bundleOne);
+
+ Thread processOne = new Thread() {
+ public void run() {
+ try {
+ firstResponse = server.sendRequestFile("http://localhost:8888/processes/correlationMultiTest",
+ bundleOne, "testRequest.soap");
+ System.out.println("=>\n" + firstResponse);
+ } catch (Exception e) {
+ fail(e.getMessage());
+ }
+ }
+ };
+ processOne.start();
+ processOne.join();
+
+ try {
+ processOne.join();
+ assertTrue(firstResponse.contains("tooManyProcesses"), firstResponse);
+ } finally {
+ server.undeployProcess(bundleOne);
+ }
+
+ }
+
+ public String getODEConfigDir() {
+ return getClass().getClassLoader().getResource("webapp").getFile() + "/WEB-INF/conf.jpa-derby";
+ }
+}
Modified: branches/ODE/ODE-1.x/axis2-war/src/test/java/org/apache/ode/axis2/hydration/ProcessSizeTest.java
===================================================================
--- branches/ODE/ODE-1.x/axis2-war/src/test/java/org/apache/ode/axis2/hydration/ProcessSizeTest.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/axis2-war/src/test/java/org/apache/ode/axis2/hydration/ProcessSizeTest.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -17,128 +17,128 @@
* under the License.
*/
-package org.apache.ode.axis2.hydration;
-
-import static org.testng.Assert.assertTrue;
-import static org.testng.Assert.fail;
-import static org.testng.AssertJUnit.assertTrue;
-
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.om.OMText;
-import org.apache.axiom.om.util.Base64;
-
-import org.apache.ode.axis2.Axis2TestBase;
-import org.apache.ode.axis2.DummyService;
-import org.apache.ode.axis2.service.ServiceClientUtil;
-import org.apache.ode.tools.sendsoap.cline.HttpSoapSender;
-import org.apache.ode.utils.DOMUtils;
-import org.apache.ode.utils.Namespaces;
-
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-import org.w3c.dom.Element;
-
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-
-import java.net.URL;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-
-import javax.xml.namespace.QName;
-
-
-/**
- * Test the limit on the number of process instances.
- *
- * @author $author$
- * @version $Revision$
- */
-public class ProcessSizeTest extends Axis2TestBase {
- private OMFactory _factory;
- private DateFormat xsdDF = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm");
- private ServiceClientUtil _client;
- private String _deployedName;
-
- /**
- * test case set up
- *
- * @throws Exception Exception
- */
- @BeforeMethod
- protected void setUp() throws Exception {
- super.setUp();
-
- // Create a factory
- _factory = OMAbstractFactory.getOMFactory();
- _client = new ServiceClientUtil();
-
- // Just making sure the instance starts
- Thread.sleep(1000);
- }
-
- /**
- * test case tear down
- *
- * @throws Exception Exception
- */
- @AfterMethod
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- /**
- * Tests rendezvous
- *
- * @throws Exception
- */
- String firstResponse, secondResponse;
- boolean secondStarted;
- String nsAttr;
-
- @Test(dataProvider="configs")
- public void testCorrelationJoin() throws Exception {
- final String bundleOne = "TestCorrelationJoin", bundleTwo = "TestAttributeNamespaces";
-
- firstResponse = secondResponse = null;
- secondStarted = true;
-
- server.getODEServer().getBpelServer().setProcessThrottledMaximumSize(0);
-
- // deploy the first service
- server.deployService(DummyService.class.getCanonicalName());
- if (server.isDeployed(bundleOne)) server.undeployProcess(bundleOne);
- server.deployProcess(bundleOne);
-
- Thread processOne = new Thread() {
- public void run() {
- try {
- firstResponse = server.sendRequestFile("http://localhost:8888/processes/correlationMultiTest",
- bundleOne, "testRequest.soap");
- System.out.println("=>\n" + firstResponse);
- } catch (Exception e) {
- fail(e.getMessage());
- }
- }
- };
- processOne.start();
- processOne.join();
-
- try {
- processOne.join();
- assertTrue(firstResponse.contains("tooHugeProcesses"), firstResponse);
- } finally {
- server.undeployProcess(bundleOne);
- }
-
- }
-
- public String getODEConfigDir() {
- return getClass().getClassLoader().getResource("webapp").getFile() + "/WEB-INF/conf.jpa-derby";
- }
-}
+package org.apache.ode.axis2.hydration;
+
+import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.fail;
+import static org.testng.AssertJUnit.assertTrue;
+
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.om.OMText;
+import org.apache.axiom.om.util.Base64;
+
+import org.apache.ode.axis2.Axis2TestBase;
+import org.apache.ode.axis2.DummyService;
+import org.apache.ode.axis2.service.ServiceClientUtil;
+import org.apache.ode.tools.sendsoap.cline.HttpSoapSender;
+import org.apache.ode.utils.DOMUtils;
+import org.apache.ode.utils.Namespaces;
+
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+import org.w3c.dom.Element;
+
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+
+import java.net.URL;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+
+import javax.xml.namespace.QName;
+
+
+/**
+ * Test the limit on the number of process instances.
+ *
+ * @author $author$
+ * @version $Revision$
+ */
+public class ProcessSizeTest extends Axis2TestBase {
+ private OMFactory _factory;
+ private DateFormat xsdDF = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm");
+ private ServiceClientUtil _client;
+ private String _deployedName;
+
+ /**
+ * test case set up
+ *
+ * @throws Exception Exception
+ */
+ @BeforeMethod
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ // Create a factory
+ _factory = OMAbstractFactory.getOMFactory();
+ _client = new ServiceClientUtil();
+
+ // Just making sure the instance starts
+ Thread.sleep(1000);
+ }
+
+ /**
+ * test case tear down
+ *
+ * @throws Exception Exception
+ */
+ @AfterMethod
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ /**
+ * Tests rendezvous
+ *
+ * @throws Exception
+ */
+ String firstResponse, secondResponse;
+ boolean secondStarted;
+ String nsAttr;
+
+ @Test(dataProvider="configs")
+ public void testCorrelationJoin() throws Exception {
+ final String bundleOne = "TestCorrelationJoin", bundleTwo = "TestAttributeNamespaces";
+
+ firstResponse = secondResponse = null;
+ secondStarted = true;
+
+ server.getODEServer().getBpelServer().setProcessThrottledMaximumSize(0);
+
+ // deploy the first service
+ server.deployService(DummyService.class.getCanonicalName());
+ if (server.isDeployed(bundleOne)) server.undeployProcess(bundleOne);
+ server.deployProcess(bundleOne);
+
+ Thread processOne = new Thread() {
+ public void run() {
+ try {
+ firstResponse = server.sendRequestFile("http://localhost:8888/processes/correlationMultiTest",
+ bundleOne, "testRequest.soap");
+ System.out.println("=>\n" + firstResponse);
+ } catch (Exception e) {
+ fail(e.getMessage());
+ }
+ }
+ };
+ processOne.start();
+ processOne.join();
+
+ try {
+ processOne.join();
+ assertTrue(firstResponse.contains("tooHugeProcesses"), firstResponse);
+ } finally {
+ server.undeployProcess(bundleOne);
+ }
+
+ }
+
+ public String getODEConfigDir() {
+ return getClass().getClassLoader().getResource("webapp").getFile() + "/WEB-INF/conf.jpa-derby";
+ }
+}
Modified: branches/ODE/ODE-1.x/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/AssignGeneratorMessages.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/AssignGeneratorMessages.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/AssignGeneratorMessages.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,89 +1,89 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.bpel.compiler;
-
-import org.apache.ode.bpel.compiler.api.CompilationMessage;
-import org.apache.ode.bpel.compiler.api.CompilationMessageBundle;
-
-import javax.xml.namespace.QName;
-
-public class AssignGeneratorMessages extends CompilationMessageBundle {
-
- /** Copy missing from-spec. */
- public CompilationMessage errMissingFromSpec() {
- return this.formatCompilationMessage("Copy missing from-spec.");
- }
-
- /** Copy to message variable {0} requires a message for the r-value. */
- public CompilationMessage errCopyToMessageFromNonMessage(String lval) {
- return this.formatCompilationMessage(
- "Copy to message variable {0} requires a message for the r-value.", lval);
- }
-
- /** Copy from message variable {0} requires a message for the l-value. */
- public CompilationMessage errCopyFromMessageToNonMessage(String rval) {
- return this.formatCompilationMessage(
- "Copy from message variable {0} requires a message for the l-value.", rval);
- }
-
- /**
- * Copy to message variable {0} of type {1} from message {2} of type {3} is
- * not permitted (the message types do not match).
- */
- public CompilationMessage errMismatchedMessageAssignment(String lvar, QName tlvalue,
- String rval, QName trvalue) {
- return this.formatCompilationMessage(
- "Copy to message variable {0} of type {1} from message {2}" +
- " of type {3} is not permitted (the message types do not match).", lvar,
- tlvalue, rval, trvalue);
- }
-
- /** Copy to partner link {0} requires the partnerRole to be defined on partner link. */
- public CompilationMessage errCopyToUndeclaredPartnerRole(String lval) {
- return this.formatCompilationMessage(
- "Copy to partner link {0} requires the partnerRole to be defined on partner link.", lval);
- }
-
- /**
- * Copy from partner link {0} with enpoint reference {1} requires
- * the corresponding role to be defined on partner link.
- */
- public CompilationMessage errCopyFromUndeclaredPartnerRole(String rval, String epr) {
- return this.formatCompilationMessage(
- "Copy from partner link {0} with enpoint reference {1} requires" +
- " the corresponding role to be defined on partner link.", rval, epr);
- }
-
- /** Copy missing to-spec. */
- public CompilationMessage errMissingToSpec() {
- return this.formatCompilationMessage("Copy missing to-spec.");
- }
-
- /** From-spec format is unrecognized. */
- public CompilationMessage errUnkownFromSpec() {
- return this.formatCompilationMessage("From-spec format is unrecognized.");
- }
-
- /** To-spec format is unrecognized. */
- public CompilationMessage errUnknownToSpec() {
- return this.formatCompilationMessage("To-spec format is unrecognized.");
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.bpel.compiler;
+
+import org.apache.ode.bpel.compiler.api.CompilationMessage;
+import org.apache.ode.bpel.compiler.api.CompilationMessageBundle;
+
+import javax.xml.namespace.QName;
+
+public class AssignGeneratorMessages extends CompilationMessageBundle {
+
+ /** Copy missing from-spec. */
+ public CompilationMessage errMissingFromSpec() {
+ return this.formatCompilationMessage("Copy missing from-spec.");
+ }
+
+ /** Copy to message variable {0} requires a message for the r-value. */
+ public CompilationMessage errCopyToMessageFromNonMessage(String lval) {
+ return this.formatCompilationMessage(
+ "Copy to message variable {0} requires a message for the r-value.", lval);
+ }
+
+ /** Copy from message variable {0} requires a message for the l-value. */
+ public CompilationMessage errCopyFromMessageToNonMessage(String rval) {
+ return this.formatCompilationMessage(
+ "Copy from message variable {0} requires a message for the l-value.", rval);
+ }
+
+ /**
+ * Copy to message variable {0} of type {1} from message {2} of type {3} is
+ * not permitted (the message types do not match).
+ */
+ public CompilationMessage errMismatchedMessageAssignment(String lvar, QName tlvalue,
+ String rval, QName trvalue) {
+ return this.formatCompilationMessage(
+ "Copy to message variable {0} of type {1} from message {2}" +
+ " of type {3} is not permitted (the message types do not match).", lvar,
+ tlvalue, rval, trvalue);
+ }
+
+ /** Copy to partner link {0} requires the partnerRole to be defined on partner link. */
+ public CompilationMessage errCopyToUndeclaredPartnerRole(String lval) {
+ return this.formatCompilationMessage(
+ "Copy to partner link {0} requires the partnerRole to be defined on partner link.", lval);
+ }
+
+ /**
+ * Copy from partner link {0} with enpoint reference {1} requires
+ * the corresponding role to be defined on partner link.
+ */
+ public CompilationMessage errCopyFromUndeclaredPartnerRole(String rval, String epr) {
+ return this.formatCompilationMessage(
+ "Copy from partner link {0} with enpoint reference {1} requires" +
+ " the corresponding role to be defined on partner link.", rval, epr);
+ }
+
+ /** Copy missing to-spec. */
+ public CompilationMessage errMissingToSpec() {
+ return this.formatCompilationMessage("Copy missing to-spec.");
+ }
+
+ /** From-spec format is unrecognized. */
+ public CompilationMessage errUnkownFromSpec() {
+ return this.formatCompilationMessage("From-spec format is unrecognized.");
+ }
+
+ /** To-spec format is unrecognized. */
+ public CompilationMessage errUnknownToSpec() {
+ return this.formatCompilationMessage("To-spec format is unrecognized.");
+ }
+
+}
Modified: branches/ODE/ODE-1.x/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/FlowGeneratorMessages.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/FlowGeneratorMessages.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/FlowGeneratorMessages.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,42 +1,42 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.bpel.compiler;
-
-import org.apache.ode.bpel.compiler.api.CompilationMessage;
-import org.apache.ode.bpel.compiler.api.CompilationMessageBundle;
-
-public class FlowGeneratorMessages extends CompilationMessageBundle {
-
- /** The link "{0}" does not have a source. */
- public CompilationMessage errLinkMissingSourceActivity(String linkName) {
- return this.formatCompilationMessage("The link \"{0}\" does not have a source.", linkName);
- }
-
- /** The link "{0}" does not have a target. */
- public CompilationMessage errLinkMissingTargetActivity(String linkName) {
- return this.formatCompilationMessage("The link \"{0}\" does not have a target.", linkName);
- }
-
- /** Duplicate declaration of link "{0}". */
- public CompilationMessage errDuplicateLinkDecl(String linkName) {
- return this.formatCompilationMessage("Duplicate declaration of link \"{0}\".", linkName);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.bpel.compiler;
+
+import org.apache.ode.bpel.compiler.api.CompilationMessage;
+import org.apache.ode.bpel.compiler.api.CompilationMessageBundle;
+
+public class FlowGeneratorMessages extends CompilationMessageBundle {
+
+ /** The link "{0}" does not have a source. */
+ public CompilationMessage errLinkMissingSourceActivity(String linkName) {
+ return this.formatCompilationMessage("The link \"{0}\" does not have a source.", linkName);
+ }
+
+ /** The link "{0}" does not have a target. */
+ public CompilationMessage errLinkMissingTargetActivity(String linkName) {
+ return this.formatCompilationMessage("The link \"{0}\" does not have a target.", linkName);
+ }
+
+ /** Duplicate declaration of link "{0}". */
+ public CompilationMessage errDuplicateLinkDecl(String linkName) {
+ return this.formatCompilationMessage("Duplicate declaration of link \"{0}\".", linkName);
+ }
+
+}
Modified: branches/ODE/ODE-1.x/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/InvokeGeneratorMessages.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/InvokeGeneratorMessages.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/InvokeGeneratorMessages.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,47 +1,47 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.bpel.compiler;
-
-import org.apache.ode.bpel.compiler.api.CompilationMessage;
-import org.apache.ode.bpel.compiler.api.CompilationMessageBundle;
-
-public class InvokeGeneratorMessages extends CompilationMessageBundle {
-
- /**
- * Invoke doesn't define an output variable even though the operation {0}
- * declares an output message.
- */
- public CompilationMessage errInvokeNoOutputMessageForOutputOp(String operation) {
- return this.formatCompilationMessage(
- "Invoke doesn't define an output variable even though the operation \"{0}\" "
- + "declares an output message.", operation);
- }
-
- /**
- * Invoke doesn't define an input variable even though the operation {0}
- * declares an input message.
- */
- public CompilationMessage errInvokeNoInputMessageForInputOp(String operation) {
- return this.formatCompilationMessage(
- "Invoke doesn't define an output variable even though the operation \"{0}\" "
- + "declares an output message.", operation);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.bpel.compiler;
+
+import org.apache.ode.bpel.compiler.api.CompilationMessage;
+import org.apache.ode.bpel.compiler.api.CompilationMessageBundle;
+
+public class InvokeGeneratorMessages extends CompilationMessageBundle {
+
+ /**
+ * Invoke doesn't define an output variable even though the operation {0}
+ * declares an output message.
+ */
+ public CompilationMessage errInvokeNoOutputMessageForOutputOp(String operation) {
+ return this.formatCompilationMessage(
+ "Invoke doesn't define an output variable even though the operation \"{0}\" "
+ + "declares an output message.", operation);
+ }
+
+ /**
+ * Invoke doesn't define an input variable even though the operation {0}
+ * declares an input message.
+ */
+ public CompilationMessage errInvokeNoInputMessageForInputOp(String operation) {
+ return this.formatCompilationMessage(
+ "Invoke doesn't define an output variable even though the operation \"{0}\" "
+ + "declares an output message.", operation);
+ }
+
+}
Modified: branches/ODE/ODE-1.x/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/PickGeneratorMessages.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/PickGeneratorMessages.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/PickGeneratorMessages.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,54 +1,54 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.bpel.compiler;
-
-import org.apache.ode.bpel.compiler.api.CompilationMessage;
-import org.apache.ode.bpel.compiler.api.CompilationMessageBundle;
-
-public class PickGeneratorMessages extends CompilationMessageBundle {
-
- /**
- * Attempt to use multiple non-initiate correlation sets; second set was
- * "{0}".
- */
- public CompilationMessage errSecondNonInitiateOrJoinCorrelationSet(String setName) {
- return this.formatCompilationMessage("Attempt to use multiple non-initiate or join correlation sets;"
- + " second set was \"{0}\".", setName);
- }
-
- // TODO: better error message
- public CompilationMessage errForOrUntilMustBeGiven() {
- return this.formatCompilationMessage("errForOrUntilMustBeGiven");
- }
-
- public CompilationMessage errEmptyOnMessage() {
- return this.formatCompilationMessage("An onMessage element declared in a pick can't be empty.");
- }
-
- // TODO: better error message
- public CompilationMessage errOnAlarmWithCreateInstance() {
- return this.formatCompilationMessage("errOnAlarmWithCreateInstance");
- }
-
- public CompilationMessage errRendezvousNotSupported() {
- return this.formatCompilationMessage("Rendezvous correlation mode not supported in this context.");
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.bpel.compiler;
+
+import org.apache.ode.bpel.compiler.api.CompilationMessage;
+import org.apache.ode.bpel.compiler.api.CompilationMessageBundle;
+
+public class PickGeneratorMessages extends CompilationMessageBundle {
+
+ /**
+ * Attempt to use multiple non-initiate correlation sets; second set was
+ * "{0}".
+ */
+ public CompilationMessage errSecondNonInitiateOrJoinCorrelationSet(String setName) {
+ return this.formatCompilationMessage("Attempt to use multiple non-initiate or join correlation sets;"
+ + " second set was \"{0}\".", setName);
+ }
+
+ // TODO: better error message
+ public CompilationMessage errForOrUntilMustBeGiven() {
+ return this.formatCompilationMessage("errForOrUntilMustBeGiven");
+ }
+
+ public CompilationMessage errEmptyOnMessage() {
+ return this.formatCompilationMessage("An onMessage element declared in a pick can't be empty.");
+ }
+
+ // TODO: better error message
+ public CompilationMessage errOnAlarmWithCreateInstance() {
+ return this.formatCompilationMessage("errOnAlarmWithCreateInstance");
+ }
+
+ public CompilationMessage errRendezvousNotSupported() {
+ return this.formatCompilationMessage("Rendezvous correlation mode not supported in this context.");
+ }
+
+}
Modified: branches/ODE/ODE-1.x/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ReplyGeneratorMessages.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ReplyGeneratorMessages.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ReplyGeneratorMessages.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,41 +1,41 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.bpel.compiler;
-
-import org.apache.ode.bpel.compiler.api.CompilationMessage;
-import org.apache.ode.bpel.compiler.api.CompilationMessageBundle;
-
-public class ReplyGeneratorMessages extends CompilationMessageBundle {
-
- /** The <reply> must specify a reply message. */
- public CompilationMessage errOutputVariableMustBeSpecified() {
- return this.formatCompilationMessage("The <reply> must specify a reply message.");
- }
-
- /**
- * The <reply> activity has an undeclared fault "{0}" for operation
- * "{1}".
- */
- public CompilationMessage errUndeclaredFault(String faultName, String operationName) {
- return this.formatCompilationMessage("The <reply> activity has an undeclared fault"
- + "\"{0}\" for operation \"{1}\".", faultName, operationName);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.bpel.compiler;
+
+import org.apache.ode.bpel.compiler.api.CompilationMessage;
+import org.apache.ode.bpel.compiler.api.CompilationMessageBundle;
+
+public class ReplyGeneratorMessages extends CompilationMessageBundle {
+
+ /** The <reply> must specify a reply message. */
+ public CompilationMessage errOutputVariableMustBeSpecified() {
+ return this.formatCompilationMessage("The <reply> must specify a reply message.");
+ }
+
+ /**
+ * The <reply> activity has an undeclared fault "{0}" for operation
+ * "{1}".
+ */
+ public CompilationMessage errUndeclaredFault(String faultName, String operationName) {
+ return this.formatCompilationMessage("The <reply> activity has an undeclared fault"
+ + "\"{0}\" for operation \"{1}\".", faultName, operationName);
+ }
+
+}
Modified: branches/ODE/ODE-1.x/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WaitGeneratorMessages.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WaitGeneratorMessages.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WaitGeneratorMessages.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,32 +1,32 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.bpel.compiler;
-
-import org.apache.ode.bpel.compiler.api.CompilationMessage;
-import org.apache.ode.bpel.compiler.api.CompilationMessageBundle;
-
-public class WaitGeneratorMessages extends CompilationMessageBundle {
-
- /** Must specify exactly one "for" or "until" expression. */
- public CompilationMessage errWaitMustDefineForOrUntilDuration() {
- return this.formatCompilationMessage("Must specify exactly one \"for\" or \"until\" expression.");
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.bpel.compiler;
+
+import org.apache.ode.bpel.compiler.api.CompilationMessage;
+import org.apache.ode.bpel.compiler.api.CompilationMessageBundle;
+
+public class WaitGeneratorMessages extends CompilationMessageBundle {
+
+ /** Must specify exactly one "for" or "until" expression. */
+ public CompilationMessage errWaitMustDefineForOrUntilDuration() {
+ return this.formatCompilationMessage("Must specify exactly one \"for\" or \"until\" expression.");
+ }
+
+}
Modified: branches/ODE/ODE-1.x/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/CompilationMessageBundle.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/CompilationMessageBundle.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/CompilationMessageBundle.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,71 +1,71 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.bpel.compiler.api;
-
-import org.apache.ode.utils.msg.MessageBundle;
-
-public abstract class CompilationMessageBundle extends MessageBundle {
-
- // TODO turn CompilationMessage.CODE into a proper Java5 enum
- private static String[] PREFIXES = {"inf", "warn", "err"};
- private static short[] SEVERITIES = {CompilationMessage.INFO, CompilationMessage.WARN,
- CompilationMessage.ERROR};
-
- protected CompilationMessage formatCompilationMessage(String message, Object... args) {
- String methodName = "errUnknown";
- String methodKey = null;
- short severity = 0;
-
- // format the regular message text
- String msg = this.format(message, args);
-
- // I will *so* burn in hell for this
- StackTraceElement[] stack = new Throwable().getStackTrace();
- if (stack.length > 1) {
- methodName = stack[1].getMethodName();
- }
- else {
- // bummer: no stack trace - create an unknown error as fallback.
- }
-
- // find method prefix
- for (int i = 0; i < PREFIXES.length; i++) {
- if (methodName.startsWith(PREFIXES[i])) {
- methodKey = methodName.substring(PREFIXES[i].length());
- severity = SEVERITIES[i];
- break;
- }
- }
-
- // found a prefixed method?
- if (methodKey == null) {
- throw new UnsupportedOperationException("unexpected caller method: " + methodName);
- }
-
- CompilationMessage cmsg = new CompilationMessage();
- cmsg.severity = severity;
- cmsg.phase = 0;
- cmsg.messageText = msg;
- cmsg.code = methodKey;
-
- return cmsg;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.bpel.compiler.api;
+
+import org.apache.ode.utils.msg.MessageBundle;
+
+public abstract class CompilationMessageBundle extends MessageBundle {
+
+ // TODO turn CompilationMessage.CODE into a proper Java5 enum
+ private static String[] PREFIXES = {"inf", "warn", "err"};
+ private static short[] SEVERITIES = {CompilationMessage.INFO, CompilationMessage.WARN,
+ CompilationMessage.ERROR};
+
+ protected CompilationMessage formatCompilationMessage(String message, Object... args) {
+ String methodName = "errUnknown";
+ String methodKey = null;
+ short severity = 0;
+
+ // format the regular message text
+ String msg = this.format(message, args);
+
+ // I will *so* burn in hell for this
+ StackTraceElement[] stack = new Throwable().getStackTrace();
+ if (stack.length > 1) {
+ methodName = stack[1].getMethodName();
+ }
+ else {
+ // bummer: no stack trace - create an unknown error as fallback.
+ }
+
+ // find method prefix
+ for (int i = 0; i < PREFIXES.length; i++) {
+ if (methodName.startsWith(PREFIXES[i])) {
+ methodKey = methodName.substring(PREFIXES[i].length());
+ severity = SEVERITIES[i];
+ break;
+ }
+ }
+
+ // found a prefixed method?
+ if (methodKey == null) {
+ throw new UnsupportedOperationException("unexpected caller method: " + methodName);
+ }
+
+ CompilationMessage cmsg = new CompilationMessage();
+ cmsg.severity = severity;
+ cmsg.phase = 0;
+ cmsg.messageText = msg;
+ cmsg.code = methodKey;
+
+ return cmsg;
+ }
+
+}
Modified: branches/ODE/ODE-1.x/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xquery10/compiler/XQuery10BpelFunctions.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xquery10/compiler/XQuery10BpelFunctions.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xquery10/compiler/XQuery10BpelFunctions.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -17,165 +17,165 @@
* under the License.
*/
-package org.apache.ode.bpel.elang.xquery10.compiler;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-import javax.xml.xpath.XPathFunction;
-import javax.xml.xpath.XPathFunctionException;
-
-import net.sf.saxon.dom.NodeWrapper;
-import net.sf.saxon.expr.XPathContext;
-import net.sf.saxon.om.Item;
-
-import org.apache.ode.bpel.elang.xpath20.compiler.Constants;
-import org.apache.ode.bpel.elang.xpath20.compiler.JaxpFunctionResolver;
-import org.apache.ode.utils.Namespaces;
-import org.w3c.dom.Node;
-
-
-/**
- * XQuery-Friendly definition of BPEL functions, which
- * delegates calls to the JAXP-based function resolver
- */
-public class XQuery10BpelFunctions {
- public static final String USER_DATA_KEY_FUNCTION_RESOLVER = "function-resolver";
- private static final QName WSBPEL_GET_VARIABLE_PROPERTY = new QName(Namespaces.WSBPEL2_0_FINAL_EXEC,
- Constants.EXT_FUNCTION_GETVARIABLEPROPERTY);
- private static final QName WSBPEL_GET_VARIABLE_DATA = new QName(Namespaces.WSBPEL2_0_FINAL_EXEC,
- Constants.EXT_FUNCTION_GETVARIABLEDATA);
- private static final QName WSBPEL_GET_LINK_STATUS = new QName(Namespaces.WSBPEL2_0_FINAL_EXEC,
- Constants.EXT_FUNCTION_GETLINKSTATUS);
- private static final QName WSBPEL_DO_XSL_TRANSFORM = new QName(Namespaces.WSBPEL2_0_FINAL_EXEC,
- Constants.EXT_FUNCTION_DOXSLTRANSFORM);
-
- /**
- * WS-BPEL getVariableProperty function
- *
- * @param context context
- * @param variableName variableName
- * @param propertyName propertyName
- *
- * @return type
- *
- * @throws XPathFunctionException XPathFunctionException
- */
- public static Object getVariableProperty(XPathContext context,
- String variableName, String propertyName) throws XPathFunctionException {
- ArrayList<String> arguments = new ArrayList<String>();
- arguments.add(variableName);
- arguments.add(propertyName);
-
- return evaluate(resolveFunction(context, WSBPEL_GET_VARIABLE_PROPERTY),
- arguments);
- }
-
- /**
- * WS-BPEL getVariableData function
- *
- * @param context context
- * @param variableName variableName
- * @param partName partName
- * @param xpath xpath
- *
- * @return type
- *
- * @throws XPathFunctionException XPathFunctionException
- */
- public static Object getVariableData(XPathContext context,
- String variableName, String partName, String xpath)
- throws XPathFunctionException {
- ArrayList<String> arguments = new ArrayList<String>();
- arguments.add(variableName);
- arguments.add(partName);
- arguments.add(xpath);
-
- return evaluate(resolveFunction(context, WSBPEL_GET_VARIABLE_DATA),
- arguments);
- }
-
- /**
- * WS-BPEL doXslTransform function
- *
- * @param context context
- * @param xslUri xslUri
- * @param sources sources
- *
- * @return type
- *
- * @throws XPathFunctionException XPathFunctionException
- */
- public static Object doXslTransform(XPathContext context, String xslUri,
- Object sources) throws XPathFunctionException {
- ArrayList<Object> arguments = new ArrayList<Object>();
- arguments.add(xslUri);
- arguments.add(sources);
-
- return evaluate(resolveFunction(context, WSBPEL_DO_XSL_TRANSFORM),
- arguments);
- }
-
- /**
- * WS-BPEL getLinkStatus function
- *
- * @param context context
- * @param linkName linkName
- *
- * @return type
- *
- * @throws XPathFunctionException XPathFunctionException
- */
- public static Object getLinkStatus(XPathContext context, String linkName)
- throws XPathFunctionException {
- ArrayList<String> arguments = new ArrayList<String>();
- arguments.add(linkName);
-
- return evaluate(resolveFunction(context, WSBPEL_GET_LINK_STATUS),
- arguments);
- }
-
- /**
- * Locates the JAXP equivalent function
- *
- * @param context context
- * @param name name
- *
- * @return type
- */
- private static XPathFunction resolveFunction(XPathContext context,
- QName name) {
- JaxpFunctionResolver funcResolver = null;
- Item item = context.getCurrentIterator().current();
-
- if (item instanceof NodeWrapper) {
- Node node = (Node) ((NodeWrapper) item).getUnderlyingNode();
-
- if (node != null) {
- funcResolver = (JaxpFunctionResolver) node.getUserData(USER_DATA_KEY_FUNCTION_RESOLVER);
- }
- }
-
- return funcResolver.resolveFunction(name, 0);
- }
-
- /**
- * Evaluates function against arguments passed by XQuery
- *
- * @param function function
- * @param arguments arguments
- *
- * @return type
- *
- * @throws XPathFunctionException XPathFunctionException
- */
- private static Object evaluate(XPathFunction function, List arguments)
- throws XPathFunctionException {
- if (function == null) {
- throw new XPathFunctionException("Unable to locate function in library");
- }
-
- return function.evaluate(arguments);
- }
-}
+package org.apache.ode.bpel.elang.xquery10.compiler;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+import javax.xml.xpath.XPathFunction;
+import javax.xml.xpath.XPathFunctionException;
+
+import net.sf.saxon.dom.NodeWrapper;
+import net.sf.saxon.expr.XPathContext;
+import net.sf.saxon.om.Item;
+
+import org.apache.ode.bpel.elang.xpath20.compiler.Constants;
+import org.apache.ode.bpel.elang.xpath20.compiler.JaxpFunctionResolver;
+import org.apache.ode.utils.Namespaces;
+import org.w3c.dom.Node;
+
+
+/**
+ * XQuery-Friendly definition of BPEL functions, which
+ * delegates calls to the JAXP-based function resolver
+ */
+public class XQuery10BpelFunctions {
+ public static final String USER_DATA_KEY_FUNCTION_RESOLVER = "function-resolver";
+ private static final QName WSBPEL_GET_VARIABLE_PROPERTY = new QName(Namespaces.WSBPEL2_0_FINAL_EXEC,
+ Constants.EXT_FUNCTION_GETVARIABLEPROPERTY);
+ private static final QName WSBPEL_GET_VARIABLE_DATA = new QName(Namespaces.WSBPEL2_0_FINAL_EXEC,
+ Constants.EXT_FUNCTION_GETVARIABLEDATA);
+ private static final QName WSBPEL_GET_LINK_STATUS = new QName(Namespaces.WSBPEL2_0_FINAL_EXEC,
+ Constants.EXT_FUNCTION_GETLINKSTATUS);
+ private static final QName WSBPEL_DO_XSL_TRANSFORM = new QName(Namespaces.WSBPEL2_0_FINAL_EXEC,
+ Constants.EXT_FUNCTION_DOXSLTRANSFORM);
+
+ /**
+ * WS-BPEL getVariableProperty function
+ *
+ * @param context context
+ * @param variableName variableName
+ * @param propertyName propertyName
+ *
+ * @return type
+ *
+ * @throws XPathFunctionException XPathFunctionException
+ */
+ public static Object getVariableProperty(XPathContext context,
+ String variableName, String propertyName) throws XPathFunctionException {
+ ArrayList<String> arguments = new ArrayList<String>();
+ arguments.add(variableName);
+ arguments.add(propertyName);
+
+ return evaluate(resolveFunction(context, WSBPEL_GET_VARIABLE_PROPERTY),
+ arguments);
+ }
+
+ /**
+ * WS-BPEL getVariableData function
+ *
+ * @param context context
+ * @param variableName variableName
+ * @param partName partName
+ * @param xpath xpath
+ *
+ * @return type
+ *
+ * @throws XPathFunctionException XPathFunctionException
+ */
+ public static Object getVariableData(XPathContext context,
+ String variableName, String partName, String xpath)
+ throws XPathFunctionException {
+ ArrayList<String> arguments = new ArrayList<String>();
+ arguments.add(variableName);
+ arguments.add(partName);
+ arguments.add(xpath);
+
+ return evaluate(resolveFunction(context, WSBPEL_GET_VARIABLE_DATA),
+ arguments);
+ }
+
+ /**
+ * WS-BPEL doXslTransform function
+ *
+ * @param context context
+ * @param xslUri xslUri
+ * @param sources sources
+ *
+ * @return type
+ *
+ * @throws XPathFunctionException XPathFunctionException
+ */
+ public static Object doXslTransform(XPathContext context, String xslUri,
+ Object sources) throws XPathFunctionException {
+ ArrayList<Object> arguments = new ArrayList<Object>();
+ arguments.add(xslUri);
+ arguments.add(sources);
+
+ return evaluate(resolveFunction(context, WSBPEL_DO_XSL_TRANSFORM),
+ arguments);
+ }
+
+ /**
+ * WS-BPEL getLinkStatus function
+ *
+ * @param context context
+ * @param linkName linkName
+ *
+ * @return type
+ *
+ * @throws XPathFunctionException XPathFunctionException
+ */
+ public static Object getLinkStatus(XPathContext context, String linkName)
+ throws XPathFunctionException {
+ ArrayList<String> arguments = new ArrayList<String>();
+ arguments.add(linkName);
+
+ return evaluate(resolveFunction(context, WSBPEL_GET_LINK_STATUS),
+ arguments);
+ }
+
+ /**
+ * Locates the JAXP equivalent function
+ *
+ * @param context context
+ * @param name name
+ *
+ * @return type
+ */
+ private static XPathFunction resolveFunction(XPathContext context,
+ QName name) {
+ JaxpFunctionResolver funcResolver = null;
+ Item item = context.getCurrentIterator().current();
+
+ if (item instanceof NodeWrapper) {
+ Node node = (Node) ((NodeWrapper) item).getUnderlyingNode();
+
+ if (node != null) {
+ funcResolver = (JaxpFunctionResolver) node.getUserData(USER_DATA_KEY_FUNCTION_RESOLVER);
+ }
+ }
+
+ return funcResolver.resolveFunction(name, 0);
+ }
+
+ /**
+ * Evaluates function against arguments passed by XQuery
+ *
+ * @param function function
+ * @param arguments arguments
+ *
+ * @return type
+ *
+ * @throws XPathFunctionException XPathFunctionException
+ */
+ private static Object evaluate(XPathFunction function, List arguments)
+ throws XPathFunctionException {
+ if (function == null) {
+ throw new XPathFunctionException("Unable to locate function in library");
+ }
+
+ return function.evaluate(arguments);
+ }
+}
Modified: branches/ODE/ODE-1.x/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xquery10/compiler/XQuery10ExpressionCompilerBPEL20.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xquery10/compiler/XQuery10ExpressionCompilerBPEL20.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xquery10/compiler/XQuery10ExpressionCompilerBPEL20.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,29 +1,29 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.ode.bpel.elang.xquery10.compiler;
-
-import org.apache.ode.utils.Namespaces;
-
-
-public class XQuery10ExpressionCompilerBPEL20 extends XQuery10ExpressionCompilerImpl {
-
- public XQuery10ExpressionCompilerBPEL20() {
- super(Namespaces.WSBPEL2_0_FINAL_EXEC);
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.elang.xquery10.compiler;
+
+import org.apache.ode.utils.Namespaces;
+
+
+public class XQuery10ExpressionCompilerBPEL20 extends XQuery10ExpressionCompilerImpl {
+
+ public XQuery10ExpressionCompilerBPEL20() {
+ super(Namespaces.WSBPEL2_0_FINAL_EXEC);
+ }
+}
Modified: branches/ODE/ODE-1.x/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler/CompilationMessageTest.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler/CompilationMessageTest.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler/CompilationMessageTest.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,117 +1,117 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.bpel.compiler;
-
-import org.apache.ode.bpel.compiler.api.CompilationMessage;
-import org.apache.ode.utils.msg.MessageBundle;
-
-import java.net.URI;
-import java.util.Locale;
-
-import junit.framework.TestCase;
-
-public class CompilationMessageTest extends TestCase {
-
- private static String NO_PARAMETER = "No parameter!";
- private static String NO_PARAMETER_CODE = "NoParameter";
- private static String NO_PARAMETER_DE = "Kein Parameter!";
- private static String WRONG_PARAMETER = "Wrong parameter :-)";
- private static String WRONG_PARAMETER_CODE = "WrongParameter";
-
- private CompilationTestMessages _bundle;
- private SourceLocationImpl sloc;
- private Locale oldLocale;
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- oldLocale = Locale.getDefault();
- Locale.setDefault(Locale.ENGLISH);
- _bundle = MessageBundle.getMessages(CompilationTestMessages.class);
- sloc = new SourceLocationImpl(new URI("urn:foo"));
- }
-
- @Override
- protected void tearDown() throws Exception {
- _bundle = null;
- Locale.setDefault(oldLocale);
- super.tearDown();
- }
-
- public void testNoParameter() {
- CompilationMessage msg = _bundle.infNoParameter().setSource(sloc);
- assertEquals(NO_PARAMETER, msg.messageText);
- assertEquals(CompilationMessage.INFO, msg.severity);
- assertEquals(NO_PARAMETER_CODE, msg.code);
- assertSame(sloc, msg.source);
-
- msg = _bundle.warnNoParameter().setSource(sloc);
- assertEquals("No parameter!", msg.messageText);
- assertEquals(CompilationMessage.WARN, msg.severity);
- assertEquals(NO_PARAMETER_CODE, msg.code);
- assertSame(sloc, msg.source);
-
- msg = _bundle.errNoParameter().setSource(sloc);
- assertEquals(NO_PARAMETER, msg.messageText);
- assertEquals(CompilationMessage.ERROR, msg.severity);
- assertEquals(NO_PARAMETER_CODE, msg.code);
- assertSame(sloc, msg.source);
- }
-
- public void testNoParameterLocalized() {
- CompilationTestMessages bundle = MessageBundle.getMessages(
- CompilationTestMessages.class, Locale.GERMAN);
- CompilationMessage msg = bundle.infNoParameter().setSource(sloc);
- assertEquals(NO_PARAMETER_DE, msg.messageText);
- assertEquals(CompilationMessage.INFO, msg.severity);
- assertEquals(NO_PARAMETER_CODE, msg.code);
- assertSame(sloc, msg.source);
- }
-
- public void testWrongParameter() {
- CompilationMessage msg = _bundle.infWrongParameter(":-)").setSource(sloc);
- assertEquals(WRONG_PARAMETER, msg.messageText);
- assertEquals(CompilationMessage.INFO, msg.severity);
- assertEquals(WRONG_PARAMETER_CODE, msg.code);
- assertSame(sloc, msg.source);
-
- msg = _bundle.warnWrongParameter(":-)").setSource(sloc);
- assertEquals(WRONG_PARAMETER, msg.messageText);
- assertEquals(CompilationMessage.WARN, msg.severity);
- assertEquals(WRONG_PARAMETER_CODE, msg.code);
- assertSame(sloc, msg.source);
-
- msg = _bundle.errWrongParameter(":-)").setSource(sloc);
- assertEquals(WRONG_PARAMETER, msg.messageText);
- assertEquals(CompilationMessage.ERROR, msg.severity);
- assertEquals(WRONG_PARAMETER_CODE, msg.code);
- assertSame(sloc, msg.source);
- }
-
- public void testWrongMethod() {
- try {
- _bundle.msgWrongMethod().setSource(sloc);
- fail("should have failed on msgWrongMethod()");
- }
- catch (UnsupportedOperationException uop) {
- // OK
- }
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.bpel.compiler;
+
+import org.apache.ode.bpel.compiler.api.CompilationMessage;
+import org.apache.ode.utils.msg.MessageBundle;
+
+import java.net.URI;
+import java.util.Locale;
+
+import junit.framework.TestCase;
+
+public class CompilationMessageTest extends TestCase {
+
+ private static String NO_PARAMETER = "No parameter!";
+ private static String NO_PARAMETER_CODE = "NoParameter";
+ private static String NO_PARAMETER_DE = "Kein Parameter!";
+ private static String WRONG_PARAMETER = "Wrong parameter :-)";
+ private static String WRONG_PARAMETER_CODE = "WrongParameter";
+
+ private CompilationTestMessages _bundle;
+ private SourceLocationImpl sloc;
+ private Locale oldLocale;
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ oldLocale = Locale.getDefault();
+ Locale.setDefault(Locale.ENGLISH);
+ _bundle = MessageBundle.getMessages(CompilationTestMessages.class);
+ sloc = new SourceLocationImpl(new URI("urn:foo"));
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ _bundle = null;
+ Locale.setDefault(oldLocale);
+ super.tearDown();
+ }
+
+ public void testNoParameter() {
+ CompilationMessage msg = _bundle.infNoParameter().setSource(sloc);
+ assertEquals(NO_PARAMETER, msg.messageText);
+ assertEquals(CompilationMessage.INFO, msg.severity);
+ assertEquals(NO_PARAMETER_CODE, msg.code);
+ assertSame(sloc, msg.source);
+
+ msg = _bundle.warnNoParameter().setSource(sloc);
+ assertEquals("No parameter!", msg.messageText);
+ assertEquals(CompilationMessage.WARN, msg.severity);
+ assertEquals(NO_PARAMETER_CODE, msg.code);
+ assertSame(sloc, msg.source);
+
+ msg = _bundle.errNoParameter().setSource(sloc);
+ assertEquals(NO_PARAMETER, msg.messageText);
+ assertEquals(CompilationMessage.ERROR, msg.severity);
+ assertEquals(NO_PARAMETER_CODE, msg.code);
+ assertSame(sloc, msg.source);
+ }
+
+ public void testNoParameterLocalized() {
+ CompilationTestMessages bundle = MessageBundle.getMessages(
+ CompilationTestMessages.class, Locale.GERMAN);
+ CompilationMessage msg = bundle.infNoParameter().setSource(sloc);
+ assertEquals(NO_PARAMETER_DE, msg.messageText);
+ assertEquals(CompilationMessage.INFO, msg.severity);
+ assertEquals(NO_PARAMETER_CODE, msg.code);
+ assertSame(sloc, msg.source);
+ }
+
+ public void testWrongParameter() {
+ CompilationMessage msg = _bundle.infWrongParameter(":-)").setSource(sloc);
+ assertEquals(WRONG_PARAMETER, msg.messageText);
+ assertEquals(CompilationMessage.INFO, msg.severity);
+ assertEquals(WRONG_PARAMETER_CODE, msg.code);
+ assertSame(sloc, msg.source);
+
+ msg = _bundle.warnWrongParameter(":-)").setSource(sloc);
+ assertEquals(WRONG_PARAMETER, msg.messageText);
+ assertEquals(CompilationMessage.WARN, msg.severity);
+ assertEquals(WRONG_PARAMETER_CODE, msg.code);
+ assertSame(sloc, msg.source);
+
+ msg = _bundle.errWrongParameter(":-)").setSource(sloc);
+ assertEquals(WRONG_PARAMETER, msg.messageText);
+ assertEquals(CompilationMessage.ERROR, msg.severity);
+ assertEquals(WRONG_PARAMETER_CODE, msg.code);
+ assertSame(sloc, msg.source);
+ }
+
+ public void testWrongMethod() {
+ try {
+ _bundle.msgWrongMethod().setSource(sloc);
+ fail("should have failed on msgWrongMethod()");
+ }
+ catch (UnsupportedOperationException uop) {
+ // OK
+ }
+ }
+
+}
Modified: branches/ODE/ODE-1.x/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler/CompilationTestMessages.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler/CompilationTestMessages.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler/CompilationTestMessages.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,55 +1,55 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.bpel.compiler;
-
-import org.apache.ode.bpel.compiler.api.CompilationMessage;
-import org.apache.ode.bpel.compiler.api.CompilationMessageBundle;
-
-public class CompilationTestMessages extends CompilationMessageBundle {
-
- public CompilationMessage infNoParameter() {
- return this.formatCompilationMessage("No parameter!");
- }
-
- public CompilationMessage warnNoParameter() {
- return this.formatCompilationMessage("No parameter!");
- }
-
- public CompilationMessage errNoParameter() {
- return this.formatCompilationMessage("No parameter!");
- }
-
- public CompilationMessage infWrongParameter(String parm) {
- return this.formatCompilationMessage("Wrong parameter {0}", parm);
- }
-
- public CompilationMessage warnWrongParameter(String parm) {
- return this.formatCompilationMessage("Wrong parameter {0}", parm);
- }
-
- public CompilationMessage errWrongParameter(String parm) {
- return this.formatCompilationMessage("Wrong parameter {0}", parm);
- }
-
- public CompilationMessage msgWrongMethod() {
- return this.formatCompilationMessage("Ouch!");
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.bpel.compiler;
+
+import org.apache.ode.bpel.compiler.api.CompilationMessage;
+import org.apache.ode.bpel.compiler.api.CompilationMessageBundle;
+
+public class CompilationTestMessages extends CompilationMessageBundle {
+
+ public CompilationMessage infNoParameter() {
+ return this.formatCompilationMessage("No parameter!");
+ }
+
+ public CompilationMessage warnNoParameter() {
+ return this.formatCompilationMessage("No parameter!");
+ }
+
+ public CompilationMessage errNoParameter() {
+ return this.formatCompilationMessage("No parameter!");
+ }
+
+ public CompilationMessage infWrongParameter(String parm) {
+ return this.formatCompilationMessage("Wrong parameter {0}", parm);
+ }
+
+ public CompilationMessage warnWrongParameter(String parm) {
+ return this.formatCompilationMessage("Wrong parameter {0}", parm);
+ }
+
+ public CompilationMessage errWrongParameter(String parm) {
+ return this.formatCompilationMessage("Wrong parameter {0}", parm);
+ }
+
+ public CompilationMessage msgWrongMethod() {
+ return this.formatCompilationMessage("Ouch!");
+ }
+
+}
Modified: branches/ODE/ODE-1.x/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler/CompilationTestMessages_de.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler/CompilationTestMessages_de.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler/CompilationTestMessages_de.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,30 +1,30 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.bpel.compiler;
-
-import org.apache.ode.bpel.compiler.api.CompilationMessage;
-
-public class CompilationTestMessages_de extends CompilationTestMessages {
-
- public CompilationMessage infNoParameter() {
- return this.formatCompilationMessage("Kein Parameter!");
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.bpel.compiler;
+
+import org.apache.ode.bpel.compiler.api.CompilationMessage;
+
+public class CompilationTestMessages_de extends CompilationTestMessages {
+
+ public CompilationMessage infNoParameter() {
+ return this.formatCompilationMessage("Kein Parameter!");
+ }
+
+}
Modified: branches/ODE/ODE-1.x/bpel-epr/src/main/java/org/apache/ode/bpel/common/evt/DebugBpelEventListener.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-epr/src/main/java/org/apache/ode/bpel/common/evt/DebugBpelEventListener.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-epr/src/main/java/org/apache/ode/bpel/common/evt/DebugBpelEventListener.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,65 +1,65 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.ode.bpel.common.evt;
-
-import java.util.Properties;
-
-import org.apache.commons.lang.BooleanUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.ode.bpel.evt.BpelEvent;
-import org.apache.ode.bpel.iapi.BpelEventListener;
-
-/**
- * Example implementation of the {@link BpelEventListener} interface.
- *
- * Dumps navigation events to a logging appender and optionally to stdout.
- * To use the DebugBpelEventListener add the following lines to your
- * ode-xxx.properties file:
- * <code>
- * ode-jbi.event.listeners=org.apache.ode.bpel.common.evt.DebugBpelEventListener
- * debugeventlistener.dumpToStdOut=on/off
- * </code>
- *
- * @author Tammo van Lessen (University of Stuttgart)
- */
-public class DebugBpelEventListener implements BpelEventListener {
- private static final Log __log = LogFactory.getLog(BpelEventListener.class);
-
- private static final String SYSOUT_KEY = "debugeventlistener.dumpToStdOut";
- private boolean _dumpToStdOut = false;
-
- public void onEvent(BpelEvent bpelEvent) {
- if (__log.isDebugEnabled()) {
- __log.debug(bpelEvent.toString());
- }
-
- if (_dumpToStdOut) {
- System.out.println(bpelEvent.toString());
- }
- }
-
- public void startup(Properties configProperties) {
- if (configProperties != null) {
- _dumpToStdOut = BooleanUtils.toBoolean(configProperties.getProperty(SYSOUT_KEY, "false"));
- }
- }
-
- public void shutdown() {}
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.common.evt;
+
+import java.util.Properties;
+
+import org.apache.commons.lang.BooleanUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ode.bpel.evt.BpelEvent;
+import org.apache.ode.bpel.iapi.BpelEventListener;
+
+/**
+ * Example implementation of the {@link BpelEventListener} interface.
+ *
+ * Dumps navigation events to a logging appender and optionally to stdout.
+ * To use the DebugBpelEventListener add the following lines to your
+ * ode-xxx.properties file:
+ * <code>
+ * ode-jbi.event.listeners=org.apache.ode.bpel.common.evt.DebugBpelEventListener
+ * debugeventlistener.dumpToStdOut=on/off
+ * </code>
+ *
+ * @author Tammo van Lessen (University of Stuttgart)
+ */
+public class DebugBpelEventListener implements BpelEventListener {
+ private static final Log __log = LogFactory.getLog(BpelEventListener.class);
+
+ private static final String SYSOUT_KEY = "debugeventlistener.dumpToStdOut";
+ private boolean _dumpToStdOut = false;
+
+ public void onEvent(BpelEvent bpelEvent) {
+ if (__log.isDebugEnabled()) {
+ __log.debug(bpelEvent.toString());
+ }
+
+ if (_dumpToStdOut) {
+ System.out.println(bpelEvent.toString());
+ }
+ }
+
+ public void startup(Properties configProperties) {
+ if (configProperties != null) {
+ _dumpToStdOut = BooleanUtils.toBoolean(configProperties.getProperty(SYSOUT_KEY, "false"));
+ }
+ }
+
+ public void shutdown() {}
+}
Modified: branches/ODE/ODE-1.x/bpel-obj/src/main/java/org/apache/ode/bpel/elang/xquery10/o/OXQuery10ExpressionBPEL20.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-obj/src/main/java/org/apache/ode/bpel/elang/xquery10/o/OXQuery10ExpressionBPEL20.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-obj/src/main/java/org/apache/ode/bpel/elang/xquery10/o/OXQuery10ExpressionBPEL20.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,45 +1,45 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.bpel.elang.xquery10.o;
-
-import javax.xml.namespace.QName;
-
-import net.sf.saxon.expr.Expression;
-import net.sf.saxon.query.XQueryExpression;
-
-import org.apache.ode.bpel.elang.xpath20.o.OXPath20ExpressionBPEL20;
-import org.apache.ode.bpel.o.OProcess;
-
-/**
- * A representation of an XQuery expression
- */
-public class OXQuery10ExpressionBPEL20 extends OXPath20ExpressionBPEL20 {
-
- private static final long serialVersionUID = -1L;
-
- public String xquery;
-
- public OXQuery10ExpressionBPEL20(OProcess owner, QName qname_getVariableData,
- QName qname_getVariableProperty, QName qname_getLinkStatus,
- QName qname_doXslTransform, boolean isJoinExpression) {
- super(owner, qname_getVariableData, qname_getVariableProperty, qname_getLinkStatus,
- qname_doXslTransform, isJoinExpression);
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.bpel.elang.xquery10.o;
+
+import javax.xml.namespace.QName;
+
+import net.sf.saxon.expr.Expression;
+import net.sf.saxon.query.XQueryExpression;
+
+import org.apache.ode.bpel.elang.xpath20.o.OXPath20ExpressionBPEL20;
+import org.apache.ode.bpel.o.OProcess;
+
+/**
+ * A representation of an XQuery expression
+ */
+public class OXQuery10ExpressionBPEL20 extends OXPath20ExpressionBPEL20 {
+
+ private static final long serialVersionUID = -1L;
+
+ public String xquery;
+
+ public OXQuery10ExpressionBPEL20(OProcess owner, QName qname_getVariableData,
+ QName qname_getVariableProperty, QName qname_getLinkStatus,
+ QName qname_doXslTransform, boolean isJoinExpression) {
+ super(owner, qname_getVariableData, qname_getVariableProperty, qname_getLinkStatus,
+ qname_doXslTransform, isJoinExpression);
+ }
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/Compiler.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/Compiler.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/Compiler.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,27 +1,27 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql;
-
-import org.apache.ode.ql.eval.skel.CommandEvaluator;
-import org.apache.ode.ql.tree.nodes.Query;
-
-public abstract class Compiler<R, PARAMC> {
- public abstract CommandEvaluator<R, PARAMC> compile(Query query);
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql;
+
+import org.apache.ode.ql.eval.skel.CommandEvaluator;
+import org.apache.ode.ql.tree.nodes.Query;
+
+public abstract class Compiler<R, PARAMC> {
+ public abstract CommandEvaluator<R, PARAMC> compile(Query query);
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/ValidationException.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/ValidationException.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/ValidationException.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,54 +1,54 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql;
-
-public class ValidationException extends Exception {
- private static final long serialVersionUID = -6838858327728094014L;
-
- /**
- *
- */
- public ValidationException() {
- super();
- }
-
- /**
- * @param message
- * @param cause
- */
- public ValidationException(String message, Throwable cause) {
- super(message, cause);
- }
-
- /**
- * @param message
- */
- public ValidationException(String message) {
- super(message);
- }
-
- /**
- * @param cause
- */
- public ValidationException(Throwable cause) {
- super(cause);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql;
+
+public class ValidationException extends Exception {
+ private static final long serialVersionUID = -6838858327728094014L;
+
+ /**
+ *
+ */
+ public ValidationException() {
+ super();
+ }
+
+ /**
+ * @param message
+ * @param cause
+ */
+ public ValidationException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * @param message
+ */
+ public ValidationException(String message) {
+ super(message);
+ }
+
+ /**
+ * @param cause
+ */
+ public ValidationException(Throwable cause) {
+ super(cause);
+ }
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/AbstractCMPEvaluator.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/AbstractCMPEvaluator.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/AbstractCMPEvaluator.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,34 +1,34 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.eval.skel;
-
-public abstract class AbstractCMPEvaluator<ID, R, PARAMC> implements CMPEvaluator<ID, R, PARAMC> {
- protected final ID identifier;
-
- protected AbstractCMPEvaluator(ID identifier) {
- this.identifier = identifier;
- }
- /**
- * @see org.apache.ode.ql.eval.skel.Identified#getIdentifier()
- */
- public ID getIdentifier() {
- return identifier;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.eval.skel;
+
+public abstract class AbstractCMPEvaluator<ID, R, PARAMC> implements CMPEvaluator<ID, R, PARAMC> {
+ protected final ID identifier;
+
+ protected AbstractCMPEvaluator(ID identifier) {
+ this.identifier = identifier;
+ }
+ /**
+ * @see org.apache.ode.ql.eval.skel.Identified#getIdentifier()
+ */
+ public ID getIdentifier() {
+ return identifier;
+ }
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/AbstractConjunction.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/AbstractConjunction.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/AbstractConjunction.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,32 +1,32 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.eval.skel;
-
-import java.util.Collection;
-
-public abstract class AbstractConjunction<R, PARAMC> extends AbstractContainer implements
- ConjunctionEvaluator<R, PARAMC> {
-
- public AbstractConjunction(Collection<CommandEvaluator> childs) {
- super(childs);
- }
-
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.eval.skel;
+
+import java.util.Collection;
+
+public abstract class AbstractConjunction<R, PARAMC> extends AbstractContainer implements
+ ConjunctionEvaluator<R, PARAMC> {
+
+ public AbstractConjunction(Collection<CommandEvaluator> childs) {
+ super(childs);
+ }
+
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/AbstractContainer.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/AbstractContainer.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/AbstractContainer.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,36 +1,36 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.eval.skel;
-
-import java.util.Collection;
-
-public abstract class AbstractContainer implements CommandContainer {
- protected final Collection<CommandEvaluator> childs;
-
- public AbstractContainer(Collection<CommandEvaluator> childs) {
- super();
- this.childs = childs;
- }
-
- public Collection<CommandEvaluator> getChilds() {
- return childs;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.eval.skel;
+
+import java.util.Collection;
+
+public abstract class AbstractContainer implements CommandContainer {
+ protected final Collection<CommandEvaluator> childs;
+
+ public AbstractContainer(Collection<CommandEvaluator> childs) {
+ super();
+ this.childs = childs;
+ }
+
+ public Collection<CommandEvaluator> getChilds() {
+ return childs;
+ }
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/AbstractDisjunction.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/AbstractDisjunction.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/AbstractDisjunction.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,32 +1,32 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.eval.skel;
-
-import java.util.Collection;
-
-public abstract class AbstractDisjunction<R, PARAMC> extends AbstractContainer implements
- DisjunctionEvaluator<R, PARAMC> {
-
- public AbstractDisjunction(Collection<CommandEvaluator> childs) {
- super(childs);
- }
-
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.eval.skel;
+
+import java.util.Collection;
+
+public abstract class AbstractDisjunction<R, PARAMC> extends AbstractContainer implements
+ DisjunctionEvaluator<R, PARAMC> {
+
+ public AbstractDisjunction(Collection<CommandEvaluator> childs) {
+ super(childs);
+ }
+
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/AbstractEqualityEvaluator.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/AbstractEqualityEvaluator.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/AbstractEqualityEvaluator.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,32 +1,32 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.eval.skel;
-
-public abstract class AbstractEqualityEvaluator<ID, R, PARAMC> extends AbstractCMPEvaluator<ID, R, PARAMC> implements EqualityEvaluator<ID, R, PARAMC> {
-
- /**
- * @param identifier
- */
- public AbstractEqualityEvaluator(ID identifier) {
- super(identifier);
- }
-
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.eval.skel;
+
+public abstract class AbstractEqualityEvaluator<ID, R, PARAMC> extends AbstractCMPEvaluator<ID, R, PARAMC> implements EqualityEvaluator<ID, R, PARAMC> {
+
+ /**
+ * @param identifier
+ */
+ public AbstractEqualityEvaluator(ID identifier) {
+ super(identifier);
+ }
+
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/CMPEvaluator.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/CMPEvaluator.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/CMPEvaluator.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,24 +1,24 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.eval.skel;
-
-interface CMPEvaluator<ID, R, PARAMC> extends CommandEvaluator<R, PARAMC>, Identified<ID> {
-
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.eval.skel;
+
+interface CMPEvaluator<ID, R, PARAMC> extends CommandEvaluator<R, PARAMC>, Identified<ID> {
+
}
\ No newline at end of file
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/CommandContainer.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/CommandContainer.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/CommandContainer.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,26 +1,26 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.eval.skel;
-
-import java.util.Collection;
-
-public interface CommandContainer {
- public Collection<CommandEvaluator> getChilds();
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.eval.skel;
+
+import java.util.Collection;
+
+public interface CommandContainer {
+ public Collection<CommandEvaluator> getChilds();
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/CommandEvaluator.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/CommandEvaluator.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/CommandEvaluator.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,25 +1,25 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.eval.skel;
-
-public interface CommandEvaluator<R, PARAMC> {
- public R evaluate(PARAMC paramValue);
-}
-
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.eval.skel;
+
+public interface CommandEvaluator<R, PARAMC> {
+ public R evaluate(PARAMC paramValue);
+}
+
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/ConjunctionEvaluator.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/ConjunctionEvaluator.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/ConjunctionEvaluator.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,24 +1,24 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.eval.skel;
-
-public interface ConjunctionEvaluator<R, PARAMC> extends LogicEvaluator<R, PARAMC> {
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.eval.skel;
+
+public interface ConjunctionEvaluator<R, PARAMC> extends LogicEvaluator<R, PARAMC> {
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/DisjunctionEvaluator.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/DisjunctionEvaluator.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/DisjunctionEvaluator.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,24 +1,24 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.eval.skel;
-
-public interface DisjunctionEvaluator<R, PARAMC> extends LogicEvaluator<R, PARAMC> {
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.eval.skel;
+
+public interface DisjunctionEvaluator<R, PARAMC> extends LogicEvaluator<R, PARAMC> {
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/EqualityEvaluator.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/EqualityEvaluator.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/EqualityEvaluator.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,24 +1,24 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.eval.skel;
-
-public interface EqualityEvaluator<ID, R, PARAMC> extends CMPEvaluator<ID, R, PARAMC> {
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.eval.skel;
+
+public interface EqualityEvaluator<ID, R, PARAMC> extends CMPEvaluator<ID, R, PARAMC> {
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/GEEvaluator.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/GEEvaluator.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/GEEvaluator.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,24 +1,24 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.eval.skel;
-
-public interface GEEvaluator<ID, R, PARAMC> extends CMPEvaluator<ID, R, PARAMC> {
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.eval.skel;
+
+public interface GEEvaluator<ID, R, PARAMC> extends CMPEvaluator<ID, R, PARAMC> {
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/GreaterEvaluator.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/GreaterEvaluator.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/GreaterEvaluator.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,24 +1,24 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.eval.skel;
-
-public interface GreaterEvaluator<ID, R, PARAMC> extends CMPEvaluator<ID, R, PARAMC> {
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.eval.skel;
+
+public interface GreaterEvaluator<ID, R, PARAMC> extends CMPEvaluator<ID, R, PARAMC> {
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/INEvaluator.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/INEvaluator.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/INEvaluator.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,24 +1,24 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.eval.skel;
-
-public interface INEvaluator<ID, R, PARAMC> extends CMPEvaluator<ID, R, PARAMC> {
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.eval.skel;
+
+public interface INEvaluator<ID, R, PARAMC> extends CMPEvaluator<ID, R, PARAMC> {
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/Identified.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/Identified.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/Identified.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,25 +1,25 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.eval.skel;
-
-public interface Identified<ID> {
- public ID getIdentifier();
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.eval.skel;
+
+public interface Identified<ID> {
+ public ID getIdentifier();
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/LEEvaluator.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/LEEvaluator.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/LEEvaluator.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,24 +1,24 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.eval.skel;
-
-public interface LEEvaluator<ID, R, PARAMC> extends CMPEvaluator<ID, R, PARAMC> {
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.eval.skel;
+
+public interface LEEvaluator<ID, R, PARAMC> extends CMPEvaluator<ID, R, PARAMC> {
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/LessEvaluator.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/LessEvaluator.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/LessEvaluator.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,24 +1,24 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.eval.skel;
-
-public interface LessEvaluator<ID, R, PARAMC> extends CMPEvaluator<ID, R, PARAMC> {
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.eval.skel;
+
+public interface LessEvaluator<ID, R, PARAMC> extends CMPEvaluator<ID, R, PARAMC> {
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/LikeEvaluator.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/LikeEvaluator.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/LikeEvaluator.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,24 +1,24 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.eval.skel;
-
-public interface LikeEvaluator<ID, R, PARAMC> extends CMPEvaluator<ID, R, PARAMC> {
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.eval.skel;
+
+public interface LikeEvaluator<ID, R, PARAMC> extends CMPEvaluator<ID, R, PARAMC> {
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/LogicEvaluator.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/LogicEvaluator.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/LogicEvaluator.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,24 +1,24 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.eval.skel;
-
-public interface LogicEvaluator<R, PARAMC> extends CommandEvaluator<R, PARAMC>, CommandContainer {
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.eval.skel;
+
+public interface LogicEvaluator<R, PARAMC> extends CommandEvaluator<R, PARAMC>, CommandContainer {
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/NestedCommandEvaluator.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/NestedCommandEvaluator.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/NestedCommandEvaluator.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,24 +1,24 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.eval.skel;
-
-public interface NestedCommandEvaluator<R, PARAMC> extends CommandEvaluator<R, PARAMC> {
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.eval.skel;
+
+public interface NestedCommandEvaluator<R, PARAMC> extends CommandEvaluator<R, PARAMC> {
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/OrderByEvaluator.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/OrderByEvaluator.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/eval/skel/OrderByEvaluator.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,24 +1,24 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.eval.skel;
-
-public interface OrderByEvaluator<R, PARAMC> extends CommandEvaluator<R, PARAMC> {
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.eval.skel;
+
+public interface OrderByEvaluator<R, PARAMC> extends CommandEvaluator<R, PARAMC> {
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/jcc/ASTField.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/jcc/ASTField.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/jcc/ASTField.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,42 +1,42 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.jcc;
-
-public class ASTField extends SimpleNode {
- protected String name;
-
- public ASTField(int id) {
- super(id);
- }
- /**
- * @return the name
- */
- public String getName() {
- return name;
- }
-
- /**
- * @param name the name to set
- */
- public void setName(String name) {
- this.name = name;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.jcc;
+
+public class ASTField extends SimpleNode {
+ protected String name;
+
+ public ASTField(int id) {
+ super(id);
+ }
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @param name the name to set
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/jcc/ASTLimit.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/jcc/ASTLimit.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/jcc/ASTLimit.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,50 +1,50 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.jcc;
-
-public class ASTLimit extends SimpleNode {
- private int number;
-
- public ASTLimit(int id) {
- super(id);
- }
-
- /**
- * @return the number
- */
- public int getNumber() {
- return number;
- }
-
- /**
- * @param number the number to set
- */
- public void setNumber(int number) {
- this.number = number;
- }
-
- /**
- * @param number the number to set
- */
- public void setNumber(String number) {
- this.number = Integer.parseInt(number);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.jcc;
+
+public class ASTLimit extends SimpleNode {
+ private int number;
+
+ public ASTLimit(int id) {
+ super(id);
+ }
+
+ /**
+ * @return the number
+ */
+ public int getNumber() {
+ return number;
+ }
+
+ /**
+ * @param number the number to set
+ */
+ public void setNumber(int number) {
+ this.number = number;
+ }
+
+ /**
+ * @param number the number to set
+ */
+ public void setNumber(String number) {
+ this.number = Integer.parseInt(number);
+ }
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/jcc/ASTOrderBy.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/jcc/ASTOrderBy.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/jcc/ASTOrderBy.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,42 +1,42 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.jcc;
-
-public class ASTOrderBy extends SimpleNode {
- protected String name;
-
- public ASTOrderBy(int id) {
- super(id);
- }
- /**
- * @return the name
- */
- public String getName() {
- return name;
- }
-
- /**
- * @param name the name to set
- */
- public void setName(String name) {
- this.name = name;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.jcc;
+
+public class ASTOrderBy extends SimpleNode {
+ protected String name;
+
+ public ASTOrderBy(int id) {
+ super(id);
+ }
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @param name the name to set
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/jcc/ASTOrderType.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/jcc/ASTOrderType.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/jcc/ASTOrderType.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,44 +1,44 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.jcc;
-
-public class ASTOrderType extends SimpleNode {
- protected String value;
-
- public ASTOrderType(int id) {
- super(id);
- }
-
- /**
- * @return the value
- */
- public String getValue() {
- return value;
- }
-
- /**
- * @param value the value to set
- */
- public void setValue(String value) {
- this.value = value;
- }
-
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.jcc;
+
+public class ASTOrderType extends SimpleNode {
+ protected String value;
+
+ public ASTOrderType(int id) {
+ super(id);
+ }
+
+ /**
+ * @return the value
+ */
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * @param value the value to set
+ */
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/jcc/ASTProperty.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/jcc/ASTProperty.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/jcc/ASTProperty.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,42 +1,42 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.jcc;
-
-import javax.xml.namespace.QName;
-
-public class ASTProperty extends SimpleNode {
- protected QName name;
-
- public ASTProperty(int id) {
- super(id);
- }
-
- public void setName(String value) {
- name = QName.valueOf(value.substring(1));
- }
-
- /**
- * @return the name
- */
- public QName getName() {
- return name;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.jcc;
+
+import javax.xml.namespace.QName;
+
+public class ASTProperty extends SimpleNode {
+ protected QName name;
+
+ public ASTProperty(int id) {
+ super(id);
+ }
+
+ public void setName(String value) {
+ name = QName.valueOf(value.substring(1));
+ }
+
+ /**
+ * @return the name
+ */
+ public QName getName() {
+ return name;
+ }
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/jcc/ASTValue.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/jcc/ASTValue.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/jcc/ASTValue.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,44 +1,44 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.jcc;
-
-public class ASTValue extends SimpleNode {
- protected String value;
-
- public ASTValue(int id) {
- super(id);
- }
-
- /**
- * @return the value
- */
- public String getValue() {
- return value;
- }
-
- /**
- * @param value the value to set
- */
- public void setValue(String value) {
- //TODO
- this.value = value.substring(1, value.length()-1);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.jcc;
+
+public class ASTValue extends SimpleNode {
+ protected String value;
+
+ public ASTValue(int id) {
+ super(id);
+ }
+
+ /**
+ * @return the value
+ */
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * @param value the value to set
+ */
+ public void setValue(String value) {
+ //TODO
+ this.value = value.substring(1, value.length()-1);
+ }
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/jcc/Parser.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/jcc/Parser.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/jcc/Parser.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,28 +1,28 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.jcc;
-
-import java.io.StringReader;
-
-public class Parser extends QLParser {
- public Parser(String query) {
- super(new StringReader(query));
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.jcc;
+
+import java.io.StringReader;
+
+public class Parser extends QLParser {
+ public Parser(String query) {
+ super(new StringReader(query));
+ }
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/jcc/TreeBuilder.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/jcc/TreeBuilder.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/jcc/TreeBuilder.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,231 +1,231 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.jcc;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.apache.ode.ql.tree.Builder;
-import org.apache.ode.ql.tree.nodes.Conjunction;
-import org.apache.ode.ql.tree.nodes.Disjunction;
-import org.apache.ode.ql.tree.nodes.Equality;
-import org.apache.ode.ql.tree.nodes.GE;
-import org.apache.ode.ql.tree.nodes.Greater;
-import org.apache.ode.ql.tree.nodes.Identifier;
-import org.apache.ode.ql.tree.nodes.In;
-import org.apache.ode.ql.tree.nodes.LE;
-import org.apache.ode.ql.tree.nodes.Less;
-import org.apache.ode.ql.tree.nodes.Like;
-import org.apache.ode.ql.tree.nodes.Limit;
-import org.apache.ode.ql.tree.nodes.LogicNode;
-import org.apache.ode.ql.tree.nodes.OrderBy;
-import org.apache.ode.ql.tree.nodes.OrderByElement;
-import org.apache.ode.ql.tree.nodes.OrderByType;
-import org.apache.ode.ql.tree.nodes.Query;
-import org.apache.ode.ql.tree.nodes.Value;
-
-public class TreeBuilder extends Builder<String> {
-
- public org.apache.ode.ql.tree.nodes.Node build(String query) {
- try {
- org.apache.ode.ql.jcc.ASTStart start = new Parser(query).start();
- return build(start);
- }catch(ParseException ex) {
- //TODO create common exception which will indicate parsing exception
- throw new RuntimeException(ex.getMessage(), ex);
- }
- }
- private org.apache.ode.ql.tree.nodes.Node build(Node node) {
- if(node instanceof ASTAnd) {
- return createConjunction(node);
- }
- if(node instanceof ASTOr) {
- return createDisjunction(node);
- }
- if(node instanceof ASTLess) {
- return createLess(node);
- }
- if(node instanceof ASTGreater) {
- return createGreater(node);
- }
- if(node instanceof ASTLE) {
- return createLE(node);
- }
- if(node instanceof ASTIn) {
- return createIn(node);
- }
- if(node instanceof ASTGE) {
- return createGE(node);
- }
- if(node instanceof ASTEqual) {
- return createEquality(node);
- }
- if(node instanceof ASTLike) {
- return createLike(node);
- }
- if(node instanceof ASTStart) {
- return createSelection((ASTStart)node);
- }
- throw new IllegalArgumentException("Unsupported node type "+node.getClass());
- }
-
- private Query createSelection(ASTStart node) {
- Collection<Object> childs = new ArrayList<Object>(node.jjtGetNumChildren());
- OrderBy orderBy = null;
- Limit limit = null;
- for(int index = 0;index < node.jjtGetNumChildren();index++) {
- Node childNode = node.jjtGetChild(index);
- if(childNode instanceof ASTOrderBy) {
- orderBy = createOrderBy(childNode);
- } else if(childNode instanceof ASTLimit) {
- limit = createLimit(childNode);
- } else {
- Object child = build(childNode);
- childs.add(child);
- }
- }
- return new Query(childs, orderBy, limit);
- }
- private OrderBy createOrderBy(Node node) {
- Collection<OrderByElement> orders = new ArrayList<OrderByElement>(node.jjtGetNumChildren());
- for(int i = 0;i < node.jjtGetNumChildren();i++) {
- orders.add(createOrderByElement((ASTOrderByField)node.jjtGetChild(i)));
- }
- return new OrderBy(orders);
- }
- private OrderByElement createOrderByElement(ASTOrderByField node) {
- int childsNum = node.jjtGetNumChildren();
- OrderByType type;
- if(childsNum==1) {
- type = OrderByType.ASC;
- } if(childsNum==2) {
- ASTOrderType astType = (ASTOrderType)extractChildNode(node, 1);
- type = OrderByType.valueOf(astType.getValue().toUpperCase());
- } else {
- //TODO
- throw new IllegalArgumentException();
- }
- Identifier id = createIdentifier(node, 0);
- return new OrderByElement(id, type);
- }
- private Conjunction createConjunction(Node node) {
- Collection<LogicNode> childs = extractLogicNodes(node);
- return new Conjunction(childs);
- }
-
- private Disjunction createDisjunction(Node node) {
- Collection<LogicNode> childs = extractLogicNodes(node);
- return new Disjunction(childs);
- }
-
- private LE createLE(Node node) {
- checkChildsNumber(node, 2);
- return new LE(createIdentifier(node, 0), createValue(node, 1));
- }
-
- private In createIn(Node node) {
- checkChildsNumber(node, 2);
- Node inValuesNode = extractChildNode(node, 1, ASTInValues.class);
- Collection<Value> values = new ArrayList<Value>(inValuesNode.jjtGetNumChildren());
- for(int index = 0;index < inValuesNode.jjtGetNumChildren();index++) {
- values.add(createValue(inValuesNode, index));
- }
- return new In(createIdentifier(node, 0), values);
- }
-
- private GE createGE(Node node) {
- checkChildsNumber(node, 2);
- return new GE(createIdentifier(node, 0), createValue(node, 1));
- }
- private Less createLess(Node node) {
- checkChildsNumber(node, 2);
- return new Less(createIdentifier(node, 0), createValue(node, 1));
- }
- private Greater createGreater(Node node) {
- checkChildsNumber(node, 2);
- return new Greater(createIdentifier(node, 0), createValue(node, 1));
- }
- private Equality createEquality(Node node) {
- checkChildsNumber(node, 2);
- return new Equality(createIdentifier(node, 0), createValue(node, 1));
- }
- private Like createLike(Node node) {
- checkChildsNumber(node, 2);
- return new Like(createIdentifier(node, 0), createValue(node, 1));
- }
-
- private Value createValue(Node parentNode, int index) {
- return new Value<String>(extractValue(parentNode, index).value);
- }
- private Limit createLimit(Node node) {
- return new Limit(((ASTLimit)node).getNumber());
- }
- private Identifier createIdentifier(Node parentNode, int index) {
- Node node = extractChildNode(parentNode, index);
- if(node instanceof ASTField) {
- return new org.apache.ode.ql.tree.nodes.Field(((ASTField)node).name);
- }
- if(node instanceof ASTProperty) {
- return new org.apache.ode.ql.tree.nodes.Property(((ASTProperty)node).getName());
- }
- //TODO
- throw new IllegalArgumentException("");
- }
- private ASTValue extractValue(Node parentNode, int index) {
- return (ASTValue)extractChildNode(parentNode, index, ASTValue.class);
- }
-
- @SuppressWarnings("unchecked")
- private Node extractChildNode(Node parentNode, int index, Class expected) {
- Node node = extractChildNode(parentNode, index);
- if(!(expected.isAssignableFrom(node.getClass()))) {
- //TODO
- throw new IllegalArgumentException("");
- }
- return node;
- }
- private Node extractChildNode(Node parentNode, int index) {
- if(parentNode.jjtGetNumChildren()<=index) {
- //TODO
- throw new IllegalArgumentException("");
- }
- return parentNode.jjtGetChild(index);
- }
-
- private Collection<LogicNode> extractLogicNodes(Node parentNode) {
- Collection<LogicNode> childs = new ArrayList<LogicNode>(parentNode.jjtGetNumChildren());
- for(int index = 0;index < parentNode.jjtGetNumChildren();index++) {
- childs.add((LogicNode)build(parentNode.jjtGetChild(index)));
- }
- return childs;
- }
-
- /*
- private static boolean checkInheritance(Object obj, Class clazz) {
- return clazz.isAssignableFrom(clazz.getClass());
- }
- */
- private static void checkChildsNumber(Node node, int expected) {
- int actual = node.jjtGetNumChildren();
- if(actual!=expected) {
- throw new IllegalArgumentException("Expected childs cound("+actual+") differes from expected "+expected);
- }
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.jcc;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.apache.ode.ql.tree.Builder;
+import org.apache.ode.ql.tree.nodes.Conjunction;
+import org.apache.ode.ql.tree.nodes.Disjunction;
+import org.apache.ode.ql.tree.nodes.Equality;
+import org.apache.ode.ql.tree.nodes.GE;
+import org.apache.ode.ql.tree.nodes.Greater;
+import org.apache.ode.ql.tree.nodes.Identifier;
+import org.apache.ode.ql.tree.nodes.In;
+import org.apache.ode.ql.tree.nodes.LE;
+import org.apache.ode.ql.tree.nodes.Less;
+import org.apache.ode.ql.tree.nodes.Like;
+import org.apache.ode.ql.tree.nodes.Limit;
+import org.apache.ode.ql.tree.nodes.LogicNode;
+import org.apache.ode.ql.tree.nodes.OrderBy;
+import org.apache.ode.ql.tree.nodes.OrderByElement;
+import org.apache.ode.ql.tree.nodes.OrderByType;
+import org.apache.ode.ql.tree.nodes.Query;
+import org.apache.ode.ql.tree.nodes.Value;
+
+public class TreeBuilder extends Builder<String> {
+
+ public org.apache.ode.ql.tree.nodes.Node build(String query) {
+ try {
+ org.apache.ode.ql.jcc.ASTStart start = new Parser(query).start();
+ return build(start);
+ }catch(ParseException ex) {
+ //TODO create common exception which will indicate parsing exception
+ throw new RuntimeException(ex.getMessage(), ex);
+ }
+ }
+ private org.apache.ode.ql.tree.nodes.Node build(Node node) {
+ if(node instanceof ASTAnd) {
+ return createConjunction(node);
+ }
+ if(node instanceof ASTOr) {
+ return createDisjunction(node);
+ }
+ if(node instanceof ASTLess) {
+ return createLess(node);
+ }
+ if(node instanceof ASTGreater) {
+ return createGreater(node);
+ }
+ if(node instanceof ASTLE) {
+ return createLE(node);
+ }
+ if(node instanceof ASTIn) {
+ return createIn(node);
+ }
+ if(node instanceof ASTGE) {
+ return createGE(node);
+ }
+ if(node instanceof ASTEqual) {
+ return createEquality(node);
+ }
+ if(node instanceof ASTLike) {
+ return createLike(node);
+ }
+ if(node instanceof ASTStart) {
+ return createSelection((ASTStart)node);
+ }
+ throw new IllegalArgumentException("Unsupported node type "+node.getClass());
+ }
+
+ private Query createSelection(ASTStart node) {
+ Collection<Object> childs = new ArrayList<Object>(node.jjtGetNumChildren());
+ OrderBy orderBy = null;
+ Limit limit = null;
+ for(int index = 0;index < node.jjtGetNumChildren();index++) {
+ Node childNode = node.jjtGetChild(index);
+ if(childNode instanceof ASTOrderBy) {
+ orderBy = createOrderBy(childNode);
+ } else if(childNode instanceof ASTLimit) {
+ limit = createLimit(childNode);
+ } else {
+ Object child = build(childNode);
+ childs.add(child);
+ }
+ }
+ return new Query(childs, orderBy, limit);
+ }
+ private OrderBy createOrderBy(Node node) {
+ Collection<OrderByElement> orders = new ArrayList<OrderByElement>(node.jjtGetNumChildren());
+ for(int i = 0;i < node.jjtGetNumChildren();i++) {
+ orders.add(createOrderByElement((ASTOrderByField)node.jjtGetChild(i)));
+ }
+ return new OrderBy(orders);
+ }
+ private OrderByElement createOrderByElement(ASTOrderByField node) {
+ int childsNum = node.jjtGetNumChildren();
+ OrderByType type;
+ if(childsNum==1) {
+ type = OrderByType.ASC;
+ } if(childsNum==2) {
+ ASTOrderType astType = (ASTOrderType)extractChildNode(node, 1);
+ type = OrderByType.valueOf(astType.getValue().toUpperCase());
+ } else {
+ //TODO
+ throw new IllegalArgumentException();
+ }
+ Identifier id = createIdentifier(node, 0);
+ return new OrderByElement(id, type);
+ }
+ private Conjunction createConjunction(Node node) {
+ Collection<LogicNode> childs = extractLogicNodes(node);
+ return new Conjunction(childs);
+ }
+
+ private Disjunction createDisjunction(Node node) {
+ Collection<LogicNode> childs = extractLogicNodes(node);
+ return new Disjunction(childs);
+ }
+
+ private LE createLE(Node node) {
+ checkChildsNumber(node, 2);
+ return new LE(createIdentifier(node, 0), createValue(node, 1));
+ }
+
+ private In createIn(Node node) {
+ checkChildsNumber(node, 2);
+ Node inValuesNode = extractChildNode(node, 1, ASTInValues.class);
+ Collection<Value> values = new ArrayList<Value>(inValuesNode.jjtGetNumChildren());
+ for(int index = 0;index < inValuesNode.jjtGetNumChildren();index++) {
+ values.add(createValue(inValuesNode, index));
+ }
+ return new In(createIdentifier(node, 0), values);
+ }
+
+ private GE createGE(Node node) {
+ checkChildsNumber(node, 2);
+ return new GE(createIdentifier(node, 0), createValue(node, 1));
+ }
+ private Less createLess(Node node) {
+ checkChildsNumber(node, 2);
+ return new Less(createIdentifier(node, 0), createValue(node, 1));
+ }
+ private Greater createGreater(Node node) {
+ checkChildsNumber(node, 2);
+ return new Greater(createIdentifier(node, 0), createValue(node, 1));
+ }
+ private Equality createEquality(Node node) {
+ checkChildsNumber(node, 2);
+ return new Equality(createIdentifier(node, 0), createValue(node, 1));
+ }
+ private Like createLike(Node node) {
+ checkChildsNumber(node, 2);
+ return new Like(createIdentifier(node, 0), createValue(node, 1));
+ }
+
+ private Value createValue(Node parentNode, int index) {
+ return new Value<String>(extractValue(parentNode, index).value);
+ }
+ private Limit createLimit(Node node) {
+ return new Limit(((ASTLimit)node).getNumber());
+ }
+ private Identifier createIdentifier(Node parentNode, int index) {
+ Node node = extractChildNode(parentNode, index);
+ if(node instanceof ASTField) {
+ return new org.apache.ode.ql.tree.nodes.Field(((ASTField)node).name);
+ }
+ if(node instanceof ASTProperty) {
+ return new org.apache.ode.ql.tree.nodes.Property(((ASTProperty)node).getName());
+ }
+ //TODO
+ throw new IllegalArgumentException("");
+ }
+ private ASTValue extractValue(Node parentNode, int index) {
+ return (ASTValue)extractChildNode(parentNode, index, ASTValue.class);
+ }
+
+ @SuppressWarnings("unchecked")
+ private Node extractChildNode(Node parentNode, int index, Class expected) {
+ Node node = extractChildNode(parentNode, index);
+ if(!(expected.isAssignableFrom(node.getClass()))) {
+ //TODO
+ throw new IllegalArgumentException("");
+ }
+ return node;
+ }
+ private Node extractChildNode(Node parentNode, int index) {
+ if(parentNode.jjtGetNumChildren()<=index) {
+ //TODO
+ throw new IllegalArgumentException("");
+ }
+ return parentNode.jjtGetChild(index);
+ }
+
+ private Collection<LogicNode> extractLogicNodes(Node parentNode) {
+ Collection<LogicNode> childs = new ArrayList<LogicNode>(parentNode.jjtGetNumChildren());
+ for(int index = 0;index < parentNode.jjtGetNumChildren();index++) {
+ childs.add((LogicNode)build(parentNode.jjtGetChild(index)));
+ }
+ return childs;
+ }
+
+ /*
+ private static boolean checkInheritance(Object obj, Class clazz) {
+ return clazz.isAssignableFrom(clazz.getClass());
+ }
+ */
+ private static void checkChildsNumber(Node node, int expected) {
+ int actual = node.jjtGetNumChildren();
+ if(actual!=expected) {
+ throw new IllegalArgumentException("Expected childs cound("+actual+") differes from expected "+expected);
+ }
+ }
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/Builder.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/Builder.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/Builder.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,24 +1,24 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.tree;
-
-public abstract class Builder<ET> {
- public abstract org.apache.ode.ql.tree.nodes.Node build(ET expr);
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.tree;
+
+public abstract class Builder<ET> {
+ public abstract org.apache.ode.ql.tree.nodes.Node build(ET expr);
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/BuilderFactory.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/BuilderFactory.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/BuilderFactory.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,36 +1,36 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.tree;
-
-import org.apache.ode.ql.jcc.TreeBuilder;
-
-public class BuilderFactory {
- private static BuilderFactory INSTANCE = new BuilderFactory();
-
- private BuilderFactory() {}
-
- public static BuilderFactory getInstance() {
- return INSTANCE;
- }
-
- public Builder createBuilder() {
- return new TreeBuilder();
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.tree;
+
+import org.apache.ode.ql.jcc.TreeBuilder;
+
+public class BuilderFactory {
+ private static BuilderFactory INSTANCE = new BuilderFactory();
+
+ private BuilderFactory() {}
+
+ public static BuilderFactory getInstance() {
+ return INSTANCE;
+ }
+
+ public Builder createBuilder() {
+ return new TreeBuilder();
+ }
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/AbstractLogicExpr.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/AbstractLogicExpr.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/AbstractLogicExpr.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,45 +1,45 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.tree.nodes;
-
-import java.util.Collection;
-
-public class AbstractLogicExpr implements LogicExprNode, LogicNode {
- private static final long serialVersionUID = -626046952079668882L;
-
- private final Collection<LogicNode> childs;
-
- /**
- * @param childs
- */
- protected AbstractLogicExpr(final Collection<LogicNode> childs) {
- super();
- this.childs = childs;
- }
-
-
- /**
- * @see org.apache.ode.ql.tree.nodes.LogicExprNode#getChilds()
- */
- public Collection<LogicNode> getChilds() {
- return childs;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.tree.nodes;
+
+import java.util.Collection;
+
+public class AbstractLogicExpr implements LogicExprNode, LogicNode {
+ private static final long serialVersionUID = -626046952079668882L;
+
+ private final Collection<LogicNode> childs;
+
+ /**
+ * @param childs
+ */
+ protected AbstractLogicExpr(final Collection<LogicNode> childs) {
+ super();
+ this.childs = childs;
+ }
+
+
+ /**
+ * @see org.apache.ode.ql.tree.nodes.LogicExprNode#getChilds()
+ */
+ public Collection<LogicNode> getChilds() {
+ return childs;
+ }
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Conjunction.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Conjunction.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Conjunction.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,35 +1,35 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.tree.nodes;
-
-import java.util.Collection;
-
-public class Conjunction extends AbstractLogicExpr {
-
- private static final long serialVersionUID = -470480764480851402L;
-
- /**
- * @param childs
- */
- public Conjunction(final Collection<LogicNode> childs) {
- super(childs);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.tree.nodes;
+
+import java.util.Collection;
+
+public class Conjunction extends AbstractLogicExpr {
+
+ private static final long serialVersionUID = -470480764480851402L;
+
+ /**
+ * @param childs
+ */
+ public Conjunction(final Collection<LogicNode> childs) {
+ super(childs);
+ }
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Disjunction.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Disjunction.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Disjunction.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,33 +1,33 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.tree.nodes;
-
-import java.util.Collection;
-
-public class Disjunction extends AbstractLogicExpr {
-
- /**
- * @param childs
- */
- public Disjunction(Collection<LogicNode> childs) {
- super(childs);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.tree.nodes;
+
+import java.util.Collection;
+
+public class Disjunction extends AbstractLogicExpr {
+
+ /**
+ * @param childs
+ */
+ public Disjunction(Collection<LogicNode> childs) {
+ super(childs);
+ }
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Equality.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Equality.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Equality.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,33 +1,33 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.tree.nodes;
-
-public class Equality extends IdentifierToValueCMP {
- private static final long serialVersionUID = 8151616227509392901L;
-
- /**
- * @param identifier
- * @param value
- */
- public Equality(Identifier identifier, Value value) {
- super(identifier, value);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.tree.nodes;
+
+public class Equality extends IdentifierToValueCMP {
+ private static final long serialVersionUID = 8151616227509392901L;
+
+ /**
+ * @param identifier
+ * @param value
+ */
+ public Equality(Identifier identifier, Value value) {
+ super(identifier, value);
+ }
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Field.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Field.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Field.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,44 +1,44 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.tree.nodes;
-
-public class Field implements Identifier {
- private static final long serialVersionUID = -6349426426188324243L;
-
- private final String name;
-
- /**
- * @param name
- */
- public Field(final String name) {
- super();
- this.name = name;
- }
-
-
- /**
- * @return the name
- */
- public String getName() {
- return name;
- }
-
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.tree.nodes;
+
+public class Field implements Identifier {
+ private static final long serialVersionUID = -6349426426188324243L;
+
+ private final String name;
+
+ /**
+ * @param name
+ */
+ public Field(final String name) {
+ super();
+ this.name = name;
+ }
+
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/GE.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/GE.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/GE.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,34 +1,34 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.tree.nodes;
-
-public class GE extends IdentifierToValueCMP {
- private static final long serialVersionUID = -3950615207473647667L;
-
- /**
- * @param identifier
- * @param value
- */
- public GE(Identifier identifier, Value value) {
- super(identifier, value);
- }
-
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.tree.nodes;
+
+public class GE extends IdentifierToValueCMP {
+ private static final long serialVersionUID = -3950615207473647667L;
+
+ /**
+ * @param identifier
+ * @param value
+ */
+ public GE(Identifier identifier, Value value) {
+ super(identifier, value);
+ }
+
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Greater.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Greater.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Greater.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,34 +1,34 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.tree.nodes;
-
-public class Greater extends IdentifierToValueCMP {
- private static final long serialVersionUID = 3377082099238584486L;
-
- /**
- * @param identifier
- * @param value
- */
- public Greater(Identifier identifier, Value value) {
- super(identifier, value);
- }
-
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.tree.nodes;
+
+public class Greater extends IdentifierToValueCMP {
+ private static final long serialVersionUID = 3377082099238584486L;
+
+ /**
+ * @param identifier
+ * @param value
+ */
+ public Greater(Identifier identifier, Value value) {
+ super(identifier, value);
+ }
+
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Identifier.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Identifier.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Identifier.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,24 +1,24 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.tree.nodes;
-
-public interface Identifier extends Node {
- public String getName();
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.tree.nodes;
+
+public interface Identifier extends Node {
+ public String getName();
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/IdentifierToValueCMP.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/IdentifierToValueCMP.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/IdentifierToValueCMP.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,50 +1,50 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.tree.nodes;
-
-public abstract class IdentifierToValueCMP implements LogicNode {
- private final Identifier identifier;
- private final Value value;
-
-
- /**
- * @param identifier
- * @param value
- */
- protected IdentifierToValueCMP(final Identifier identifier, final Value value) {
- super();
- this.identifier = identifier;
- this.value = value;
- }
- /**
- * @return the identifier
- */
- public Identifier getIdentifier() {
- return identifier;
- }
- /**
- * @return the value
- */
- public Value getValue() {
- return value;
- }
-
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.tree.nodes;
+
+public abstract class IdentifierToValueCMP implements LogicNode {
+ private final Identifier identifier;
+ private final Value value;
+
+
+ /**
+ * @param identifier
+ * @param value
+ */
+ protected IdentifierToValueCMP(final Identifier identifier, final Value value) {
+ super();
+ this.identifier = identifier;
+ this.value = value;
+ }
+ /**
+ * @return the identifier
+ */
+ public Identifier getIdentifier() {
+ return identifier;
+ }
+ /**
+ * @return the value
+ */
+ public Value getValue() {
+ return value;
+ }
+
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/In.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/In.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/In.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,54 +1,54 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.tree.nodes;
-
-import java.util.Collection;
-
-public class In implements LogicNode {
- private static final long serialVersionUID = -5110159406556440523L;
-
- private final Identifier identifier;
- private final Collection<Value> values;
-
- /**
- * @param identifier
- * @param values
- */
- public In(final Identifier identifier, final Collection<Value> values) {
- super();
- this.identifier = identifier;
- this.values = values;
- }
- /**
- * @return the identifier
- */
- public Identifier getIdentifier() {
- return identifier;
- }
- /**
- * @return the values
- */
- public Collection<Value> getValues() {
- return values;
- }
-
-
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.tree.nodes;
+
+import java.util.Collection;
+
+public class In implements LogicNode {
+ private static final long serialVersionUID = -5110159406556440523L;
+
+ private final Identifier identifier;
+ private final Collection<Value> values;
+
+ /**
+ * @param identifier
+ * @param values
+ */
+ public In(final Identifier identifier, final Collection<Value> values) {
+ super();
+ this.identifier = identifier;
+ this.values = values;
+ }
+ /**
+ * @return the identifier
+ */
+ public Identifier getIdentifier() {
+ return identifier;
+ }
+ /**
+ * @return the values
+ */
+ public Collection<Value> getValues() {
+ return values;
+ }
+
+
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/LE.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/LE.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/LE.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,34 +1,34 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.tree.nodes;
-
-public class LE extends IdentifierToValueCMP {
- private static final long serialVersionUID = 4340261946576837633L;
-
- /**
- * @param identifier
- * @param value
- */
- public LE(Identifier identifier, Value value) {
- super(identifier, value);
- }
-
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.tree.nodes;
+
+public class LE extends IdentifierToValueCMP {
+ private static final long serialVersionUID = 4340261946576837633L;
+
+ /**
+ * @param identifier
+ * @param value
+ */
+ public LE(Identifier identifier, Value value) {
+ super(identifier, value);
+ }
+
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Less.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Less.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Less.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,33 +1,33 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.tree.nodes;
-
-public class Less extends IdentifierToValueCMP {
- private static final long serialVersionUID = 4565600302207865897L;
-
- /**
- * @param identifier
- * @param value
- */
- public Less(Identifier identifier, Value value) {
- super(identifier, value);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.tree.nodes;
+
+public class Less extends IdentifierToValueCMP {
+ private static final long serialVersionUID = 4565600302207865897L;
+
+ /**
+ * @param identifier
+ * @param value
+ */
+ public Less(Identifier identifier, Value value) {
+ super(identifier, value);
+ }
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Like.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Like.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Like.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,33 +1,33 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.tree.nodes;
-
-public class Like extends IdentifierToValueCMP {
- private static final long serialVersionUID = 5326597610659165414L;
-
- /**
- * @param identifier
- * @param value
- */
- public Like(Identifier identifier, Value value) {
- super(identifier, value);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.tree.nodes;
+
+public class Like extends IdentifierToValueCMP {
+ private static final long serialVersionUID = 5326597610659165414L;
+
+ /**
+ * @param identifier
+ * @param value
+ */
+ public Like(Identifier identifier, Value value) {
+ super(identifier, value);
+ }
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Limit.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Limit.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Limit.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,50 +1,50 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.tree.nodes;
-
-public class Limit implements Node {
- private static final long serialVersionUID = -2717124113311491484L;
-
- private int number;
-
- /**
- * @param number
- */
- public Limit(int number) {
- super();
- this.number = number;
- }
-
- /**
- * @return the number
- */
- public int getNumber() {
- return number;
- }
-
- /**
- * @param number the number to set
- */
- public void setNumber(int number) {
- this.number = number;
- }
-
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.tree.nodes;
+
+public class Limit implements Node {
+ private static final long serialVersionUID = -2717124113311491484L;
+
+ private int number;
+
+ /**
+ * @param number
+ */
+ public Limit(int number) {
+ super();
+ this.number = number;
+ }
+
+ /**
+ * @return the number
+ */
+ public int getNumber() {
+ return number;
+ }
+
+ /**
+ * @param number the number to set
+ */
+ public void setNumber(int number) {
+ this.number = number;
+ }
+
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/LogicExprNode.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/LogicExprNode.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/LogicExprNode.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,26 +1,26 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.tree.nodes;
-
-import java.util.Collection;
-
-public interface LogicExprNode extends Node {
- public Collection<LogicNode> getChilds();
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.tree.nodes;
+
+import java.util.Collection;
+
+public interface LogicExprNode extends Node {
+ public Collection<LogicNode> getChilds();
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/LogicNode.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/LogicNode.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/LogicNode.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,23 +1,23 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.tree.nodes;
-
-public interface LogicNode extends Node {
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.tree.nodes;
+
+public interface LogicNode extends Node {
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Node.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Node.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Node.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,26 +1,26 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.tree.nodes;
-
-import java.io.Serializable;
-
-public interface Node extends Serializable {
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.tree.nodes;
+
+import java.io.Serializable;
+
+public interface Node extends Serializable {
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/OrderBy.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/OrderBy.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/OrderBy.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,46 +1,46 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.tree.nodes;
-
-import java.util.Collection;
-
-public class OrderBy implements Node {
- private static final long serialVersionUID = -5995328590580131666L;
-
- private final Collection<OrderByElement> orders;
-
- /**
- * @param orders
- */
- public OrderBy(final Collection<OrderByElement> orders) {
- super();
- this.orders = orders;
- }
-
-
- /**
- * @return the orders
- */
- public Collection<OrderByElement> getOrders() {
- return orders;
- }
-
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.tree.nodes;
+
+import java.util.Collection;
+
+public class OrderBy implements Node {
+ private static final long serialVersionUID = -5995328590580131666L;
+
+ private final Collection<OrderByElement> orders;
+
+ /**
+ * @param orders
+ */
+ public OrderBy(final Collection<OrderByElement> orders) {
+ super();
+ this.orders = orders;
+ }
+
+
+ /**
+ * @return the orders
+ */
+ public Collection<OrderByElement> getOrders() {
+ return orders;
+ }
+
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/OrderByElement.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/OrderByElement.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/OrderByElement.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,57 +1,57 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.tree.nodes;
-
-public class OrderByElement<ID extends Identifier> implements Node {
- private static final long serialVersionUID = -3927580891987350265L;
-
- protected final ID identifier;
- protected final OrderByType type;
-
- /**
- * @param identifier
- */
- public OrderByElement(final ID identifier) {
- this(identifier, OrderByType.ASC);
- }
- /**
- * @param identifier
- * @param type
- */
- public OrderByElement(final ID identifier, final OrderByType type) {
- super();
- this.identifier = identifier;
- this.type = type;
- }
- /**
- * @return the identifier
- */
- public ID getIdentifier() {
- return identifier;
- }
- /**
- * @return the type
- */
- public OrderByType getType() {
- return type;
- }
-
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.tree.nodes;
+
+public class OrderByElement<ID extends Identifier> implements Node {
+ private static final long serialVersionUID = -3927580891987350265L;
+
+ protected final ID identifier;
+ protected final OrderByType type;
+
+ /**
+ * @param identifier
+ */
+ public OrderByElement(final ID identifier) {
+ this(identifier, OrderByType.ASC);
+ }
+ /**
+ * @param identifier
+ * @param type
+ */
+ public OrderByElement(final ID identifier, final OrderByType type) {
+ super();
+ this.identifier = identifier;
+ this.type = type;
+ }
+ /**
+ * @return the identifier
+ */
+ public ID getIdentifier() {
+ return identifier;
+ }
+ /**
+ * @return the type
+ */
+ public OrderByType getType() {
+ return type;
+ }
+
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/OrderByType.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/OrderByType.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/OrderByType.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,24 +1,24 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.tree.nodes;
-
-public enum OrderByType {
- ASC, DESC
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.tree.nodes;
+
+public enum OrderByType {
+ ASC, DESC
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Property.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Property.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Property.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,47 +1,47 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.tree.nodes;
-
-import javax.xml.namespace.QName;
-
-public class Property implements Identifier {
- private static final long serialVersionUID = -6249689910742825036L;
-
- private final QName name;
-
- /**
- * @param name
- */
- public Property(final QName name) {
- super();
- this.name = name;
- }
-
- public String getNamespace() {
- return name.getNamespaceURI();
- }
- /**
- * @return the name
- */
- public String getName() {
- return name.getLocalPart();
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.tree.nodes;
+
+import javax.xml.namespace.QName;
+
+public class Property implements Identifier {
+ private static final long serialVersionUID = -6249689910742825036L;
+
+ private final QName name;
+
+ /**
+ * @param name
+ */
+ public Property(final QName name) {
+ super();
+ this.name = name;
+ }
+
+ public String getNamespace() {
+ return name.getNamespaceURI();
+ }
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name.getLocalPart();
+ }
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Query.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Query.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Query.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,93 +1,93 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.tree.nodes;
-
-import java.util.Collection;
-
-public class Query implements Node {
- private static final long serialVersionUID = -1889820969391077174L;
- private final Collection<Object> childs;
- private final OrderBy order;
- private Limit limit;
-
-
- /**
- * @param childs
- * @param order
- * @param limit
- */
- public Query(final Collection<Object> childs, final OrderBy order, Limit limit) {
- super();
- this.childs = childs;
- this.order = order;
- this.limit = limit;
- }
-
-
- /**
- * @param childs
- * @param order
- */
- public Query(final Collection<Object> childs, final OrderBy order) {
- super();
- this.childs = childs;
- this.order = order;
- }
-
-
- /**
- * @param childs
- */
- public Query(final Collection<Object> childs) {
- this(childs, null);
- }
-
-
- /**
- * @return the childs
- */
- public Collection<Object> getChilds() {
- return childs;
- }
-
-
- /**
- * @return the order
- */
- public OrderBy getOrder() {
- return order;
- }
-
-
- /**
- * @return the limit
- */
- public Limit getLimit() {
- return limit;
- }
-
-
- /**
- * @param limit the limit to set
- */
- public void setLimit(Limit limit) {
- this.limit = limit;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.tree.nodes;
+
+import java.util.Collection;
+
+public class Query implements Node {
+ private static final long serialVersionUID = -1889820969391077174L;
+ private final Collection<Object> childs;
+ private final OrderBy order;
+ private Limit limit;
+
+
+ /**
+ * @param childs
+ * @param order
+ * @param limit
+ */
+ public Query(final Collection<Object> childs, final OrderBy order, Limit limit) {
+ super();
+ this.childs = childs;
+ this.order = order;
+ this.limit = limit;
+ }
+
+
+ /**
+ * @param childs
+ * @param order
+ */
+ public Query(final Collection<Object> childs, final OrderBy order) {
+ super();
+ this.childs = childs;
+ this.order = order;
+ }
+
+
+ /**
+ * @param childs
+ */
+ public Query(final Collection<Object> childs) {
+ this(childs, null);
+ }
+
+
+ /**
+ * @return the childs
+ */
+ public Collection<Object> getChilds() {
+ return childs;
+ }
+
+
+ /**
+ * @return the order
+ */
+ public OrderBy getOrder() {
+ return order;
+ }
+
+
+ /**
+ * @return the limit
+ */
+ public Limit getLimit() {
+ return limit;
+ }
+
+
+ /**
+ * @param limit the limit to set
+ */
+ public void setLimit(Limit limit) {
+ this.limit = limit;
+ }
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Value.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Value.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/Value.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,61 +1,61 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.tree.nodes;
-
-public class Value<V> implements Node {
- private static final long serialVersionUID = -533404312907890996L;
-
- private V value;
-
- /**
- * @param value
- */
- public Value(final V value) {
- super();
- this.value = value;
- }
-
-
- /**
- *
- */
- public Value() {
- super();
- }
-
-
- /**
- * @return the value
- */
- public V getValue() {
- return value;
- }
-
-
- /**
- * @param value the value to set
- */
- public void setValue(V value) {
- this.value = value;
- }
-
-
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.tree.nodes;
+
+public class Value<V> implements Node {
+ private static final long serialVersionUID = -533404312907890996L;
+
+ private V value;
+
+ /**
+ * @param value
+ */
+ public Value(final V value) {
+ super();
+ this.value = value;
+ }
+
+
+ /**
+ *
+ */
+ public Value() {
+ super();
+ }
+
+
+ /**
+ * @return the value
+ */
+ public V getValue() {
+ return value;
+ }
+
+
+ /**
+ * @param value the value to set
+ */
+ public void setValue(V value) {
+ this.value = value;
+ }
+
+
+
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/ValuesHelper.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/ValuesHelper.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/main/java/org/apache/ode/ql/tree/nodes/ValuesHelper.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,35 +1,35 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.ql.tree.nodes;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-
-public class ValuesHelper {
- public static Collection extract(Collection values) {
- Collection<Object> result = new ArrayList<Object>(values.size());
- for(Iterator iter = values.iterator();iter.hasNext();) {
- Value value = (Value)iter.next();
- result.add(value.getValue());
- }
- return result;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.ql.tree.nodes;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+
+public class ValuesHelper {
+ public static Collection extract(Collection values) {
+ Collection<Object> result = new ArrayList<Object>(values.size());
+ for(Iterator iter = values.iterator();iter.hasNext();) {
+ Value value = (Value)iter.next();
+ result.add(value.getValue());
+ }
+ return result;
+ }
+}
Modified: branches/ODE/ODE-1.x/bpel-ql/src/test/java/org/apache/ode/ql/SyntaxTest.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-ql/src/test/java/org/apache/ode/ql/SyntaxTest.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-ql/src/test/java/org/apache/ode/ql/SyntaxTest.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,78 +1,78 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.ode.ql;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-
-import junit.framework.TestCase;
-
-import org.apache.ode.ql.tree.Builder;
-import org.apache.ode.ql.tree.BuilderFactory;
-
-public class SyntaxTest extends TestCase {
-
- private final static String TESTS_DIR = "target/test-classes";
-
- private File[] casesFiles = new File(TESTS_DIR).listFiles();
-
- /**
- * @see junit.framework.TestCase#setUp()
- */
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- casesFiles = new File(System.getProperty("baseDir")).listFiles();
- //casesFiles = new File(TESTS_DIR).listFiles();
- }
-
- public void test() throws Exception {
- for(File caseFile : casesFiles) {
- if (caseFile.isFile()) {
- doTestCaseFile(caseFile);
- }
- }
- }
-
- public void doTestCaseFile(File caseFile) throws Exception {
- BufferedReader reader = new BufferedReader(new FileReader(caseFile));
- try {
- String testCase;
- while((testCase = reader.readLine())!=null) {
- try {
- doTest(testCase);
- }catch(Throwable ex) {
- throw new Exception("Failure in "+caseFile.toString()+":" + testCase + " case.", ex);
- }
-
- }
- }finally {
- reader.close();
- }
- }
-
- public void doTest(String query) throws Exception {
- Builder<String> builder = BuilderFactory.getInstance().createBuilder();
- @SuppressWarnings("unused")
- final org.apache.ode.ql.tree.nodes.Node rootNode = builder.build(query);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.ql;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+
+import junit.framework.TestCase;
+
+import org.apache.ode.ql.tree.Builder;
+import org.apache.ode.ql.tree.BuilderFactory;
+
+public class SyntaxTest extends TestCase {
+
+ private final static String TESTS_DIR = "target/test-classes";
+
+ private File[] casesFiles = new File(TESTS_DIR).listFiles();
+
+ /**
+ * @see junit.framework.TestCase#setUp()
+ */
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ casesFiles = new File(System.getProperty("baseDir")).listFiles();
+ //casesFiles = new File(TESTS_DIR).listFiles();
+ }
+
+ public void test() throws Exception {
+ for(File caseFile : casesFiles) {
+ if (caseFile.isFile()) {
+ doTestCaseFile(caseFile);
+ }
+ }
+ }
+
+ public void doTestCaseFile(File caseFile) throws Exception {
+ BufferedReader reader = new BufferedReader(new FileReader(caseFile));
+ try {
+ String testCase;
+ while((testCase = reader.readLine())!=null) {
+ try {
+ doTest(testCase);
+ }catch(Throwable ex) {
+ throw new Exception("Failure in "+caseFile.toString()+":" + testCase + " case.", ex);
+ }
+
+ }
+ }finally {
+ reader.close();
+ }
+ }
+
+ public void doTest(String query) throws Exception {
+ Builder<String> builder = BuilderFactory.getInstance().createBuilder();
+ @SuppressWarnings("unused")
+ final org.apache.ode.ql.tree.nodes.Node rootNode = builder.build(query);
+ }
+
+}
Modified: branches/ODE/ODE-1.x/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath20/runtime/XPath20ExpressionModifier.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath20/runtime/XPath20ExpressionModifier.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath20/runtime/XPath20ExpressionModifier.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -17,201 +17,201 @@
* under the License.
*/
-package org.apache.ode.bpel.elang.xpath20.runtime;
-
-import java.util.Iterator;
-
-import javax.xml.namespace.QName;
-import javax.xml.transform.TransformerException;
-import javax.xml.xpath.XPathExpression;
-
-import net.sf.saxon.expr.AxisExpression;
-import net.sf.saxon.expr.Expression;
-import net.sf.saxon.expr.ItemChecker;
-import net.sf.saxon.expr.PathExpression;
-import net.sf.saxon.expr.VariableReference;
-import net.sf.saxon.om.Axis;
-import net.sf.saxon.om.NamePool;
-import net.sf.saxon.pattern.NameTest;
-import net.sf.saxon.pattern.NodeKindTest;
-import net.sf.saxon.pattern.NodeTest;
-import net.sf.saxon.xpath.XPathExpressionImpl;
-
-import org.apache.ode.utils.DOMUtils;
-import org.apache.ode.utils.NSContext;
-import org.w3c.dom.Attr;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-
-/**
- * A helper utility that modifies XPath Expression in-place. This is meant
- * to be reusable across the XPath and XQuery runtimes.
- */
-public class XPath20ExpressionModifier {
- private NSContext contextUris;
- private NamePool namePool;
-
- /**
- * Creates a new XPath20ExpressionModifier object.
- *
- * @param contextUris
- * @param namePool
- */
- public XPath20ExpressionModifier(NSContext contextUris, NamePool namePool) {
- this.contextUris = contextUris;
- this.namePool = namePool;
- }
-
- /**
- * Insert nodes into the specified XPath expression wherever
- * required To be precise, an node is added to its parent if:
- * a) the node is an element...
- * b) that corresponds to an step...
- * c) that has a child axis...
- * d) whose parent had no children with its name...
- * e) and all preceding steps are element name tests.
- *
- * @param xpathExpr
- * @param namePool
- *
- * @throws DOMException
- * @throws TransformerException
- */
- @SuppressWarnings("unchecked")
- public void insertMissingData(XPathExpression xpathExpr, Node contextNode)
- throws DOMException, TransformerException {
- if ((contextNode == null) || !(contextNode instanceof Element) ||
- !(xpathExpr instanceof XPathExpressionImpl)) {
- return;
- }
-
- Expression expression = ((XPathExpressionImpl) xpathExpr).getInternalExpression();
- Iterator<Expression> subExpressions = (Iterator<Expression>) expression.iterateSubExpressions();
-
- if (!subExpressions.hasNext()) {
- return;
- }
-
- Expression subExpr = (Expression) subExpressions.next();
-
- if (!(subExpr instanceof PathExpression)) {
- return;
- }
-
- Document document = DOMUtils.toDOMDocument(contextNode);
- PathExpression pathExpr = (PathExpression) subExpr;
- Expression step = pathExpr.getFirstStep();
-
- while (step != null) {
- if (step instanceof AxisExpression) {
- AxisExpression axisExpr = (AxisExpression) step;
-
- NodeTest nodeTest = axisExpr.getNodeTest();
-
- if (!(nodeTest instanceof NameTest)) {
- break;
- }
-
- NameTest nameTest = (NameTest) nodeTest;
-
- QName childName = getQualifiedName(nameTest.getFingerprint(),
- namePool, contextUris);
-
- if (Axis.CHILD == axisExpr.getAxis()) {
- if (NodeKindTest.ELEMENT.getNodeKindMask() != nameTest.getNodeKindMask()) {
- break;
- }
-
- NodeList children = ((Element) contextNode).getElementsByTagNameNS(childName.getNamespaceURI(),
- childName.getLocalPart());
- if ((children == null) || (children.getLength() == 0)) {
- Node child = document.createElementNS(childName.getNamespaceURI(),
- DOMUtils.getQualifiedName(childName));
- contextNode.appendChild(child);
- contextNode = child;
- } else if (children.getLength() == 1) {
- contextNode = children.item(0);
- } else {
- break;
- }
- } else if (Axis.ATTRIBUTE == axisExpr.getAxis()) {
- if (NodeKindTest.ATTRIBUTE.getNodeKindMask() != nameTest.getNodeKindMask()) {
- break;
- }
-
- Attr attribute = ((Element) contextNode).getAttributeNodeNS(childName.getNamespaceURI(), childName.getLocalPart());
- if (attribute == null) {
- attribute = document.createAttributeNS(childName.getNamespaceURI(), childName.getLocalPart());
- ((Element) contextNode).setAttributeNode(attribute);
- contextNode = attribute;
- } else {
- break;
- }
-
- } else {
- break;
- }
-
-
- } else if (step instanceof ItemChecker) {
- ItemChecker itemChecker = (ItemChecker) step;
- Expression baseExpr = itemChecker.getBaseExpression();
-
- if (!(baseExpr instanceof VariableReference)) {
- break;
- }
- } else {
- break;
- }
-
- if (pathExpr != null) {
- Expression remainingSteps = pathExpr.getRemainingSteps();
-
- if (remainingSteps instanceof PathExpression) {
- pathExpr = (PathExpression) remainingSteps;
- step = pathExpr.getFirstStep();
- } else if (remainingSteps instanceof AxisExpression) {
- pathExpr = null;
- step = (AxisExpression) remainingSteps;
- }
- } else {
- break;
- }
- }
- }
-
- /**
- * Create the QName by running the given finger print against the
- * given context
- *
- * @param fingerprint
- * @param namePool
- * @param nsContext
- *
- * @return The QName corresponding to the finger print
- */
- private QName getQualifiedName(int fingerprint, NamePool namePool,
- NSContext nsContext) {
- String localName = namePool.getLocalName(fingerprint);
- String prefix = namePool.getPrefix(fingerprint);
- String uri = namePool.getURI(fingerprint);
-
- // Unfortunately, NSContext.getPrefix(String URI) doesn't always work
- // So, we need to find the prefix for the URI the hard way
- if ((prefix == null) || "".equals(prefix)) {
- for (String nsPrefix : nsContext.getPrefixes()) {
- String nsUri = nsContext.getNamespaceURI(nsPrefix);
-
- if (nsUri.equals(uri)) {
- prefix = nsPrefix;
- }
- }
- }
-
- return new QName(uri, localName, prefix);
- }
+package org.apache.ode.bpel.elang.xpath20.runtime;
+
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+import javax.xml.transform.TransformerException;
+import javax.xml.xpath.XPathExpression;
+
+import net.sf.saxon.expr.AxisExpression;
+import net.sf.saxon.expr.Expression;
+import net.sf.saxon.expr.ItemChecker;
+import net.sf.saxon.expr.PathExpression;
+import net.sf.saxon.expr.VariableReference;
+import net.sf.saxon.om.Axis;
+import net.sf.saxon.om.NamePool;
+import net.sf.saxon.pattern.NameTest;
+import net.sf.saxon.pattern.NodeKindTest;
+import net.sf.saxon.pattern.NodeTest;
+import net.sf.saxon.xpath.XPathExpressionImpl;
+
+import org.apache.ode.utils.DOMUtils;
+import org.apache.ode.utils.NSContext;
+import org.w3c.dom.Attr;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+
+/**
+ * A helper utility that modifies XPath Expression in-place. This is meant
+ * to be reusable across the XPath and XQuery runtimes.
+ */
+public class XPath20ExpressionModifier {
+ private NSContext contextUris;
+ private NamePool namePool;
+
+ /**
+ * Creates a new XPath20ExpressionModifier object.
+ *
+ * @param contextUris
+ * @param namePool
+ */
+ public XPath20ExpressionModifier(NSContext contextUris, NamePool namePool) {
+ this.contextUris = contextUris;
+ this.namePool = namePool;
+ }
+
+ /**
+ * Insert nodes into the specified XPath expression wherever
+ * required To be precise, an node is added to its parent if:
+ * a) the node is an element...
+ * b) that corresponds to an step...
+ * c) that has a child axis...
+ * d) whose parent had no children with its name...
+ * e) and all preceding steps are element name tests.
+ *
+ * @param xpathExpr
+ * @param namePool
+ *
+ * @throws DOMException
+ * @throws TransformerException
+ */
+ @SuppressWarnings("unchecked")
+ public void insertMissingData(XPathExpression xpathExpr, Node contextNode)
+ throws DOMException, TransformerException {
+ if ((contextNode == null) || !(contextNode instanceof Element) ||
+ !(xpathExpr instanceof XPathExpressionImpl)) {
+ return;
+ }
+
+ Expression expression = ((XPathExpressionImpl) xpathExpr).getInternalExpression();
+ Iterator<Expression> subExpressions = (Iterator<Expression>) expression.iterateSubExpressions();
+
+ if (!subExpressions.hasNext()) {
+ return;
+ }
+
+ Expression subExpr = (Expression) subExpressions.next();
+
+ if (!(subExpr instanceof PathExpression)) {
+ return;
+ }
+
+ Document document = DOMUtils.toDOMDocument(contextNode);
+ PathExpression pathExpr = (PathExpression) subExpr;
+ Expression step = pathExpr.getFirstStep();
+
+ while (step != null) {
+ if (step instanceof AxisExpression) {
+ AxisExpression axisExpr = (AxisExpression) step;
+
+ NodeTest nodeTest = axisExpr.getNodeTest();
+
+ if (!(nodeTest instanceof NameTest)) {
+ break;
+ }
+
+ NameTest nameTest = (NameTest) nodeTest;
+
+ QName childName = getQualifiedName(nameTest.getFingerprint(),
+ namePool, contextUris);
+
+ if (Axis.CHILD == axisExpr.getAxis()) {
+ if (NodeKindTest.ELEMENT.getNodeKindMask() != nameTest.getNodeKindMask()) {
+ break;
+ }
+
+ NodeList children = ((Element) contextNode).getElementsByTagNameNS(childName.getNamespaceURI(),
+ childName.getLocalPart());
+ if ((children == null) || (children.getLength() == 0)) {
+ Node child = document.createElementNS(childName.getNamespaceURI(),
+ DOMUtils.getQualifiedName(childName));
+ contextNode.appendChild(child);
+ contextNode = child;
+ } else if (children.getLength() == 1) {
+ contextNode = children.item(0);
+ } else {
+ break;
+ }
+ } else if (Axis.ATTRIBUTE == axisExpr.getAxis()) {
+ if (NodeKindTest.ATTRIBUTE.getNodeKindMask() != nameTest.getNodeKindMask()) {
+ break;
+ }
+
+ Attr attribute = ((Element) contextNode).getAttributeNodeNS(childName.getNamespaceURI(), childName.getLocalPart());
+ if (attribute == null) {
+ attribute = document.createAttributeNS(childName.getNamespaceURI(), childName.getLocalPart());
+ ((Element) contextNode).setAttributeNode(attribute);
+ contextNode = attribute;
+ } else {
+ break;
+ }
+
+ } else {
+ break;
+ }
+
+
+ } else if (step instanceof ItemChecker) {
+ ItemChecker itemChecker = (ItemChecker) step;
+ Expression baseExpr = itemChecker.getBaseExpression();
+
+ if (!(baseExpr instanceof VariableReference)) {
+ break;
+ }
+ } else {
+ break;
+ }
+
+ if (pathExpr != null) {
+ Expression remainingSteps = pathExpr.getRemainingSteps();
+
+ if (remainingSteps instanceof PathExpression) {
+ pathExpr = (PathExpression) remainingSteps;
+ step = pathExpr.getFirstStep();
+ } else if (remainingSteps instanceof AxisExpression) {
+ pathExpr = null;
+ step = (AxisExpression) remainingSteps;
+ }
+ } else {
+ break;
+ }
+ }
+ }
+
+ /**
+ * Create the QName by running the given finger print against the
+ * given context
+ *
+ * @param fingerprint
+ * @param namePool
+ * @param nsContext
+ *
+ * @return The QName corresponding to the finger print
+ */
+ private QName getQualifiedName(int fingerprint, NamePool namePool,
+ NSContext nsContext) {
+ String localName = namePool.getLocalName(fingerprint);
+ String prefix = namePool.getPrefix(fingerprint);
+ String uri = namePool.getURI(fingerprint);
+
+ // Unfortunately, NSContext.getPrefix(String URI) doesn't always work
+ // So, we need to find the prefix for the URI the hard way
+ if ((prefix == null) || "".equals(prefix)) {
+ for (String nsPrefix : nsContext.getPrefixes()) {
+ String nsUri = nsContext.getNamespaceURI(nsPrefix);
+
+ if (nsUri.equals(uri)) {
+ prefix = nsPrefix;
+ }
+ }
+ }
+
+ return new QName(uri, localName, prefix);
+ }
}
\ No newline at end of file
Modified: branches/ODE/ODE-1.x/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xquery10/runtime/XQuery10BpelFunctions.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xquery10/runtime/XQuery10BpelFunctions.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xquery10/runtime/XQuery10BpelFunctions.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -17,166 +17,166 @@
* under the License.
*/
-package org.apache.ode.bpel.elang.xquery10.runtime;
-
-import net.sf.saxon.dom.NodeWrapper;
-import net.sf.saxon.expr.XPathContext;
-import net.sf.saxon.om.Item;
-
-import org.apache.ode.bpel.elang.xpath20.compiler.Constants;
-import org.apache.ode.bpel.elang.xpath20.runtime.JaxpFunctionResolver;
-import org.apache.ode.utils.Namespaces;
-
-import org.w3c.dom.Node;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-import javax.xml.xpath.XPathFunction;
-import javax.xml.xpath.XPathFunctionException;
-
-
-/**
- * XQuery-Friendly definition of BPEL functions, which
- * delegates calls to the JAXP-based function resolver
- */
-public class XQuery10BpelFunctions {
- public static final String USER_DATA_KEY_FUNCTION_RESOLVER = "function-resolver";
- private static final QName WSBPEL_GET_VARIABLE_PROPERTY = new QName(Namespaces.WSBPEL2_0_FINAL_EXEC,
- Constants.EXT_FUNCTION_GETVARIABLEPROPERTY);
- private static final QName WSBPEL_GET_VARIABLE_DATA = new QName(Namespaces.WSBPEL2_0_FINAL_EXEC,
- Constants.EXT_FUNCTION_GETVARIABLEDATA);
- private static final QName WSBPEL_GET_LINK_STATUS = new QName(Namespaces.WSBPEL2_0_FINAL_EXEC,
- Constants.EXT_FUNCTION_GETLINKSTATUS);
- private static final QName WSBPEL_DO_XSL_TRANSFORM = new QName(Namespaces.WSBPEL2_0_FINAL_EXEC,
- Constants.EXT_FUNCTION_DOXSLTRANSFORM);
-
- /**
- * WS-BPEL getVariableProperty function
- *
- * @param context context
- * @param variableName variableName
- * @param propertyName propertyName
- *
- * @return type
- *
- * @throws XPathFunctionException XPathFunctionException
- */
- public static Object getVariableProperty(XPathContext context,
- String variableName, String propertyName) throws XPathFunctionException {
- ArrayList<String> arguments = new ArrayList<String>();
- arguments.add(variableName);
- arguments.add(propertyName);
-
- return evaluate(resolveFunction(context, WSBPEL_GET_VARIABLE_PROPERTY),
- arguments);
- }
-
- /**
- * WS-BPEL getVariableData function
- *
- * @param context context
- * @param variableName variableName
- * @param partName partName
- * @param xpath xpath
- *
- * @return type
- *
- * @throws XPathFunctionException XPathFunctionException
- */
- public static Object getVariableData(XPathContext context,
- String variableName, String partName, String xpath)
- throws XPathFunctionException {
- ArrayList<String> arguments = new ArrayList<String>();
- arguments.add(variableName);
- arguments.add(partName);
- arguments.add(xpath);
-
- return evaluate(resolveFunction(context, WSBPEL_GET_VARIABLE_DATA),
- arguments);
- }
-
- /**
- * WS-BPEL doXslTransform function
- *
- * @param context context
- * @param xslUri xslUri
- * @param sources sources
- *
- * @return type
- *
- * @throws XPathFunctionException XPathFunctionException
- */
- public static Object doXslTransform(XPathContext context, String xslUri,
- Object sources) throws XPathFunctionException {
- ArrayList<Object> arguments = new ArrayList<Object>();
- arguments.add(xslUri);
- arguments.add(sources);
-
- return evaluate(resolveFunction(context, WSBPEL_DO_XSL_TRANSFORM),
- arguments);
- }
-
- /**
- * WS-BPEL getLinkStatus function
- *
- * @param context context
- * @param linkName linkName
- *
- * @return type
- *
- * @throws XPathFunctionException XPathFunctionException
- */
- public static Object getLinkStatus(XPathContext context, String linkName)
- throws XPathFunctionException {
- ArrayList<String> arguments = new ArrayList<String>();
- arguments.add(linkName);
-
- return evaluate(resolveFunction(context, WSBPEL_GET_LINK_STATUS),
- arguments);
- }
-
- /**
- * Locates the equivalent JAXP function
- *
- * @param context context
- * @param name name
- *
- * @return type
- */
- private static XPathFunction resolveFunction(XPathContext context,
- QName name) {
- JaxpFunctionResolver funcResolver = null;
- Item item = context.getCurrentIterator().current();
-
- if (item instanceof NodeWrapper) {
- Node node = (Node) ((NodeWrapper) item).getUnderlyingNode();
-
- if (node != null) {
- funcResolver = (JaxpFunctionResolver) node.getUserData(USER_DATA_KEY_FUNCTION_RESOLVER);
- }
- }
-
- return funcResolver.resolveFunction(name, 0);
- }
-
- /**
- * Evaluates function against arguments passed by XQuery
- *
- * @param function function
- * @param arguments arguments
- *
- * @return type
- *
- * @throws XPathFunctionException XPathFunctionException
- */
- private static Object evaluate(XPathFunction function, List arguments)
- throws XPathFunctionException {
- if (function == null) {
- throw new XPathFunctionException("Unable to locate function in library");
- }
-
- return function.evaluate(arguments);
- }
-}
+package org.apache.ode.bpel.elang.xquery10.runtime;
+
+import net.sf.saxon.dom.NodeWrapper;
+import net.sf.saxon.expr.XPathContext;
+import net.sf.saxon.om.Item;
+
+import org.apache.ode.bpel.elang.xpath20.compiler.Constants;
+import org.apache.ode.bpel.elang.xpath20.runtime.JaxpFunctionResolver;
+import org.apache.ode.utils.Namespaces;
+
+import org.w3c.dom.Node;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+import javax.xml.xpath.XPathFunction;
+import javax.xml.xpath.XPathFunctionException;
+
+
+/**
+ * XQuery-Friendly definition of BPEL functions, which
+ * delegates calls to the JAXP-based function resolver
+ */
+public class XQuery10BpelFunctions {
+ public static final String USER_DATA_KEY_FUNCTION_RESOLVER = "function-resolver";
+ private static final QName WSBPEL_GET_VARIABLE_PROPERTY = new QName(Namespaces.WSBPEL2_0_FINAL_EXEC,
+ Constants.EXT_FUNCTION_GETVARIABLEPROPERTY);
+ private static final QName WSBPEL_GET_VARIABLE_DATA = new QName(Namespaces.WSBPEL2_0_FINAL_EXEC,
+ Constants.EXT_FUNCTION_GETVARIABLEDATA);
+ private static final QName WSBPEL_GET_LINK_STATUS = new QName(Namespaces.WSBPEL2_0_FINAL_EXEC,
+ Constants.EXT_FUNCTION_GETLINKSTATUS);
+ private static final QName WSBPEL_DO_XSL_TRANSFORM = new QName(Namespaces.WSBPEL2_0_FINAL_EXEC,
+ Constants.EXT_FUNCTION_DOXSLTRANSFORM);
+
+ /**
+ * WS-BPEL getVariableProperty function
+ *
+ * @param context context
+ * @param variableName variableName
+ * @param propertyName propertyName
+ *
+ * @return type
+ *
+ * @throws XPathFunctionException XPathFunctionException
+ */
+ public static Object getVariableProperty(XPathContext context,
+ String variableName, String propertyName) throws XPathFunctionException {
+ ArrayList<String> arguments = new ArrayList<String>();
+ arguments.add(variableName);
+ arguments.add(propertyName);
+
+ return evaluate(resolveFunction(context, WSBPEL_GET_VARIABLE_PROPERTY),
+ arguments);
+ }
+
+ /**
+ * WS-BPEL getVariableData function
+ *
+ * @param context context
+ * @param variableName variableName
+ * @param partName partName
+ * @param xpath xpath
+ *
+ * @return type
+ *
+ * @throws XPathFunctionException XPathFunctionException
+ */
+ public static Object getVariableData(XPathContext context,
+ String variableName, String partName, String xpath)
+ throws XPathFunctionException {
+ ArrayList<String> arguments = new ArrayList<String>();
+ arguments.add(variableName);
+ arguments.add(partName);
+ arguments.add(xpath);
+
+ return evaluate(resolveFunction(context, WSBPEL_GET_VARIABLE_DATA),
+ arguments);
+ }
+
+ /**
+ * WS-BPEL doXslTransform function
+ *
+ * @param context context
+ * @param xslUri xslUri
+ * @param sources sources
+ *
+ * @return type
+ *
+ * @throws XPathFunctionException XPathFunctionException
+ */
+ public static Object doXslTransform(XPathContext context, String xslUri,
+ Object sources) throws XPathFunctionException {
+ ArrayList<Object> arguments = new ArrayList<Object>();
+ arguments.add(xslUri);
+ arguments.add(sources);
+
+ return evaluate(resolveFunction(context, WSBPEL_DO_XSL_TRANSFORM),
+ arguments);
+ }
+
+ /**
+ * WS-BPEL getLinkStatus function
+ *
+ * @param context context
+ * @param linkName linkName
+ *
+ * @return type
+ *
+ * @throws XPathFunctionException XPathFunctionException
+ */
+ public static Object getLinkStatus(XPathContext context, String linkName)
+ throws XPathFunctionException {
+ ArrayList<String> arguments = new ArrayList<String>();
+ arguments.add(linkName);
+
+ return evaluate(resolveFunction(context, WSBPEL_GET_LINK_STATUS),
+ arguments);
+ }
+
+ /**
+ * Locates the equivalent JAXP function
+ *
+ * @param context context
+ * @param name name
+ *
+ * @return type
+ */
+ private static XPathFunction resolveFunction(XPathContext context,
+ QName name) {
+ JaxpFunctionResolver funcResolver = null;
+ Item item = context.getCurrentIterator().current();
+
+ if (item instanceof NodeWrapper) {
+ Node node = (Node) ((NodeWrapper) item).getUnderlyingNode();
+
+ if (node != null) {
+ funcResolver = (JaxpFunctionResolver) node.getUserData(USER_DATA_KEY_FUNCTION_RESOLVER);
+ }
+ }
+
+ return funcResolver.resolveFunction(name, 0);
+ }
+
+ /**
+ * Evaluates function against arguments passed by XQuery
+ *
+ * @param function function
+ * @param arguments arguments
+ *
+ * @return type
+ *
+ * @throws XPathFunctionException XPathFunctionException
+ */
+ private static Object evaluate(XPathFunction function, List arguments)
+ throws XPathFunctionException {
+ if (function == null) {
+ throw new XPathFunctionException("Unable to locate function in library");
+ }
+
+ return function.evaluate(arguments);
+ }
+}
Modified: branches/ODE/ODE-1.x/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xquery10/runtime/XQuery10ExpressionRuntime.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xquery10/runtime/XQuery10ExpressionRuntime.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xquery10/runtime/XQuery10ExpressionRuntime.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,617 +1,617 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.ode.bpel.elang.xquery10.runtime;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Collections;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xquery.XQConnection;
-import javax.xml.xquery.XQConstants;
-import javax.xml.xquery.XQDataSource;
-import javax.xml.xquery.XQException;
-import javax.xml.xquery.XQItem;
-import javax.xml.xquery.XQItemType;
-import javax.xml.xquery.XQPreparedExpression;
-import javax.xml.xquery.XQResultSequence;
-import javax.xml.xquery.XQSequence;
-import javax.xml.xquery.XQSequenceType;
-import javax.xml.xquery.XQStaticContext;
-
-import net.sf.saxon.Configuration;
-import net.sf.saxon.om.Validation;
-import net.sf.saxon.trans.DynamicError;
-import net.sf.saxon.value.DurationValue;
-import net.sf.saxon.xqj.SaxonXQConnection;
-import net.sf.saxon.xqj.SaxonXQDataSource;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.ode.bpel.common.FaultException;
-import org.apache.ode.bpel.elang.xpath20.compiler.Constants;
-import org.apache.ode.bpel.elang.xpath20.compiler.WrappedResolverException;
-import org.apache.ode.bpel.elang.xpath20.runtime.JaxpFunctionResolver;
-import org.apache.ode.bpel.elang.xpath20.runtime.JaxpVariableResolver;
-import org.apache.ode.bpel.elang.xquery10.compiler.XQuery10BpelFunctions;
-import org.apache.ode.bpel.elang.xquery10.o.OXQuery10ExpressionBPEL20;
-import org.apache.ode.bpel.explang.ConfigurationException;
-import org.apache.ode.bpel.explang.EvaluationContext;
-import org.apache.ode.bpel.explang.EvaluationException;
-import org.apache.ode.bpel.explang.ExpressionLanguageRuntime;
-import org.apache.ode.bpel.o.OExpression;
-import org.apache.ode.utils.DOMUtils;
-import org.apache.ode.utils.ISO8601DateParser;
-import org.apache.ode.utils.NSContext;
-import org.apache.ode.utils.xsd.Duration;
-import org.apache.ode.utils.xsl.XslTransformHandler;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-
-/**
- * XQuery 1.0 Expression Language run-time subsytem. Saxon implementation.
- */
-@SuppressWarnings("deprecation")
-public class XQuery10ExpressionRuntime implements ExpressionLanguageRuntime {
- static final short NODE_TYPE = 1;
- static final short NODESET_TYPE = 2;
- static final short STRING_TYPE = 3;
- static final short BOOLEAN_TYPE = 4;
- static final short NUMBER_TYPE = 5;
-
- /** Class-level logger. */
- private static final Log __log = LogFactory.getLog(XQuery10ExpressionRuntime.class);
-
- /**
- * Creates a new XQuery10ExpressionRuntime object.
- */
- public XQuery10ExpressionRuntime() {
- }
-
- /**
- * Initialize XSL Transformer
- *
- * @param properties properties
- *
- * @throws ConfigurationException ConfigurationException
- */
- public void initialize(Map properties) throws ConfigurationException {
- TransformerFactory trsf = new net.sf.saxon.TransformerFactoryImpl();
- XslTransformHandler.getInstance().setTransformerFactory(trsf);
- }
-
- /**
- *
- * @see org.apache.ode.bpel.explang.ExpressionLanguageRuntime#evaluateAsString(org.apache.ode.bpel.o.OExpression,
- * org.apache.ode.bpel.explang.EvaluationContext)
- */
- public String evaluateAsString(OExpression cexp, EvaluationContext ctx)
- throws FaultException, EvaluationException {
- return (String) evaluate(cexp, ctx, XPathConstants.STRING);
- }
-
- /**
- *
- * @see org.apache.ode.bpel.explang.ExpressionLanguageRuntime#evaluateAsBoolean(org.apache.ode.bpel.o.OExpression,
- * org.apache.ode.bpel.explang.EvaluationContext)
- */
- public boolean evaluateAsBoolean(OExpression cexp, EvaluationContext ctx)
- throws FaultException, EvaluationException {
- return (Boolean) evaluate(cexp, ctx, XPathConstants.BOOLEAN);
- }
-
- /**
- * Evaluate expression and return a number
- *
- * @param cexp cexp
- * @param ctx ctx
- *
- * @return type
- *
- * @throws FaultException FaultException
- * @throws EvaluationException EvaluationException
- */
- public Number evaluateAsNumber(OExpression cexp, EvaluationContext ctx)
- throws FaultException, EvaluationException {
- return (Number) evaluate(cexp, ctx, XPathConstants.NUMBER);
- }
-
- /**
- *
- * @see org.apache.ode.bpel.explang.ExpressionLanguageRuntime#evaluate(org.apache.ode.bpel.o.OExpression,
- * org.apache.ode.bpel.explang.EvaluationContext)
- */
- public List evaluate(OExpression cexp, EvaluationContext ctx)
- throws FaultException, EvaluationException {
- List result;
- Object someRes = evaluate(cexp, ctx, XPathConstants.NODESET);
-
- if (someRes instanceof List) {
- result = (List) someRes;
- __log.debug("Returned list of size " + result.size());
-
- if ((result.size() == 1) && !(result.get(0) instanceof Node)) {
- // Dealing with a Java class
- Object simpleType = result.get(0);
-
- // Dates get a separate treatment as we don't want to call toString on them
- String textVal;
-
- if (simpleType instanceof Date) {
- textVal = ISO8601DateParser.format((Date) simpleType);
- } else if (simpleType instanceof DurationValue) {
- textVal = ((DurationValue) simpleType).getStringValue();
- } else {
- textVal = simpleType.toString();
- }
-
- // Wrapping in a document
- Document d = DOMUtils.newDocument();
-
- // Giving our node a parent just in case it's an LValue expression
- Element wrapper = d.createElement("wrapper");
- Text text = d.createTextNode(textVal);
- wrapper.appendChild(text);
- d.appendChild(wrapper);
- result = Collections.singletonList(text);
- }
- } else if (someRes instanceof NodeList) {
- NodeList retVal = (NodeList) someRes;
- __log.debug("Returned node list of size " + retVal.getLength());
- result = new ArrayList(retVal.getLength());
-
- for (int m = 0; m < retVal.getLength(); ++m) {
- Node val = retVal.item(m);
-
- if (val.getNodeType() == Node.DOCUMENT_NODE) {
- val = ((Document) val).getDocumentElement();
- }
-
- result.add(val);
- }
- } else {
- result = null;
- }
-
- return result;
- }
-
- /**
- * Evaluate expression and return a node
- *
- * @param cexp cexp
- * @param ctx ctx
- *
- * @return type
- *
- * @throws FaultException FaultException
- * @throws EvaluationException EvaluationException
- */
- public Node evaluateNode(OExpression cexp, EvaluationContext ctx)
- throws FaultException, EvaluationException {
- List retVal = evaluate(cexp, ctx);
-
- if (retVal.size() == 0) {
- throw new FaultException(cexp.getOwner().constants.qnSelectionFailure,
- "No results for expression: " + cexp);
- }
-
- if (retVal.size() > 1) {
- throw new FaultException(cexp.getOwner().constants.qnSelectionFailure,
- "Multiple results for expression: " + cexp);
- }
-
- return (Node) retVal.get(0);
- }
-
- /**
- * Evaluate expression and return a date
- *
- * @param cexp cexp
- * @param context context
- *
- * @return type
- *
- * @throws FaultException FaultException
- * @throws EvaluationException EvaluationException
- */
- public Calendar evaluateAsDate(OExpression cexp, EvaluationContext context)
- throws FaultException, EvaluationException {
- List literal = DOMUtils.toList(evaluate(cexp, context,
- XPathConstants.NODESET));
-
- if (literal.size() == 0) {
- throw new FaultException(cexp.getOwner().constants.qnSelectionFailure,
- "No results for expression: " + cexp);
- }
-
- if (literal.size() > 1) {
- throw new FaultException(cexp.getOwner().constants.qnSelectionFailure,
- "Multiple results for expression: " + cexp);
- }
-
- Object date = literal.get(0);
-
- if (date instanceof Calendar) {
- return (Calendar) date;
- }
-
- if (date instanceof Date) {
- Calendar cal = Calendar.getInstance();
- cal.setTime((Date) date);
-
- return cal;
- }
-
- if (date instanceof Element) {
- date = ((Element) date).getTextContent();
- }
-
- try {
- return ISO8601DateParser.parseCal(date.toString());
- } catch (Exception ex) {
- String errmsg = "Invalid date: " + literal;
- __log.error(errmsg, ex);
- throw new FaultException(cexp.getOwner().constants.qnInvalidExpressionValue,
- errmsg);
- }
- }
-
- /**
- * Evaluate expression and return duration
- *
- * @param cexp cexp
- * @param context context
- *
- * @return type
- *
- * @throws FaultException FaultException
- * @throws EvaluationException EvaluationException
- */
- public Duration evaluateAsDuration(OExpression cexp,
- EvaluationContext context) throws FaultException, EvaluationException {
- String literal = this.evaluateAsString(cexp, context);
-
- try {
- return new Duration(literal);
- } catch (Exception ex) {
- String errmsg = "Invalid duration: " + literal;
- __log.error(errmsg, ex);
- throw new FaultException(cexp.getOwner().constants.qnInvalidExpressionValue,
- errmsg);
- }
- }
-
- /**
- * Evaluate expression and return opaque type
- *
- * @param cexp cexp
- * @param ctx ctx
- * @param type type
- *
- * @return type
- *
- * @throws FaultException FaultException
- * @throws EvaluationException EvaluationException
- */
- private Object evaluate(OExpression cexp, EvaluationContext ctx, QName type)
- throws FaultException, EvaluationException {
- try {
- OXQuery10ExpressionBPEL20 oxquery10 = ((OXQuery10ExpressionBPEL20) cexp);
-
- XQDataSource xqds = new SaxonXQDataSource();
- XQConnection xqconn = xqds.getConnection();
-
- Configuration configuration = ((SaxonXQConnection) xqconn).getConfiguration();
- configuration.setAllNodesUntyped(true);
- configuration.setHostLanguage(Configuration.XQUERY);
-
- XQStaticContext staticEnv = xqconn.getStaticContext();
-
- NSContext nsContext = oxquery10.namespaceCtx;
- Set<String> prefixes = nsContext.getPrefixes();
- for (String prefix : prefixes) {
- String uri = nsContext.getNamespaceURI(prefix);
- staticEnv.declareNamespace(prefix, uri);
- }
-
- configuration.setSchemaValidationMode(Validation.SKIP);
- xqconn.setStaticContext(staticEnv);
-
- // Prepare expression, for starters
- String xquery = oxquery10.xquery.replaceFirst(
- Constants.XQUERY_FUNCTION_HANDLER_COMPILER,
- Constants.XQUERY_FUNCTION_HANDLER_RUNTIME);
- XQPreparedExpression exp = xqconn.prepareExpression(xquery);
-
- JaxpFunctionResolver funcResolver = new JaxpFunctionResolver(ctx,
- oxquery10);
- JaxpVariableResolver variableResolver = new JaxpVariableResolver(ctx,
- oxquery10, configuration);
- // Bind external variables to runtime values
- for (QName variable : exp.getAllUnboundExternalVariables()) {
- // Evaluate referenced variable
- Object value = variableResolver.resolveVariable(variable);
-
- // Figure out type of variable
- XQSequenceType xqType = getItemType(xqconn, value);
-
- // Saxon doesn't like binding sequences to variables
- if (value instanceof Node) {
- // a node is a node-list, but the inverse isn't true.
- // so, if the value is truly a node, leave it alone.
- } else if (value instanceof NodeList) {
- // So extract the first item from the node list
- NodeList nodeList = (NodeList) value;
- ArrayList nodeArray = new ArrayList();
- for (int i = 0; i < nodeList.getLength(); i++) {
- nodeArray.add(nodeList.item(i));
- }
- value = xqconn.createSequence(nodeArray.iterator());
- }
-
-
- // Bind value with external variable
- if (value != null && xqType != null) {
- if (value instanceof XQSequence) {
- exp.bindSequence(variable, (XQSequence) value);
- } else {
- if (xqType instanceof XQItemType) {
- exp.bindObject(variable, value, (XQItemType) xqType);
- }
- }
- }
- }
-
- // Set context node
- Node contextNode = (ctx.getRootNode() == null)
- ? DOMUtils.newDocument() : ctx.getRootNode();
- contextNode.setUserData(XQuery10BpelFunctions.USER_DATA_KEY_FUNCTION_RESOLVER,
- funcResolver, null);
- exp.bindItem(XQConstants.CONTEXT_ITEM,
- xqconn.createItemFromNode(contextNode, xqconn.createNodeType()));
-
- // Execute query
- XQResultSequence result = exp.executeQuery();
-
- // Cast Saxon result to Java result
- Object evalResult = getResultValue(type, result);
-
- if ((evalResult != null) && __log.isDebugEnabled()) {
- __log.debug("Expression " + cexp.toString() +
- " generated result " + evalResult + " - type=" +
- evalResult.getClass().getName());
-
- if (ctx.getRootNode() != null) {
- __log.debug("Was using context node " +
- DOMUtils.domToString(ctx.getRootNode()));
- }
- }
-
- return evalResult;
- } catch (XQException xqe) {
- // Extracting the real cause from all this wrapping isn't a simple task
- Throwable cause = (xqe.getCause() != null) ? xqe.getCause() : xqe;
-
- if (cause instanceof DynamicError) {
- Throwable th = ((DynamicError) cause).getException();
-
- if (th != null) {
- cause = th;
-
- if (cause.getCause() != null) {
- cause = cause.getCause();
- }
- }
- }
-
- throw new EvaluationException(
- "Error while executing an XQuery expression: " + cause.toString(), cause);
- } catch (WrappedResolverException wre) {
- __log.debug("Could not evaluate expression because of ", wre);
- throw (FaultException) wre.getCause();
- }
- }
-
- /**
- * Return opaque object embedded in XQuery Item
- *
- * @param item item
- *
- * @return type
- *
- * @throws XQException XQException
- */
- private Object getItemValue(XQItem item) throws XQException {
- XQItemType itemType = item.getItemType();
- Object itemValue = null;
-
- switch (itemType.getBaseType()) {
- case XQItemType.XQBASETYPE_BOOLEAN:
- itemValue = item.getBoolean();
-
- break;
-
- case XQItemType.XQBASETYPE_DECIMAL:
- itemValue = item.getDouble();
-
- break;
-
- case XQItemType.XQBASETYPE_BYTE:
- itemValue = item.getByte();
-
- break;
-
- case XQItemType.XQBASETYPE_FLOAT:
- itemValue = item.getFloat();
-
- break;
-
- case XQItemType.XQBASETYPE_INT:
- case XQItemType.XQBASETYPE_INTEGER:
- itemValue = item.getInt();
-
- break;
-
- case XQItemType.XQBASETYPE_LONG:
- itemValue = item.getLong();
-
- break;
-
- case XQItemType.XQBASETYPE_ANYTYPE:
- itemValue = item.getNode();
-
- break;
-
- case XQItemType.XQBASETYPE_ANYURI:
- itemValue = item.getNodeUri();
-
- break;
-
- case XQItemType.XQBASETYPE_SHORT:
- itemValue = item.getShort();
-
- break;
-
- case XQItemType.XQBASETYPE_STRING:
- case XQItemType.XQBASETYPE_ANYATOMICTYPE:
- itemValue = item.getAtomicValue();
-
- break;
-
- }
-
- return itemValue;
- }
-
- /**
- * Return XQuery type corresponding to given value
- *
- * @param xqconn XQuery connection
- * @param value value
- *
- * @return type
- *
- * @throws XQException XQException
- */
- private XQSequenceType getItemType(XQConnection xqconn, Object value) throws XQException {
- XQSequenceType xqType = null;
- if (value instanceof Long) {
- xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_LONG);
- } else if (value instanceof String) {
- xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_STRING);
- } else if (value instanceof Boolean) {
- xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_BOOLEAN);
- } else if (value instanceof Date) {
- xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_DATETIME);
- } else if (value instanceof BigDecimal) {
- xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_DECIMAL);
- } else if (value instanceof Float) {
- xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_FLOAT);
- } else if (value instanceof URI) {
- xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_ANYURI);
- } else if (value instanceof QName) {
- xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_QNAME);
- } else if (value instanceof BigInteger) {
- xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_INT);
- } else if (value instanceof Integer) {
- xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_INTEGER);
- } else if (value instanceof Double) {
- xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_DOUBLE);
- } else if (value instanceof Byte) {
- xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_BYTE);
- } else if (value instanceof Node) {
- xqType = xqconn.createNodeType();
- } else if (value instanceof NodeList || value instanceof XQSequence) {
- XQItemType xqItemType = xqconn.createNodeType();
- xqType = xqconn.createSequenceType(xqItemType, XQSequenceType.OCC_ZERO_OR_MORE);
- }
- return xqType;
- }
-
- /**
- * Cast XQuery sequence into an opaque list
- *
- * @param type type
- * @param result result
- *
- * @return value
- *
- * @throws XQException XQException
- */
- private Object getResultValue(QName type, XQResultSequence result) throws XQException {
- Document document = DOMUtils.newDocument();
- Object resultValue = null;
- if (XPathConstants.NODESET.equals(type)) {
- List list = new ArrayList();
-
- while (result.next()) {
- Object itemValue = getItemValue(result.getItem());
- if (itemValue instanceof Document) {
- itemValue = DOMUtils.cloneNode(document, ((Document) itemValue).getDocumentElement());
- } else if (itemValue instanceof Node) {
- itemValue = DOMUtils.cloneNode(document, (Node) itemValue);
- }
-
- if (itemValue != null) {
- list.add(itemValue);
- }
- }
-
- resultValue = list;
- } else if (XPathConstants.NODE.equals(type)) {
- XQItem item = null;
- if (result.count() > 0) {
- result.first();
- if (result.isOnItem()) {
- item = result.getItem();
- }
- }
- if (item != null) {
- resultValue = getItemValue(item);
- if (resultValue instanceof Node) {
- resultValue = DOMUtils.cloneNode(document, (Node) resultValue);
- }
- }
- } else if (XPathConstants.STRING.equals(type)) {
- resultValue = result.getSequenceAsString(new Properties());
- } else if (XPathConstants.NUMBER.equals(type)) {
- resultValue = result.getSequenceAsString(new Properties());
- resultValue = Integer.parseInt((String) resultValue);
- } else if (XPathConstants.BOOLEAN.equals(type)) {
- resultValue = result.getSequenceAsString(new Properties());
- resultValue = Boolean.parseBoolean((String) resultValue);
- }
- return resultValue;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.elang.xquery10.runtime;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xquery.XQConnection;
+import javax.xml.xquery.XQConstants;
+import javax.xml.xquery.XQDataSource;
+import javax.xml.xquery.XQException;
+import javax.xml.xquery.XQItem;
+import javax.xml.xquery.XQItemType;
+import javax.xml.xquery.XQPreparedExpression;
+import javax.xml.xquery.XQResultSequence;
+import javax.xml.xquery.XQSequence;
+import javax.xml.xquery.XQSequenceType;
+import javax.xml.xquery.XQStaticContext;
+
+import net.sf.saxon.Configuration;
+import net.sf.saxon.om.Validation;
+import net.sf.saxon.trans.DynamicError;
+import net.sf.saxon.value.DurationValue;
+import net.sf.saxon.xqj.SaxonXQConnection;
+import net.sf.saxon.xqj.SaxonXQDataSource;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ode.bpel.common.FaultException;
+import org.apache.ode.bpel.elang.xpath20.compiler.Constants;
+import org.apache.ode.bpel.elang.xpath20.compiler.WrappedResolverException;
+import org.apache.ode.bpel.elang.xpath20.runtime.JaxpFunctionResolver;
+import org.apache.ode.bpel.elang.xpath20.runtime.JaxpVariableResolver;
+import org.apache.ode.bpel.elang.xquery10.compiler.XQuery10BpelFunctions;
+import org.apache.ode.bpel.elang.xquery10.o.OXQuery10ExpressionBPEL20;
+import org.apache.ode.bpel.explang.ConfigurationException;
+import org.apache.ode.bpel.explang.EvaluationContext;
+import org.apache.ode.bpel.explang.EvaluationException;
+import org.apache.ode.bpel.explang.ExpressionLanguageRuntime;
+import org.apache.ode.bpel.o.OExpression;
+import org.apache.ode.utils.DOMUtils;
+import org.apache.ode.utils.ISO8601DateParser;
+import org.apache.ode.utils.NSContext;
+import org.apache.ode.utils.xsd.Duration;
+import org.apache.ode.utils.xsl.XslTransformHandler;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Text;
+
+
+/**
+ * XQuery 1.0 Expression Language run-time subsytem. Saxon implementation.
+ */
+@SuppressWarnings("deprecation")
+public class XQuery10ExpressionRuntime implements ExpressionLanguageRuntime {
+ static final short NODE_TYPE = 1;
+ static final short NODESET_TYPE = 2;
+ static final short STRING_TYPE = 3;
+ static final short BOOLEAN_TYPE = 4;
+ static final short NUMBER_TYPE = 5;
+
+ /** Class-level logger. */
+ private static final Log __log = LogFactory.getLog(XQuery10ExpressionRuntime.class);
+
+ /**
+ * Creates a new XQuery10ExpressionRuntime object.
+ */
+ public XQuery10ExpressionRuntime() {
+ }
+
+ /**
+ * Initialize XSL Transformer
+ *
+ * @param properties properties
+ *
+ * @throws ConfigurationException ConfigurationException
+ */
+ public void initialize(Map properties) throws ConfigurationException {
+ TransformerFactory trsf = new net.sf.saxon.TransformerFactoryImpl();
+ XslTransformHandler.getInstance().setTransformerFactory(trsf);
+ }
+
+ /**
+ *
+ * @see org.apache.ode.bpel.explang.ExpressionLanguageRuntime#evaluateAsString(org.apache.ode.bpel.o.OExpression,
+ * org.apache.ode.bpel.explang.EvaluationContext)
+ */
+ public String evaluateAsString(OExpression cexp, EvaluationContext ctx)
+ throws FaultException, EvaluationException {
+ return (String) evaluate(cexp, ctx, XPathConstants.STRING);
+ }
+
+ /**
+ *
+ * @see org.apache.ode.bpel.explang.ExpressionLanguageRuntime#evaluateAsBoolean(org.apache.ode.bpel.o.OExpression,
+ * org.apache.ode.bpel.explang.EvaluationContext)
+ */
+ public boolean evaluateAsBoolean(OExpression cexp, EvaluationContext ctx)
+ throws FaultException, EvaluationException {
+ return (Boolean) evaluate(cexp, ctx, XPathConstants.BOOLEAN);
+ }
+
+ /**
+ * Evaluate expression and return a number
+ *
+ * @param cexp cexp
+ * @param ctx ctx
+ *
+ * @return type
+ *
+ * @throws FaultException FaultException
+ * @throws EvaluationException EvaluationException
+ */
+ public Number evaluateAsNumber(OExpression cexp, EvaluationContext ctx)
+ throws FaultException, EvaluationException {
+ return (Number) evaluate(cexp, ctx, XPathConstants.NUMBER);
+ }
+
+ /**
+ *
+ * @see org.apache.ode.bpel.explang.ExpressionLanguageRuntime#evaluate(org.apache.ode.bpel.o.OExpression,
+ * org.apache.ode.bpel.explang.EvaluationContext)
+ */
+ public List evaluate(OExpression cexp, EvaluationContext ctx)
+ throws FaultException, EvaluationException {
+ List result;
+ Object someRes = evaluate(cexp, ctx, XPathConstants.NODESET);
+
+ if (someRes instanceof List) {
+ result = (List) someRes;
+ __log.debug("Returned list of size " + result.size());
+
+ if ((result.size() == 1) && !(result.get(0) instanceof Node)) {
+ // Dealing with a Java class
+ Object simpleType = result.get(0);
+
+ // Dates get a separate treatment as we don't want to call toString on them
+ String textVal;
+
+ if (simpleType instanceof Date) {
+ textVal = ISO8601DateParser.format((Date) simpleType);
+ } else if (simpleType instanceof DurationValue) {
+ textVal = ((DurationValue) simpleType).getStringValue();
+ } else {
+ textVal = simpleType.toString();
+ }
+
+ // Wrapping in a document
+ Document d = DOMUtils.newDocument();
+
+ // Giving our node a parent just in case it's an LValue expression
+ Element wrapper = d.createElement("wrapper");
+ Text text = d.createTextNode(textVal);
+ wrapper.appendChild(text);
+ d.appendChild(wrapper);
+ result = Collections.singletonList(text);
+ }
+ } else if (someRes instanceof NodeList) {
+ NodeList retVal = (NodeList) someRes;
+ __log.debug("Returned node list of size " + retVal.getLength());
+ result = new ArrayList(retVal.getLength());
+
+ for (int m = 0; m < retVal.getLength(); ++m) {
+ Node val = retVal.item(m);
+
+ if (val.getNodeType() == Node.DOCUMENT_NODE) {
+ val = ((Document) val).getDocumentElement();
+ }
+
+ result.add(val);
+ }
+ } else {
+ result = null;
+ }
+
+ return result;
+ }
+
+ /**
+ * Evaluate expression and return a node
+ *
+ * @param cexp cexp
+ * @param ctx ctx
+ *
+ * @return type
+ *
+ * @throws FaultException FaultException
+ * @throws EvaluationException EvaluationException
+ */
+ public Node evaluateNode(OExpression cexp, EvaluationContext ctx)
+ throws FaultException, EvaluationException {
+ List retVal = evaluate(cexp, ctx);
+
+ if (retVal.size() == 0) {
+ throw new FaultException(cexp.getOwner().constants.qnSelectionFailure,
+ "No results for expression: " + cexp);
+ }
+
+ if (retVal.size() > 1) {
+ throw new FaultException(cexp.getOwner().constants.qnSelectionFailure,
+ "Multiple results for expression: " + cexp);
+ }
+
+ return (Node) retVal.get(0);
+ }
+
+ /**
+ * Evaluate expression and return a date
+ *
+ * @param cexp cexp
+ * @param context context
+ *
+ * @return type
+ *
+ * @throws FaultException FaultException
+ * @throws EvaluationException EvaluationException
+ */
+ public Calendar evaluateAsDate(OExpression cexp, EvaluationContext context)
+ throws FaultException, EvaluationException {
+ List literal = DOMUtils.toList(evaluate(cexp, context,
+ XPathConstants.NODESET));
+
+ if (literal.size() == 0) {
+ throw new FaultException(cexp.getOwner().constants.qnSelectionFailure,
+ "No results for expression: " + cexp);
+ }
+
+ if (literal.size() > 1) {
+ throw new FaultException(cexp.getOwner().constants.qnSelectionFailure,
+ "Multiple results for expression: " + cexp);
+ }
+
+ Object date = literal.get(0);
+
+ if (date instanceof Calendar) {
+ return (Calendar) date;
+ }
+
+ if (date instanceof Date) {
+ Calendar cal = Calendar.getInstance();
+ cal.setTime((Date) date);
+
+ return cal;
+ }
+
+ if (date instanceof Element) {
+ date = ((Element) date).getTextContent();
+ }
+
+ try {
+ return ISO8601DateParser.parseCal(date.toString());
+ } catch (Exception ex) {
+ String errmsg = "Invalid date: " + literal;
+ __log.error(errmsg, ex);
+ throw new FaultException(cexp.getOwner().constants.qnInvalidExpressionValue,
+ errmsg);
+ }
+ }
+
+ /**
+ * Evaluate expression and return duration
+ *
+ * @param cexp cexp
+ * @param context context
+ *
+ * @return type
+ *
+ * @throws FaultException FaultException
+ * @throws EvaluationException EvaluationException
+ */
+ public Duration evaluateAsDuration(OExpression cexp,
+ EvaluationContext context) throws FaultException, EvaluationException {
+ String literal = this.evaluateAsString(cexp, context);
+
+ try {
+ return new Duration(literal);
+ } catch (Exception ex) {
+ String errmsg = "Invalid duration: " + literal;
+ __log.error(errmsg, ex);
+ throw new FaultException(cexp.getOwner().constants.qnInvalidExpressionValue,
+ errmsg);
+ }
+ }
+
+ /**
+ * Evaluate expression and return opaque type
+ *
+ * @param cexp cexp
+ * @param ctx ctx
+ * @param type type
+ *
+ * @return type
+ *
+ * @throws FaultException FaultException
+ * @throws EvaluationException EvaluationException
+ */
+ private Object evaluate(OExpression cexp, EvaluationContext ctx, QName type)
+ throws FaultException, EvaluationException {
+ try {
+ OXQuery10ExpressionBPEL20 oxquery10 = ((OXQuery10ExpressionBPEL20) cexp);
+
+ XQDataSource xqds = new SaxonXQDataSource();
+ XQConnection xqconn = xqds.getConnection();
+
+ Configuration configuration = ((SaxonXQConnection) xqconn).getConfiguration();
+ configuration.setAllNodesUntyped(true);
+ configuration.setHostLanguage(Configuration.XQUERY);
+
+ XQStaticContext staticEnv = xqconn.getStaticContext();
+
+ NSContext nsContext = oxquery10.namespaceCtx;
+ Set<String> prefixes = nsContext.getPrefixes();
+ for (String prefix : prefixes) {
+ String uri = nsContext.getNamespaceURI(prefix);
+ staticEnv.declareNamespace(prefix, uri);
+ }
+
+ configuration.setSchemaValidationMode(Validation.SKIP);
+ xqconn.setStaticContext(staticEnv);
+
+ // Prepare expression, for starters
+ String xquery = oxquery10.xquery.replaceFirst(
+ Constants.XQUERY_FUNCTION_HANDLER_COMPILER,
+ Constants.XQUERY_FUNCTION_HANDLER_RUNTIME);
+ XQPreparedExpression exp = xqconn.prepareExpression(xquery);
+
+ JaxpFunctionResolver funcResolver = new JaxpFunctionResolver(ctx,
+ oxquery10);
+ JaxpVariableResolver variableResolver = new JaxpVariableResolver(ctx,
+ oxquery10, configuration);
+ // Bind external variables to runtime values
+ for (QName variable : exp.getAllUnboundExternalVariables()) {
+ // Evaluate referenced variable
+ Object value = variableResolver.resolveVariable(variable);
+
+ // Figure out type of variable
+ XQSequenceType xqType = getItemType(xqconn, value);
+
+ // Saxon doesn't like binding sequences to variables
+ if (value instanceof Node) {
+ // a node is a node-list, but the inverse isn't true.
+ // so, if the value is truly a node, leave it alone.
+ } else if (value instanceof NodeList) {
+ // So extract the first item from the node list
+ NodeList nodeList = (NodeList) value;
+ ArrayList nodeArray = new ArrayList();
+ for (int i = 0; i < nodeList.getLength(); i++) {
+ nodeArray.add(nodeList.item(i));
+ }
+ value = xqconn.createSequence(nodeArray.iterator());
+ }
+
+
+ // Bind value with external variable
+ if (value != null && xqType != null) {
+ if (value instanceof XQSequence) {
+ exp.bindSequence(variable, (XQSequence) value);
+ } else {
+ if (xqType instanceof XQItemType) {
+ exp.bindObject(variable, value, (XQItemType) xqType);
+ }
+ }
+ }
+ }
+
+ // Set context node
+ Node contextNode = (ctx.getRootNode() == null)
+ ? DOMUtils.newDocument() : ctx.getRootNode();
+ contextNode.setUserData(XQuery10BpelFunctions.USER_DATA_KEY_FUNCTION_RESOLVER,
+ funcResolver, null);
+ exp.bindItem(XQConstants.CONTEXT_ITEM,
+ xqconn.createItemFromNode(contextNode, xqconn.createNodeType()));
+
+ // Execute query
+ XQResultSequence result = exp.executeQuery();
+
+ // Cast Saxon result to Java result
+ Object evalResult = getResultValue(type, result);
+
+ if ((evalResult != null) && __log.isDebugEnabled()) {
+ __log.debug("Expression " + cexp.toString() +
+ " generated result " + evalResult + " - type=" +
+ evalResult.getClass().getName());
+
+ if (ctx.getRootNode() != null) {
+ __log.debug("Was using context node " +
+ DOMUtils.domToString(ctx.getRootNode()));
+ }
+ }
+
+ return evalResult;
+ } catch (XQException xqe) {
+ // Extracting the real cause from all this wrapping isn't a simple task
+ Throwable cause = (xqe.getCause() != null) ? xqe.getCause() : xqe;
+
+ if (cause instanceof DynamicError) {
+ Throwable th = ((DynamicError) cause).getException();
+
+ if (th != null) {
+ cause = th;
+
+ if (cause.getCause() != null) {
+ cause = cause.getCause();
+ }
+ }
+ }
+
+ throw new EvaluationException(
+ "Error while executing an XQuery expression: " + cause.toString(), cause);
+ } catch (WrappedResolverException wre) {
+ __log.debug("Could not evaluate expression because of ", wre);
+ throw (FaultException) wre.getCause();
+ }
+ }
+
+ /**
+ * Return opaque object embedded in XQuery Item
+ *
+ * @param item item
+ *
+ * @return type
+ *
+ * @throws XQException XQException
+ */
+ private Object getItemValue(XQItem item) throws XQException {
+ XQItemType itemType = item.getItemType();
+ Object itemValue = null;
+
+ switch (itemType.getBaseType()) {
+ case XQItemType.XQBASETYPE_BOOLEAN:
+ itemValue = item.getBoolean();
+
+ break;
+
+ case XQItemType.XQBASETYPE_DECIMAL:
+ itemValue = item.getDouble();
+
+ break;
+
+ case XQItemType.XQBASETYPE_BYTE:
+ itemValue = item.getByte();
+
+ break;
+
+ case XQItemType.XQBASETYPE_FLOAT:
+ itemValue = item.getFloat();
+
+ break;
+
+ case XQItemType.XQBASETYPE_INT:
+ case XQItemType.XQBASETYPE_INTEGER:
+ itemValue = item.getInt();
+
+ break;
+
+ case XQItemType.XQBASETYPE_LONG:
+ itemValue = item.getLong();
+
+ break;
+
+ case XQItemType.XQBASETYPE_ANYTYPE:
+ itemValue = item.getNode();
+
+ break;
+
+ case XQItemType.XQBASETYPE_ANYURI:
+ itemValue = item.getNodeUri();
+
+ break;
+
+ case XQItemType.XQBASETYPE_SHORT:
+ itemValue = item.getShort();
+
+ break;
+
+ case XQItemType.XQBASETYPE_STRING:
+ case XQItemType.XQBASETYPE_ANYATOMICTYPE:
+ itemValue = item.getAtomicValue();
+
+ break;
+
+ }
+
+ return itemValue;
+ }
+
+ /**
+ * Return XQuery type corresponding to given value
+ *
+ * @param xqconn XQuery connection
+ * @param value value
+ *
+ * @return type
+ *
+ * @throws XQException XQException
+ */
+ private XQSequenceType getItemType(XQConnection xqconn, Object value) throws XQException {
+ XQSequenceType xqType = null;
+ if (value instanceof Long) {
+ xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_LONG);
+ } else if (value instanceof String) {
+ xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_STRING);
+ } else if (value instanceof Boolean) {
+ xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_BOOLEAN);
+ } else if (value instanceof Date) {
+ xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_DATETIME);
+ } else if (value instanceof BigDecimal) {
+ xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_DECIMAL);
+ } else if (value instanceof Float) {
+ xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_FLOAT);
+ } else if (value instanceof URI) {
+ xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_ANYURI);
+ } else if (value instanceof QName) {
+ xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_QNAME);
+ } else if (value instanceof BigInteger) {
+ xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_INT);
+ } else if (value instanceof Integer) {
+ xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_INTEGER);
+ } else if (value instanceof Double) {
+ xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_DOUBLE);
+ } else if (value instanceof Byte) {
+ xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_BYTE);
+ } else if (value instanceof Node) {
+ xqType = xqconn.createNodeType();
+ } else if (value instanceof NodeList || value instanceof XQSequence) {
+ XQItemType xqItemType = xqconn.createNodeType();
+ xqType = xqconn.createSequenceType(xqItemType, XQSequenceType.OCC_ZERO_OR_MORE);
+ }
+ return xqType;
+ }
+
+ /**
+ * Cast XQuery sequence into an opaque list
+ *
+ * @param type type
+ * @param result result
+ *
+ * @return value
+ *
+ * @throws XQException XQException
+ */
+ private Object getResultValue(QName type, XQResultSequence result) throws XQException {
+ Document document = DOMUtils.newDocument();
+ Object resultValue = null;
+ if (XPathConstants.NODESET.equals(type)) {
+ List list = new ArrayList();
+
+ while (result.next()) {
+ Object itemValue = getItemValue(result.getItem());
+ if (itemValue instanceof Document) {
+ itemValue = DOMUtils.cloneNode(document, ((Document) itemValue).getDocumentElement());
+ } else if (itemValue instanceof Node) {
+ itemValue = DOMUtils.cloneNode(document, (Node) itemValue);
+ }
+
+ if (itemValue != null) {
+ list.add(itemValue);
+ }
+ }
+
+ resultValue = list;
+ } else if (XPathConstants.NODE.equals(type)) {
+ XQItem item = null;
+ if (result.count() > 0) {
+ result.first();
+ if (result.isOnItem()) {
+ item = result.getItem();
+ }
+ }
+ if (item != null) {
+ resultValue = getItemValue(item);
+ if (resultValue instanceof Node) {
+ resultValue = DOMUtils.cloneNode(document, (Node) resultValue);
+ }
+ }
+ } else if (XPathConstants.STRING.equals(type)) {
+ resultValue = result.getSequenceAsString(new Properties());
+ } else if (XPathConstants.NUMBER.equals(type)) {
+ resultValue = result.getSequenceAsString(new Properties());
+ resultValue = Integer.parseInt((String) resultValue);
+ } else if (XPathConstants.BOOLEAN.equals(type)) {
+ resultValue = result.getSequenceAsString(new Properties());
+ resultValue = Boolean.parseBoolean((String) resultValue);
+ }
+ return resultValue;
+ }
+}
Modified: branches/ODE/ODE-1.x/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/MexDaoUtil.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/MexDaoUtil.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/MexDaoUtil.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -17,46 +17,46 @@
* under the License.
*/
-package org.apache.ode.bpel.engine;
-
-import javax.xml.namespace.QName;
-
-import org.apache.ode.bpel.dao.MessageDAO;
-import org.apache.ode.bpel.dao.MessageExchangeDAO;
-import org.apache.ode.bpel.iapi.Message;
-import org.apache.ode.bpel.iapi.MessageExchange;
-import org.apache.ode.bpel.iapi.MessageExchange.FailureType;
-import org.apache.ode.bpel.iapi.MessageExchange.Status;
-import org.w3c.dom.Element;
-
-/**
- * Some handy utilities methods for dealing with MEX impls.
- *
- */
-class MexDaoUtil {
-
- static void setFailed(MessageExchangeImpl mex, FailureType ftype, String explanation) {
- mex.setStatus(Status.FAILURE);
- mex.setFaultExplanation(explanation);
- mex.setFailure(ftype, explanation, null);
- }
-
- static void setFaulted(MessageExchangeImpl mex, QName faultType, Element faultmsg) {
- mex.setStatus(Status.FAULT);
- Message flt = mex.createMessage(faultType);
- flt.setMessage(faultmsg);
- mex.setFault(faultType, flt);
- }
-
- static void setResponse(MessageExchangeImpl mex, QName responseType, Element response) {
- mex.setStatus(Status.RESPONSE);
- mex.setFault(null, null);
- Message resp = mex.createMessage(responseType);
- resp.setMessage(response);
- mex.setResponse(resp);
- }
-
- public static void setFailure(PartnerRoleMessageExchangeImpl mex, FailureType type, String description, Element details) {
- mex.replyWithFailure(type, description, details);
- }
-}
+package org.apache.ode.bpel.engine;
+
+import javax.xml.namespace.QName;
+
+import org.apache.ode.bpel.dao.MessageDAO;
+import org.apache.ode.bpel.dao.MessageExchangeDAO;
+import org.apache.ode.bpel.iapi.Message;
+import org.apache.ode.bpel.iapi.MessageExchange;
+import org.apache.ode.bpel.iapi.MessageExchange.FailureType;
+import org.apache.ode.bpel.iapi.MessageExchange.Status;
+import org.w3c.dom.Element;
+
+/**
+ * Some handy utilities methods for dealing with MEX impls.
+ *
+ */
+class MexDaoUtil {
+
+ static void setFailed(MessageExchangeImpl mex, FailureType ftype, String explanation) {
+ mex.setStatus(Status.FAILURE);
+ mex.setFaultExplanation(explanation);
+ mex.setFailure(ftype, explanation, null);
+ }
+
+ static void setFaulted(MessageExchangeImpl mex, QName faultType, Element faultmsg) {
+ mex.setStatus(Status.FAULT);
+ Message flt = mex.createMessage(faultType);
+ flt.setMessage(faultmsg);
+ mex.setFault(faultType, flt);
+ }
+
+ static void setResponse(MessageExchangeImpl mex, QName responseType, Element response) {
+ mex.setStatus(Status.RESPONSE);
+ mex.setFault(null, null);
+ Message resp = mex.createMessage(responseType);
+ resp.setMessage(response);
+ mex.setResponse(resp);
+ }
+
+ public static void setFailure(PartnerRoleMessageExchangeImpl mex, FailureType type, String description, Element details) {
+ mex.replyWithFailure(type, description, details);
+ }
+}
Modified: branches/ODE/ODE-1.x/bpel-runtime/src/main/java/org/apache/ode/bpel/intercept/InstanceCountThrottler.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-runtime/src/main/java/org/apache/ode/bpel/intercept/InstanceCountThrottler.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-runtime/src/main/java/org/apache/ode/bpel/intercept/InstanceCountThrottler.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,42 +1,42 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.ode.bpel.intercept;
-
-import org.apache.ode.bpel.iapi.MyRoleMessageExchange;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-import javax.xml.namespace.QName;
-import java.util.Map;
-
-/**
- * An example of a simple interceptor providing a "throttling" capability - that is an
- * ability to limit the number of instances created for a given process.
- *
- * @author Maciej Szefler
- */
-public class InstanceCountThrottler extends NoOpInterceptor {
-
- @Override
- public void onNewInstanceInvoked(MyRoleMessageExchange mex,
- InterceptorContext ic) throws FailMessageExchangeException {
- if (ic.getProcessDAO().getNumInstances() >= ic.getBpelProcess().getInstanceMaximumCount())
- throw new FailMessageExchangeException("Too many instances.");
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.intercept;
+
+import org.apache.ode.bpel.iapi.MyRoleMessageExchange;
+import org.w3c.dom.Node;
+import org.w3c.dom.Text;
+
+import javax.xml.namespace.QName;
+import java.util.Map;
+
+/**
+ * An example of a simple interceptor providing a "throttling" capability - that is an
+ * ability to limit the number of instances created for a given process.
+ *
+ * @author Maciej Szefler
+ */
+public class InstanceCountThrottler extends NoOpInterceptor {
+
+ @Override
+ public void onNewInstanceInvoked(MyRoleMessageExchange mex,
+ InterceptorContext ic) throws FailMessageExchangeException {
+ if (ic.getProcessDAO().getNumInstances() >= ic.getBpelProcess().getInstanceMaximumCount())
+ throw new FailMessageExchangeException("Too many instances.");
+ }
+}
Modified: branches/ODE/ODE-1.x/bpel-runtime/src/main/java/org/apache/ode/bpel/intercept/ProcessCountThrottler.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-runtime/src/main/java/org/apache/ode/bpel/intercept/ProcessCountThrottler.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-runtime/src/main/java/org/apache/ode/bpel/intercept/ProcessCountThrottler.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,41 +1,41 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.ode.bpel.intercept;
-
-import org.apache.ode.bpel.iapi.MyRoleMessageExchange;
-import org.apache.ode.bpel.runtime.InvalidProcessException;
-
-/**
- * An example of a simple interceptor providing a "throttling" capability - that is an
- * ability to limit the size of processes created in a server.
- */
-public class ProcessCountThrottler extends NoOpInterceptor {
-
- @Override
- public void onJobScheduled(MyRoleMessageExchange mex,
- InterceptorContext ic) throws FailMessageExchangeException,
- FaultMessageExchangeException {
- while (ic.getBpelEngine().getHydratedProcessCount(ic.getBpelProcess().getPID()) > ic.getBpelEngine().getProcessThrottledMaximumCount()) {
- if (!ic.getBpelEngine().dehydrateLastUnusedProcess()) {
- mex.setProperty("causeCode", String.valueOf(InvalidProcessException.TOO_MANY_PROCESSES_CAUSE_CODE));
- throw new FailMessageExchangeException("The number of processes in-use is more than the upper limit (" + ic.getBpelEngine().getProcessThrottledMaximumCount() + ")");
- }
- }
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.intercept;
+
+import org.apache.ode.bpel.iapi.MyRoleMessageExchange;
+import org.apache.ode.bpel.runtime.InvalidProcessException;
+
+/**
+ * An example of a simple interceptor providing a "throttling" capability - that is an
+ * ability to limit the size of processes created in a server.
+ */
+public class ProcessCountThrottler extends NoOpInterceptor {
+
+ @Override
+ public void onJobScheduled(MyRoleMessageExchange mex,
+ InterceptorContext ic) throws FailMessageExchangeException,
+ FaultMessageExchangeException {
+ while (ic.getBpelEngine().getHydratedProcessCount(ic.getBpelProcess().getPID()) > ic.getBpelEngine().getProcessThrottledMaximumCount()) {
+ if (!ic.getBpelEngine().dehydrateLastUnusedProcess()) {
+ mex.setProperty("causeCode", String.valueOf(InvalidProcessException.TOO_MANY_PROCESSES_CAUSE_CODE));
+ throw new FailMessageExchangeException("The number of processes in-use is more than the upper limit (" + ic.getBpelEngine().getProcessThrottledMaximumCount() + ")");
+ }
+ }
+ }
+}
Modified: branches/ODE/ODE-1.x/bpel-runtime/src/main/java/org/apache/ode/bpel/intercept/ProcessSizeThrottler.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-runtime/src/main/java/org/apache/ode/bpel/intercept/ProcessSizeThrottler.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-runtime/src/main/java/org/apache/ode/bpel/intercept/ProcessSizeThrottler.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,41 +1,41 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.ode.bpel.intercept;
-
-import org.apache.ode.bpel.iapi.MyRoleMessageExchange;
-import org.apache.ode.bpel.runtime.InvalidProcessException;
-
-/**
- * An example of a simple interceptor providing a "throttling" capability - that is an
- * ability to limit the size of processes created in a server.
- */
-public class ProcessSizeThrottler extends NoOpInterceptor {
-
- @Override
- public void onJobScheduled(MyRoleMessageExchange mex,
- InterceptorContext ic) throws FailMessageExchangeException,
- FaultMessageExchangeException {
- while (ic.getBpelEngine().getHydratedProcessSize(ic.getBpelProcess().getPID()) > ic.getBpelEngine().getProcessThrottledMaximumSize()) {
- if (!ic.getBpelEngine().dehydrateLastUnusedProcess()) {
- mex.setProperty("causeCode", String.valueOf(InvalidProcessException.TOO_HUGE_PROCESSES_CAUSE_CODE));
- throw new FailMessageExchangeException("The size of all running processes is more than the upper limit (" + ic.getBpelEngine().getProcessThrottledMaximumSize() + ")");
- }
- }
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.intercept;
+
+import org.apache.ode.bpel.iapi.MyRoleMessageExchange;
+import org.apache.ode.bpel.runtime.InvalidProcessException;
+
+/**
+ * An example of a simple interceptor providing a "throttling" capability - that is an
+ * ability to limit the size of processes created in a server.
+ */
+public class ProcessSizeThrottler extends NoOpInterceptor {
+
+ @Override
+ public void onJobScheduled(MyRoleMessageExchange mex,
+ InterceptorContext ic) throws FailMessageExchangeException,
+ FaultMessageExchangeException {
+ while (ic.getBpelEngine().getHydratedProcessSize(ic.getBpelProcess().getPID()) > ic.getBpelEngine().getProcessThrottledMaximumSize()) {
+ if (!ic.getBpelEngine().dehydrateLastUnusedProcess()) {
+ mex.setProperty("causeCode", String.valueOf(InvalidProcessException.TOO_HUGE_PROCESSES_CAUSE_CODE));
+ throw new FailMessageExchangeException("The size of all running processes is more than the upper limit (" + ic.getBpelEngine().getProcessThrottledMaximumSize() + ")");
+ }
+ }
+ }
+}
Modified: branches/ODE/ODE-1.x/bpel-test/src/main/java/org/apache/ode/test/MessageExchangeContextImpl.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-test/src/main/java/org/apache/ode/test/MessageExchangeContextImpl.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-test/src/main/java/org/apache/ode/test/MessageExchangeContextImpl.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,170 +1,170 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.test;
-
-import java.io.IOException;
-
-import javax.xml.namespace.QName;
-
-import org.apache.ode.bpel.iapi.BpelEngineException;
-import org.apache.ode.bpel.iapi.ContextException;
-import org.apache.ode.bpel.iapi.Message;
-import org.apache.ode.bpel.iapi.MessageExchangeContext;
-import org.apache.ode.bpel.iapi.MyRoleMessageExchange;
-import org.apache.ode.bpel.iapi.PartnerRoleMessageExchange;
-import org.apache.ode.bpel.iapi.MessageExchange.Status;
-import org.apache.ode.utils.DOMUtils;
-import org.w3c.dom.Element;
-import org.xml.sax.SAXException;
-
-/**
- * This is a simple MessageExchangeContext implementation
- * that only supports a set of "well known" portTypes used
- * for testing.
- *
- *
- */
-public class MessageExchangeContextImpl implements MessageExchangeContext {
-
- private static final String PROBE_NS = "http://ode/bpel/unit-test/ProbeService.wsdl";
- private static final String FAULT_NS = "http://ode/bpel/unit-test/FaultService.wsdl";
-
- // Probe Service is a simple concatination service
- private static final QName probePT = new QName(PROBE_NS,"probeMessagePT");
- private static final QName faultPT = new QName(FAULT_NS,"faultMessagePT");
-
- private Message currentResponse;
-
- public void invokePartner(PartnerRoleMessageExchange mex)
- throws ContextException {
- QName calledPT = mex.getPortType().getQName();
-
- if (calledPT.equals(probePT)) {
- invokeProbeService(mex);
- }
-
- if (calledPT.equals(faultPT)) {
- invokeFaultService(mex);
- }
-
- }
-
- public void onAsyncReply(MyRoleMessageExchange myRoleMex)
- throws BpelEngineException {
- Status mStat = myRoleMex.getStatus();
- if ( mStat == Status.RESPONSE ) {
- currentResponse = myRoleMex.getResponse();
- }
- myRoleMex.complete();
- }
-
- private void invokeProbeService(PartnerRoleMessageExchange prmx) {
- Message msg = prmx.getRequest();
- Element elm1 = prmx.getRequest().getPart("probeName");
- Element elm2 = prmx.getRequest().getPart("probeData");
-
- if ( elm1 != null && elm2 != null ) {
- String cat = elm2.getTextContent()+" -> "+elm1.getTextContent();
- elm2.setTextContent(cat);
- msg.setPart("probeData", elm2);
- final Message response = prmx.createMessage(prmx.getOperation().getOutput().getMessage().getQName());
-
- response.setMessage(msg.getMessage());
- prmx.reply(response);
- }
- }
-
- private void invokeFaultService(PartnerRoleMessageExchange prmx) {
- QName errorMsgType = new QName(FAULT_NS,"errorMessage");
- QName responseMsgType = new QName(FAULT_NS,"faultMessage");
- Message faultMsg = prmx.createMessage(errorMsgType);
- Message responseMsg = prmx.createMessage(responseMsgType);
-
- String ind1 = prmx.getRequest().getPart("faultIndicator1").getTextContent();
- String ind2 = prmx.getRequest().getPart("faultIndicator2").getTextContent();
- String inputData = prmx.getRequest().getPart("faultData").getTextContent();
-
- StringBuffer faultData = new StringBuffer("<message><errorID>FA-1</errorID><errorText>");
- faultData.append(inputData);
- faultData.append("</errorText></message>");
-
- StringBuffer responseData = new StringBuffer("<message><faultName>FA-NoFault</faultName><faultData>");
- responseData.append(inputData);
- responseData.append("</faultData></message>");
-
-
- Element faultResponse = null;
- Element response = null;
- try {
- faultResponse = DOMUtils.stringToDOM(faultData.toString());
- response = DOMUtils.stringToDOM(responseData.toString());
- } catch (SAXException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
-
- // TODO: Question - how does one set parts that are of a simple xsd type?
- faultMsg.setMessage(faultResponse);
- responseMsg.setMessage(response);
-
- if ( ind1.equals("yes")){
- prmx.replyWithFault(new QName(FAULT_NS,"FaultMessage1"), faultMsg);
- } else {
- if ( ind2.equals("yes")){
- prmx.replyWithFault(new QName(FAULT_NS,"FaultMessage2"), faultMsg);
- } else {
- prmx.replyWithFault(new QName(FAULT_NS,"UnKnownFault"), faultMsg);
- }
- }
-
- }
-
- public Message getCurrentResponse() {
- return currentResponse;
- }
-
- public void clearCurrentResponse() {
- currentResponse = null;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.test;
+
+import java.io.IOException;
+
+import javax.xml.namespace.QName;
+
+import org.apache.ode.bpel.iapi.BpelEngineException;
+import org.apache.ode.bpel.iapi.ContextException;
+import org.apache.ode.bpel.iapi.Message;
+import org.apache.ode.bpel.iapi.MessageExchangeContext;
+import org.apache.ode.bpel.iapi.MyRoleMessageExchange;
+import org.apache.ode.bpel.iapi.PartnerRoleMessageExchange;
+import org.apache.ode.bpel.iapi.MessageExchange.Status;
+import org.apache.ode.utils.DOMUtils;
+import org.w3c.dom.Element;
+import org.xml.sax.SAXException;
+
+/**
+ * This is a simple MessageExchangeContext implementation
+ * that only supports a set of "well known" portTypes used
+ * for testing.
+ *
+ *
+ */
+public class MessageExchangeContextImpl implements MessageExchangeContext {
+
+ private static final String PROBE_NS = "http://ode/bpel/unit-test/ProbeService.wsdl";
+ private static final String FAULT_NS = "http://ode/bpel/unit-test/FaultService.wsdl";
+
+ // Probe Service is a simple concatination service
+ private static final QName probePT = new QName(PROBE_NS,"probeMessagePT");
+ private static final QName faultPT = new QName(FAULT_NS,"faultMessagePT");
+
+ private Message currentResponse;
+
+ public void invokePartner(PartnerRoleMessageExchange mex)
+ throws ContextException {
+ QName calledPT = mex.getPortType().getQName();
+
+ if (calledPT.equals(probePT)) {
+ invokeProbeService(mex);
+ }
+
+ if (calledPT.equals(faultPT)) {
+ invokeFaultService(mex);
+ }
+
+ }
+
+ public void onAsyncReply(MyRoleMessageExchange myRoleMex)
+ throws BpelEngineException {
+ Status mStat = myRoleMex.getStatus();
+ if ( mStat == Status.RESPONSE ) {
+ currentResponse = myRoleMex.getResponse();
+ }
+ myRoleMex.complete();
+ }
+
+ private void invokeProbeService(PartnerRoleMessageExchange prmx) {
+ Message msg = prmx.getRequest();
+ Element elm1 = prmx.getRequest().getPart("probeName");
+ Element elm2 = prmx.getRequest().getPart("probeData");
+
+ if ( elm1 != null && elm2 != null ) {
+ String cat = elm2.getTextContent()+" -> "+elm1.getTextContent();
+ elm2.setTextContent(cat);
+ msg.setPart("probeData", elm2);
+ final Message response = prmx.createMessage(prmx.getOperation().getOutput().getMessage().getQName());
+
+ response.setMessage(msg.getMessage());
+ prmx.reply(response);
+ }
+ }
+
+ private void invokeFaultService(PartnerRoleMessageExchange prmx) {
+ QName errorMsgType = new QName(FAULT_NS,"errorMessage");
+ QName responseMsgType = new QName(FAULT_NS,"faultMessage");
+ Message faultMsg = prmx.createMessage(errorMsgType);
+ Message responseMsg = prmx.createMessage(responseMsgType);
+
+ String ind1 = prmx.getRequest().getPart("faultIndicator1").getTextContent();
+ String ind2 = prmx.getRequest().getPart("faultIndicator2").getTextContent();
+ String inputData = prmx.getRequest().getPart("faultData").getTextContent();
+
+ StringBuffer faultData = new StringBuffer("<message><errorID>FA-1</errorID><errorText>");
+ faultData.append(inputData);
+ faultData.append("</errorText></message>");
+
+ StringBuffer responseData = new StringBuffer("<message><faultName>FA-NoFault</faultName><faultData>");
+ responseData.append(inputData);
+ responseData.append("</faultData></message>");
+
+
+ Element faultResponse = null;
+ Element response = null;
+ try {
+ faultResponse = DOMUtils.stringToDOM(faultData.toString());
+ response = DOMUtils.stringToDOM(responseData.toString());
+ } catch (SAXException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+
+ // TODO: Question - how does one set parts that are of a simple xsd type?
+ faultMsg.setMessage(faultResponse);
+ responseMsg.setMessage(response);
+
+ if ( ind1.equals("yes")){
+ prmx.replyWithFault(new QName(FAULT_NS,"FaultMessage1"), faultMsg);
+ } else {
+ if ( ind2.equals("yes")){
+ prmx.replyWithFault(new QName(FAULT_NS,"FaultMessage2"), faultMsg);
+ } else {
+ prmx.replyWithFault(new QName(FAULT_NS,"UnKnownFault"), faultMsg);
+ }
+ }
+
+ }
+
+ public Message getCurrentResponse() {
+ return currentResponse;
+ }
+
+ public void clearCurrentResponse() {
+ currentResponse = null;
+ }
+
+}
Modified: branches/ODE/ODE-1.x/bpel-test/src/main/java/org/apache/ode/test/PartnerRoleChannelImpl.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-test/src/main/java/org/apache/ode/test/PartnerRoleChannelImpl.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-test/src/main/java/org/apache/ode/test/PartnerRoleChannelImpl.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,68 +1,68 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.ode.test;
-
-import org.apache.ode.bpel.iapi.EndpointReference;
-import org.apache.ode.bpel.iapi.PartnerRoleChannel;
-import org.apache.ode.utils.DOMUtils;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class PartnerRoleChannelImpl implements PartnerRoleChannel {
-
- public PartnerRoleChannelImpl() {
-
- }
-
- public void close() {
-
- }
-
- public EndpointReference getInitialEndpointReference() {
- final Document doc = DOMUtils.newDocument();
- Element serviceref = doc.createElementNS(EndpointReference.SERVICE_REF_QNAME.getNamespaceURI(),
- EndpointReference.SERVICE_REF_QNAME.getLocalPart());
- doc.appendChild(serviceref);
- return new EndpointReference() {
- public Document toXML() {
- return doc;
- }
- };
- }
-}
-
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.test;
+
+import org.apache.ode.bpel.iapi.EndpointReference;
+import org.apache.ode.bpel.iapi.PartnerRoleChannel;
+import org.apache.ode.utils.DOMUtils;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+public class PartnerRoleChannelImpl implements PartnerRoleChannel {
+
+ public PartnerRoleChannelImpl() {
+
+ }
+
+ public void close() {
+
+ }
+
+ public EndpointReference getInitialEndpointReference() {
+ final Document doc = DOMUtils.newDocument();
+ Element serviceref = doc.createElementNS(EndpointReference.SERVICE_REF_QNAME.getNamespaceURI(),
+ EndpointReference.SERVICE_REF_QNAME.getLocalPart());
+ doc.appendChild(serviceref);
+ return new EndpointReference() {
+ public Document toXML() {
+ return doc;
+ }
+ };
+ }
+}
+
Modified: branches/ODE/ODE-1.x/bpel-test/src/test/java/org/apache/ode/test/DataHandling20Test.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-test/src/test/java/org/apache/ode/test/DataHandling20Test.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-test/src/test/java/org/apache/ode/test/DataHandling20Test.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,128 +1,128 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.ode.test;
-
-import org.junit.Test;
-
-public class DataHandling20Test extends BPELTestAbstract {
- @Test
- public void testComposeUrl() throws Throwable {
- go("/bpel/2.0/TestComposeUrl");
- }
-
- @Test
- public void testCombineUrl() throws Throwable {
- go("/bpel/2.0/TestCombineUrl");
- }
-
- @Test
- public void testExpandTemplate() throws Throwable {
- go("/bpel/2.0/TestExpandTemplate");
- }
-
- @Test
- public void testXPathNamespace1() throws Throwable {
- go("/bpel/2.0/TestXPathNamespace1");
- }
-
- @Test
- public void testXPathNamespace2() throws Throwable {
- go("/bpel/2.0/TestXPathNamespace2");
- }
-
- @Test
- public void testToQuery() throws Throwable {
- go("/bpel/2.0/TestToQuery");
- }
-
- @Test
- public void testSubTreeAssign() throws Throwable {
- go("/bpel/2.0/TestSubTreeAssign");
- }
-
- @Test
- public void testAssignActivity1() throws Throwable {
- go("/bpel/2.0/TestAssignActivity1");
- }
-
- @Test
- public void testAssignActivity2() throws Throwable {
- go("/bpel/2.0/TestAssignActivity2");
- }
-
- @Test
- public void testAssignComplex() throws Throwable {
- go("/bpel/2.0/TestAssignComplex");
- }
-
- @Test
- public void testSimpleTypeParts() throws Throwable {
- go("/bpel/2.0/TestSimpleTypeParts");
- }
-
- @Test
- public void testSimpleVariableType() throws Throwable {
- go("/bpel/2.0/TestSimpleVariableType");
- }
-
- @Test
- public void testXslTransform() throws Throwable {
- go("/bpel/2.0/TestXslTransform");
- }
-
- @Test
- public void testSplit() throws Throwable {
- go("/bpel/2.0/TestSplit");
- }
-
- @Test
- public void testCounter() throws Throwable {
- go("/bpel/2.0/TestCounter");
- }
-
- @Test
- public void testDate() throws Throwable {
- go("/bpel/2.0/TestAssignDate");
- }
-
- @Test
- public void testMsgDate() throws Throwable {
- go("/bpel/2.0/TestMsgDate");
- }
-
- @Test
- public void testDuration() throws Throwable {
- go("/bpel/2.0/TestDuration");
- }
-
- @Test
- public void testAssignMissingData() throws Throwable {
- go("/bpel/2.0/TestAssignMissingData");
- }
-
- @Test
- public void testXQueryExpression() throws Throwable {
- go("/bpel/2.0/TestXQueryExpression");
- }
-
- @Test
- public void testInsertMissingData() throws Throwable {
- go("/bpel/2.0/TestInsertMissingData");
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.test;
+
+import org.junit.Test;
+
+public class DataHandling20Test extends BPELTestAbstract {
+ @Test
+ public void testComposeUrl() throws Throwable {
+ go("/bpel/2.0/TestComposeUrl");
+ }
+
+ @Test
+ public void testCombineUrl() throws Throwable {
+ go("/bpel/2.0/TestCombineUrl");
+ }
+
+ @Test
+ public void testExpandTemplate() throws Throwable {
+ go("/bpel/2.0/TestExpandTemplate");
+ }
+
+ @Test
+ public void testXPathNamespace1() throws Throwable {
+ go("/bpel/2.0/TestXPathNamespace1");
+ }
+
+ @Test
+ public void testXPathNamespace2() throws Throwable {
+ go("/bpel/2.0/TestXPathNamespace2");
+ }
+
+ @Test
+ public void testToQuery() throws Throwable {
+ go("/bpel/2.0/TestToQuery");
+ }
+
+ @Test
+ public void testSubTreeAssign() throws Throwable {
+ go("/bpel/2.0/TestSubTreeAssign");
+ }
+
+ @Test
+ public void testAssignActivity1() throws Throwable {
+ go("/bpel/2.0/TestAssignActivity1");
+ }
+
+ @Test
+ public void testAssignActivity2() throws Throwable {
+ go("/bpel/2.0/TestAssignActivity2");
+ }
+
+ @Test
+ public void testAssignComplex() throws Throwable {
+ go("/bpel/2.0/TestAssignComplex");
+ }
+
+ @Test
+ public void testSimpleTypeParts() throws Throwable {
+ go("/bpel/2.0/TestSimpleTypeParts");
+ }
+
+ @Test
+ public void testSimpleVariableType() throws Throwable {
+ go("/bpel/2.0/TestSimpleVariableType");
+ }
+
+ @Test
+ public void testXslTransform() throws Throwable {
+ go("/bpel/2.0/TestXslTransform");
+ }
+
+ @Test
+ public void testSplit() throws Throwable {
+ go("/bpel/2.0/TestSplit");
+ }
+
+ @Test
+ public void testCounter() throws Throwable {
+ go("/bpel/2.0/TestCounter");
+ }
+
+ @Test
+ public void testDate() throws Throwable {
+ go("/bpel/2.0/TestAssignDate");
+ }
+
+ @Test
+ public void testMsgDate() throws Throwable {
+ go("/bpel/2.0/TestMsgDate");
+ }
+
+ @Test
+ public void testDuration() throws Throwable {
+ go("/bpel/2.0/TestDuration");
+ }
+
+ @Test
+ public void testAssignMissingData() throws Throwable {
+ go("/bpel/2.0/TestAssignMissingData");
+ }
+
+ @Test
+ public void testXQueryExpression() throws Throwable {
+ go("/bpel/2.0/TestXQueryExpression");
+ }
+
+ @Test
+ public void testInsertMissingData() throws Throwable {
+ go("/bpel/2.0/TestInsertMissingData");
+ }
+}
Modified: branches/ODE/ODE-1.x/bpel-test/src/test/java/org/apache/ode/test/MessageRouting20Test.java
===================================================================
--- branches/ODE/ODE-1.x/bpel-test/src/test/java/org/apache/ode/test/MessageRouting20Test.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/bpel-test/src/test/java/org/apache/ode/test/MessageRouting20Test.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,131 +1,131 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.ode.test;
-
-import org.junit.Ignore;
-import org.junit.Test;
-
-public class MessageRouting20Test extends BPELTestAbstract {
-
- @Test public void testCorrelation() throws Throwable {
- go("/bpel/2.0/TestCorrelation");
- }
-
- @Test public void testCorrelation1() throws Throwable {
- go("/bpel/2.0/TestCorrelation1");
- }
-
- @Test public void testCorrelationJoin() throws Throwable {
- go("/bpel/2.0/TestCorrelationJoin");
- }
-
- @Test public void testCorrelationJoinReceive() throws Throwable {
- go("/bpel/2.0/TestCorrelationJoinReceive");
- }
-
- @Test public void testCorrelationJoinInvoke() throws Throwable {
- go("/bpel/2.0/TestCorrelationJoinInvoke");
- }
-
- @Test public void testCorrelationJoinOnMessage() throws Throwable {
- go("/bpel/2.0/TestCorrelationJoinOnMessage");
- }
-
- @Test public void testCorrelationJoinEvent() throws Throwable {
- go("/bpel/2.0/TestCorrelationJoinEvent");
- }
-
- @Test public void testCorrelationJoinReply() throws Throwable {
- go("/bpel/2.0/TestCorrelationJoinReply");
- }
-
- @Test public void testCorrelationMulti() throws Throwable {
- go("/bpel/2.0/TestCorrelationMulti");
- }
-
- @Test public void testCorrelationMultiNegative() throws Throwable {
- go("/bpel/2.0/TestCorrelationMultiNegative");
- }
-
- @Test public void testCorrelationMultiJoin() throws Throwable {
- go("/bpel/2.0/TestCorrelationMultiJoin");
- }
-
- @Test public void testCorrelationMultiComplex() throws Throwable {
- go("/bpel/2.0/TestCorrelationMultiComplex");
- }
-
- @Ignore("fix test bed for handling ASYNC mex") @Test public void testCorrelationOpaque() throws Throwable {
- //TODO Fix me, we need to capture the session id to send it in the second test message
- go("/bpel/2.0/TestCorrelationOpaque");
- }
-
- @Test public void testDynamicPick() throws Throwable {
- go("/bpel/2.0/TestDynamicPick");
- }
-
- @Test public void testInstPick() throws Throwable {
- go("/bpel/2.0/TestInstantiatingPick");
- }
-
- @Test public void testStaticOnMessage() throws Throwable {
- go("/bpel/2.0/TestStaticOnMessage");
- }
-
- @Test public void testStaticPick() throws Throwable {
- go("/bpel/2.0/TestStaticPick");
- }
-
- @Ignore("fix test bed for handling ASYNC mex") @Test public void testNegativeCorrelation() throws Throwable {
- /**
- * This test contains invalid BPEL. There is an instantiating
- * <receive> and a subsequent <pick> that does not define a correlation
- * key. The BPEL compiler should throw an exception indicating
- * the BPEL code error ( verify with spec ).
- *
- * See JIRA ODE-64
- *
- */
- // TODO fix the bug first
- negative("target/test-classes/bpel/2.0/NegativeCorrelationTest");
- }
-
- @Test @Ignore("fix test bed for handling ASYNC mex") public void testNegativeInitialization() throws Throwable {
- /**
- * This test contains invalid BPEL. There is an instantiating
- * <receive> within a <scope>. The <scope> contains eventhandlers
- * that reference the correlation set found on the receive. The BPEL
- * compiler should throw an exception indicating
- * the BPEL error ( verify with spec ) or at runtime
- * a clear initialization exception should be thrown.
- *
- * See JIRA ODE-61.
- *
- * The message exchange should return with a Fault/Failure.
- *
- */
- // TODO fix the bug first
- negative("target/test-classes/bpel/2.0/NegativeInitializationTest");
- }
-
- @Test public void testConcurrentSyncMex() throws Throwable {
- go("/bpel/2.0/TestConcurrentSyncMex");
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.test;
+
+import org.junit.Ignore;
+import org.junit.Test;
+
+public class MessageRouting20Test extends BPELTestAbstract {
+
+ @Test public void testCorrelation() throws Throwable {
+ go("/bpel/2.0/TestCorrelation");
+ }
+
+ @Test public void testCorrelation1() throws Throwable {
+ go("/bpel/2.0/TestCorrelation1");
+ }
+
+ @Test public void testCorrelationJoin() throws Throwable {
+ go("/bpel/2.0/TestCorrelationJoin");
+ }
+
+ @Test public void testCorrelationJoinReceive() throws Throwable {
+ go("/bpel/2.0/TestCorrelationJoinReceive");
+ }
+
+ @Test public void testCorrelationJoinInvoke() throws Throwable {
+ go("/bpel/2.0/TestCorrelationJoinInvoke");
+ }
+
+ @Test public void testCorrelationJoinOnMessage() throws Throwable {
+ go("/bpel/2.0/TestCorrelationJoinOnMessage");
+ }
+
+ @Test public void testCorrelationJoinEvent() throws Throwable {
+ go("/bpel/2.0/TestCorrelationJoinEvent");
+ }
+
+ @Test public void testCorrelationJoinReply() throws Throwable {
+ go("/bpel/2.0/TestCorrelationJoinReply");
+ }
+
+ @Test public void testCorrelationMulti() throws Throwable {
+ go("/bpel/2.0/TestCorrelationMulti");
+ }
+
+ @Test public void testCorrelationMultiNegative() throws Throwable {
+ go("/bpel/2.0/TestCorrelationMultiNegative");
+ }
+
+ @Test public void testCorrelationMultiJoin() throws Throwable {
+ go("/bpel/2.0/TestCorrelationMultiJoin");
+ }
+
+ @Test public void testCorrelationMultiComplex() throws Throwable {
+ go("/bpel/2.0/TestCorrelationMultiComplex");
+ }
+
+ @Ignore("fix test bed for handling ASYNC mex") @Test public void testCorrelationOpaque() throws Throwable {
+ //TODO Fix me, we need to capture the session id to send it in the second test message
+ go("/bpel/2.0/TestCorrelationOpaque");
+ }
+
+ @Test public void testDynamicPick() throws Throwable {
+ go("/bpel/2.0/TestDynamicPick");
+ }
+
+ @Test public void testInstPick() throws Throwable {
+ go("/bpel/2.0/TestInstantiatingPick");
+ }
+
+ @Test public void testStaticOnMessage() throws Throwable {
+ go("/bpel/2.0/TestStaticOnMessage");
+ }
+
+ @Test public void testStaticPick() throws Throwable {
+ go("/bpel/2.0/TestStaticPick");
+ }
+
+ @Ignore("fix test bed for handling ASYNC mex") @Test public void testNegativeCorrelation() throws Throwable {
+ /**
+ * This test contains invalid BPEL. There is an instantiating
+ * <receive> and a subsequent <pick> that does not define a correlation
+ * key. The BPEL compiler should throw an exception indicating
+ * the BPEL code error ( verify with spec ).
+ *
+ * See JIRA ODE-64
+ *
+ */
+ // TODO fix the bug first
+ negative("target/test-classes/bpel/2.0/NegativeCorrelationTest");
+ }
+
+ @Test @Ignore("fix test bed for handling ASYNC mex") public void testNegativeInitialization() throws Throwable {
+ /**
+ * This test contains invalid BPEL. There is an instantiating
+ * <receive> within a <scope>. The <scope> contains eventhandlers
+ * that reference the correlation set found on the receive. The BPEL
+ * compiler should throw an exception indicating
+ * the BPEL error ( verify with spec ) or at runtime
+ * a clear initialization exception should be thrown.
+ *
+ * See JIRA ODE-61.
+ *
+ * The message exchange should return with a Fault/Failure.
+ *
+ */
+ // TODO fix the bug first
+ negative("target/test-classes/bpel/2.0/NegativeInitializationTest");
+ }
+
+ @Test public void testConcurrentSyncMex() throws Throwable {
+ go("/bpel/2.0/TestConcurrentSyncMex");
+ }
+
+}
Modified: branches/ODE/ODE-1.x/dao-jpa/src/main/java/org/apache/ode/dao/jpa/ActivityRecoveryDAOImpl.java
===================================================================
--- branches/ODE/ODE-1.x/dao-jpa/src/main/java/org/apache/ode/dao/jpa/ActivityRecoveryDAOImpl.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/dao-jpa/src/main/java/org/apache/ode/dao/jpa/ActivityRecoveryDAOImpl.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,150 +1,149 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.dao.jpa;
-
-import org.apache.ode.bpel.dao.ActivityRecoveryDAO;
-import org.apache.ode.utils.DOMUtils;
-import org.w3c.dom.Element;
-
-import javax.persistence.Basic;
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Lob;
-import javax.persistence.ManyToOne;
-import javax.persistence.NamedQueries;
-import javax.persistence.NamedQuery;
-import javax.persistence.Table;
-import java.util.Date;
-
-
-@Entity
-@Table(name="ODE_ACTIVITY_RECOVERY")
-@NamedQueries({
- @NamedQuery(name=ActivityRecoveryDAOImpl.DELETE_ACTIVITY_RECOVERIES_BY_IDS, query="delete from ActivityRecoveryDAOImpl as a where a._instanceId in(:ids)"),
- @NamedQuery(name=ActivityRecoveryDAOImpl.COUNT_ACTIVITY_RECOVERIES_BY_INSTANCES,
- query="select r._instanceId, count(r._id) from ActivityRecoveryDAOImpl r where r._instance in(:instances) group by r._instanceId")
-})
-public class ActivityRecoveryDAOImpl implements ActivityRecoveryDAO {
- public final static String DELETE_ACTIVITY_RECOVERIES_BY_IDS = "DELETE_ACTIVITY_RECOVERIES_BY_IDS";
-
- public final static String COUNT_ACTIVITY_RECOVERIES_BY_INSTANCES = "COUNT_ACTIVITY_RECOVERIES_BY_INSTANCES";
-
- @Id @Column(name="ID")
- @GeneratedValue(strategy= GenerationType.AUTO)
- @SuppressWarnings("unused")
- private Long _id;
-
- @Basic @Column(name="ACTIVITY_ID")
- private long _activityId;
- @Basic @Column(name="CHANNEL")
- private String _channel;
- @Basic @Column(name="REASON")
- private String _reason;
- @Basic @Column(name="DATE_TIME")
- private Date _dateTime;
- @Lob @Column(name="DETAILS")
- private String _details;
- @Basic @Column(name="ACTIONS")
- private String _actions;
- @Basic @Column(name="RETRIES")
- private int _retries;
-
- @SuppressWarnings("unused")
- @Basic @Column(name="INSTANCE_ID", insertable=false, updatable=false, nullable=true)
- private Long _instanceId;
-
- // _instances is unused because this is a one-way relationship at the database level
- @SuppressWarnings("unused")
- @ManyToOne(fetch=FetchType.LAZY,cascade={CascadeType.PERSIST}) @Column(name="INSTANCE_ID")
- private ProcessInstanceDAOImpl _instance;
-
-
- public ActivityRecoveryDAOImpl() {}
- public ActivityRecoveryDAOImpl(String channel, long activityId,
- String reason, Date dateTime, Element data, String[] actions,
- int retries) {
- _channel = channel;
- _activityId = activityId;
- _reason = reason;
- _dateTime = dateTime;
-
- if (data != null) _details = DOMUtils.domToString(data);
-
- String alist = actions[0];
- for (int i = 1; i < actions.length; ++i)
- alist += " " + actions[i];
- _actions = alist;
-
- _retries = retries;
- }
-
- public String getActions() {
- return _actions;
- }
-
- public String[] getActionsList() {
- return getActions().split(" ");
- }
-
- public long getActivityId() {
- return _activityId;
- }
-
- public String getChannel() {
- return _channel;
- }
-
- public Date getDateTime() {
- return _dateTime;
- }
-
- public Element getDetails() {
- Element ret = null;
- if ( _details != null ) {
- try {
- ret = DOMUtils.stringToDOM(_details);
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
- return ret;
- }
-
- public String getReason() {
- return _reason;
- }
-
- public int getRetries() {
- return _retries;
- }
-
- public ProcessInstanceDAOImpl getInstance() {
- return _instance;
- }
-
- public void setInstance(ProcessInstanceDAOImpl instance) {
- _instance = instance;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.dao.jpa;
+
+import org.apache.ode.bpel.dao.ActivityRecoveryDAO;
+import org.apache.ode.utils.DOMUtils;
+import org.w3c.dom.Element;
+
+import javax.persistence.Basic;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Lob;
+import javax.persistence.ManyToOne;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.Table;
+import java.util.Date;
+
+
+@Entity
+@Table(name="ODE_ACTIVITY_RECOVERY")
+@NamedQueries({
+ @NamedQuery(name=ActivityRecoveryDAOImpl.DELETE_ACTIVITY_RECOVERIES_BY_IDS, query="delete from ActivityRecoveryDAOImpl as a where a._instanceId in(:ids)"),
+ @NamedQuery(name=ActivityRecoveryDAOImpl.COUNT_ACTIVITY_RECOVERIES_BY_INSTANCES,
+ query="select r._instanceId, count(r._id) from ActivityRecoveryDAOImpl r where r._instance in(:instances) group by r._instanceId")
+})
+public class ActivityRecoveryDAOImpl implements ActivityRecoveryDAO {
+ public final static String DELETE_ACTIVITY_RECOVERIES_BY_IDS = "DELETE_ACTIVITY_RECOVERIES_BY_IDS";
+ public final static String COUNT_ACTIVITY_RECOVERIES_BY_INSTANCES = "COUNT_ACTIVITY_RECOVERIES_BY_INSTANCES";
+
+ @Id @Column(name="ID")
+ @GeneratedValue(strategy= GenerationType.AUTO)
+ @SuppressWarnings("unused")
+ private Long _id;
+
+ @Basic @Column(name="ACTIVITY_ID")
+ private long _activityId;
+ @Basic @Column(name="CHANNEL")
+ private String _channel;
+ @Basic @Column(name="REASON")
+ private String _reason;
+ @Basic @Column(name="DATE_TIME")
+ private Date _dateTime;
+ @Lob @Column(name="DETAILS")
+ private String _details;
+ @Basic @Column(name="ACTIONS")
+ private String _actions;
+ @Basic @Column(name="RETRIES")
+ private int _retries;
+
+ @SuppressWarnings("unused")
+ @Basic @Column(name="INSTANCE_ID", insertable=false, updatable=false, nullable=true)
+ private Long _instanceId;
+
+ // _instances is unused because this is a one-way relationship at the database level
+ @SuppressWarnings("unused")
+ @ManyToOne(fetch=FetchType.LAZY,cascade={CascadeType.PERSIST}) @Column(name="INSTANCE_ID")
+ private ProcessInstanceDAOImpl _instance;
+
+
+ public ActivityRecoveryDAOImpl() {}
+ public ActivityRecoveryDAOImpl(String channel, long activityId,
+ String reason, Date dateTime, Element data, String[] actions,
+ int retries) {
+ _channel = channel;
+ _activityId = activityId;
+ _reason = reason;
+ _dateTime = dateTime;
+
+ if (data != null) _details = DOMUtils.domToString(data);
+
+ String alist = actions[0];
+ for (int i = 1; i < actions.length; ++i)
+ alist += " " + actions[i];
+ _actions = alist;
+
+ _retries = retries;
+ }
+
+ public String getActions() {
+ return _actions;
+ }
+
+ public String[] getActionsList() {
+ return getActions().split(" ");
+ }
+
+ public long getActivityId() {
+ return _activityId;
+ }
+
+ public String getChannel() {
+ return _channel;
+ }
+
+ public Date getDateTime() {
+ return _dateTime;
+ }
+
+ public Element getDetails() {
+ Element ret = null;
+ if ( _details != null ) {
+ try {
+ ret = DOMUtils.stringToDOM(_details);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ return ret;
+ }
+
+ public String getReason() {
+ return _reason;
+ }
+
+ public int getRetries() {
+ return _retries;
+ }
+
+ public ProcessInstanceDAOImpl getInstance() {
+ return _instance;
+ }
+
+ public void setInstance(ProcessInstanceDAOImpl instance) {
+ _instance = instance;
+ }
+}
Modified: branches/ODE/ODE-1.x/dao-jpa/src/main/java/org/apache/ode/dao/jpa/ProcessInstanceDAOImpl.java
===================================================================
--- branches/ODE/ODE-1.x/dao-jpa/src/main/java/org/apache/ode/dao/jpa/ProcessInstanceDAOImpl.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/dao-jpa/src/main/java/org/apache/ode/dao/jpa/ProcessInstanceDAOImpl.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,396 +1,394 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.ode.dao.jpa;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.ode.bpel.common.ProcessState;
-import org.apache.ode.bpel.dao.ActivityRecoveryDAO;
-import org.apache.ode.bpel.dao.BpelDAOConnection;
-import org.apache.ode.bpel.dao.CorrelationSetDAO;
-import org.apache.ode.bpel.dao.CorrelatorDAO;
-import org.apache.ode.bpel.dao.FaultDAO;
-import org.apache.ode.bpel.dao.MessageExchangeDAO;
-import org.apache.ode.bpel.dao.ProcessDAO;
-import org.apache.ode.bpel.dao.ProcessInstanceDAO;
-import org.apache.ode.bpel.dao.ScopeDAO;
-import org.apache.ode.bpel.dao.ScopeStateEnum;
-import org.apache.ode.bpel.dao.XmlDataDAO;
-import org.apache.ode.bpel.evt.ProcessInstanceEvent;
-import org.apache.ode.bpel.iapi.ProcessConf.CLEANUP_CATEGORY;
-import org.w3c.dom.Element;
-
-import javax.persistence.Basic;
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Lob;
-import javax.persistence.ManyToOne;
-import javax.persistence.NamedQueries;
-import javax.persistence.NamedQuery;
-import javax.persistence.OneToMany;
-import javax.persistence.OneToOne;
-import javax.persistence.Table;
-import javax.xml.namespace.QName;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-@Entity
-@Table(name="ODE_PROCESS_INSTANCE")
-@NamedQueries({
- @NamedQuery(name=ProcessInstanceDAOImpl.DELETE_INSTANCES_BY_PROCESS, query="delete from ProcessInstanceDAOImpl as i where i._process = :process"),
- @NamedQuery(name=ProcessInstanceDAOImpl.SELECT_INSTANCE_IDS_BY_PROCESS, query="select i._instanceId from ProcessInstanceDAOImpl as i where i._process = :process"),
- @NamedQuery(name=ProcessInstanceDAOImpl.COUNT_INSTANCE_IDS_BY_PROCESS, query="select count(i._instanceId) from ProcessInstanceDAOImpl as i where i._process = :process"),
- @NamedQuery(name=ProcessInstanceDAOImpl.SELECT_FAULT_IDS_BY_PROCESS, query="select i._faultId from ProcessInstanceDAOImpl as i where i._process = :process and i._faultId is not null"),
- @NamedQuery(name=ProcessInstanceDAOImpl.COUNT_FAILED_INSTANCES_BY_STATUS_AND_PROCESS_ID,
- query="select count(i._instanceId), max(i._lastRecovery) from ProcessInstanceDAOImpl as i where i._process._processId = :processId and i._state in(:states) and exists(select r from ActivityRecoveryDAOImpl r where i = r._instance)")
-})
-public class ProcessInstanceDAOImpl extends OpenJPADAO implements ProcessInstanceDAO {
- private static final Log __log = LogFactory.getLog(ProcessInstanceDAOImpl.class);
-
- public final static String DELETE_INSTANCES_BY_PROCESS = "DELETE_INSTANCES_BY_PROCESS";
- public final static String SELECT_INSTANCE_IDS_BY_PROCESS = "SELECT_INSTANCE_IDS_BY_PROCESS";
- public final static String COUNT_INSTANCE_IDS_BY_PROCESS = "COUNT_INSTANCE_IDS_BY_PROCESS";
-
- public final static String SELECT_FAULT_IDS_BY_PROCESS = "SELECT_FAULT_IDS_BY_PROCESS";
-
- public final static String COUNT_FAILED_INSTANCES_BY_STATUS_AND_PROCESS_ID = "COUNT_FAILED_INSTANCES_BY_STATUS_AND_PROCESS_ID";
-
- @Id @Column(name="ID")
- @GeneratedValue(strategy=GenerationType.AUTO)
- private Long _instanceId;
- @Basic @Column(name="LAST_RECOVERY_DATE")
- private Date _lastRecovery;
- @Basic @Column(name="LAST_ACTIVE_TIME")
- private Date _lastActive;
- @Basic @Column(name="INSTANCE_STATE")
- private short _state;
- @Basic @Column(name="PREVIOUS_STATE")
- private short _previousState;
- @Lob @Column(name="EXECUTION_STATE")
- private byte[] _executionState;
- @Basic @Column(name="SEQUENCE")
- private long _sequence;
- @Basic @Column(name="DATE_CREATED")
- private Date _dateCreated = new Date();
-
- @OneToOne(fetch=FetchType.LAZY,cascade={CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}) @Column(name="ROOT_SCOPE_ID")
- private ScopeDAOImpl _rootScope;
- @OneToMany(targetEntity=ScopeDAOImpl.class,mappedBy="_processInstance",fetch=FetchType.LAZY,cascade={CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH})
- private Collection<ScopeDAO> _scopes = new ArrayList<ScopeDAO>();
- @OneToMany(targetEntity=ActivityRecoveryDAOImpl.class,mappedBy="_instance",fetch=FetchType.LAZY,cascade={CascadeType.ALL})
- private Collection<ActivityRecoveryDAO> _recoveries = new ArrayList<ActivityRecoveryDAO>();
-
- @SuppressWarnings("unused")
- @Basic @Column(name="FAULT_ID", insertable=false, updatable=false, nullable=true)
- private long _faultId;
- @OneToOne(fetch=FetchType.LAZY,cascade={CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}) @Column(name="FAULT_ID")
- private FaultDAOImpl _fault;
- @ManyToOne(fetch=FetchType.LAZY,cascade={CascadeType.PERSIST}) @Column(name="PROCESS_ID")
- private ProcessDAOImpl _process;
- @ManyToOne(fetch=FetchType.LAZY,cascade={CascadeType.PERSIST}) @Column(name="INSTANTIATING_CORRELATOR_ID")
- private CorrelatorDAOImpl _instantiatingCorrelator;
-
- @OneToMany(targetEntity=MessageExchangeDAOImpl.class,mappedBy="_processInst",fetch=FetchType.LAZY)
- @SuppressWarnings("unused")
- private Collection<MessageExchangeDAO> _messageExchanges = new ArrayList<MessageExchangeDAO>();
-
- private transient int _activityFailureCount = -1;
-
- public ProcessInstanceDAOImpl() {}
- public ProcessInstanceDAOImpl(CorrelatorDAOImpl correlator, ProcessDAOImpl process) {
- _instantiatingCorrelator = correlator;
- _process = process;
- }
-
- public void createActivityRecovery(String channel, long activityId,
- String reason, Date dateTime, Element data, String[] actions,
- int retries) {
- ActivityRecoveryDAOImpl ar = new ActivityRecoveryDAOImpl(channel, activityId, reason, dateTime, data, actions, retries);
- _recoveries.add(ar);
- ar.setInstance(this);
- _lastRecovery = dateTime;
- }
-
- public ScopeDAO createScope(ScopeDAO parentScope, String name, int scopeModelId) {
- ScopeDAOImpl ret = new ScopeDAOImpl((ScopeDAOImpl)parentScope,name,scopeModelId,this);
- ret.setState(ScopeStateEnum.ACTIVE);
- _scopes.add(ret);
- _rootScope = (parentScope == null)?ret:_rootScope;
-
- // Must persist the scope to generate a scope ID
- getEM().persist(ret);
- return ret;
- }
-
- @SuppressWarnings("unchecked")
- public Collection<CorrelationSetDAO> selectCorrelationSets(Collection<ProcessInstanceDAO> instances) {
- return getEM().createNamedQuery(CorrelationSetDAOImpl.SELECT_CORRELATION_SETS_BY_INSTANCES).setParameter("instances", instances).getResultList();
- }
-
- public void delete(Set<CLEANUP_CATEGORY> cleanupCategories) {
- if(__log.isDebugEnabled()) __log.debug("Cleaning up instance Data with " + cleanupCategories);
-
- // remove jacob state
- setExecutionState(null);
- if (getEM() != null) {
- if( !cleanupCategories.isEmpty() ) {
- // by default, we do not flush before select; flush it, so we can delete no matter if an entity is loaded up
- // or not; more importantly, OpenJPA will secretly load from the entire table if some entities reside only
- // in memory
- getEM().flush();
- }
-
- if (cleanupCategories.contains(CLEANUP_CATEGORY.EVENTS)) {
- deleteEvents();
- }
- if (cleanupCategories.contains(CLEANUP_CATEGORY.CORRELATIONS)) {
- deleteCorrelations();
- }
- if( cleanupCategories.contains(CLEANUP_CATEGORY.MESSAGES) ) {
- deleteMessageRoutes();
- }
- if (cleanupCategories.contains(CLEANUP_CATEGORY.VARIABLES)) {
- deleteVariables();
- }
- if (cleanupCategories.contains(CLEANUP_CATEGORY.INSTANCE)) {
- deleteInstance();
- }
-
- getEM().flush();
- }
- }
-
- private void deleteInstance() {
- if( _fault != null ) {
- getEM().remove(_fault);
- }
- getEM().remove(this); // This deletes ActivityRecoveryDAO
- }
-
- @SuppressWarnings("unchecked")
- private void deleteVariables() {
- Collection xmlDataIds = getEM().createNamedQuery(XmlDataDAOImpl.SELECT_XMLDATA_IDS_BY_INSTANCE).setParameter("instance", this).getResultList();
- batchUpdateByIds(xmlDataIds.iterator(), getEM().createNamedQuery(XmlDataProperty.DELETE_XML_DATA_PROPERTIES_BY_XML_DATA_IDS), "xmlDataIds");
- Collection scopeIds = getEM().createNamedQuery(ScopeDAOImpl.SELECT_SCOPE_IDS_BY_INSTANCE).setParameter("instance", this).getResultList();
- batchUpdateByIds(scopeIds.iterator(), getEM().createNamedQuery(XmlDataDAOImpl.DELETE_XMLDATA_BY_SCOPE_IDS), "scopeIds");
-
- batchUpdateByIds(scopeIds.iterator(), getEM().createNamedQuery(PartnerLinkDAOImpl.DELETE_PARTNER_LINKS_BY_SCOPE_IDS), "scopeIds");
- batchUpdateByIds(scopeIds.iterator(), getEM().createNamedQuery(ScopeDAOImpl.DELETE_SCOPES_BY_SCOPE_IDS), "ids");
- }
-
- private void deleteMessageRoutes() {
- getEM().createNamedQuery(MessageRouteDAOImpl.DELETE_MESSAGE_ROUTES_BY_INSTANCE).setParameter ("instance", this).executeUpdate();
- }
-
- @SuppressWarnings("unchecked")
- private void deleteCorrelations() {
- Collection corrSetIds = getEM().createNamedQuery(CorrelationSetDAOImpl.SELECT_CORRELATION_SET_IDS_BY_INSTANCE).setParameter("instance", this).getResultList();
- batchUpdateByIds(corrSetIds.iterator(), getEM().createNamedQuery(CorrSetProperty.DELETE_CORSET_PROPERTIES_BY_PROPERTY_IDS), "corrSetIds");
- batchUpdateByIds(corrSetIds.iterator(), getEM().createNamedQuery(CorrelationSetDAOImpl.DELETE_CORRELATION_SETS_BY_IDS), "ids");
- }
-
- private void deleteEvents() {
- getEM().createNamedQuery(EventDAOImpl.DELETE_EVENTS_BY_INSTANCE).setParameter ("instance", this).executeUpdate();
- }
-
- public void deleteActivityRecovery(String channel) {
- ActivityRecoveryDAOImpl toRemove = null;
- for (ActivityRecoveryDAO _recovery : _recoveries) {
- ActivityRecoveryDAOImpl arElement = (ActivityRecoveryDAOImpl) _recovery;
- if (arElement.getChannel().equals(channel)) {
- toRemove = arElement;
- break;
- }
- }
- if (toRemove != null) {
- getEM().remove(toRemove);
- _recoveries.remove(toRemove);
- }
-
- }
-
- public void finishCompletion() {
- // make sure we have completed.
- assert (ProcessState.isFinished(this.getState()));
- // let our process know that we've done our work.
- }
-
- public long genMonotonic() {
- return _sequence++;
- }
-
- public int getActivityFailureCount() {
- if( _activityFailureCount == -1 ) {
- _activityFailureCount = _recoveries.size();
- }
-
- return _activityFailureCount;
- }
-
- public void setActivityFailureCount(int activityFailureCount) {
- _activityFailureCount = activityFailureCount;
- }
-
- public Date getActivityFailureDateTime() {
- return _lastRecovery;
- }
-
- public Collection<ActivityRecoveryDAO> getActivityRecoveries() {
- return _recoveries;
- }
-
- public CorrelationSetDAO getCorrelationSet(String name) {
- // TODO: should this method be deprecated?
-
- // Its not clear where the correlation set for the process is used
- // or populated.
-
- throw new UnsupportedOperationException();
-
- //return null;
- }
-
- public Set<CorrelationSetDAO> getCorrelationSets() {
- // TODO: should this method be deprecated?
- // Its not clear where the correlation set for the process is used
- // or populated.
- return new HashSet<CorrelationSetDAO>();
- }
-
- public Date getCreateTime() {
- return _dateCreated;
- }
-
- public EventsFirstLastCountTuple getEventsFirstLastCount() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public byte[] getExecutionState() {
- return _executionState;
- }
-
- public FaultDAO getFault() {
- return _fault;
- }
-
- public Long getInstanceId() {
- return _instanceId;
- }
-
- public CorrelatorDAO getInstantiatingCorrelator() {
- return _instantiatingCorrelator;
- }
-
- public Date getLastActiveTime() {
- return _lastActive;
- }
-
- public short getPreviousState() {
- return _previousState;
- }
-
- public ProcessDAO getProcess() {
- return _process;
- }
-
- public ScopeDAO getRootScope() {
- return _rootScope;
- }
-
- public ScopeDAO getScope(Long scopeInstanceId) {
- return getEM().find(ScopeDAOImpl.class, scopeInstanceId);
- }
-
- public Collection<ScopeDAO> getScopes(String scopeName) {
- Collection<ScopeDAO> ret = new ArrayList<ScopeDAO>();
-
- for (ScopeDAO sElement : _scopes) {
- if ( sElement.getName().equals(scopeName)) ret.add(sElement);
- }
- return ret;
- }
-
- public Collection<ScopeDAO> getScopes() {
- return _scopes;
- }
-
- public short getState() {
- return _state;
- }
-
- public XmlDataDAO[] getVariables(String variableName, int scopeModelId) {
-
- //TODO: This method is not used and should be considered a deprecation candidate.
-
- List<XmlDataDAO> results = new ArrayList<XmlDataDAO>();
-
- for (ScopeDAO sElement : _scopes) {
- if ( sElement.getModelId() == scopeModelId) {
- XmlDataDAO var = sElement.getVariable(variableName);
- if ( var != null ) results.add(var);
- }
- }
- return results.toArray(new XmlDataDAO[results.size()]);
- }
-
- public void insertBpelEvent(ProcessInstanceEvent event) {
- getConn().insertBpelEvent(event, getProcess(), this);
- }
-
- public void setExecutionState(byte[] execState) {
- _executionState = execState;
- }
-
- public void setFault(FaultDAO fault) {
- _fault = (FaultDAOImpl)fault;
- }
-
- public void setFault(QName faultName, String explanation, int faultLineNo,
- int activityId, Element faultMessage) {
- _fault = new FaultDAOImpl(faultName,explanation,faultLineNo,activityId,faultMessage);
- }
-
- public void setLastActiveTime(Date dt) {
- _lastActive = dt;
- }
-
- public void setState(short state) {
- _previousState = _state;
- _state = state;
- }
-
- void removeRoutes(String routeGroupId) {
- _process.removeRoutes(routeGroupId, this);
- }
-
- public BpelDAOConnection getConnection() {
- return new BPELDAOConnectionImpl(getEM());
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.dao.jpa;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ode.bpel.common.ProcessState;
+import org.apache.ode.bpel.dao.ActivityRecoveryDAO;
+import org.apache.ode.bpel.dao.BpelDAOConnection;
+import org.apache.ode.bpel.dao.CorrelationSetDAO;
+import org.apache.ode.bpel.dao.CorrelatorDAO;
+import org.apache.ode.bpel.dao.FaultDAO;
+import org.apache.ode.bpel.dao.MessageExchangeDAO;
+import org.apache.ode.bpel.dao.ProcessDAO;
+import org.apache.ode.bpel.dao.ProcessInstanceDAO;
+import org.apache.ode.bpel.dao.ScopeDAO;
+import org.apache.ode.bpel.dao.ScopeStateEnum;
+import org.apache.ode.bpel.dao.XmlDataDAO;
+import org.apache.ode.bpel.evt.ProcessInstanceEvent;
+import org.apache.ode.bpel.iapi.ProcessConf.CLEANUP_CATEGORY;
+import org.w3c.dom.Element;
+
+import javax.persistence.Basic;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Lob;
+import javax.persistence.ManyToOne;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.OneToMany;
+import javax.persistence.OneToOne;
+import javax.persistence.Table;
+import javax.xml.namespace.QName;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+@Entity
+@Table(name="ODE_PROCESS_INSTANCE")
+@NamedQueries({
+ @NamedQuery(name=ProcessInstanceDAOImpl.DELETE_INSTANCES_BY_PROCESS, query="delete from ProcessInstanceDAOImpl as i where i._process = :process"),
+ @NamedQuery(name=ProcessInstanceDAOImpl.SELECT_INSTANCE_IDS_BY_PROCESS, query="select i._instanceId from ProcessInstanceDAOImpl as i where i._process = :process"),
+ @NamedQuery(name=ProcessInstanceDAOImpl.COUNT_INSTANCE_IDS_BY_PROCESS, query="select count(i._instanceId) from ProcessInstanceDAOImpl as i where i._process = :process"),
+ @NamedQuery(name=ProcessInstanceDAOImpl.SELECT_FAULT_IDS_BY_PROCESS, query="select i._faultId from ProcessInstanceDAOImpl as i where i._process = :process and i._faultId is not null"),
+ @NamedQuery(name=ProcessInstanceDAOImpl.COUNT_FAILED_INSTANCES_BY_STATUS_AND_PROCESS_ID,
+ query="select count(i._instanceId), max(i._lastRecovery) from ProcessInstanceDAOImpl as i where i._process._processId = :processId and i._state in(:states) and exists(select r from ActivityRecoveryDAOImpl r where i = r._instance)")
+})
+public class ProcessInstanceDAOImpl extends OpenJPADAO implements ProcessInstanceDAO {
+ private static final Log __log = LogFactory.getLog(ProcessInstanceDAOImpl.class);
+
+ public final static String DELETE_INSTANCES_BY_PROCESS = "DELETE_INSTANCES_BY_PROCESS";
+ public final static String SELECT_INSTANCE_IDS_BY_PROCESS = "SELECT_INSTANCE_IDS_BY_PROCESS"; public final static String COUNT_INSTANCE_IDS_BY_PROCESS = "COUNT_INSTANCE_IDS_BY_PROCESS";
+
+ public final static String SELECT_FAULT_IDS_BY_PROCESS = "SELECT_FAULT_IDS_BY_PROCESS";
+ public final static String COUNT_FAILED_INSTANCES_BY_STATUS_AND_PROCESS_ID = "COUNT_FAILED_INSTANCES_BY_STATUS_AND_PROCESS_ID";
+
+ @Id @Column(name="ID")
+ @GeneratedValue(strategy=GenerationType.AUTO)
+ private Long _instanceId;
+ @Basic @Column(name="LAST_RECOVERY_DATE")
+ private Date _lastRecovery;
+ @Basic @Column(name="LAST_ACTIVE_TIME")
+ private Date _lastActive;
+ @Basic @Column(name="INSTANCE_STATE")
+ private short _state;
+ @Basic @Column(name="PREVIOUS_STATE")
+ private short _previousState;
+ @Lob @Column(name="EXECUTION_STATE")
+ private byte[] _executionState;
+ @Basic @Column(name="SEQUENCE")
+ private long _sequence;
+ @Basic @Column(name="DATE_CREATED")
+ private Date _dateCreated = new Date();
+
+ @OneToOne(fetch=FetchType.LAZY,cascade={CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}) @Column(name="ROOT_SCOPE_ID")
+ private ScopeDAOImpl _rootScope;
+ @OneToMany(targetEntity=ScopeDAOImpl.class,mappedBy="_processInstance",fetch=FetchType.LAZY,cascade={CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH})
+ private Collection<ScopeDAO> _scopes = new ArrayList<ScopeDAO>();
+ @OneToMany(targetEntity=ActivityRecoveryDAOImpl.class,mappedBy="_instance",fetch=FetchType.LAZY,cascade={CascadeType.ALL})
+ private Collection<ActivityRecoveryDAO> _recoveries = new ArrayList<ActivityRecoveryDAO>();
+
+ @SuppressWarnings("unused")
+ @Basic @Column(name="FAULT_ID", insertable=false, updatable=false, nullable=true)
+ private long _faultId;
+ @OneToOne(fetch=FetchType.LAZY,cascade={CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}) @Column(name="FAULT_ID")
+ private FaultDAOImpl _fault;
+ @ManyToOne(fetch=FetchType.LAZY,cascade={CascadeType.PERSIST}) @Column(name="PROCESS_ID")
+ private ProcessDAOImpl _process;
+ @ManyToOne(fetch=FetchType.LAZY,cascade={CascadeType.PERSIST}) @Column(name="INSTANTIATING_CORRELATOR_ID")
+ private CorrelatorDAOImpl _instantiatingCorrelator;
+
+ @OneToMany(targetEntity=MessageExchangeDAOImpl.class,mappedBy="_processInst",fetch=FetchType.LAZY)
+ @SuppressWarnings("unused")
+ private Collection<MessageExchangeDAO> _messageExchanges = new ArrayList<MessageExchangeDAO>();
+
+ private transient int _activityFailureCount = -1;
+
+ public ProcessInstanceDAOImpl() {}
+ public ProcessInstanceDAOImpl(CorrelatorDAOImpl correlator, ProcessDAOImpl process) {
+ _instantiatingCorrelator = correlator;
+ _process = process;
+ }
+
+ public void createActivityRecovery(String channel, long activityId,
+ String reason, Date dateTime, Element data, String[] actions,
+ int retries) {
+ ActivityRecoveryDAOImpl ar = new ActivityRecoveryDAOImpl(channel, activityId, reason, dateTime, data, actions, retries);
+ _recoveries.add(ar);
+ ar.setInstance(this);
+ _lastRecovery = dateTime;
+ }
+
+ public ScopeDAO createScope(ScopeDAO parentScope, String name, int scopeModelId) {
+ ScopeDAOImpl ret = new ScopeDAOImpl((ScopeDAOImpl)parentScope,name,scopeModelId,this);
+ ret.setState(ScopeStateEnum.ACTIVE);
+ _scopes.add(ret);
+ _rootScope = (parentScope == null)?ret:_rootScope;
+
+ // Must persist the scope to generate a scope ID
+ getEM().persist(ret);
+ return ret;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Collection<CorrelationSetDAO> selectCorrelationSets(Collection<ProcessInstanceDAO> instances) {
+ return getEM().createNamedQuery(CorrelationSetDAOImpl.SELECT_CORRELATION_SETS_BY_INSTANCES).setParameter("instances", instances).getResultList();
+ }
+
+ public void delete(Set<CLEANUP_CATEGORY> cleanupCategories) {
+ if(__log.isDebugEnabled()) __log.debug("Cleaning up instance Data with " + cleanupCategories);
+
+ // remove jacob state
+ setExecutionState(null);
+ if (getEM() != null) {
+ if( !cleanupCategories.isEmpty() ) {
+ // by default, we do not flush before select; flush it, so we can delete no matter if an entity is loaded up
+ // or not; more importantly, OpenJPA will secretly load from the entire table if some entities reside only
+ // in memory
+ getEM().flush();
+ }
+
+ if (cleanupCategories.contains(CLEANUP_CATEGORY.EVENTS)) {
+ deleteEvents();
+ }
+ if (cleanupCategories.contains(CLEANUP_CATEGORY.CORRELATIONS)) {
+ deleteCorrelations();
+ }
+ if( cleanupCategories.contains(CLEANUP_CATEGORY.MESSAGES) ) {
+ deleteMessageRoutes();
+ }
+ if (cleanupCategories.contains(CLEANUP_CATEGORY.VARIABLES)) {
+ deleteVariables();
+ }
+ if (cleanupCategories.contains(CLEANUP_CATEGORY.INSTANCE)) {
+ deleteInstance();
+ }
+
+ getEM().flush();
+ }
+ }
+
+ private void deleteInstance() {
+ if( _fault != null ) {
+ getEM().remove(_fault);
+ }
+ getEM().remove(this); // This deletes ActivityRecoveryDAO
+ }
+
+ @SuppressWarnings("unchecked")
+ private void deleteVariables() {
+ Collection xmlDataIds = getEM().createNamedQuery(XmlDataDAOImpl.SELECT_XMLDATA_IDS_BY_INSTANCE).setParameter("instance", this).getResultList();
+ batchUpdateByIds(xmlDataIds.iterator(), getEM().createNamedQuery(XmlDataProperty.DELETE_XML_DATA_PROPERTIES_BY_XML_DATA_IDS), "xmlDataIds");
+ Collection scopeIds = getEM().createNamedQuery(ScopeDAOImpl.SELECT_SCOPE_IDS_BY_INSTANCE).setParameter("instance", this).getResultList();
+ batchUpdateByIds(scopeIds.iterator(), getEM().createNamedQuery(XmlDataDAOImpl.DELETE_XMLDATA_BY_SCOPE_IDS), "scopeIds");
+
+ batchUpdateByIds(scopeIds.iterator(), getEM().createNamedQuery(PartnerLinkDAOImpl.DELETE_PARTNER_LINKS_BY_SCOPE_IDS), "scopeIds");
+ batchUpdateByIds(scopeIds.iterator(), getEM().createNamedQuery(ScopeDAOImpl.DELETE_SCOPES_BY_SCOPE_IDS), "ids");
+ }
+
+ private void deleteMessageRoutes() {
+ getEM().createNamedQuery(MessageRouteDAOImpl.DELETE_MESSAGE_ROUTES_BY_INSTANCE).setParameter ("instance", this).executeUpdate();
+ }
+
+ @SuppressWarnings("unchecked")
+ private void deleteCorrelations() {
+ Collection corrSetIds = getEM().createNamedQuery(CorrelationSetDAOImpl.SELECT_CORRELATION_SET_IDS_BY_INSTANCE).setParameter("instance", this).getResultList();
+ batchUpdateByIds(corrSetIds.iterator(), getEM().createNamedQuery(CorrSetProperty.DELETE_CORSET_PROPERTIES_BY_PROPERTY_IDS), "corrSetIds");
+ batchUpdateByIds(corrSetIds.iterator(), getEM().createNamedQuery(CorrelationSetDAOImpl.DELETE_CORRELATION_SETS_BY_IDS), "ids");
+ }
+
+ private void deleteEvents() {
+ getEM().createNamedQuery(EventDAOImpl.DELETE_EVENTS_BY_INSTANCE).setParameter ("instance", this).executeUpdate();
+ }
+
+ public void deleteActivityRecovery(String channel) {
+ ActivityRecoveryDAOImpl toRemove = null;
+ for (ActivityRecoveryDAO _recovery : _recoveries) {
+ ActivityRecoveryDAOImpl arElement = (ActivityRecoveryDAOImpl) _recovery;
+ if (arElement.getChannel().equals(channel)) {
+ toRemove = arElement;
+ break;
+ }
+ }
+ if (toRemove != null) {
+ getEM().remove(toRemove);
+ _recoveries.remove(toRemove);
+ }
+
+ }
+
+ public void finishCompletion() {
+ // make sure we have completed.
+ assert (ProcessState.isFinished(this.getState()));
+ // let our process know that we've done our work.
+ }
+
+ public long genMonotonic() {
+ return _sequence++;
+ }
+
+ public int getActivityFailureCount() {
+ if( _activityFailureCount == -1 ) {
+ _activityFailureCount = _recoveries.size();
+ }
+
+ return _activityFailureCount;
+ }
+
+ public void setActivityFailureCount(int activityFailureCount) {
+ _activityFailureCount = activityFailureCount;
+ }
+
+ public Date getActivityFailureDateTime() {
+ return _lastRecovery;
+ }
+
+ public Collection<ActivityRecoveryDAO> getActivityRecoveries() {
+ return _recoveries;
+ }
+
+ public CorrelationSetDAO getCorrelationSet(String name) {
+ // TODO: should this method be deprecated?
+
+ // Its not clear where the correlation set for the process is used
+ // or populated.
+
+ throw new UnsupportedOperationException();
+
+ //return null;
+ }
+
+ public Set<CorrelationSetDAO> getCorrelationSets() {
+ // TODO: should this method be deprecated?
+ // Its not clear where the correlation set for the process is used
+ // or populated.
+ return new HashSet<CorrelationSetDAO>();
+ }
+
+ public Date getCreateTime() {
+ return _dateCreated;
+ }
+
+ public EventsFirstLastCountTuple getEventsFirstLastCount() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public byte[] getExecutionState() {
+ return _executionState;
+ }
+
+ public FaultDAO getFault() {
+ return _fault;
+ }
+
+ public Long getInstanceId() {
+ return _instanceId;
+ }
+
+ public CorrelatorDAO getInstantiatingCorrelator() {
+ return _instantiatingCorrelator;
+ }
+
+ public Date getLastActiveTime() {
+ return _lastActive;
+ }
+
+ public short getPreviousState() {
+ return _previousState;
+ }
+
+ public ProcessDAO getProcess() {
+ return _process;
+ }
+
+ public ScopeDAO getRootScope() {
+ return _rootScope;
+ }
+
+ public ScopeDAO getScope(Long scopeInstanceId) {
+ return getEM().find(ScopeDAOImpl.class, scopeInstanceId);
+ }
+
+ public Collection<ScopeDAO> getScopes(String scopeName) {
+ Collection<ScopeDAO> ret = new ArrayList<ScopeDAO>();
+
+ for (ScopeDAO sElement : _scopes) {
+ if ( sElement.getName().equals(scopeName)) ret.add(sElement);
+ }
+ return ret;
+ }
+
+ public Collection<ScopeDAO> getScopes() {
+ return _scopes;
+ }
+
+ public short getState() {
+ return _state;
+ }
+
+ public XmlDataDAO[] getVariables(String variableName, int scopeModelId) {
+
+ //TODO: This method is not used and should be considered a deprecation candidate.
+
+ List<XmlDataDAO> results = new ArrayList<XmlDataDAO>();
+
+ for (ScopeDAO sElement : _scopes) {
+ if ( sElement.getModelId() == scopeModelId) {
+ XmlDataDAO var = sElement.getVariable(variableName);
+ if ( var != null ) results.add(var);
+ }
+ }
+ return results.toArray(new XmlDataDAO[results.size()]);
+ }
+
+ public void insertBpelEvent(ProcessInstanceEvent event) {
+ getConn().insertBpelEvent(event, getProcess(), this);
+ }
+
+ public void setExecutionState(byte[] execState) {
+ _executionState = execState;
+ }
+
+ public void setFault(FaultDAO fault) {
+ _fault = (FaultDAOImpl)fault;
+ }
+
+ public void setFault(QName faultName, String explanation, int faultLineNo,
+ int activityId, Element faultMessage) {
+ _fault = new FaultDAOImpl(faultName,explanation,faultLineNo,activityId,faultMessage);
+ }
+
+ public void setLastActiveTime(Date dt) {
+ _lastActive = dt;
+ }
+
+ public void setState(short state) {
+ _previousState = _state;
+ _state = state;
+ }
+
+ void removeRoutes(String routeGroupId) {
+ _process.removeRoutes(routeGroupId, this);
+ }
+
+ public BpelDAOConnection getConnection() {
+ return new BPELDAOConnectionImpl(getEM());
+ }
+}
Modified: branches/ODE/ODE-1.x/utils/src/main/java/org/apache/ode/utils/CronExpression.java
===================================================================
--- branches/ODE/ODE-1.x/utils/src/main/java/org/apache/ode/utils/CronExpression.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/utils/src/main/java/org/apache/ode/utils/CronExpression.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -1,1583 +1,1583 @@
-package org.apache.ode.utils;
-
-import java.io.Serializable;
-import java.text.ParseException;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Locale;
-import java.util.Map;
-import java.util.SortedSet;
-import java.util.StringTokenizer;
-import java.util.TimeZone;
-import java.util.TreeSet;
-
-
-/**
- * Provides a parser and evaluator for unix-like cron expressions. Cron
- * expressions provide the ability to specify complex time combinations such as
- * "At 8:00am every Monday through Friday" or "At 1:30am every
- * last Friday of the month".
- * <P>
- * Cron expressions are comprised of 6 required fields and one optional field
- * separated by white space. The fields respectively are described as follows:
- *
- * <table cellspacing="8">
- * <tr>
- * <th align="left">Field Name</th>
- * <th align="left"> </th>
- * <th align="left">Allowed Values</th>
- * <th align="left"> </th>
- * <th align="left">Allowed Special Characters</th>
- * </tr>
- * <tr>
- * <td align="left"><code>Seconds</code></td>
- * <td align="left"> </th>
- * <td align="left"><code>0-59</code></td>
- * <td align="left"> </th>
- * <td align="left"><code>, - * /</code></td>
- * </tr>
- * <tr>
- * <td align="left"><code>Minutes</code></td>
- * <td align="left"> </th>
- * <td align="left"><code>0-59</code></td>
- * <td align="left"> </th>
- * <td align="left"><code>, - * /</code></td>
- * </tr>
- * <tr>
- * <td align="left"><code>Hours</code></td>
- * <td align="left"> </th>
- * <td align="left"><code>0-23</code></td>
- * <td align="left"> </th>
- * <td align="left"><code>, - * /</code></td>
- * </tr>
- * <tr>
- * <td align="left"><code>Day-of-month</code></td>
- * <td align="left"> </th>
- * <td align="left"><code>1-31</code></td>
- * <td align="left"> </th>
- * <td align="left"><code>, - * ? / L W</code></td>
- * </tr>
- * <tr>
- * <td align="left"><code>Month</code></td>
- * <td align="left"> </th>
- * <td align="left"><code>1-12 or JAN-DEC</code></td>
- * <td align="left"> </th>
- * <td align="left"><code>, - * /</code></td>
- * </tr>
- * <tr>
- * <td align="left"><code>Day-of-Week</code></td>
- * <td align="left"> </th>
- * <td align="left"><code>1-7 or SUN-SAT</code></td>
- * <td align="left"> </th>
- * <td align="left"><code>, - * ? / L #</code></td>
- * </tr>
- * <tr>
- * <td align="left"><code>Year (Optional)</code></td>
- * <td align="left"> </th>
- * <td align="left"><code>empty, 1970-2099</code></td>
- * <td align="left"> </th>
- * <td align="left"><code>, - * /</code></td>
- * </tr>
- * </table>
- * <P>
- * The '*' character is used to specify all values. For example, "*"
- * in the minute field means "every minute".
- * <P>
- * The '?' character is allowed for the day-of-month and day-of-week fields. It
- * is used to specify 'no specific value'. This is useful when you need to
- * specify something in one of the two fields, but not the other.
- * <P>
- * The '-' character is used to specify ranges For example "10-12" in
- * the hour field means "the hours 10, 11 and 12".
- * <P>
- * The ',' character is used to specify additional values. For example
- * "MON,WED,FRI" in the day-of-week field means "the days Monday,
- * Wednesday, and Friday".
- * <P>
- * The '/' character is used to specify increments. For example "0/15"
- * in the seconds field means "the seconds 0, 15, 30, and 45". And
- * "5/15" in the seconds field means "the seconds 5, 20, 35, and
- * 50". Specifying '*' before the '/' is equivalent to specifying 0 is
- * the value to start with. Essentially, for each field in the expression, there
- * is a set of numbers that can be turned on or off. For seconds and minutes,
- * the numbers range from 0 to 59. For hours 0 to 23, for days of the month 0 to
- * 31, and for months 1 to 12. The "/" character simply helps you turn
- * on every "nth" value in the given set. Thus "7/6" in the
- * month field only turns on month "7", it does NOT mean every 6th
- * month, please note that subtlety.
- * <P>
- * The 'L' character is allowed for the day-of-month and day-of-week fields.
- * This character is short-hand for "last", but it has different
- * meaning in each of the two fields. For example, the value "L" in
- * the day-of-month field means "the last day of the month" - day 31
- * for January, day 28 for February on non-leap years. If used in the
- * day-of-week field by itself, it simply means "7" or
- * "SAT". But if used in the day-of-week field after another value, it
- * means "the last xxx day of the month" - for example "6L"
- * means "the last friday of the month". When using the 'L' option, it
- * is important not to specify lists, or ranges of values, as you'll get
- * confusing results.
- * <P>
- * The 'W' character is allowed for the day-of-month field. This character
- * is used to specify the weekday (Monday-Friday) nearest the given day. As an
- * example, if you were to specify "15W" as the value for the
- * day-of-month field, the meaning is: "the nearest weekday to the 15th of
- * the month". So if the 15th is a Saturday, the trigger will fire on
- * Friday the 14th. If the 15th is a Sunday, the trigger will fire on Monday the
- * 16th. If the 15th is a Tuesday, then it will fire on Tuesday the 15th.
- * However if you specify "1W" as the value for day-of-month, and the
- * 1st is a Saturday, the trigger will fire on Monday the 3rd, as it will not
- * 'jump' over the boundary of a month's days. The 'W' character can only be
- * specified when the day-of-month is a single day, not a range or list of days.
- * <P>
- * The 'L' and 'W' characters can also be combined for the day-of-month
- * expression to yield 'LW', which translates to "last weekday of the
- * month".
- * <P>
- * The '#' character is allowed for the day-of-week field. This character is
- * used to specify "the nth" XXX day of the month. For example, the
- * value of "6#3" in the day-of-week field means the third Friday of
- * the month (day 6 = Friday and "#3" = the 3rd one in the month).
- * Other examples: "2#1" = the first Monday of the month and
- * "4#5" = the fifth Wednesday of the month. Note that if you specify
- * "#5" and there is not 5 of the given day-of-week in the month, then
- * no firing will occur that month. If the '#' character is used, there can
- * only be one expression in the day-of-week field ("3#1,6#3" is
- * not valid, since there are two expressions).
- * <P>
- * <!--The 'C' character is allowed for the day-of-month and day-of-week fields.
- * This character is short-hand for "calendar". This means values are
- * calculated against the associated calendar, if any. If no calendar is
- * associated, then it is equivalent to having an all-inclusive calendar. A
- * value of "5C" in the day-of-month field means "the first day included by the
- * calendar on or after the 5th". A value of "1C" in the day-of-week field
- * means "the first day included by the calendar on or after sunday".-->
- * <P>
- * The legal characters and the names of months and days of the week are not
- * case sensitive.
- *
- * <p>
- * <b>NOTES:</b>
- * <ul>
- * <li>Support for specifying both a day-of-week and a day-of-month value is
- * not complete (you'll need to use the '?' character in one of these fields).
- * </li>
- * <li>Overflowing ranges is supported - that is, having a larger number on
- * the left hand side than the right. You might do 22-2 to catch 10 o'clock
- * at night until 2 o'clock in the morning, or you might have NOV-FEB. It is
- * very important to note that overuse of overflowing ranges creates ranges
- * that don't make sense and no effort has been made to determine which
- * interpretation CronExpression chooses. An example would be
- * "0 0 14-6 ? * FRI-MON". </li>
- * </ul>
- * </p>
- *
- *
- * @author Sharada Jambula, James House
- * @author Contributions from Mads Henderson
- * @author Refactoring from CronTrigger to CronExpression by Aaron Craven
- * @author Scraped from the quartz project: http://www.opensymphony.com/quartz/
- */
-public class CronExpression implements Serializable, Cloneable {
-
- private static final long serialVersionUID = 12423409423L;
-
- protected static final int SECOND = 0;
- protected static final int MINUTE = 1;
- protected static final int HOUR = 2;
- protected static final int DAY_OF_MONTH = 3;
- protected static final int MONTH = 4;
- protected static final int DAY_OF_WEEK = 5;
- protected static final int YEAR = 6;
- protected static final int ALL_SPEC_INT = 99; // '*'
- protected static final int NO_SPEC_INT = 98; // '?'
- protected static final Integer ALL_SPEC = new Integer(ALL_SPEC_INT);
- protected static final Integer NO_SPEC = new Integer(NO_SPEC_INT);
-
- protected static final Map monthMap = new HashMap(20);
- protected static final Map dayMap = new HashMap(60);
- static {
- monthMap.put("JAN", new Integer(0));
- monthMap.put("FEB", new Integer(1));
- monthMap.put("MAR", new Integer(2));
- monthMap.put("APR", new Integer(3));
- monthMap.put("MAY", new Integer(4));
- monthMap.put("JUN", new Integer(5));
- monthMap.put("JUL", new Integer(6));
- monthMap.put("AUG", new Integer(7));
- monthMap.put("SEP", new Integer(8));
- monthMap.put("OCT", new Integer(9));
- monthMap.put("NOV", new Integer(10));
- monthMap.put("DEC", new Integer(11));
-
- dayMap.put("SUN", new Integer(1));
- dayMap.put("MON", new Integer(2));
- dayMap.put("TUE", new Integer(3));
- dayMap.put("WED", new Integer(4));
- dayMap.put("THU", new Integer(5));
- dayMap.put("FRI", new Integer(6));
- dayMap.put("SAT", new Integer(7));
- }
-
- private String cronExpression = null;
- private TimeZone timeZone = null;
- protected transient TreeSet seconds;
- protected transient TreeSet minutes;
- protected transient TreeSet hours;
- protected transient TreeSet daysOfMonth;
- protected transient TreeSet months;
- protected transient TreeSet daysOfWeek;
- protected transient TreeSet years;
-
- protected transient boolean lastdayOfWeek = false;
- protected transient int nthdayOfWeek = 0;
- protected transient boolean lastdayOfMonth = false;
- protected transient boolean nearestWeekday = false;
- protected transient boolean expressionParsed = false;
-
- /**
- * Constructs a new <CODE>CronExpression</CODE> based on the specified
- * parameter.
- *
- * @param cronExpression String representation of the cron expression the
- * new object should represent
- * @throws java.text.ParseException
- * if the string expression cannot be parsed into a valid
- * <CODE>CronExpression</CODE>
- */
- public CronExpression(String cronExpression) throws ParseException {
- if (cronExpression == null) {
- throw new IllegalArgumentException("cronExpression cannot be null");
- }
-
- this.cronExpression = cronExpression.toUpperCase(Locale.US);
-
- buildExpression(this.cronExpression);
- }
-
- /**
- * Indicates whether the given date satisfies the cron expression. Note that
- * milliseconds are ignored, so two Dates falling on different milliseconds
- * of the same second will always have the same result here.
- *
- * @param date the date to evaluate
- * @return a boolean indicating whether the given date satisfies the cron
- * expression
- */
- public boolean isSatisfiedBy(Date date) {
- Calendar testDateCal = Calendar.getInstance(getTimeZone());
- testDateCal.setTime(date);
- testDateCal.set(Calendar.MILLISECOND, 0);
- Date originalDate = testDateCal.getTime();
-
- testDateCal.add(Calendar.SECOND, -1);
-
- Date timeAfter = getTimeAfter(testDateCal.getTime());
-
- return ((timeAfter != null) && (timeAfter.equals(originalDate)));
- }
-
- /**
- * Returns the next date/time <I>after</I> the given date/time which
- * satisfies the cron expression.
- *
- * @param date the date/time at which to begin the search for the next valid
- * date/time
- * @return the next valid date/time
- */
- public Date getNextValidTimeAfter(Date date) {
- return getTimeAfter(date);
- }
-
- /**
- * Returns the next date/time <I>after</I> the given date/time which does
- * <I>not</I> satisfy the expression
- *
- * @param date the date/time at which to begin the search for the next
- * invalid date/time
- * @return the next valid date/time
- */
- public Date getNextInvalidTimeAfter(Date date) {
- long difference = 1000;
-
- //move back to the nearest second so differences will be accurate
- Calendar adjustCal = Calendar.getInstance(getTimeZone());
- adjustCal.setTime(date);
- adjustCal.set(Calendar.MILLISECOND, 0);
- Date lastDate = adjustCal.getTime();
-
- Date newDate = null;
-
- //TODO: (QUARTZ-481) IMPROVE THIS! The following is a BAD solution to this problem. Performance will be very bad here, depending on the cron expression. It is, however A solution.
-
- //keep getting the next included time until it's farther than one second
- // apart. At that point, lastDate is the last valid fire time. We return
- // the second immediately following it.
- while (difference == 1000) {
- newDate = getTimeAfter(lastDate);
-
- difference = newDate.getTime() - lastDate.getTime();
-
- if (difference == 1000) {
- lastDate = newDate;
- }
- }
-
- return new Date(lastDate.getTime() + 1000);
- }
-
- /**
- * Returns the time zone for which this <code>CronExpression</code>
- * will be resolved.
- */
- public TimeZone getTimeZone() {
- if (timeZone == null) {
- timeZone = TimeZone.getDefault();
- }
-
- return timeZone;
- }
-
- /**
- * Sets the time zone for which this <code>CronExpression</code>
- * will be resolved.
- */
- public void setTimeZone(TimeZone timeZone) {
- this.timeZone = timeZone;
- }
-
- /**
- * Returns the string representation of the <CODE>CronExpression</CODE>
- *
- * @return a string representation of the <CODE>CronExpression</CODE>
- */
- public String toString() {
- return cronExpression;
- }
-
- /**
- * Indicates whether the specified cron expression can be parsed into a
- * valid cron expression
- *
- * @param cronExpression the expression to evaluate
- * @return a boolean indicating whether the given expression is a valid cron
- * expression
- */
- public static boolean isValidExpression(String cronExpression) {
-
- try {
- new CronExpression(cronExpression);
- } catch (ParseException pe) {
- return false;
- }
-
- return true;
- }
-
- ////////////////////////////////////////////////////////////////////////////
- //
- // Expression Parsing Functions
- //
- ////////////////////////////////////////////////////////////////////////////
-
- protected void buildExpression(String expression) throws ParseException {
- expressionParsed = true;
-
- try {
-
- if (seconds == null) {
- seconds = new TreeSet();
- }
- if (minutes == null) {
- minutes = new TreeSet();
- }
- if (hours == null) {
- hours = new TreeSet();
- }
- if (daysOfMonth == null) {
- daysOfMonth = new TreeSet();
- }
- if (months == null) {
- months = new TreeSet();
- }
- if (daysOfWeek == null) {
- daysOfWeek = new TreeSet();
- }
- if (years == null) {
- years = new TreeSet();
- }
-
- int exprOn = SECOND;
-
- StringTokenizer exprsTok = new StringTokenizer(expression, " \t",
- false);
-
- while (exprsTok.hasMoreTokens() && exprOn <= YEAR) {
- String expr = exprsTok.nextToken().trim();
-
- // throw an exception if L is used with other days of the month
- if(exprOn == DAY_OF_MONTH && expr.indexOf('L') != -1 && expr.length() > 1 && expr.indexOf(",") >= 0) {
- throw new ParseException("Support for specifying 'L' and 'LW' with other days of the month is not implemented", -1);
- }
- // throw an exception if L is used with other days of the week
- if(exprOn == DAY_OF_WEEK && expr.indexOf('L') != -1 && expr.length() > 1 && expr.indexOf(",") >= 0) {
- throw new ParseException("Support for specifying 'L' with other days of the week is not implemented", -1);
- }
-
- StringTokenizer vTok = new StringTokenizer(expr, ",");
- while (vTok.hasMoreTokens()) {
- String v = vTok.nextToken();
- storeExpressionVals(0, v, exprOn);
- }
-
- exprOn++;
- }
-
- if (exprOn <= DAY_OF_WEEK) {
- throw new ParseException("Unexpected end of expression.",
- expression.length());
- }
-
- if (exprOn <= YEAR) {
- storeExpressionVals(0, "*", YEAR);
- }
-
- TreeSet dow = getSet(DAY_OF_WEEK);
- TreeSet dom = getSet(DAY_OF_MONTH);
-
- // Copying the logic from the UnsupportedOperationException below
- boolean dayOfMSpec = !dom.contains(NO_SPEC);
- boolean dayOfWSpec = !dow.contains(NO_SPEC);
-
- if (dayOfMSpec && !dayOfWSpec) {
- // skip
- } else if (dayOfWSpec && !dayOfMSpec) {
- // skip
- } else {
- throw new ParseException(
- "Support for specifying both a day-of-week AND a day-of-month parameter is not implemented.", 0);
- }
- } catch (ParseException pe) {
- throw pe;
- } catch (Exception e) {
- throw new ParseException("Illegal cron expression format ("
- + e.toString() + ")", 0);
- }
- }
-
- protected int storeExpressionVals(int pos, String s, int type)
- throws ParseException {
-
- int incr = 0;
- int i = skipWhiteSpace(pos, s);
- if (i >= s.length()) {
- return i;
- }
- char c = s.charAt(i);
- if ((c >= 'A') && (c <= 'Z') && (!s.equals("L")) && (!s.equals("LW"))) {
- String sub = s.substring(i, i + 3);
- int sval = -1;
- int eval = -1;
- if (type == MONTH) {
- sval = getMonthNumber(sub) + 1;
- if (sval <= 0) {
- throw new ParseException("Invalid Month value: '" + sub + "'", i);
- }
- if (s.length() > i + 3) {
- c = s.charAt(i + 3);
- if (c == '-') {
- i += 4;
- sub = s.substring(i, i + 3);
- eval = getMonthNumber(sub) + 1;
- if (eval <= 0) {
- throw new ParseException("Invalid Month value: '" + sub + "'", i);
- }
- }
- }
- } else if (type == DAY_OF_WEEK) {
- sval = getDayOfWeekNumber(sub);
- if (sval < 0) {
- throw new ParseException("Invalid Day-of-Week value: '"
- + sub + "'", i);
- }
- if (s.length() > i + 3) {
- c = s.charAt(i + 3);
- if (c == '-') {
- i += 4;
- sub = s.substring(i, i + 3);
- eval = getDayOfWeekNumber(sub);
- if (eval < 0) {
- throw new ParseException(
- "Invalid Day-of-Week value: '" + sub
- + "'", i);
- }
- } else if (c == '#') {
- try {
- i += 4;
- nthdayOfWeek = Integer.parseInt(s.substring(i));
- if (nthdayOfWeek < 1 || nthdayOfWeek > 5) {
- throw new Exception();
- }
- } catch (Exception e) {
- throw new ParseException(
- "A numeric value between 1 and 5 must follow the '#' option",
- i);
- }
- } else if (c == 'L') {
- lastdayOfWeek = true;
- i++;
- }
- }
-
- } else {
- throw new ParseException(
- "Illegal characters for this position: '" + sub + "'",
- i);
- }
- if (eval != -1) {
- incr = 1;
- }
- addToSet(sval, eval, incr, type);
- return (i + 3);
- }
-
- if (c == '?') {
- i++;
- if ((i + 1) < s.length()
- && (s.charAt(i) != ' ' && s.charAt(i + 1) != '\t')) {
- throw new ParseException("Illegal character after '?': "
- + s.charAt(i), i);
- }
- if (type != DAY_OF_WEEK && type != DAY_OF_MONTH) {
- throw new ParseException(
- "'?' can only be specfied for Day-of-Month or Day-of-Week.",
- i);
- }
- if (type == DAY_OF_WEEK && !lastdayOfMonth) {
- int val = ((Integer) daysOfMonth.last()).intValue();
- if (val == NO_SPEC_INT) {
- throw new ParseException(
- "'?' can only be specfied for Day-of-Month -OR- Day-of-Week.",
- i);
- }
- }
-
- addToSet(NO_SPEC_INT, -1, 0, type);
- return i;
- }
-
- if (c == '*' || c == '/') {
- if (c == '*' && (i + 1) >= s.length()) {
- addToSet(ALL_SPEC_INT, -1, incr, type);
- return i + 1;
- } else if (c == '/'
- && ((i + 1) >= s.length() || s.charAt(i + 1) == ' ' || s
- .charAt(i + 1) == '\t')) {
- throw new ParseException("'/' must be followed by an integer.", i);
- } else if (c == '*') {
- i++;
- }
- c = s.charAt(i);
- if (c == '/') { // is an increment specified?
- i++;
- if (i >= s.length()) {
- throw new ParseException("Unexpected end of string.", i);
- }
-
- incr = getNumericValue(s, i);
-
- i++;
- if (incr > 10) {
- i++;
- }
- if (incr > 59 && (type == SECOND || type == MINUTE)) {
- throw new ParseException("Increment > 60 : " + incr, i);
- } else if (incr > 23 && (type == HOUR)) {
- throw new ParseException("Increment > 24 : " + incr, i);
- } else if (incr > 31 && (type == DAY_OF_MONTH)) {
- throw new ParseException("Increment > 31 : " + incr, i);
- } else if (incr > 7 && (type == DAY_OF_WEEK)) {
- throw new ParseException("Increment > 7 : " + incr, i);
- } else if (incr > 12 && (type == MONTH)) {
- throw new ParseException("Increment > 12 : " + incr, i);
- }
- } else {
- incr = 1;
- }
-
- addToSet(ALL_SPEC_INT, -1, incr, type);
- return i;
- } else if (c == 'L') {
- i++;
- if (type == DAY_OF_MONTH) {
- lastdayOfMonth = true;
- }
- if (type == DAY_OF_WEEK) {
- addToSet(7, 7, 0, type);
- }
- if(type == DAY_OF_MONTH && s.length() > i) {
- c = s.charAt(i);
- if(c == 'W') {
- nearestWeekday = true;
- i++;
- }
- }
- return i;
- } else if (c >= '0' && c <= '9') {
- int val = Integer.parseInt(String.valueOf(c));
- i++;
- if (i >= s.length()) {
- addToSet(val, -1, -1, type);
- } else {
- c = s.charAt(i);
- if (c >= '0' && c <= '9') {
- ValueSet vs = getValue(val, s, i);
- val = vs.value;
- i = vs.pos;
- }
- i = checkNext(i, s, val, type);
- return i;
- }
- } else {
- throw new ParseException("Unexpected character: " + c, i);
- }
-
- return i;
- }
-
- protected int checkNext(int pos, String s, int val, int type)
- throws ParseException {
-
- int end = -1;
- int i = pos;
-
- if (i >= s.length()) {
- addToSet(val, end, -1, type);
- return i;
- }
-
- char c = s.charAt(pos);
-
- if (c == 'L') {
- if (type == DAY_OF_WEEK) {
- lastdayOfWeek = true;
- } else {
- throw new ParseException("'L' option is not valid here. (pos=" + i + ")", i);
- }
- TreeSet set = getSet(type);
- set.add(new Integer(val));
- i++;
- return i;
- }
-
- if (c == 'W') {
- if (type == DAY_OF_MONTH) {
- nearestWeekday = true;
- } else {
- throw new ParseException("'W' option is not valid here. (pos=" + i + ")", i);
- }
- TreeSet set = getSet(type);
- set.add(new Integer(val));
- i++;
- return i;
- }
-
- if (c == '#') {
- if (type != DAY_OF_WEEK) {
- throw new ParseException("'#' option is not valid here. (pos=" + i + ")", i);
- }
- i++;
- try {
- nthdayOfWeek = Integer.parseInt(s.substring(i));
- if (nthdayOfWeek < 1 || nthdayOfWeek > 5) {
- throw new Exception();
- }
- } catch (Exception e) {
- throw new ParseException(
- "A numeric value between 1 and 5 must follow the '#' option",
- i);
- }
-
- TreeSet set = getSet(type);
- set.add(new Integer(val));
- i++;
- return i;
- }
-
- if (c == '-') {
- i++;
- c = s.charAt(i);
- int v = Integer.parseInt(String.valueOf(c));
- end = v;
- i++;
- if (i >= s.length()) {
- addToSet(val, end, 1, type);
- return i;
- }
- c = s.charAt(i);
- if (c >= '0' && c <= '9') {
- ValueSet vs = getValue(v, s, i);
- int v1 = vs.value;
- end = v1;
- i = vs.pos;
- }
- if (i < s.length() && ((c = s.charAt(i)) == '/')) {
- i++;
- c = s.charAt(i);
- int v2 = Integer.parseInt(String.valueOf(c));
- i++;
- if (i >= s.length()) {
- addToSet(val, end, v2, type);
- return i;
- }
- c = s.charAt(i);
- if (c >= '0' && c <= '9') {
- ValueSet vs = getValue(v2, s, i);
- int v3 = vs.value;
- addToSet(val, end, v3, type);
- i = vs.pos;
- return i;
- } else {
- addToSet(val, end, v2, type);
- return i;
- }
- } else {
- addToSet(val, end, 1, type);
- return i;
- }
- }
-
- if (c == '/') {
- i++;
- c = s.charAt(i);
- int v2 = Integer.parseInt(String.valueOf(c));
- i++;
- if (i >= s.length()) {
- addToSet(val, end, v2, type);
- return i;
- }
- c = s.charAt(i);
- if (c >= '0' && c <= '9') {
- ValueSet vs = getValue(v2, s, i);
- int v3 = vs.value;
- addToSet(val, end, v3, type);
- i = vs.pos;
- return i;
- } else {
- throw new ParseException("Unexpected character '" + c + "' after '/'", i);
- }
- }
-
- addToSet(val, end, 0, type);
- i++;
- return i;
- }
-
- public String getCronExpression() {
- return cronExpression;
- }
-
- public String getExpressionSummary() {
- StringBuffer buf = new StringBuffer();
-
- buf.append("seconds: ");
- buf.append(getExpressionSetSummary(seconds));
- buf.append("\n");
- buf.append("minutes: ");
- buf.append(getExpressionSetSummary(minutes));
- buf.append("\n");
- buf.append("hours: ");
- buf.append(getExpressionSetSummary(hours));
- buf.append("\n");
- buf.append("daysOfMonth: ");
- buf.append(getExpressionSetSummary(daysOfMonth));
- buf.append("\n");
- buf.append("months: ");
- buf.append(getExpressionSetSummary(months));
- buf.append("\n");
- buf.append("daysOfWeek: ");
- buf.append(getExpressionSetSummary(daysOfWeek));
- buf.append("\n");
- buf.append("lastdayOfWeek: ");
- buf.append(lastdayOfWeek);
- buf.append("\n");
- buf.append("nearestWeekday: ");
- buf.append(nearestWeekday);
- buf.append("\n");
- buf.append("NthDayOfWeek: ");
- buf.append(nthdayOfWeek);
- buf.append("\n");
- buf.append("lastdayOfMonth: ");
- buf.append(lastdayOfMonth);
- buf.append("\n");
- buf.append("years: ");
- buf.append(getExpressionSetSummary(years));
- buf.append("\n");
-
- return buf.toString();
- }
-
- protected String getExpressionSetSummary(java.util.Set set) {
-
- if (set.contains(NO_SPEC)) {
- return "?";
- }
- if (set.contains(ALL_SPEC)) {
- return "*";
- }
-
- StringBuffer buf = new StringBuffer();
-
- Iterator itr = set.iterator();
- boolean first = true;
- while (itr.hasNext()) {
- Integer iVal = (Integer) itr.next();
- String val = iVal.toString();
- if (!first) {
- buf.append(",");
- }
- buf.append(val);
- first = false;
- }
-
- return buf.toString();
- }
-
- protected String getExpressionSetSummary(java.util.ArrayList list) {
-
- if (list.contains(NO_SPEC)) {
- return "?";
- }
- if (list.contains(ALL_SPEC)) {
- return "*";
- }
-
- StringBuffer buf = new StringBuffer();
-
- Iterator itr = list.iterator();
- boolean first = true;
- while (itr.hasNext()) {
- Integer iVal = (Integer) itr.next();
- String val = iVal.toString();
- if (!first) {
- buf.append(",");
- }
- buf.append(val);
- first = false;
- }
-
- return buf.toString();
- }
-
- protected int skipWhiteSpace(int i, String s) {
- for (; i < s.length() && (s.charAt(i) == ' ' || s.charAt(i) == '\t'); i++) {
- ;
- }
-
- return i;
- }
-
- protected int findNextWhiteSpace(int i, String s) {
- for (; i < s.length() && (s.charAt(i) != ' ' || s.charAt(i) != '\t'); i++) {
- ;
- }
-
- return i;
- }
-
- protected void addToSet(int val, int end, int incr, int type)
- throws ParseException {
-
- TreeSet set = getSet(type);
-
- if (type == SECOND || type == MINUTE) {
- if ((val < 0 || val > 59 || end > 59) && (val != ALL_SPEC_INT)) {
- throw new ParseException(
- "Minute and Second values must be between 0 and 59",
- -1);
- }
- } else if (type == HOUR) {
- if ((val < 0 || val > 23 || end > 23) && (val != ALL_SPEC_INT)) {
- throw new ParseException(
- "Hour values must be between 0 and 23", -1);
- }
- } else if (type == DAY_OF_MONTH) {
- if ((val < 1 || val > 31 || end > 31) && (val != ALL_SPEC_INT)
- && (val != NO_SPEC_INT)) {
- throw new ParseException(
- "Day of month values must be between 1 and 31", -1);
- }
- } else if (type == MONTH) {
- if ((val < 1 || val > 12 || end > 12) && (val != ALL_SPEC_INT)) {
- throw new ParseException(
- "Month values must be between 1 and 12", -1);
- }
- } else if (type == DAY_OF_WEEK) {
- if ((val == 0 || val > 7 || end > 7) && (val != ALL_SPEC_INT)
- && (val != NO_SPEC_INT)) {
- throw new ParseException(
- "Day-of-Week values must be between 1 and 7", -1);
- }
- }
-
- if ((incr == 0 || incr == -1) && val != ALL_SPEC_INT) {
- if (val != -1) {
- set.add(new Integer(val));
- } else {
- set.add(NO_SPEC);
- }
-
- return;
- }
-
- int startAt = val;
- int stopAt = end;
-
- if (val == ALL_SPEC_INT && incr <= 0) {
- incr = 1;
- set.add(ALL_SPEC); // put in a marker, but also fill values
- }
-
- if (type == SECOND || type == MINUTE) {
- if (stopAt == -1) {
- stopAt = 59;
- }
- if (startAt == -1 || startAt == ALL_SPEC_INT) {
- startAt = 0;
- }
- } else if (type == HOUR) {
- if (stopAt == -1) {
- stopAt = 23;
- }
- if (startAt == -1 || startAt == ALL_SPEC_INT) {
- startAt = 0;
- }
- } else if (type == DAY_OF_MONTH) {
- if (stopAt == -1) {
- stopAt = 31;
- }
- if (startAt == -1 || startAt == ALL_SPEC_INT) {
- startAt = 1;
- }
- } else if (type == MONTH) {
- if (stopAt == -1) {
- stopAt = 12;
- }
- if (startAt == -1 || startAt == ALL_SPEC_INT) {
- startAt = 1;
- }
- } else if (type == DAY_OF_WEEK) {
- if (stopAt == -1) {
- stopAt = 7;
- }
- if (startAt == -1 || startAt == ALL_SPEC_INT) {
- startAt = 1;
- }
- } else if (type == YEAR) {
- if (stopAt == -1) {
- stopAt = 2099;
- }
- if (startAt == -1 || startAt == ALL_SPEC_INT) {
- startAt = 1970;
- }
- }
-
- // if the end of the range is before the start, then we need to overflow into
- // the next day, month etc. This is done by adding the maximum amount for that
- // type, and using modulus max to determine the value being added.
- int max = -1;
- if (stopAt < startAt) {
- switch (type) {
- case SECOND : max = 60; break;
- case MINUTE : max = 60; break;
- case HOUR : max = 24; break;
- case MONTH : max = 12; break;
- case DAY_OF_WEEK : max = 7; break;
- case DAY_OF_MONTH : max = 31; break;
- case YEAR : throw new IllegalArgumentException("Start year must be less than stop year");
- default : throw new IllegalArgumentException("Unexpected type encountered");
- }
- stopAt += max;
- }
-
- for (int i = startAt; i <= stopAt; i += incr) {
- if (max == -1) {
- // ie: there's no max to overflow over
- set.add(new Integer(i));
- } else {
- // take the modulus to get the real value
- int i2 = i % max;
-
- // 1-indexed ranges should not include 0, and should include their max
- if (i2 == 0 && (type == MONTH || type == DAY_OF_WEEK || type == DAY_OF_MONTH) ) {
- i2 = max;
- }
-
- set.add(new Integer(i2));
- }
- }
- }
-
- protected TreeSet getSet(int type) {
- switch (type) {
- case SECOND:
- return seconds;
- case MINUTE:
- return minutes;
- case HOUR:
- return hours;
- case DAY_OF_MONTH:
- return daysOfMonth;
- case MONTH:
- return months;
- case DAY_OF_WEEK:
- return daysOfWeek;
- case YEAR:
- return years;
- default:
- return null;
- }
- }
-
- protected ValueSet getValue(int v, String s, int i) {
- char c = s.charAt(i);
- String s1 = String.valueOf(v);
- while (c >= '0' && c <= '9') {
- s1 += c;
- i++;
- if (i >= s.length()) {
- break;
- }
- c = s.charAt(i);
- }
- ValueSet val = new ValueSet();
-
- val.pos = (i < s.length()) ? i : i + 1;
- val.value = Integer.parseInt(s1);
- return val;
- }
-
- protected int getNumericValue(String s, int i) {
- int endOfVal = findNextWhiteSpace(i, s);
- String val = s.substring(i, endOfVal);
- return Integer.parseInt(val);
- }
-
- protected int getMonthNumber(String s) {
- Integer integer = (Integer) monthMap.get(s);
-
- if (integer == null) {
- return -1;
- }
-
- return integer.intValue();
- }
-
- protected int getDayOfWeekNumber(String s) {
- Integer integer = (Integer) dayMap.get(s);
-
- if (integer == null) {
- return -1;
- }
-
- return integer.intValue();
- }
-
- ////////////////////////////////////////////////////////////////////////////
- //
- // Computation Functions
- //
- ////////////////////////////////////////////////////////////////////////////
-
- protected Date getTimeAfter(Date afterTime) {
-
- Calendar cl = Calendar.getInstance(getTimeZone());
-
- // move ahead one second, since we're computing the time *after* the
- // given time
- afterTime = new Date(afterTime.getTime() + 1000);
- // CronTrigger does not deal with milliseconds
- cl.setTime(afterTime);
- cl.set(Calendar.MILLISECOND, 0);
-
- boolean gotOne = false;
- // loop until we've computed the next time, or we've past the endTime
- while (!gotOne) {
-
- //if (endTime != null && cl.getTime().after(endTime)) return null;
- if(cl.get(Calendar.YEAR) > 2999) { // prevent endless loop...
- return null;
- }
-
- SortedSet st = null;
- int t = 0;
-
- int sec = cl.get(Calendar.SECOND);
- int min = cl.get(Calendar.MINUTE);
-
- // get second.................................................
- st = seconds.tailSet(new Integer(sec));
- if (st != null && st.size() != 0) {
- sec = ((Integer) st.first()).intValue();
- } else {
- sec = ((Integer) seconds.first()).intValue();
- min++;
- cl.set(Calendar.MINUTE, min);
- }
- cl.set(Calendar.SECOND, sec);
-
- min = cl.get(Calendar.MINUTE);
- int hr = cl.get(Calendar.HOUR_OF_DAY);
- t = -1;
-
- // get minute.................................................
- st = minutes.tailSet(new Integer(min));
- if (st != null && st.size() != 0) {
- t = min;
- min = ((Integer) st.first()).intValue();
- } else {
- min = ((Integer) minutes.first()).intValue();
- hr++;
- }
- if (min != t) {
- cl.set(Calendar.SECOND, 0);
- cl.set(Calendar.MINUTE, min);
- setCalendarHour(cl, hr);
- continue;
- }
- cl.set(Calendar.MINUTE, min);
-
- hr = cl.get(Calendar.HOUR_OF_DAY);
- int day = cl.get(Calendar.DAY_OF_MONTH);
- t = -1;
-
- // get hour...................................................
- st = hours.tailSet(new Integer(hr));
- if (st != null && st.size() != 0) {
- t = hr;
- hr = ((Integer) st.first()).intValue();
- } else {
- hr = ((Integer) hours.first()).intValue();
- day++;
- }
- if (hr != t) {
- cl.set(Calendar.SECOND, 0);
- cl.set(Calendar.MINUTE, 0);
- cl.set(Calendar.DAY_OF_MONTH, day);
- setCalendarHour(cl, hr);
- continue;
- }
- cl.set(Calendar.HOUR_OF_DAY, hr);
-
- day = cl.get(Calendar.DAY_OF_MONTH);
- int mon = cl.get(Calendar.MONTH) + 1;
- // '+ 1' because calendar is 0-based for this field, and we are
- // 1-based
- t = -1;
- int tmon = mon;
-
- // get day...................................................
- boolean dayOfMSpec = !daysOfMonth.contains(NO_SPEC);
- boolean dayOfWSpec = !daysOfWeek.contains(NO_SPEC);
- if (dayOfMSpec && !dayOfWSpec) { // get day by day of month rule
- st = daysOfMonth.tailSet(new Integer(day));
- if (lastdayOfMonth) {
- if(!nearestWeekday) {
- t = day;
- day = getLastDayOfMonth(mon, cl.get(Calendar.YEAR));
- } else {
- t = day;
- day = getLastDayOfMonth(mon, cl.get(Calendar.YEAR));
-
- java.util.Calendar tcal = java.util.Calendar.getInstance(getTimeZone());
- tcal.set(Calendar.SECOND, 0);
- tcal.set(Calendar.MINUTE, 0);
- tcal.set(Calendar.HOUR_OF_DAY, 0);
- tcal.set(Calendar.DAY_OF_MONTH, day);
- tcal.set(Calendar.MONTH, mon - 1);
- tcal.set(Calendar.YEAR, cl.get(Calendar.YEAR));
-
- int ldom = getLastDayOfMonth(mon, cl.get(Calendar.YEAR));
- int dow = tcal.get(Calendar.DAY_OF_WEEK);
-
- if(dow == Calendar.SATURDAY && day == 1) {
- day += 2;
- } else if(dow == Calendar.SATURDAY) {
- day -= 1;
- } else if(dow == Calendar.SUNDAY && day == ldom) {
- day -= 2;
- } else if(dow == Calendar.SUNDAY) {
- day += 1;
- }
-
- tcal.set(Calendar.SECOND, sec);
- tcal.set(Calendar.MINUTE, min);
- tcal.set(Calendar.HOUR_OF_DAY, hr);
- tcal.set(Calendar.DAY_OF_MONTH, day);
- tcal.set(Calendar.MONTH, mon - 1);
- Date nTime = tcal.getTime();
- if(nTime.before(afterTime)) {
- day = 1;
- mon++;
- }
- }
- } else if(nearestWeekday) {
- t = day;
- day = ((Integer) daysOfMonth.first()).intValue();
-
- java.util.Calendar tcal = java.util.Calendar.getInstance(getTimeZone());
- tcal.set(Calendar.SECOND, 0);
- tcal.set(Calendar.MINUTE, 0);
- tcal.set(Calendar.HOUR_OF_DAY, 0);
- tcal.set(Calendar.DAY_OF_MONTH, day);
- tcal.set(Calendar.MONTH, mon - 1);
- tcal.set(Calendar.YEAR, cl.get(Calendar.YEAR));
-
- int ldom = getLastDayOfMonth(mon, cl.get(Calendar.YEAR));
- int dow = tcal.get(Calendar.DAY_OF_WEEK);
-
- if(dow == Calendar.SATURDAY && day == 1) {
- day += 2;
- } else if(dow == Calendar.SATURDAY) {
- day -= 1;
- } else if(dow == Calendar.SUNDAY && day == ldom) {
- day -= 2;
- } else if(dow == Calendar.SUNDAY) {
- day += 1;
- }
-
-
- tcal.set(Calendar.SECOND, sec);
- tcal.set(Calendar.MINUTE, min);
- tcal.set(Calendar.HOUR_OF_DAY, hr);
- tcal.set(Calendar.DAY_OF_MONTH, day);
- tcal.set(Calendar.MONTH, mon - 1);
- Date nTime = tcal.getTime();
- if(nTime.before(afterTime)) {
- day = ((Integer) daysOfMonth.first()).intValue();
- mon++;
- }
- } else if (st != null && st.size() != 0) {
- t = day;
- day = ((Integer) st.first()).intValue();
- // make sure we don't over-run a short month, such as february
- int lastDay = getLastDayOfMonth(mon, cl.get(Calendar.YEAR));
- if (day > lastDay) {
- day = ((Integer) daysOfMonth.first()).intValue();
- mon++;
- }
- } else {
- day = ((Integer) daysOfMonth.first()).intValue();
- mon++;
- }
-
- if (day != t || mon != tmon) {
- cl.set(Calendar.SECOND, 0);
- cl.set(Calendar.MINUTE, 0);
- cl.set(Calendar.HOUR_OF_DAY, 0);
- cl.set(Calendar.DAY_OF_MONTH, day);
- cl.set(Calendar.MONTH, mon - 1);
- // '- 1' because calendar is 0-based for this field, and we
- // are 1-based
- continue;
- }
- } else if (dayOfWSpec && !dayOfMSpec) { // get day by day of week rule
- if (lastdayOfWeek) { // are we looking for the last XXX day of
- // the month?
- int dow = ((Integer) daysOfWeek.first()).intValue(); // desired
- // d-o-w
- int cDow = cl.get(Calendar.DAY_OF_WEEK); // current d-o-w
- int daysToAdd = 0;
- if (cDow < dow) {
- daysToAdd = dow - cDow;
- }
- if (cDow > dow) {
- daysToAdd = dow + (7 - cDow);
- }
-
- int lDay = getLastDayOfMonth(mon, cl.get(Calendar.YEAR));
-
- if (day + daysToAdd > lDay) { // did we already miss the
- // last one?
- cl.set(Calendar.SECOND, 0);
- cl.set(Calendar.MINUTE, 0);
- cl.set(Calendar.HOUR_OF_DAY, 0);
- cl.set(Calendar.DAY_OF_MONTH, 1);
- cl.set(Calendar.MONTH, mon);
- // no '- 1' here because we are promoting the month
- continue;
- }
-
- // find date of last occurance of this day in this month...
- while ((day + daysToAdd + 7) <= lDay) {
- daysToAdd += 7;
- }
-
- day += daysToAdd;
-
- if (daysToAdd > 0) {
- cl.set(Calendar.SECOND, 0);
- cl.set(Calendar.MINUTE, 0);
- cl.set(Calendar.HOUR_OF_DAY, 0);
- cl.set(Calendar.DAY_OF_MONTH, day);
- cl.set(Calendar.MONTH, mon - 1);
- // '- 1' here because we are not promoting the month
- continue;
- }
-
- } else if (nthdayOfWeek != 0) {
- // are we looking for the Nth XXX day in the month?
- int dow = ((Integer) daysOfWeek.first()).intValue(); // desired
- // d-o-w
- int cDow = cl.get(Calendar.DAY_OF_WEEK); // current d-o-w
- int daysToAdd = 0;
- if (cDow < dow) {
- daysToAdd = dow - cDow;
- } else if (cDow > dow) {
- daysToAdd = dow + (7 - cDow);
- }
-
- boolean dayShifted = false;
- if (daysToAdd > 0) {
- dayShifted = true;
- }
-
- day += daysToAdd;
- int weekOfMonth = day / 7;
- if (day % 7 > 0) {
- weekOfMonth++;
- }
-
- daysToAdd = (nthdayOfWeek - weekOfMonth) * 7;
- day += daysToAdd;
- if (daysToAdd < 0
- || day > getLastDayOfMonth(mon, cl
- .get(Calendar.YEAR))) {
- cl.set(Calendar.SECOND, 0);
- cl.set(Calendar.MINUTE, 0);
- cl.set(Calendar.HOUR_OF_DAY, 0);
- cl.set(Calendar.DAY_OF_MONTH, 1);
- cl.set(Calendar.MONTH, mon);
- // no '- 1' here because we are promoting the month
- continue;
- } else if (daysToAdd > 0 || dayShifted) {
- cl.set(Calendar.SECOND, 0);
- cl.set(Calendar.MINUTE, 0);
- cl.set(Calendar.HOUR_OF_DAY, 0);
- cl.set(Calendar.DAY_OF_MONTH, day);
- cl.set(Calendar.MONTH, mon - 1);
- // '- 1' here because we are NOT promoting the month
- continue;
- }
- } else {
- int cDow = cl.get(Calendar.DAY_OF_WEEK); // current d-o-w
- int dow = ((Integer) daysOfWeek.first()).intValue(); // desired
- // d-o-w
- st = daysOfWeek.tailSet(new Integer(cDow));
- if (st != null && st.size() > 0) {
- dow = ((Integer) st.first()).intValue();
- }
-
- int daysToAdd = 0;
- if (cDow < dow) {
- daysToAdd = dow - cDow;
- }
- if (cDow > dow) {
- daysToAdd = dow + (7 - cDow);
- }
-
- int lDay = getLastDayOfMonth(mon, cl.get(Calendar.YEAR));
-
- if (day + daysToAdd > lDay) { // will we pass the end of
- // the month?
- cl.set(Calendar.SECOND, 0);
- cl.set(Calendar.MINUTE, 0);
- cl.set(Calendar.HOUR_OF_DAY, 0);
- cl.set(Calendar.DAY_OF_MONTH, 1);
- cl.set(Calendar.MONTH, mon);
- // no '- 1' here because we are promoting the month
- continue;
- } else if (daysToAdd > 0) { // are we swithing days?
- cl.set(Calendar.SECOND, 0);
- cl.set(Calendar.MINUTE, 0);
- cl.set(Calendar.HOUR_OF_DAY, 0);
- cl.set(Calendar.DAY_OF_MONTH, day + daysToAdd);
- cl.set(Calendar.MONTH, mon - 1);
- // '- 1' because calendar is 0-based for this field,
- // and we are 1-based
- continue;
- }
- }
- } else { // dayOfWSpec && !dayOfMSpec
- throw new UnsupportedOperationException(
- "Support for specifying both a day-of-week AND a day-of-month parameter is not implemented.");
- // TODO:
- }
- cl.set(Calendar.DAY_OF_MONTH, day);
-
- mon = cl.get(Calendar.MONTH) + 1;
- // '+ 1' because calendar is 0-based for this field, and we are
- // 1-based
- int year = cl.get(Calendar.YEAR);
- t = -1;
-
- // test for expressions that never generate a valid fire date,
- // but keep looping...
- if (year > 2099) {
- return null;
- }
-
- // get month...................................................
- st = months.tailSet(new Integer(mon));
- if (st != null && st.size() != 0) {
- t = mon;
- mon = ((Integer) st.first()).intValue();
- } else {
- mon = ((Integer) months.first()).intValue();
- year++;
- }
- if (mon != t) {
- cl.set(Calendar.SECOND, 0);
- cl.set(Calendar.MINUTE, 0);
- cl.set(Calendar.HOUR_OF_DAY, 0);
- cl.set(Calendar.DAY_OF_MONTH, 1);
- cl.set(Calendar.MONTH, mon - 1);
- // '- 1' because calendar is 0-based for this field, and we are
- // 1-based
- cl.set(Calendar.YEAR, year);
- continue;
- }
- cl.set(Calendar.MONTH, mon - 1);
- // '- 1' because calendar is 0-based for this field, and we are
- // 1-based
-
- year = cl.get(Calendar.YEAR);
- t = -1;
-
- // get year...................................................
- st = years.tailSet(new Integer(year));
- if (st != null && st.size() != 0) {
- t = year;
- year = ((Integer) st.first()).intValue();
- } else {
- return null; // ran out of years...
- }
-
- if (year != t) {
- cl.set(Calendar.SECOND, 0);
- cl.set(Calendar.MINUTE, 0);
- cl.set(Calendar.HOUR_OF_DAY, 0);
- cl.set(Calendar.DAY_OF_MONTH, 1);
- cl.set(Calendar.MONTH, 0);
- // '- 1' because calendar is 0-based for this field, and we are
- // 1-based
- cl.set(Calendar.YEAR, year);
- continue;
- }
- cl.set(Calendar.YEAR, year);
-
- gotOne = true;
- } // while( !done )
-
- return cl.getTime();
- }
-
- /**
- * Advance the calendar to the particular hour paying particular attention
- * to daylight saving problems.
- *
- * @param cal
- * @param hour
- */
- protected void setCalendarHour(Calendar cal, int hour) {
- cal.set(java.util.Calendar.HOUR_OF_DAY, hour);
- if (cal.get(java.util.Calendar.HOUR_OF_DAY) != hour && hour != 24) {
- cal.set(java.util.Calendar.HOUR_OF_DAY, hour + 1);
- }
- }
-
- /**
- * NOT YET IMPLEMENTED: Returns the time before the given time
- * that the <code>CronExpression</code> matches.
- */
- protected Date getTimeBefore(Date endTime) {
- // TODO: implement QUARTZ-423
- return null;
- }
-
- /**
- * NOT YET IMPLEMENTED: Returns the final time that the
- * <code>CronExpression</code> will match.
- */
- public Date getFinalFireTime() {
- // TODO: implement QUARTZ-423
- return null;
- }
-
- protected boolean isLeapYear(int year) {
- return ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0));
- }
-
- protected int getLastDayOfMonth(int monthNum, int year) {
-
- switch (monthNum) {
- case 1:
- return 31;
- case 2:
- return (isLeapYear(year)) ? 29 : 28;
- case 3:
- return 31;
- case 4:
- return 30;
- case 5:
- return 31;
- case 6:
- return 30;
- case 7:
- return 31;
- case 8:
- return 31;
- case 9:
- return 30;
- case 10:
- return 31;
- case 11:
- return 30;
- case 12:
- return 31;
- default:
- throw new IllegalArgumentException("Illegal month number: "
- + monthNum);
- }
- }
-
-
- private void readObject(java.io.ObjectInputStream stream)
- throws java.io.IOException, ClassNotFoundException {
-
- stream.defaultReadObject();
- try {
- buildExpression(cronExpression);
- } catch (Exception ignore) {
- } // never happens
- }
-
- public Object clone() {
- CronExpression copy = null;
- try {
- copy = new CronExpression(getCronExpression());
- copy.setTimeZone(getTimeZone());
- } catch (ParseException ex) { // never happens since the source is valid...
- throw new IncompatibleClassChangeError("Not Cloneable.");
- }
- return copy;
- }
-}
-
-class ValueSet {
- public int value;
-
- public int pos;
-}
+package org.apache.ode.utils;
+
+import java.io.Serializable;
+import java.text.ParseException;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.Map;
+import java.util.SortedSet;
+import java.util.StringTokenizer;
+import java.util.TimeZone;
+import java.util.TreeSet;
+
+
+/**
+ * Provides a parser and evaluator for unix-like cron expressions. Cron
+ * expressions provide the ability to specify complex time combinations such as
+ * "At 8:00am every Monday through Friday" or "At 1:30am every
+ * last Friday of the month".
+ * <P>
+ * Cron expressions are comprised of 6 required fields and one optional field
+ * separated by white space. The fields respectively are described as follows:
+ *
+ * <table cellspacing="8">
+ * <tr>
+ * <th align="left">Field Name</th>
+ * <th align="left"> </th>
+ * <th align="left">Allowed Values</th>
+ * <th align="left"> </th>
+ * <th align="left">Allowed Special Characters</th>
+ * </tr>
+ * <tr>
+ * <td align="left"><code>Seconds</code></td>
+ * <td align="left"> </th>
+ * <td align="left"><code>0-59</code></td>
+ * <td align="left"> </th>
+ * <td align="left"><code>, - * /</code></td>
+ * </tr>
+ * <tr>
+ * <td align="left"><code>Minutes</code></td>
+ * <td align="left"> </th>
+ * <td align="left"><code>0-59</code></td>
+ * <td align="left"> </th>
+ * <td align="left"><code>, - * /</code></td>
+ * </tr>
+ * <tr>
+ * <td align="left"><code>Hours</code></td>
+ * <td align="left"> </th>
+ * <td align="left"><code>0-23</code></td>
+ * <td align="left"> </th>
+ * <td align="left"><code>, - * /</code></td>
+ * </tr>
+ * <tr>
+ * <td align="left"><code>Day-of-month</code></td>
+ * <td align="left"> </th>
+ * <td align="left"><code>1-31</code></td>
+ * <td align="left"> </th>
+ * <td align="left"><code>, - * ? / L W</code></td>
+ * </tr>
+ * <tr>
+ * <td align="left"><code>Month</code></td>
+ * <td align="left"> </th>
+ * <td align="left"><code>1-12 or JAN-DEC</code></td>
+ * <td align="left"> </th>
+ * <td align="left"><code>, - * /</code></td>
+ * </tr>
+ * <tr>
+ * <td align="left"><code>Day-of-Week</code></td>
+ * <td align="left"> </th>
+ * <td align="left"><code>1-7 or SUN-SAT</code></td>
+ * <td align="left"> </th>
+ * <td align="left"><code>, - * ? / L #</code></td>
+ * </tr>
+ * <tr>
+ * <td align="left"><code>Year (Optional)</code></td>
+ * <td align="left"> </th>
+ * <td align="left"><code>empty, 1970-2099</code></td>
+ * <td align="left"> </th>
+ * <td align="left"><code>, - * /</code></td>
+ * </tr>
+ * </table>
+ * <P>
+ * The '*' character is used to specify all values. For example, "*"
+ * in the minute field means "every minute".
+ * <P>
+ * The '?' character is allowed for the day-of-month and day-of-week fields. It
+ * is used to specify 'no specific value'. This is useful when you need to
+ * specify something in one of the two fields, but not the other.
+ * <P>
+ * The '-' character is used to specify ranges For example "10-12" in
+ * the hour field means "the hours 10, 11 and 12".
+ * <P>
+ * The ',' character is used to specify additional values. For example
+ * "MON,WED,FRI" in the day-of-week field means "the days Monday,
+ * Wednesday, and Friday".
+ * <P>
+ * The '/' character is used to specify increments. For example "0/15"
+ * in the seconds field means "the seconds 0, 15, 30, and 45". And
+ * "5/15" in the seconds field means "the seconds 5, 20, 35, and
+ * 50". Specifying '*' before the '/' is equivalent to specifying 0 is
+ * the value to start with. Essentially, for each field in the expression, there
+ * is a set of numbers that can be turned on or off. For seconds and minutes,
+ * the numbers range from 0 to 59. For hours 0 to 23, for days of the month 0 to
+ * 31, and for months 1 to 12. The "/" character simply helps you turn
+ * on every "nth" value in the given set. Thus "7/6" in the
+ * month field only turns on month "7", it does NOT mean every 6th
+ * month, please note that subtlety.
+ * <P>
+ * The 'L' character is allowed for the day-of-month and day-of-week fields.
+ * This character is short-hand for "last", but it has different
+ * meaning in each of the two fields. For example, the value "L" in
+ * the day-of-month field means "the last day of the month" - day 31
+ * for January, day 28 for February on non-leap years. If used in the
+ * day-of-week field by itself, it simply means "7" or
+ * "SAT". But if used in the day-of-week field after another value, it
+ * means "the last xxx day of the month" - for example "6L"
+ * means "the last friday of the month". When using the 'L' option, it
+ * is important not to specify lists, or ranges of values, as you'll get
+ * confusing results.
+ * <P>
+ * The 'W' character is allowed for the day-of-month field. This character
+ * is used to specify the weekday (Monday-Friday) nearest the given day. As an
+ * example, if you were to specify "15W" as the value for the
+ * day-of-month field, the meaning is: "the nearest weekday to the 15th of
+ * the month". So if the 15th is a Saturday, the trigger will fire on
+ * Friday the 14th. If the 15th is a Sunday, the trigger will fire on Monday the
+ * 16th. If the 15th is a Tuesday, then it will fire on Tuesday the 15th.
+ * However if you specify "1W" as the value for day-of-month, and the
+ * 1st is a Saturday, the trigger will fire on Monday the 3rd, as it will not
+ * 'jump' over the boundary of a month's days. The 'W' character can only be
+ * specified when the day-of-month is a single day, not a range or list of days.
+ * <P>
+ * The 'L' and 'W' characters can also be combined for the day-of-month
+ * expression to yield 'LW', which translates to "last weekday of the
+ * month".
+ * <P>
+ * The '#' character is allowed for the day-of-week field. This character is
+ * used to specify "the nth" XXX day of the month. For example, the
+ * value of "6#3" in the day-of-week field means the third Friday of
+ * the month (day 6 = Friday and "#3" = the 3rd one in the month).
+ * Other examples: "2#1" = the first Monday of the month and
+ * "4#5" = the fifth Wednesday of the month. Note that if you specify
+ * "#5" and there is not 5 of the given day-of-week in the month, then
+ * no firing will occur that month. If the '#' character is used, there can
+ * only be one expression in the day-of-week field ("3#1,6#3" is
+ * not valid, since there are two expressions).
+ * <P>
+ * <!--The 'C' character is allowed for the day-of-month and day-of-week fields.
+ * This character is short-hand for "calendar". This means values are
+ * calculated against the associated calendar, if any. If no calendar is
+ * associated, then it is equivalent to having an all-inclusive calendar. A
+ * value of "5C" in the day-of-month field means "the first day included by the
+ * calendar on or after the 5th". A value of "1C" in the day-of-week field
+ * means "the first day included by the calendar on or after sunday".-->
+ * <P>
+ * The legal characters and the names of months and days of the week are not
+ * case sensitive.
+ *
+ * <p>
+ * <b>NOTES:</b>
+ * <ul>
+ * <li>Support for specifying both a day-of-week and a day-of-month value is
+ * not complete (you'll need to use the '?' character in one of these fields).
+ * </li>
+ * <li>Overflowing ranges is supported - that is, having a larger number on
+ * the left hand side than the right. You might do 22-2 to catch 10 o'clock
+ * at night until 2 o'clock in the morning, or you might have NOV-FEB. It is
+ * very important to note that overuse of overflowing ranges creates ranges
+ * that don't make sense and no effort has been made to determine which
+ * interpretation CronExpression chooses. An example would be
+ * "0 0 14-6 ? * FRI-MON". </li>
+ * </ul>
+ * </p>
+ *
+ *
+ * @author Sharada Jambula, James House
+ * @author Contributions from Mads Henderson
+ * @author Refactoring from CronTrigger to CronExpression by Aaron Craven
+ * @author Scraped from the quartz project: http://www.opensymphony.com/quartz/
+ */
+public class CronExpression implements Serializable, Cloneable {
+
+ private static final long serialVersionUID = 12423409423L;
+
+ protected static final int SECOND = 0;
+ protected static final int MINUTE = 1;
+ protected static final int HOUR = 2;
+ protected static final int DAY_OF_MONTH = 3;
+ protected static final int MONTH = 4;
+ protected static final int DAY_OF_WEEK = 5;
+ protected static final int YEAR = 6;
+ protected static final int ALL_SPEC_INT = 99; // '*'
+ protected static final int NO_SPEC_INT = 98; // '?'
+ protected static final Integer ALL_SPEC = new Integer(ALL_SPEC_INT);
+ protected static final Integer NO_SPEC = new Integer(NO_SPEC_INT);
+
+ protected static final Map monthMap = new HashMap(20);
+ protected static final Map dayMap = new HashMap(60);
+ static {
+ monthMap.put("JAN", new Integer(0));
+ monthMap.put("FEB", new Integer(1));
+ monthMap.put("MAR", new Integer(2));
+ monthMap.put("APR", new Integer(3));
+ monthMap.put("MAY", new Integer(4));
+ monthMap.put("JUN", new Integer(5));
+ monthMap.put("JUL", new Integer(6));
+ monthMap.put("AUG", new Integer(7));
+ monthMap.put("SEP", new Integer(8));
+ monthMap.put("OCT", new Integer(9));
+ monthMap.put("NOV", new Integer(10));
+ monthMap.put("DEC", new Integer(11));
+
+ dayMap.put("SUN", new Integer(1));
+ dayMap.put("MON", new Integer(2));
+ dayMap.put("TUE", new Integer(3));
+ dayMap.put("WED", new Integer(4));
+ dayMap.put("THU", new Integer(5));
+ dayMap.put("FRI", new Integer(6));
+ dayMap.put("SAT", new Integer(7));
+ }
+
+ private String cronExpression = null;
+ private TimeZone timeZone = null;
+ protected transient TreeSet seconds;
+ protected transient TreeSet minutes;
+ protected transient TreeSet hours;
+ protected transient TreeSet daysOfMonth;
+ protected transient TreeSet months;
+ protected transient TreeSet daysOfWeek;
+ protected transient TreeSet years;
+
+ protected transient boolean lastdayOfWeek = false;
+ protected transient int nthdayOfWeek = 0;
+ protected transient boolean lastdayOfMonth = false;
+ protected transient boolean nearestWeekday = false;
+ protected transient boolean expressionParsed = false;
+
+ /**
+ * Constructs a new <CODE>CronExpression</CODE> based on the specified
+ * parameter.
+ *
+ * @param cronExpression String representation of the cron expression the
+ * new object should represent
+ * @throws java.text.ParseException
+ * if the string expression cannot be parsed into a valid
+ * <CODE>CronExpression</CODE>
+ */
+ public CronExpression(String cronExpression) throws ParseException {
+ if (cronExpression == null) {
+ throw new IllegalArgumentException("cronExpression cannot be null");
+ }
+
+ this.cronExpression = cronExpression.toUpperCase(Locale.US);
+
+ buildExpression(this.cronExpression);
+ }
+
+ /**
+ * Indicates whether the given date satisfies the cron expression. Note that
+ * milliseconds are ignored, so two Dates falling on different milliseconds
+ * of the same second will always have the same result here.
+ *
+ * @param date the date to evaluate
+ * @return a boolean indicating whether the given date satisfies the cron
+ * expression
+ */
+ public boolean isSatisfiedBy(Date date) {
+ Calendar testDateCal = Calendar.getInstance(getTimeZone());
+ testDateCal.setTime(date);
+ testDateCal.set(Calendar.MILLISECOND, 0);
+ Date originalDate = testDateCal.getTime();
+
+ testDateCal.add(Calendar.SECOND, -1);
+
+ Date timeAfter = getTimeAfter(testDateCal.getTime());
+
+ return ((timeAfter != null) && (timeAfter.equals(originalDate)));
+ }
+
+ /**
+ * Returns the next date/time <I>after</I> the given date/time which
+ * satisfies the cron expression.
+ *
+ * @param date the date/time at which to begin the search for the next valid
+ * date/time
+ * @return the next valid date/time
+ */
+ public Date getNextValidTimeAfter(Date date) {
+ return getTimeAfter(date);
+ }
+
+ /**
+ * Returns the next date/time <I>after</I> the given date/time which does
+ * <I>not</I> satisfy the expression
+ *
+ * @param date the date/time at which to begin the search for the next
+ * invalid date/time
+ * @return the next valid date/time
+ */
+ public Date getNextInvalidTimeAfter(Date date) {
+ long difference = 1000;
+
+ //move back to the nearest second so differences will be accurate
+ Calendar adjustCal = Calendar.getInstance(getTimeZone());
+ adjustCal.setTime(date);
+ adjustCal.set(Calendar.MILLISECOND, 0);
+ Date lastDate = adjustCal.getTime();
+
+ Date newDate = null;
+
+ //TODO: (QUARTZ-481) IMPROVE THIS! The following is a BAD solution to this problem. Performance will be very bad here, depending on the cron expression. It is, however A solution.
+
+ //keep getting the next included time until it's farther than one second
+ // apart. At that point, lastDate is the last valid fire time. We return
+ // the second immediately following it.
+ while (difference == 1000) {
+ newDate = getTimeAfter(lastDate);
+
+ difference = newDate.getTime() - lastDate.getTime();
+
+ if (difference == 1000) {
+ lastDate = newDate;
+ }
+ }
+
+ return new Date(lastDate.getTime() + 1000);
+ }
+
+ /**
+ * Returns the time zone for which this <code>CronExpression</code>
+ * will be resolved.
+ */
+ public TimeZone getTimeZone() {
+ if (timeZone == null) {
+ timeZone = TimeZone.getDefault();
+ }
+
+ return timeZone;
+ }
+
+ /**
+ * Sets the time zone for which this <code>CronExpression</code>
+ * will be resolved.
+ */
+ public void setTimeZone(TimeZone timeZone) {
+ this.timeZone = timeZone;
+ }
+
+ /**
+ * Returns the string representation of the <CODE>CronExpression</CODE>
+ *
+ * @return a string representation of the <CODE>CronExpression</CODE>
+ */
+ public String toString() {
+ return cronExpression;
+ }
+
+ /**
+ * Indicates whether the specified cron expression can be parsed into a
+ * valid cron expression
+ *
+ * @param cronExpression the expression to evaluate
+ * @return a boolean indicating whether the given expression is a valid cron
+ * expression
+ */
+ public static boolean isValidExpression(String cronExpression) {
+
+ try {
+ new CronExpression(cronExpression);
+ } catch (ParseException pe) {
+ return false;
+ }
+
+ return true;
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // Expression Parsing Functions
+ //
+ ////////////////////////////////////////////////////////////////////////////
+
+ protected void buildExpression(String expression) throws ParseException {
+ expressionParsed = true;
+
+ try {
+
+ if (seconds == null) {
+ seconds = new TreeSet();
+ }
+ if (minutes == null) {
+ minutes = new TreeSet();
+ }
+ if (hours == null) {
+ hours = new TreeSet();
+ }
+ if (daysOfMonth == null) {
+ daysOfMonth = new TreeSet();
+ }
+ if (months == null) {
+ months = new TreeSet();
+ }
+ if (daysOfWeek == null) {
+ daysOfWeek = new TreeSet();
+ }
+ if (years == null) {
+ years = new TreeSet();
+ }
+
+ int exprOn = SECOND;
+
+ StringTokenizer exprsTok = new StringTokenizer(expression, " \t",
+ false);
+
+ while (exprsTok.hasMoreTokens() && exprOn <= YEAR) {
+ String expr = exprsTok.nextToken().trim();
+
+ // throw an exception if L is used with other days of the month
+ if(exprOn == DAY_OF_MONTH && expr.indexOf('L') != -1 && expr.length() > 1 && expr.indexOf(",") >= 0) {
+ throw new ParseException("Support for specifying 'L' and 'LW' with other days of the month is not implemented", -1);
+ }
+ // throw an exception if L is used with other days of the week
+ if(exprOn == DAY_OF_WEEK && expr.indexOf('L') != -1 && expr.length() > 1 && expr.indexOf(",") >= 0) {
+ throw new ParseException("Support for specifying 'L' with other days of the week is not implemented", -1);
+ }
+
+ StringTokenizer vTok = new StringTokenizer(expr, ",");
+ while (vTok.hasMoreTokens()) {
+ String v = vTok.nextToken();
+ storeExpressionVals(0, v, exprOn);
+ }
+
+ exprOn++;
+ }
+
+ if (exprOn <= DAY_OF_WEEK) {
+ throw new ParseException("Unexpected end of expression.",
+ expression.length());
+ }
+
+ if (exprOn <= YEAR) {
+ storeExpressionVals(0, "*", YEAR);
+ }
+
+ TreeSet dow = getSet(DAY_OF_WEEK);
+ TreeSet dom = getSet(DAY_OF_MONTH);
+
+ // Copying the logic from the UnsupportedOperationException below
+ boolean dayOfMSpec = !dom.contains(NO_SPEC);
+ boolean dayOfWSpec = !dow.contains(NO_SPEC);
+
+ if (dayOfMSpec && !dayOfWSpec) {
+ // skip
+ } else if (dayOfWSpec && !dayOfMSpec) {
+ // skip
+ } else {
+ throw new ParseException(
+ "Support for specifying both a day-of-week AND a day-of-month parameter is not implemented.", 0);
+ }
+ } catch (ParseException pe) {
+ throw pe;
+ } catch (Exception e) {
+ throw new ParseException("Illegal cron expression format ("
+ + e.toString() + ")", 0);
+ }
+ }
+
+ protected int storeExpressionVals(int pos, String s, int type)
+ throws ParseException {
+
+ int incr = 0;
+ int i = skipWhiteSpace(pos, s);
+ if (i >= s.length()) {
+ return i;
+ }
+ char c = s.charAt(i);
+ if ((c >= 'A') && (c <= 'Z') && (!s.equals("L")) && (!s.equals("LW"))) {
+ String sub = s.substring(i, i + 3);
+ int sval = -1;
+ int eval = -1;
+ if (type == MONTH) {
+ sval = getMonthNumber(sub) + 1;
+ if (sval <= 0) {
+ throw new ParseException("Invalid Month value: '" + sub + "'", i);
+ }
+ if (s.length() > i + 3) {
+ c = s.charAt(i + 3);
+ if (c == '-') {
+ i += 4;
+ sub = s.substring(i, i + 3);
+ eval = getMonthNumber(sub) + 1;
+ if (eval <= 0) {
+ throw new ParseException("Invalid Month value: '" + sub + "'", i);
+ }
+ }
+ }
+ } else if (type == DAY_OF_WEEK) {
+ sval = getDayOfWeekNumber(sub);
+ if (sval < 0) {
+ throw new ParseException("Invalid Day-of-Week value: '"
+ + sub + "'", i);
+ }
+ if (s.length() > i + 3) {
+ c = s.charAt(i + 3);
+ if (c == '-') {
+ i += 4;
+ sub = s.substring(i, i + 3);
+ eval = getDayOfWeekNumber(sub);
+ if (eval < 0) {
+ throw new ParseException(
+ "Invalid Day-of-Week value: '" + sub
+ + "'", i);
+ }
+ } else if (c == '#') {
+ try {
+ i += 4;
+ nthdayOfWeek = Integer.parseInt(s.substring(i));
+ if (nthdayOfWeek < 1 || nthdayOfWeek > 5) {
+ throw new Exception();
+ }
+ } catch (Exception e) {
+ throw new ParseException(
+ "A numeric value between 1 and 5 must follow the '#' option",
+ i);
+ }
+ } else if (c == 'L') {
+ lastdayOfWeek = true;
+ i++;
+ }
+ }
+
+ } else {
+ throw new ParseException(
+ "Illegal characters for this position: '" + sub + "'",
+ i);
+ }
+ if (eval != -1) {
+ incr = 1;
+ }
+ addToSet(sval, eval, incr, type);
+ return (i + 3);
+ }
+
+ if (c == '?') {
+ i++;
+ if ((i + 1) < s.length()
+ && (s.charAt(i) != ' ' && s.charAt(i + 1) != '\t')) {
+ throw new ParseException("Illegal character after '?': "
+ + s.charAt(i), i);
+ }
+ if (type != DAY_OF_WEEK && type != DAY_OF_MONTH) {
+ throw new ParseException(
+ "'?' can only be specfied for Day-of-Month or Day-of-Week.",
+ i);
+ }
+ if (type == DAY_OF_WEEK && !lastdayOfMonth) {
+ int val = ((Integer) daysOfMonth.last()).intValue();
+ if (val == NO_SPEC_INT) {
+ throw new ParseException(
+ "'?' can only be specfied for Day-of-Month -OR- Day-of-Week.",
+ i);
+ }
+ }
+
+ addToSet(NO_SPEC_INT, -1, 0, type);
+ return i;
+ }
+
+ if (c == '*' || c == '/') {
+ if (c == '*' && (i + 1) >= s.length()) {
+ addToSet(ALL_SPEC_INT, -1, incr, type);
+ return i + 1;
+ } else if (c == '/'
+ && ((i + 1) >= s.length() || s.charAt(i + 1) == ' ' || s
+ .charAt(i + 1) == '\t')) {
+ throw new ParseException("'/' must be followed by an integer.", i);
+ } else if (c == '*') {
+ i++;
+ }
+ c = s.charAt(i);
+ if (c == '/') { // is an increment specified?
+ i++;
+ if (i >= s.length()) {
+ throw new ParseException("Unexpected end of string.", i);
+ }
+
+ incr = getNumericValue(s, i);
+
+ i++;
+ if (incr > 10) {
+ i++;
+ }
+ if (incr > 59 && (type == SECOND || type == MINUTE)) {
+ throw new ParseException("Increment > 60 : " + incr, i);
+ } else if (incr > 23 && (type == HOUR)) {
+ throw new ParseException("Increment > 24 : " + incr, i);
+ } else if (incr > 31 && (type == DAY_OF_MONTH)) {
+ throw new ParseException("Increment > 31 : " + incr, i);
+ } else if (incr > 7 && (type == DAY_OF_WEEK)) {
+ throw new ParseException("Increment > 7 : " + incr, i);
+ } else if (incr > 12 && (type == MONTH)) {
+ throw new ParseException("Increment > 12 : " + incr, i);
+ }
+ } else {
+ incr = 1;
+ }
+
+ addToSet(ALL_SPEC_INT, -1, incr, type);
+ return i;
+ } else if (c == 'L') {
+ i++;
+ if (type == DAY_OF_MONTH) {
+ lastdayOfMonth = true;
+ }
+ if (type == DAY_OF_WEEK) {
+ addToSet(7, 7, 0, type);
+ }
+ if(type == DAY_OF_MONTH && s.length() > i) {
+ c = s.charAt(i);
+ if(c == 'W') {
+ nearestWeekday = true;
+ i++;
+ }
+ }
+ return i;
+ } else if (c >= '0' && c <= '9') {
+ int val = Integer.parseInt(String.valueOf(c));
+ i++;
+ if (i >= s.length()) {
+ addToSet(val, -1, -1, type);
+ } else {
+ c = s.charAt(i);
+ if (c >= '0' && c <= '9') {
+ ValueSet vs = getValue(val, s, i);
+ val = vs.value;
+ i = vs.pos;
+ }
+ i = checkNext(i, s, val, type);
+ return i;
+ }
+ } else {
+ throw new ParseException("Unexpected character: " + c, i);
+ }
+
+ return i;
+ }
+
+ protected int checkNext(int pos, String s, int val, int type)
+ throws ParseException {
+
+ int end = -1;
+ int i = pos;
+
+ if (i >= s.length()) {
+ addToSet(val, end, -1, type);
+ return i;
+ }
+
+ char c = s.charAt(pos);
+
+ if (c == 'L') {
+ if (type == DAY_OF_WEEK) {
+ lastdayOfWeek = true;
+ } else {
+ throw new ParseException("'L' option is not valid here. (pos=" + i + ")", i);
+ }
+ TreeSet set = getSet(type);
+ set.add(new Integer(val));
+ i++;
+ return i;
+ }
+
+ if (c == 'W') {
+ if (type == DAY_OF_MONTH) {
+ nearestWeekday = true;
+ } else {
+ throw new ParseException("'W' option is not valid here. (pos=" + i + ")", i);
+ }
+ TreeSet set = getSet(type);
+ set.add(new Integer(val));
+ i++;
+ return i;
+ }
+
+ if (c == '#') {
+ if (type != DAY_OF_WEEK) {
+ throw new ParseException("'#' option is not valid here. (pos=" + i + ")", i);
+ }
+ i++;
+ try {
+ nthdayOfWeek = Integer.parseInt(s.substring(i));
+ if (nthdayOfWeek < 1 || nthdayOfWeek > 5) {
+ throw new Exception();
+ }
+ } catch (Exception e) {
+ throw new ParseException(
+ "A numeric value between 1 and 5 must follow the '#' option",
+ i);
+ }
+
+ TreeSet set = getSet(type);
+ set.add(new Integer(val));
+ i++;
+ return i;
+ }
+
+ if (c == '-') {
+ i++;
+ c = s.charAt(i);
+ int v = Integer.parseInt(String.valueOf(c));
+ end = v;
+ i++;
+ if (i >= s.length()) {
+ addToSet(val, end, 1, type);
+ return i;
+ }
+ c = s.charAt(i);
+ if (c >= '0' && c <= '9') {
+ ValueSet vs = getValue(v, s, i);
+ int v1 = vs.value;
+ end = v1;
+ i = vs.pos;
+ }
+ if (i < s.length() && ((c = s.charAt(i)) == '/')) {
+ i++;
+ c = s.charAt(i);
+ int v2 = Integer.parseInt(String.valueOf(c));
+ i++;
+ if (i >= s.length()) {
+ addToSet(val, end, v2, type);
+ return i;
+ }
+ c = s.charAt(i);
+ if (c >= '0' && c <= '9') {
+ ValueSet vs = getValue(v2, s, i);
+ int v3 = vs.value;
+ addToSet(val, end, v3, type);
+ i = vs.pos;
+ return i;
+ } else {
+ addToSet(val, end, v2, type);
+ return i;
+ }
+ } else {
+ addToSet(val, end, 1, type);
+ return i;
+ }
+ }
+
+ if (c == '/') {
+ i++;
+ c = s.charAt(i);
+ int v2 = Integer.parseInt(String.valueOf(c));
+ i++;
+ if (i >= s.length()) {
+ addToSet(val, end, v2, type);
+ return i;
+ }
+ c = s.charAt(i);
+ if (c >= '0' && c <= '9') {
+ ValueSet vs = getValue(v2, s, i);
+ int v3 = vs.value;
+ addToSet(val, end, v3, type);
+ i = vs.pos;
+ return i;
+ } else {
+ throw new ParseException("Unexpected character '" + c + "' after '/'", i);
+ }
+ }
+
+ addToSet(val, end, 0, type);
+ i++;
+ return i;
+ }
+
+ public String getCronExpression() {
+ return cronExpression;
+ }
+
+ public String getExpressionSummary() {
+ StringBuffer buf = new StringBuffer();
+
+ buf.append("seconds: ");
+ buf.append(getExpressionSetSummary(seconds));
+ buf.append("\n");
+ buf.append("minutes: ");
+ buf.append(getExpressionSetSummary(minutes));
+ buf.append("\n");
+ buf.append("hours: ");
+ buf.append(getExpressionSetSummary(hours));
+ buf.append("\n");
+ buf.append("daysOfMonth: ");
+ buf.append(getExpressionSetSummary(daysOfMonth));
+ buf.append("\n");
+ buf.append("months: ");
+ buf.append(getExpressionSetSummary(months));
+ buf.append("\n");
+ buf.append("daysOfWeek: ");
+ buf.append(getExpressionSetSummary(daysOfWeek));
+ buf.append("\n");
+ buf.append("lastdayOfWeek: ");
+ buf.append(lastdayOfWeek);
+ buf.append("\n");
+ buf.append("nearestWeekday: ");
+ buf.append(nearestWeekday);
+ buf.append("\n");
+ buf.append("NthDayOfWeek: ");
+ buf.append(nthdayOfWeek);
+ buf.append("\n");
+ buf.append("lastdayOfMonth: ");
+ buf.append(lastdayOfMonth);
+ buf.append("\n");
+ buf.append("years: ");
+ buf.append(getExpressionSetSummary(years));
+ buf.append("\n");
+
+ return buf.toString();
+ }
+
+ protected String getExpressionSetSummary(java.util.Set set) {
+
+ if (set.contains(NO_SPEC)) {
+ return "?";
+ }
+ if (set.contains(ALL_SPEC)) {
+ return "*";
+ }
+
+ StringBuffer buf = new StringBuffer();
+
+ Iterator itr = set.iterator();
+ boolean first = true;
+ while (itr.hasNext()) {
+ Integer iVal = (Integer) itr.next();
+ String val = iVal.toString();
+ if (!first) {
+ buf.append(",");
+ }
+ buf.append(val);
+ first = false;
+ }
+
+ return buf.toString();
+ }
+
+ protected String getExpressionSetSummary(java.util.ArrayList list) {
+
+ if (list.contains(NO_SPEC)) {
+ return "?";
+ }
+ if (list.contains(ALL_SPEC)) {
+ return "*";
+ }
+
+ StringBuffer buf = new StringBuffer();
+
+ Iterator itr = list.iterator();
+ boolean first = true;
+ while (itr.hasNext()) {
+ Integer iVal = (Integer) itr.next();
+ String val = iVal.toString();
+ if (!first) {
+ buf.append(",");
+ }
+ buf.append(val);
+ first = false;
+ }
+
+ return buf.toString();
+ }
+
+ protected int skipWhiteSpace(int i, String s) {
+ for (; i < s.length() && (s.charAt(i) == ' ' || s.charAt(i) == '\t'); i++) {
+ ;
+ }
+
+ return i;
+ }
+
+ protected int findNextWhiteSpace(int i, String s) {
+ for (; i < s.length() && (s.charAt(i) != ' ' || s.charAt(i) != '\t'); i++) {
+ ;
+ }
+
+ return i;
+ }
+
+ protected void addToSet(int val, int end, int incr, int type)
+ throws ParseException {
+
+ TreeSet set = getSet(type);
+
+ if (type == SECOND || type == MINUTE) {
+ if ((val < 0 || val > 59 || end > 59) && (val != ALL_SPEC_INT)) {
+ throw new ParseException(
+ "Minute and Second values must be between 0 and 59",
+ -1);
+ }
+ } else if (type == HOUR) {
+ if ((val < 0 || val > 23 || end > 23) && (val != ALL_SPEC_INT)) {
+ throw new ParseException(
+ "Hour values must be between 0 and 23", -1);
+ }
+ } else if (type == DAY_OF_MONTH) {
+ if ((val < 1 || val > 31 || end > 31) && (val != ALL_SPEC_INT)
+ && (val != NO_SPEC_INT)) {
+ throw new ParseException(
+ "Day of month values must be between 1 and 31", -1);
+ }
+ } else if (type == MONTH) {
+ if ((val < 1 || val > 12 || end > 12) && (val != ALL_SPEC_INT)) {
+ throw new ParseException(
+ "Month values must be between 1 and 12", -1);
+ }
+ } else if (type == DAY_OF_WEEK) {
+ if ((val == 0 || val > 7 || end > 7) && (val != ALL_SPEC_INT)
+ && (val != NO_SPEC_INT)) {
+ throw new ParseException(
+ "Day-of-Week values must be between 1 and 7", -1);
+ }
+ }
+
+ if ((incr == 0 || incr == -1) && val != ALL_SPEC_INT) {
+ if (val != -1) {
+ set.add(new Integer(val));
+ } else {
+ set.add(NO_SPEC);
+ }
+
+ return;
+ }
+
+ int startAt = val;
+ int stopAt = end;
+
+ if (val == ALL_SPEC_INT && incr <= 0) {
+ incr = 1;
+ set.add(ALL_SPEC); // put in a marker, but also fill values
+ }
+
+ if (type == SECOND || type == MINUTE) {
+ if (stopAt == -1) {
+ stopAt = 59;
+ }
+ if (startAt == -1 || startAt == ALL_SPEC_INT) {
+ startAt = 0;
+ }
+ } else if (type == HOUR) {
+ if (stopAt == -1) {
+ stopAt = 23;
+ }
+ if (startAt == -1 || startAt == ALL_SPEC_INT) {
+ startAt = 0;
+ }
+ } else if (type == DAY_OF_MONTH) {
+ if (stopAt == -1) {
+ stopAt = 31;
+ }
+ if (startAt == -1 || startAt == ALL_SPEC_INT) {
+ startAt = 1;
+ }
+ } else if (type == MONTH) {
+ if (stopAt == -1) {
+ stopAt = 12;
+ }
+ if (startAt == -1 || startAt == ALL_SPEC_INT) {
+ startAt = 1;
+ }
+ } else if (type == DAY_OF_WEEK) {
+ if (stopAt == -1) {
+ stopAt = 7;
+ }
+ if (startAt == -1 || startAt == ALL_SPEC_INT) {
+ startAt = 1;
+ }
+ } else if (type == YEAR) {
+ if (stopAt == -1) {
+ stopAt = 2099;
+ }
+ if (startAt == -1 || startAt == ALL_SPEC_INT) {
+ startAt = 1970;
+ }
+ }
+
+ // if the end of the range is before the start, then we need to overflow into
+ // the next day, month etc. This is done by adding the maximum amount for that
+ // type, and using modulus max to determine the value being added.
+ int max = -1;
+ if (stopAt < startAt) {
+ switch (type) {
+ case SECOND : max = 60; break;
+ case MINUTE : max = 60; break;
+ case HOUR : max = 24; break;
+ case MONTH : max = 12; break;
+ case DAY_OF_WEEK : max = 7; break;
+ case DAY_OF_MONTH : max = 31; break;
+ case YEAR : throw new IllegalArgumentException("Start year must be less than stop year");
+ default : throw new IllegalArgumentException("Unexpected type encountered");
+ }
+ stopAt += max;
+ }
+
+ for (int i = startAt; i <= stopAt; i += incr) {
+ if (max == -1) {
+ // ie: there's no max to overflow over
+ set.add(new Integer(i));
+ } else {
+ // take the modulus to get the real value
+ int i2 = i % max;
+
+ // 1-indexed ranges should not include 0, and should include their max
+ if (i2 == 0 && (type == MONTH || type == DAY_OF_WEEK || type == DAY_OF_MONTH) ) {
+ i2 = max;
+ }
+
+ set.add(new Integer(i2));
+ }
+ }
+ }
+
+ protected TreeSet getSet(int type) {
+ switch (type) {
+ case SECOND:
+ return seconds;
+ case MINUTE:
+ return minutes;
+ case HOUR:
+ return hours;
+ case DAY_OF_MONTH:
+ return daysOfMonth;
+ case MONTH:
+ return months;
+ case DAY_OF_WEEK:
+ return daysOfWeek;
+ case YEAR:
+ return years;
+ default:
+ return null;
+ }
+ }
+
+ protected ValueSet getValue(int v, String s, int i) {
+ char c = s.charAt(i);
+ String s1 = String.valueOf(v);
+ while (c >= '0' && c <= '9') {
+ s1 += c;
+ i++;
+ if (i >= s.length()) {
+ break;
+ }
+ c = s.charAt(i);
+ }
+ ValueSet val = new ValueSet();
+
+ val.pos = (i < s.length()) ? i : i + 1;
+ val.value = Integer.parseInt(s1);
+ return val;
+ }
+
+ protected int getNumericValue(String s, int i) {
+ int endOfVal = findNextWhiteSpace(i, s);
+ String val = s.substring(i, endOfVal);
+ return Integer.parseInt(val);
+ }
+
+ protected int getMonthNumber(String s) {
+ Integer integer = (Integer) monthMap.get(s);
+
+ if (integer == null) {
+ return -1;
+ }
+
+ return integer.intValue();
+ }
+
+ protected int getDayOfWeekNumber(String s) {
+ Integer integer = (Integer) dayMap.get(s);
+
+ if (integer == null) {
+ return -1;
+ }
+
+ return integer.intValue();
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // Computation Functions
+ //
+ ////////////////////////////////////////////////////////////////////////////
+
+ protected Date getTimeAfter(Date afterTime) {
+
+ Calendar cl = Calendar.getInstance(getTimeZone());
+
+ // move ahead one second, since we're computing the time *after* the
+ // given time
+ afterTime = new Date(afterTime.getTime() + 1000);
+ // CronTrigger does not deal with milliseconds
+ cl.setTime(afterTime);
+ cl.set(Calendar.MILLISECOND, 0);
+
+ boolean gotOne = false;
+ // loop until we've computed the next time, or we've past the endTime
+ while (!gotOne) {
+
+ //if (endTime != null && cl.getTime().after(endTime)) return null;
+ if(cl.get(Calendar.YEAR) > 2999) { // prevent endless loop...
+ return null;
+ }
+
+ SortedSet st = null;
+ int t = 0;
+
+ int sec = cl.get(Calendar.SECOND);
+ int min = cl.get(Calendar.MINUTE);
+
+ // get second.................................................
+ st = seconds.tailSet(new Integer(sec));
+ if (st != null && st.size() != 0) {
+ sec = ((Integer) st.first()).intValue();
+ } else {
+ sec = ((Integer) seconds.first()).intValue();
+ min++;
+ cl.set(Calendar.MINUTE, min);
+ }
+ cl.set(Calendar.SECOND, sec);
+
+ min = cl.get(Calendar.MINUTE);
+ int hr = cl.get(Calendar.HOUR_OF_DAY);
+ t = -1;
+
+ // get minute.................................................
+ st = minutes.tailSet(new Integer(min));
+ if (st != null && st.size() != 0) {
+ t = min;
+ min = ((Integer) st.first()).intValue();
+ } else {
+ min = ((Integer) minutes.first()).intValue();
+ hr++;
+ }
+ if (min != t) {
+ cl.set(Calendar.SECOND, 0);
+ cl.set(Calendar.MINUTE, min);
+ setCalendarHour(cl, hr);
+ continue;
+ }
+ cl.set(Calendar.MINUTE, min);
+
+ hr = cl.get(Calendar.HOUR_OF_DAY);
+ int day = cl.get(Calendar.DAY_OF_MONTH);
+ t = -1;
+
+ // get hour...................................................
+ st = hours.tailSet(new Integer(hr));
+ if (st != null && st.size() != 0) {
+ t = hr;
+ hr = ((Integer) st.first()).intValue();
+ } else {
+ hr = ((Integer) hours.first()).intValue();
+ day++;
+ }
+ if (hr != t) {
+ cl.set(Calendar.SECOND, 0);
+ cl.set(Calendar.MINUTE, 0);
+ cl.set(Calendar.DAY_OF_MONTH, day);
+ setCalendarHour(cl, hr);
+ continue;
+ }
+ cl.set(Calendar.HOUR_OF_DAY, hr);
+
+ day = cl.get(Calendar.DAY_OF_MONTH);
+ int mon = cl.get(Calendar.MONTH) + 1;
+ // '+ 1' because calendar is 0-based for this field, and we are
+ // 1-based
+ t = -1;
+ int tmon = mon;
+
+ // get day...................................................
+ boolean dayOfMSpec = !daysOfMonth.contains(NO_SPEC);
+ boolean dayOfWSpec = !daysOfWeek.contains(NO_SPEC);
+ if (dayOfMSpec && !dayOfWSpec) { // get day by day of month rule
+ st = daysOfMonth.tailSet(new Integer(day));
+ if (lastdayOfMonth) {
+ if(!nearestWeekday) {
+ t = day;
+ day = getLastDayOfMonth(mon, cl.get(Calendar.YEAR));
+ } else {
+ t = day;
+ day = getLastDayOfMonth(mon, cl.get(Calendar.YEAR));
+
+ java.util.Calendar tcal = java.util.Calendar.getInstance(getTimeZone());
+ tcal.set(Calendar.SECOND, 0);
+ tcal.set(Calendar.MINUTE, 0);
+ tcal.set(Calendar.HOUR_OF_DAY, 0);
+ tcal.set(Calendar.DAY_OF_MONTH, day);
+ tcal.set(Calendar.MONTH, mon - 1);
+ tcal.set(Calendar.YEAR, cl.get(Calendar.YEAR));
+
+ int ldom = getLastDayOfMonth(mon, cl.get(Calendar.YEAR));
+ int dow = tcal.get(Calendar.DAY_OF_WEEK);
+
+ if(dow == Calendar.SATURDAY && day == 1) {
+ day += 2;
+ } else if(dow == Calendar.SATURDAY) {
+ day -= 1;
+ } else if(dow == Calendar.SUNDAY && day == ldom) {
+ day -= 2;
+ } else if(dow == Calendar.SUNDAY) {
+ day += 1;
+ }
+
+ tcal.set(Calendar.SECOND, sec);
+ tcal.set(Calendar.MINUTE, min);
+ tcal.set(Calendar.HOUR_OF_DAY, hr);
+ tcal.set(Calendar.DAY_OF_MONTH, day);
+ tcal.set(Calendar.MONTH, mon - 1);
+ Date nTime = tcal.getTime();
+ if(nTime.before(afterTime)) {
+ day = 1;
+ mon++;
+ }
+ }
+ } else if(nearestWeekday) {
+ t = day;
+ day = ((Integer) daysOfMonth.first()).intValue();
+
+ java.util.Calendar tcal = java.util.Calendar.getInstance(getTimeZone());
+ tcal.set(Calendar.SECOND, 0);
+ tcal.set(Calendar.MINUTE, 0);
+ tcal.set(Calendar.HOUR_OF_DAY, 0);
+ tcal.set(Calendar.DAY_OF_MONTH, day);
+ tcal.set(Calendar.MONTH, mon - 1);
+ tcal.set(Calendar.YEAR, cl.get(Calendar.YEAR));
+
+ int ldom = getLastDayOfMonth(mon, cl.get(Calendar.YEAR));
+ int dow = tcal.get(Calendar.DAY_OF_WEEK);
+
+ if(dow == Calendar.SATURDAY && day == 1) {
+ day += 2;
+ } else if(dow == Calendar.SATURDAY) {
+ day -= 1;
+ } else if(dow == Calendar.SUNDAY && day == ldom) {
+ day -= 2;
+ } else if(dow == Calendar.SUNDAY) {
+ day += 1;
+ }
+
+
+ tcal.set(Calendar.SECOND, sec);
+ tcal.set(Calendar.MINUTE, min);
+ tcal.set(Calendar.HOUR_OF_DAY, hr);
+ tcal.set(Calendar.DAY_OF_MONTH, day);
+ tcal.set(Calendar.MONTH, mon - 1);
+ Date nTime = tcal.getTime();
+ if(nTime.before(afterTime)) {
+ day = ((Integer) daysOfMonth.first()).intValue();
+ mon++;
+ }
+ } else if (st != null && st.size() != 0) {
+ t = day;
+ day = ((Integer) st.first()).intValue();
+ // make sure we don't over-run a short month, such as february
+ int lastDay = getLastDayOfMonth(mon, cl.get(Calendar.YEAR));
+ if (day > lastDay) {
+ day = ((Integer) daysOfMonth.first()).intValue();
+ mon++;
+ }
+ } else {
+ day = ((Integer) daysOfMonth.first()).intValue();
+ mon++;
+ }
+
+ if (day != t || mon != tmon) {
+ cl.set(Calendar.SECOND, 0);
+ cl.set(Calendar.MINUTE, 0);
+ cl.set(Calendar.HOUR_OF_DAY, 0);
+ cl.set(Calendar.DAY_OF_MONTH, day);
+ cl.set(Calendar.MONTH, mon - 1);
+ // '- 1' because calendar is 0-based for this field, and we
+ // are 1-based
+ continue;
+ }
+ } else if (dayOfWSpec && !dayOfMSpec) { // get day by day of week rule
+ if (lastdayOfWeek) { // are we looking for the last XXX day of
+ // the month?
+ int dow = ((Integer) daysOfWeek.first()).intValue(); // desired
+ // d-o-w
+ int cDow = cl.get(Calendar.DAY_OF_WEEK); // current d-o-w
+ int daysToAdd = 0;
+ if (cDow < dow) {
+ daysToAdd = dow - cDow;
+ }
+ if (cDow > dow) {
+ daysToAdd = dow + (7 - cDow);
+ }
+
+ int lDay = getLastDayOfMonth(mon, cl.get(Calendar.YEAR));
+
+ if (day + daysToAdd > lDay) { // did we already miss the
+ // last one?
+ cl.set(Calendar.SECOND, 0);
+ cl.set(Calendar.MINUTE, 0);
+ cl.set(Calendar.HOUR_OF_DAY, 0);
+ cl.set(Calendar.DAY_OF_MONTH, 1);
+ cl.set(Calendar.MONTH, mon);
+ // no '- 1' here because we are promoting the month
+ continue;
+ }
+
+ // find date of last occurance of this day in this month...
+ while ((day + daysToAdd + 7) <= lDay) {
+ daysToAdd += 7;
+ }
+
+ day += daysToAdd;
+
+ if (daysToAdd > 0) {
+ cl.set(Calendar.SECOND, 0);
+ cl.set(Calendar.MINUTE, 0);
+ cl.set(Calendar.HOUR_OF_DAY, 0);
+ cl.set(Calendar.DAY_OF_MONTH, day);
+ cl.set(Calendar.MONTH, mon - 1);
+ // '- 1' here because we are not promoting the month
+ continue;
+ }
+
+ } else if (nthdayOfWeek != 0) {
+ // are we looking for the Nth XXX day in the month?
+ int dow = ((Integer) daysOfWeek.first()).intValue(); // desired
+ // d-o-w
+ int cDow = cl.get(Calendar.DAY_OF_WEEK); // current d-o-w
+ int daysToAdd = 0;
+ if (cDow < dow) {
+ daysToAdd = dow - cDow;
+ } else if (cDow > dow) {
+ daysToAdd = dow + (7 - cDow);
+ }
+
+ boolean dayShifted = false;
+ if (daysToAdd > 0) {
+ dayShifted = true;
+ }
+
+ day += daysToAdd;
+ int weekOfMonth = day / 7;
+ if (day % 7 > 0) {
+ weekOfMonth++;
+ }
+
+ daysToAdd = (nthdayOfWeek - weekOfMonth) * 7;
+ day += daysToAdd;
+ if (daysToAdd < 0
+ || day > getLastDayOfMonth(mon, cl
+ .get(Calendar.YEAR))) {
+ cl.set(Calendar.SECOND, 0);
+ cl.set(Calendar.MINUTE, 0);
+ cl.set(Calendar.HOUR_OF_DAY, 0);
+ cl.set(Calendar.DAY_OF_MONTH, 1);
+ cl.set(Calendar.MONTH, mon);
+ // no '- 1' here because we are promoting the month
+ continue;
+ } else if (daysToAdd > 0 || dayShifted) {
+ cl.set(Calendar.SECOND, 0);
+ cl.set(Calendar.MINUTE, 0);
+ cl.set(Calendar.HOUR_OF_DAY, 0);
+ cl.set(Calendar.DAY_OF_MONTH, day);
+ cl.set(Calendar.MONTH, mon - 1);
+ // '- 1' here because we are NOT promoting the month
+ continue;
+ }
+ } else {
+ int cDow = cl.get(Calendar.DAY_OF_WEEK); // current d-o-w
+ int dow = ((Integer) daysOfWeek.first()).intValue(); // desired
+ // d-o-w
+ st = daysOfWeek.tailSet(new Integer(cDow));
+ if (st != null && st.size() > 0) {
+ dow = ((Integer) st.first()).intValue();
+ }
+
+ int daysToAdd = 0;
+ if (cDow < dow) {
+ daysToAdd = dow - cDow;
+ }
+ if (cDow > dow) {
+ daysToAdd = dow + (7 - cDow);
+ }
+
+ int lDay = getLastDayOfMonth(mon, cl.get(Calendar.YEAR));
+
+ if (day + daysToAdd > lDay) { // will we pass the end of
+ // the month?
+ cl.set(Calendar.SECOND, 0);
+ cl.set(Calendar.MINUTE, 0);
+ cl.set(Calendar.HOUR_OF_DAY, 0);
+ cl.set(Calendar.DAY_OF_MONTH, 1);
+ cl.set(Calendar.MONTH, mon);
+ // no '- 1' here because we are promoting the month
+ continue;
+ } else if (daysToAdd > 0) { // are we swithing days?
+ cl.set(Calendar.SECOND, 0);
+ cl.set(Calendar.MINUTE, 0);
+ cl.set(Calendar.HOUR_OF_DAY, 0);
+ cl.set(Calendar.DAY_OF_MONTH, day + daysToAdd);
+ cl.set(Calendar.MONTH, mon - 1);
+ // '- 1' because calendar is 0-based for this field,
+ // and we are 1-based
+ continue;
+ }
+ }
+ } else { // dayOfWSpec && !dayOfMSpec
+ throw new UnsupportedOperationException(
+ "Support for specifying both a day-of-week AND a day-of-month parameter is not implemented.");
+ // TODO:
+ }
+ cl.set(Calendar.DAY_OF_MONTH, day);
+
+ mon = cl.get(Calendar.MONTH) + 1;
+ // '+ 1' because calendar is 0-based for this field, and we are
+ // 1-based
+ int year = cl.get(Calendar.YEAR);
+ t = -1;
+
+ // test for expressions that never generate a valid fire date,
+ // but keep looping...
+ if (year > 2099) {
+ return null;
+ }
+
+ // get month...................................................
+ st = months.tailSet(new Integer(mon));
+ if (st != null && st.size() != 0) {
+ t = mon;
+ mon = ((Integer) st.first()).intValue();
+ } else {
+ mon = ((Integer) months.first()).intValue();
+ year++;
+ }
+ if (mon != t) {
+ cl.set(Calendar.SECOND, 0);
+ cl.set(Calendar.MINUTE, 0);
+ cl.set(Calendar.HOUR_OF_DAY, 0);
+ cl.set(Calendar.DAY_OF_MONTH, 1);
+ cl.set(Calendar.MONTH, mon - 1);
+ // '- 1' because calendar is 0-based for this field, and we are
+ // 1-based
+ cl.set(Calendar.YEAR, year);
+ continue;
+ }
+ cl.set(Calendar.MONTH, mon - 1);
+ // '- 1' because calendar is 0-based for this field, and we are
+ // 1-based
+
+ year = cl.get(Calendar.YEAR);
+ t = -1;
+
+ // get year...................................................
+ st = years.tailSet(new Integer(year));
+ if (st != null && st.size() != 0) {
+ t = year;
+ year = ((Integer) st.first()).intValue();
+ } else {
+ return null; // ran out of years...
+ }
+
+ if (year != t) {
+ cl.set(Calendar.SECOND, 0);
+ cl.set(Calendar.MINUTE, 0);
+ cl.set(Calendar.HOUR_OF_DAY, 0);
+ cl.set(Calendar.DAY_OF_MONTH, 1);
+ cl.set(Calendar.MONTH, 0);
+ // '- 1' because calendar is 0-based for this field, and we are
+ // 1-based
+ cl.set(Calendar.YEAR, year);
+ continue;
+ }
+ cl.set(Calendar.YEAR, year);
+
+ gotOne = true;
+ } // while( !done )
+
+ return cl.getTime();
+ }
+
+ /**
+ * Advance the calendar to the particular hour paying particular attention
+ * to daylight saving problems.
+ *
+ * @param cal
+ * @param hour
+ */
+ protected void setCalendarHour(Calendar cal, int hour) {
+ cal.set(java.util.Calendar.HOUR_OF_DAY, hour);
+ if (cal.get(java.util.Calendar.HOUR_OF_DAY) != hour && hour != 24) {
+ cal.set(java.util.Calendar.HOUR_OF_DAY, hour + 1);
+ }
+ }
+
+ /**
+ * NOT YET IMPLEMENTED: Returns the time before the given time
+ * that the <code>CronExpression</code> matches.
+ */
+ protected Date getTimeBefore(Date endTime) {
+ // TODO: implement QUARTZ-423
+ return null;
+ }
+
+ /**
+ * NOT YET IMPLEMENTED: Returns the final time that the
+ * <code>CronExpression</code> will match.
+ */
+ public Date getFinalFireTime() {
+ // TODO: implement QUARTZ-423
+ return null;
+ }
+
+ protected boolean isLeapYear(int year) {
+ return ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0));
+ }
+
+ protected int getLastDayOfMonth(int monthNum, int year) {
+
+ switch (monthNum) {
+ case 1:
+ return 31;
+ case 2:
+ return (isLeapYear(year)) ? 29 : 28;
+ case 3:
+ return 31;
+ case 4:
+ return 30;
+ case 5:
+ return 31;
+ case 6:
+ return 30;
+ case 7:
+ return 31;
+ case 8:
+ return 31;
+ case 9:
+ return 30;
+ case 10:
+ return 31;
+ case 11:
+ return 30;
+ case 12:
+ return 31;
+ default:
+ throw new IllegalArgumentException("Illegal month number: "
+ + monthNum);
+ }
+ }
+
+
+ private void readObject(java.io.ObjectInputStream stream)
+ throws java.io.IOException, ClassNotFoundException {
+
+ stream.defaultReadObject();
+ try {
+ buildExpression(cronExpression);
+ } catch (Exception ignore) {
+ } // never happens
+ }
+
+ public Object clone() {
+ CronExpression copy = null;
+ try {
+ copy = new CronExpression(getCronExpression());
+ copy.setTimeZone(getTimeZone());
+ } catch (ParseException ex) { // never happens since the source is valid...
+ throw new IncompatibleClassChangeError("Not Cloneable.");
+ }
+ return copy;
+ }
+}
+
+class ValueSet {
+ public int value;
+
+ public int pos;
+}
Modified: branches/ODE/ODE-1.x/utils/src/main/java/org/apache/ode/utils/InternPool.java
===================================================================
--- branches/ODE/ODE-1.x/utils/src/main/java/org/apache/ode/utils/InternPool.java 2010-04-08 15:41:12 UTC (rev 618)
+++ branches/ODE/ODE-1.x/utils/src/main/java/org/apache/ode/utils/InternPool.java 2010-04-14 15:43:12 UTC (rev 619)
@@ -17,107 +17,107 @@
* under the License.
*/
-package org.apache.ode.utils;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.commons.collections.map.LRUMap;
-import org.apache.commons.collections.map.MultiKeyMap;
-
-
-/**
- * A key value based cache that internalizes immutable values
- * so that they can be shared across various BPEL objects.
- *
- */
-public class InternPool {
- private static MultiKeyMap cachedValues = MultiKeyMap.decorate(new LRUMap());
- private static Set<String> cachedBlocks = Collections.synchronizedSet(new HashSet<String>());
-
- /**
- * Creates a new KeyValueCache object.
- */
- protected InternPool() {
- }
-
- /**
- * Runs the given block in the context of a cache.
- * If you do not run your block this way, the caching
- * mechanism will be disabled.
- *
- * @param block block
- */
- public static void runBlock(InternableBlock block) {
- String processId = getProcessId();
- cachedBlocks.add(processId);
- block.run();
- cachedBlocks.remove(processId);
- clearAll(processId);
- }
-
- /**
- * Returns an internalized value if it already exists in the cache
- *
- * @param value value
- *
- * @return the internalized value
- */
- public static Object intern(Object key, Object value) {
- String processId = getProcessId();
-
- if (!cachedBlocks.contains(processId)) {
- return value;
- }
-
- synchronized (cachedValues) {
- List values = (List) cachedValues.get(processId, key);
- if (values == null) {
- cachedValues.put(processId, key, (values = new ArrayList()));
- }
-
- Object intern;
- if (values.contains(value)) {
- intern = values.get(values.indexOf(value));
- } else {
- values.add(intern = value);
- }
-
- return intern;
- }
- }
-
- /**
- * Clears all the values corresponding to the given process
- *
- * @param processId processId
- */
- protected static void clearAll(String processId) {
- synchronized (cachedValues) {
- cachedValues.remove(processId);
- }
- }
-
- /**
- * Returns the current thread id as the process id.
- *
- * @return the "process id"
- */
- private static String getProcessId() {
- return String.valueOf(Thread.currentThread().getId());
- }
-
- /**
- * An interface that clients should implement to run their
- * blocks of code in the context of this caching mechanism.
- */
- public interface InternableBlock {
- /**
- * The block to run
- */
- public void run();
- }
-}
+package org.apache.ode.utils;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.commons.collections.map.LRUMap;
+import org.apache.commons.collections.map.MultiKeyMap;
+
+
+/**
+ * A key value based cache that internalizes immutable values
+ * so that they can be shared across various BPEL objects.
+ *
+ */
+public class InternPool {
+ private static MultiKeyMap cachedValues = MultiKeyMap.decorate(new LRUMap());
+ private static Set<String> cachedBlocks = Collections.synchronizedSet(new HashSet<String>());
+
+ /**
+ * Creates a new KeyValueCache object.
+ */
+ protected InternPool() {
+ }
+
+ /**
+ * Runs the given block in the context of a cache.
+ * If you do not run your block this way, the caching
+ * mechanism will be disabled.
+ *
+ * @param block block
+ */
+ public static void runBlock(InternableBlock block) {
+ String processId = getProcessId();
+ cachedBlocks.add(processId);
+ block.run();
+ cachedBlocks.remove(processId);
+ clearAll(processId);
+ }
+
+ /**
+ * Returns an internalized value if it already exists in the cache
+ *
+ * @param value value
+ *
+ * @return the internalized value
+ */
+ public static Object intern(Object key, Object value) {
+ String processId = getProcessId();
+
+ if (!cachedBlocks.contains(processId)) {
+ return value;
+ }
+
+ synchronized (cachedValues) {
+ List values = (List) cachedValues.get(processId, key);
+ if (values == null) {
+ cachedValues.put(processId, key, (values = new ArrayList()));
+ }
+
+ Object intern;
+ if (values.contains(value)) {
+ intern = values.get(values.indexOf(value));
+ } else {
+ values.add(intern = value);
+ }
+
+ return intern;
+ }
+ }
+
+ /**
+ * Clears all the values corresponding to the given process
+ *
+ * @param processId processId
+ */
+ protected static void clearAll(String processId) {
+ synchronized (cachedValues) {
+ cachedValues.remove(processId);
+ }
+ }
+
+ /**
+ * Returns the current thread id as the process id.
+ *
+ * @return the "process id"
+ */
+ private static String getProcessId() {
+ return String.valueOf(Thread.currentThread().getId());
+ }
+
+ /**
+ * An interface that clients should implement to run their
+ * blocks of code in the context of this caching mechanism.
+ */
+ public interface InternableBlock {
+ /**
+ * The block to run
+ */
+ public void run();
+ }
+}
14 years, 8 months
riftsaw SVN: r618 - in branches/DBIssue/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode: scheduler and 1 other directory.
by riftsaw-commits@lists.jboss.org
Author: objectiser
Date: 2010-04-08 11:41:12 -0400 (Thu, 08 Apr 2010)
New Revision: 618
Added:
branches/DBIssue/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/scheduler/
branches/DBIssue/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/scheduler/Job.java
branches/DBIssue/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/scheduler/JobComparatorByDate.java
branches/DBIssue/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/scheduler/SchedulerThread.java
branches/DBIssue/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/scheduler/Task.java
branches/DBIssue/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/scheduler/TaskRunner.java
branches/DBIssue/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/scheduler/TransientScheduler.java
Modified:
branches/DBIssue/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/BPELEngineImpl.java
Log:
Transient job scheduler, to avoid additional db usage - to help isolate db concurrency issues.
Modified: branches/DBIssue/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/BPELEngineImpl.java
===================================================================
--- branches/DBIssue/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/BPELEngineImpl.java 2010-04-08 14:23:33 UTC (rev 617)
+++ branches/DBIssue/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/BPELEngineImpl.java 2010-04-08 15:41:12 UTC (rev 618)
@@ -40,6 +40,7 @@
import org.apache.ode.utils.Properties;
import org.jboss.soa.bpel.runtime.engine.BPELEngine;
import org.jboss.soa.bpel.runtime.engine.InvocationAdapter;
+import org.jboss.soa.bpel.runtime.engine.ode.scheduler.TransientScheduler;
import org.w3c.dom.Element;
import javax.sql.DataSource;
@@ -440,7 +441,8 @@
}
protected Scheduler createScheduler() {
- SimpleScheduler scheduler = new SimpleScheduler(new GUID().toString(),new JdbcDelegate(_db.getDataSource()), _odeConfig.getProperties());
+ //SimpleScheduler scheduler = new SimpleScheduler(new GUID().toString(),new JdbcDelegate(_db.getDataSource()), _odeConfig.getProperties());
+ TransientScheduler scheduler = new TransientScheduler(new GUID().toString(), _odeConfig.getProperties());
scheduler.setExecutorService(_executorService);
scheduler.setTransactionManager(_txMgr);
Added: branches/DBIssue/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/scheduler/Job.java
===================================================================
--- branches/DBIssue/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/scheduler/Job.java (rev 0)
+++ branches/DBIssue/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/scheduler/Job.java 2010-04-08 15:41:12 UTC (rev 618)
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.jboss.soa.bpel.runtime.engine.ode.scheduler;
+
+import java.util.Map;
+
+import org.apache.ode.utils.GUID;
+
+/**
+ * Like a task, but a little bit better.
+ *
+ * @author Maciej Szefler ( m s z e f l e r @ g m a i l . c o m )
+ */
+class Job extends Task {
+ String jobId;
+ boolean transacted;
+ Map<String,Object> detail;
+ boolean persisted = true;
+
+ public Job(long when, boolean transacted, Map<String, Object> jobDetail) {
+ this(when, new GUID().toString(),transacted,jobDetail);
+ }
+
+ public Job(long when, String jobId, boolean transacted,Map<String, Object> jobDetail) {
+ super(when);
+ this.jobId = jobId;
+ this.detail = jobDetail;
+ this.transacted = transacted;
+ }
+
+ @Override
+ public int hashCode() {
+ return jobId.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ return obj instanceof Job && jobId.equals(((Job) obj).jobId);
+ }
+
+ @Override
+ public String toString() {
+ return "Job "+jobId+" transacted: "+transacted+" persisted: "+persisted+" details: "+detail;
+ }
+}
Added: branches/DBIssue/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/scheduler/JobComparatorByDate.java
===================================================================
--- branches/DBIssue/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/scheduler/JobComparatorByDate.java (rev 0)
+++ branches/DBIssue/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/scheduler/JobComparatorByDate.java 2010-04-08 15:41:12 UTC (rev 618)
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.jboss.soa.bpel.runtime.engine.ode.scheduler;
+
+import java.util.Comparator;
+
+/**
+ * Compare jobs, using scheduled date as sort criteria.
+ *
+ * @author Maciej Szefler ( m s z e f l e r @ g m a i l . c o m )
+ */
+class JobComparatorByDate implements Comparator<Task> {
+
+ public int compare(Task o1, Task o2) {
+ long diff = o1.schedDate - o2.schedDate;
+ if (diff < 0) return -1;
+ if (diff > 0) return 1;
+ return 0;
+ }
+
+}
Added: branches/DBIssue/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/scheduler/SchedulerThread.java
===================================================================
--- branches/DBIssue/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/scheduler/SchedulerThread.java (rev 0)
+++ branches/DBIssue/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/scheduler/SchedulerThread.java 2010-04-08 15:41:12 UTC (rev 618)
@@ -0,0 +1,197 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.jboss.soa.bpel.runtime.engine.ode.scheduler;
+
+import java.util.concurrent.PriorityBlockingQueue;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.locks.Condition;
+import java.util.concurrent.locks.ReentrantLock;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ode.utils.stl.CollectionsX;
+import org.apache.ode.utils.stl.MemberOfFunction;
+
+/**
+ * Implements the "todo" queue and prioritized scheduling mechanism.
+ *
+ * @author mszefler
+ * @author Maciej Szefler ( m s z e f l e r @ g m a i l . c o m )
+ *
+ */
+class SchedulerThread implements Runnable {
+
+ private static final Log __log = LogFactory.getLog(SchedulerThread.class);
+
+ private static final int TODO_QUEUE_INITIAL_CAPACITY = 200;
+
+ /** Jobs ready for immediate execution. */
+ private PriorityBlockingQueue<Task> _todo;
+
+ /** Lock for managing the queue */
+ private ReentrantLock _lock = new ReentrantLock();
+
+ private Condition _activity = _lock.newCondition();
+
+ private volatile boolean _done;
+
+ private TaskRunner _taskrunner;
+
+ private Thread _thread;
+
+ SchedulerThread(TaskRunner runner) {
+ _todo = new PriorityBlockingQueue<Task>(TODO_QUEUE_INITIAL_CAPACITY,
+ new JobComparatorByDate());
+ _taskrunner = runner;
+ }
+
+ void start() {
+ if (_thread != null)
+ return;
+
+ _done = false;
+ _thread = new Thread(this, "OdeScheduler");
+ _thread.start();
+ }
+
+ /**
+ * Shutdown the thread.
+ */
+ void stop() {
+ if (_thread == null)
+ return;
+
+ _done = true;
+ _lock.lock();
+ try {
+ _activity.signal();
+ } finally {
+ _lock.unlock();
+
+ }
+
+ while (_thread != null)
+ try {
+ _thread.join();
+ _thread = null;
+ } catch (InterruptedException e) {
+ ;
+ }
+
+ }
+
+ /**
+ * Add a job to the todo queue.
+ *
+ * @param job
+ */
+ void enqueue(Task task) {
+ _lock.lock();
+ try {
+ _todo.add(task);
+ _activity.signal();
+ } finally {
+ _lock.unlock();
+ }
+ }
+
+ /**
+ * Remove a job to the todo queue.
+ *
+ * @param job
+ */
+ void dequeue(Task task) {
+ _lock.lock();
+ try {
+ _todo.remove(task);
+ _activity.signal();
+ } finally {
+ _lock.unlock();
+ }
+ }
+
+ /**
+ * Get the size of the todo queue.
+ *
+ * @return
+ */
+ public int size() {
+ return _todo.size();
+ }
+
+ /**
+ * Pop items off the todo queue, and send them to the task runner for processing.
+ */
+ public void run() {
+ while (!_done) {
+ _lock.lock();
+ try {
+ long nextjob;
+ while ((nextjob = nextJobTime()) > 0 && !_done)
+ _activity.await(nextjob, TimeUnit.MILLISECONDS);
+
+ if (!_done && nextjob == 0) {
+ Task task = _todo.take();
+ _taskrunner.runTask(task);
+
+ }
+ } catch (InterruptedException ex) {
+ ; // ignore
+ } finally {
+ _lock.unlock();
+ }
+ }
+ }
+
+ /**
+ * Calculate the time until the next available job.
+ *
+ * @return time until next job, 0 if one is one is scheduled to go, and some
+ * really large number if there are no jobs to speak of
+ */
+ private long nextJobTime() {
+ assert _lock.isLocked();
+
+ Task job = _todo.peek();
+ if (job == null)
+ return Long.MAX_VALUE;
+
+ return Math.max(0, job.schedDate - System.currentTimeMillis());
+ }
+
+ /**
+ * Remove the tasks of a given type from the list.
+ * @param tasktype type of task
+ */
+ public void clearTasks(final Class<? extends Task> tasktype) {
+ _lock.lock();
+ try {
+ CollectionsX.remove_if(_todo, new MemberOfFunction<Task>() {
+ @Override
+ public boolean isMember(Task o) {
+ return tasktype.isAssignableFrom(o.getClass());
+ }
+
+ });
+ } finally {
+ _lock.unlock();
+ }
+ }
+}
Added: branches/DBIssue/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/scheduler/Task.java
===================================================================
--- branches/DBIssue/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/scheduler/Task.java (rev 0)
+++ branches/DBIssue/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/scheduler/Task.java 2010-04-08 15:41:12 UTC (rev 618)
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.jboss.soa.bpel.runtime.engine.ode.scheduler;
+
+/**
+ * The thing that we schedule.
+ *
+ * @author Maciej Szefler ( m s z e f l e r @ g m a i l . c o m )
+ *
+ */
+class Task {
+ /** Scheduled date/time. */
+ public long schedDate;
+
+ Task(long schedDate) {
+ this.schedDate = schedDate;
+ }
+}
Added: branches/DBIssue/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/scheduler/TaskRunner.java
===================================================================
--- branches/DBIssue/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/scheduler/TaskRunner.java (rev 0)
+++ branches/DBIssue/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/scheduler/TaskRunner.java 2010-04-08 15:41:12 UTC (rev 618)
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.jboss.soa.bpel.runtime.engine.ode.scheduler;
+
+/**
+ * The thing that runs the scheduled tasks.
+ *
+ * @author Maciej Szefler ( m s z e f l e r @ g m a i l . c o m )
+ *
+ */
+interface TaskRunner {
+
+
+ public void runTask(Task task);
+}
Added: branches/DBIssue/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/scheduler/TransientScheduler.java
===================================================================
--- branches/DBIssue/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/scheduler/TransientScheduler.java (rev 0)
+++ branches/DBIssue/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/scheduler/TransientScheduler.java 2010-04-08 15:41:12 UTC (rev 618)
@@ -0,0 +1,757 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.jboss.soa.bpel.runtime.engine.ode.scheduler;
+
+import java.util.*;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CopyOnWriteArraySet;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.concurrent.atomic.AtomicLong;
+
+import javax.transaction.Status;
+import javax.transaction.Synchronization;
+import javax.transaction.SystemException;
+import javax.transaction.Transaction;
+import javax.transaction.TransactionManager;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ode.bpel.iapi.ContextException;
+import org.apache.ode.bpel.iapi.Scheduler;
+
+/**
+ * A reliable and relatively simple scheduler that uses a database to persist information about
+ * scheduled tasks.
+ *
+ * The challenge is to achieve high performance in a small memory footprint without loss of reliability
+ * while supporting distributed/clustered configurations.
+ *
+ * The design is based around three time horizons: "immediate", "near future", and "everything else".
+ * Immediate jobs (i.e. jobs that are about to be up) are written to the database and kept in
+ * an in-memory priority queue. When they execute, they are removed from the database. Near future
+ * jobs are placed in the database and assigned to the current node, however they are not stored in
+ * memory. Periodically jobs are "upgraded" from near-future to immediate status, at which point they
+ * get loaded into memory. Jobs that are further out in time, are placed in the database without a
+ * node identifer; when they are ready to be "upgraded" to near-future jobs they are assigned to one
+ * of the known live nodes. Recovery is rather straighforward, with stale node identifiers being
+ * reassigned to known good nodes.
+ *
+ * @author Maciej Szefler ( m s z e f l e r @ g m a i l . c o m )
+ *
+ */
+public class TransientScheduler implements Scheduler, TaskRunner {
+ private static final Log __log = LogFactory.getLog(TransientScheduler.class);
+
+ /**
+ * Jobs scheduled with a time that is between [now, now+immediateInterval] will be assigned to the current node, and placed
+ * directly on the todo queue.
+ */
+ long _immediateInterval = 30000;
+
+ /**
+ * Jobs scheduled with a time that is between (now+immediateInterval,now+nearFutureInterval) will be assigned to the current
+ * node, but will not be placed on the todo queue (the promoter will pick them up).
+ */
+ long _nearFutureInterval = 10 * 60 * 1000;
+
+ /** 10s of no communication and you are deemed dead. */
+ long _staleInterval = 10000;
+
+ /**
+ * Estimated sustained transaction per second capacity of the system.
+ * e.g. 100 means the system can process 100 jobs per seconds, on average
+ * This number is used to determine how many jobs to load from the database at once.
+ */
+ int _tps = 100;
+
+ TransactionManager _txm;
+
+ ExecutorService _exec;
+
+ String _nodeId;
+
+ /** Maximum number of jobs in the "near future" / todo queue. */
+ int _todoLimit = 10000;
+
+ /** The object that actually handles the jobs. */
+ volatile JobProcessor _jobProcessor;
+
+ volatile JobProcessor _polledRunnableProcessor;
+
+ private SchedulerThread _todo;
+
+ /** All the nodes we know about */
+ private CopyOnWriteArraySet<String> _knownNodes = new CopyOnWriteArraySet<String>();
+
+ /** When we last heard from our nodes. */
+ private ConcurrentHashMap<String, Long> _lastHeartBeat = new ConcurrentHashMap<String, Long>();
+
+ private boolean _running;
+
+ /** Time for next upgrade. */
+ private AtomicLong _nextUpgrade = new AtomicLong();
+
+ private Random _random = new Random();
+
+ private long _pollIntervalForPolledRunnable = Long.getLong("org.apache.ode.polledRunnable.pollInterval", 10 * 60 * 1000);
+
+ public TransientScheduler(String nodeId, Properties conf) {
+ _nodeId = nodeId;
+ _todoLimit = getIntProperty(conf, "ode.scheduler.queueLength", _todoLimit);
+ _immediateInterval = getLongProperty(conf, "ode.scheduler.immediateInterval", _immediateInterval);
+ _nearFutureInterval = getLongProperty(conf, "ode.scheduler.nearFutureInterval", _nearFutureInterval);
+ _staleInterval = getLongProperty(conf, "ode.scheduler.staleInterval", _staleInterval);
+ _tps = getIntProperty(conf, "ode.scheduler.transactionsPerSecond", _tps);
+ _todo = new SchedulerThread(this);
+ }
+
+ public void setPollIntervalForPolledRunnable(long pollIntervalForPolledRunnable) {
+ _pollIntervalForPolledRunnable = pollIntervalForPolledRunnable;
+ }
+
+ private int getIntProperty(Properties props, String propName, int defaultValue) {
+ String s = props.getProperty(propName);
+ if (s != null) return Integer.parseInt(s);
+ else return defaultValue;
+ }
+
+ private long getLongProperty(Properties props, String propName, long defaultValue) {
+ String s = props.getProperty(propName);
+ if (s != null) return Long.parseLong(s);
+ else return defaultValue;
+ }
+
+ public void setNodeId(String nodeId) {
+ _nodeId = nodeId;
+ }
+
+ public void setStaleInterval(long staleInterval) {
+ _staleInterval = staleInterval;
+ }
+
+ public void setImmediateInterval(long immediateInterval) {
+ _immediateInterval = immediateInterval;
+ }
+
+ public void setNearFutureInterval(long nearFutureInterval) {
+ _nearFutureInterval = nearFutureInterval;
+ }
+
+ public void setTransactionsPerSecond(int tps) {
+ _tps = tps;
+ }
+
+ public void setTransactionManager(TransactionManager txm) {
+ _txm = txm;
+ }
+
+ public void setExecutorService(ExecutorService executorService) {
+ _exec = executorService;
+ }
+
+ public void setPolledRunnableProcesser(JobProcessor polledRunnableProcessor) {
+ _polledRunnableProcessor = polledRunnableProcessor;
+ }
+
+ public void cancelJob(String jobId) throws ContextException {
+ _todo.dequeue(new Job(0, jobId, false, null));
+ }
+
+ public <T> Future<T> execIsolatedTransaction(final Callable<T> transaction) throws Exception, ContextException {
+ return _exec.submit(new Callable<T>() {
+ public T call() throws Exception {
+ try {
+ return execTransaction(transaction);
+ } catch (Exception e) {
+ __log.error("An exception occured while executing an isolated transaction, " +
+ "the transaction is going to be abandoned.", e);
+ return null;
+ }
+ }
+ });
+ }
+
+ public <T> T execTransaction(Callable<T> transaction) throws Exception, ContextException {
+ try {
+ if (__log.isDebugEnabled()) __log.debug("Beginning a new transaction");
+ _txm.begin();
+ } catch (Exception ex) {
+ String errmsg = "Internal Error, could not begin transaction.";
+ throw new ContextException(errmsg, ex);
+ }
+
+ boolean success = false;
+ try {
+ T retval = transaction.call();
+ success = true;
+ return retval;
+ } catch (Exception ex) {
+ throw ex;
+ } finally {
+ if (success) {
+ if (__log.isDebugEnabled()) __log.debug("Commiting on " + _txm + "...");
+ _txm.commit();
+ } else {
+ if (__log.isDebugEnabled()) __log.debug("Rollbacking on " + _txm + "...");
+ _txm.rollback();
+ }
+ }
+ }
+
+ public void setRollbackOnly() throws Exception {
+ _txm.setRollbackOnly();
+ }
+
+ public void registerSynchronizer(final Synchronizer synch) throws ContextException {
+ try {
+ _txm.getTransaction().registerSynchronization(new Synchronization() {
+
+ public void beforeCompletion() {
+ synch.beforeCompletion();
+ }
+
+ public void afterCompletion(int status) {
+ synch.afterCompletion(status == Status.STATUS_COMMITTED);
+ }
+
+ });
+ } catch (Exception e) {
+ throw new ContextException("Unable to register synchronizer.", e);
+ }
+ }
+
+ public String schedulePersistedJob(final Map<String, Object> jobDetail, Date when) throws ContextException {
+ long ctime = System.currentTimeMillis();
+ if (when == null)
+ when = new Date(ctime);
+
+ if (__log.isDebugEnabled())
+ __log.debug("scheduling " + jobDetail + " for " + when);
+
+ return schedulePersistedJob(new Job(when.getTime(), true, jobDetail), when, ctime);
+ }
+
+ public String scheduleMapSerializableRunnable(MapSerializableRunnable runnable, Date when) throws ContextException {
+ long ctime = System.currentTimeMillis();
+ if (when == null)
+ when = new Date(ctime);
+
+ Map<String, Object> jobDetails = new HashMap<String, Object>();
+ jobDetails.put("runnable", runnable);
+ runnable.storeToDetailsMap(jobDetails);
+
+ if (__log.isDebugEnabled())
+ __log.debug("scheduling " + jobDetails + " for " + when);
+
+ return schedulePersistedJob(new Job(when.getTime(), true, jobDetails), when, ctime);
+ }
+
+ private String schedulePersistedJob(Job job, Date when, long ctime) throws ContextException {
+ /*
+ boolean immediate = when.getTime() <= ctime + _immediateInterval;
+ boolean nearfuture = !immediate && when.getTime() <= ctime + _nearFutureInterval;
+ try {
+ if (immediate) {
+ // Immediate scheduling means we put it in the DB for safe keeping
+ _db.insertJob(job, _nodeId, true);
+
+ // And add it to our todo list .
+ if (_todo.size() < _todoLimit) {
+ */
+ addTodoOnCommit(job);
+ /*
+ }
+ __log.debug("scheduled immediate job: " + job.jobId);
+ } else if (nearfuture) {
+ // Near future, assign the job to ourselves (why? -- this makes it very unlikely that we
+ // would get two nodes trying to process the same instance, which causes unsightly rollbacks).
+ _db.insertJob(job, _nodeId, false);
+ __log.debug("scheduled near-future job: " + job.jobId);
+ } else {
+ // Not the near future, we don't assign a node-id, we'll assign it later.
+ _db.insertJob(job, null, false);
+ __log.debug("scheduled far-future job: " + job.jobId);
+ }
+ } catch (DatabaseException dbe) {
+ __log.error("Database error.", dbe);
+ throw new ContextException("Database error.", dbe);
+ }
+ */
+ return job.jobId;
+
+ }
+
+ public String scheduleVolatileJob(boolean transacted, Map<String, Object> jobDetail) throws ContextException {
+ Job job = new Job(System.currentTimeMillis(), transacted, jobDetail);
+ job.persisted = false;
+ addTodoOnCommit(job);
+ return job.toString();
+ }
+
+ public void setJobProcessor(JobProcessor processor) throws ContextException {
+ _jobProcessor = processor;
+ }
+
+ public void shutdown() {
+ stop();
+ _jobProcessor = null;
+ _txm = null;
+ _todo = null;
+ }
+
+ public synchronized void start() {
+ if (_running)
+ return;
+
+ if (_exec == null)
+ _exec = Executors.newCachedThreadPool();
+
+ _todo.clearTasks(UpgradeJobsTask.class);
+ _todo.clearTasks(LoadImmediateTask.class);
+ _todo.clearTasks(CheckStaleNodes.class);
+
+ _knownNodes.clear();
+
+ /*
+ try {
+ execTransaction(new Callable<Void>() {
+
+ public Void call() throws Exception {
+ _knownNodes.addAll(_db.getNodeIds());
+ return null;
+ }
+
+ });
+ } catch (Exception ex) {
+ __log.error("Error retrieving node list.", ex);
+ throw new ContextException("Error retrieving node list.", ex);
+ }
+ */
+
+ long now = System.currentTimeMillis();
+
+ // Pretend we got a heartbeat...
+ for (String s : _knownNodes) _lastHeartBeat.put(s, now);
+
+ // schedule immediate job loading for now!
+ _todo.enqueue(new LoadImmediateTask(now));
+
+ // schedule check for stale nodes, make it random so that the nodes don't overlap.
+ _todo.enqueue(new CheckStaleNodes(now + randomMean(_staleInterval)));
+
+ // do the upgrade sometime (random) in the immediate interval.
+ _todo.enqueue(new UpgradeJobsTask(now + randomMean(_immediateInterval)));
+
+ _todo.start();
+ _running = true;
+ }
+
+ private long randomMean(long mean) {
+ return (long) _random.nextDouble() * mean + (mean/2);
+ }
+
+ public synchronized void stop() {
+ if (!_running)
+ return;
+
+ _todo.stop();
+ _todo.clearTasks(UpgradeJobsTask.class);
+ _todo.clearTasks(LoadImmediateTask.class);
+ _todo.clearTasks(CheckStaleNodes.class);
+ _running = false;
+ }
+
+ /**
+ * Run a job in the current thread.
+ *
+ * @param job job to run.
+ */
+ protected void runJob(final Job job) {
+ final Scheduler.JobInfo jobInfo = new Scheduler.JobInfo(job.jobId, job.detail,
+ (Integer)(job.detail.get("retry") != null ? job.detail.get("retry") : 0));
+
+ _exec.submit(new Callable<Void>() {
+ public Void call() throws Exception {
+ if (job.transacted) {
+ try {
+ execTransaction(new Callable<Void>() {
+ public Void call() throws Exception {
+ /*
+ if (job.persisted)
+ if (!_db.deleteJob(job.jobId, _nodeId))
+ throw new JobNoLongerInDbException(job.jobId,_nodeId);
+ */
+
+ try {
+ _jobProcessor.onScheduledJob(jobInfo);
+ } catch (JobProcessorException jpe) {
+ if (jpe.retry) {
+ int retry = job.detail.get("retry") != null ? (((Integer)job.detail.get("retry")) + 1) : 0;
+ if (retry <= 10) {
+ //long delay = doRetry(job);
+ //__log.error("Error while processing transaction, retrying in " + delay + "s");
+ } else {
+ __log.error("Error while processing transaction after 10 retries, no more retries:"+job);
+ }
+ } else {
+ __log.error("Error while processing transaction, no retry.", jpe);
+ }
+ // Let execTransaction know that shit happened.
+ throw jpe;
+ }
+ return null;
+ }
+ });
+ //} catch (JobNoLongerInDbException jde) {
+ // This may happen if two node try to do the same job... we try to avoid
+ // it the synchronization is a best-effort but not perfect.
+ // __log.debug("job no longer in db forced rollback.");
+ } catch (Exception ex) {
+ __log.error("Error while executing transaction", ex);
+ }
+ } else {
+ _jobProcessor.onScheduledJob(jobInfo);
+ }
+ return null;
+ }
+ });
+ }
+
+ /**
+ * Run a job from a polled runnable thread. The runnable is not persistent,
+ * however, the poller is persistent and wakes up every given interval to
+ * check the status of the runnable.
+ * <ul>
+ * <li>1. The runnable is being scheduled; the poller persistent job dispatches
+ * the runnable to a runnable delegate thread and schedules itself to a later time.</li>
+ * <li>2. The runnable is running; the poller job re-schedules itself every time it
+ * sees the runnable is not completed.</li>
+ * <li>3. The runnable failed; the poller job passes the exception thrown on the runnable
+ * down, and the standard scheduler retries happen.</li>
+ * <li>4. The runnable completes; the poller persistent does not re-schedule itself.</li>
+ * <li>5. System powered off and restarts; the poller job does not know what the status
+ * of the runnable. This is handled just like the case #1.</li>
+ * </ul>
+ *
+ * There is at least one re-scheduling of the poller job. Since, the runnable's state is
+ * not persisted, and the same runnable may be tried again after system failure,
+ * the runnable that's used with this polling should be repeatable.
+ *
+ * @param job job to run.
+ */
+ protected void runPolledRunnable(final Job job) {
+ final Scheduler.JobInfo jobInfo = new Scheduler.JobInfo(job.jobId, job.detail,
+ (Integer)(job.detail.get("retry") != null ? job.detail.get("retry") : 0));
+
+ _exec.submit(new Callable<Void>() {
+ public Void call() throws Exception {
+ try {
+ execTransaction(new Callable<Void>() {
+ public Void call() throws Exception {
+ //if (!_db.deleteJob(job.jobId, _nodeId))
+ // throw new JobNoLongerInDbException(job.jobId,_nodeId);
+
+ try {
+ _polledRunnableProcessor.onScheduledJob(jobInfo);
+ if( !"COMPLETED".equals(String.valueOf(jobInfo.jobDetail.get("runnable_status"))) ) {
+ // the runnable is still in progress, schedule checker to 10 mins later
+ if( _pollIntervalForPolledRunnable < 0 ) {
+ if(__log.isWarnEnabled()) __log.warn("The poll interval for polled runnables is negative; setting it to 1000ms");
+ _pollIntervalForPolledRunnable = 1000;
+ }
+ job.schedDate = System.currentTimeMillis() + _pollIntervalForPolledRunnable;
+ //_db.insertJob(job, _nodeId, false);
+ addTodoOnCommit(job); // Added
+ System.out.println("GPB: WAS PERSISTENT JOB INSERT HERE !!!");
+ }
+ } catch (JobProcessorException jpe) {
+ if (jpe.retry) {
+ int retry = job.detail.get("retry") != null ? (((Integer)job.detail.get("retry")) + 1) : 0;
+ if (retry <= 10) {
+ // long delay = doRetry(job);
+ //__log.error("Error while processing transaction, retrying in " + delay + "s");
+ } else {
+ __log.error("Error while processing transaction after 10 retries, no more retries:"+job);
+ }
+ } else {
+ __log.error("Error while processing transaction, no retry.", jpe);
+ }
+ // Let execTransaction know that shit happened.
+ throw jpe;
+ }
+ return null;
+ }
+ });
+ //} catch (JobNoLongerInDbException jde) {
+ // This may happen if two node try to do the same job... we try to avoid
+ // it the synchronization is a best-effort but not perfect.
+ // __log.debug("job no longer in db forced rollback.");
+ } catch (Exception ex) {
+ __log.error("Error while executing transaction", ex);
+ }
+ return null;
+ }
+ });
+ }
+
+ private void addTodoOnCommit(final Job job) {
+ registerSynchronizer(new Synchronizer() {
+ public void afterCompletion(boolean success) {
+ if (success) {
+ _todo.enqueue(job);
+ }
+ }
+
+ public void beforeCompletion() {
+ }
+ });
+ }
+
+ public boolean isTransacted() {
+ try {
+ Transaction tx = _txm.getTransaction();
+ return (tx != null && tx.getStatus() != Status.STATUS_NO_TRANSACTION);
+ } catch (SystemException e) {
+ throw new ContextException("Internal Error: Could not obtain transaction status.");
+ }
+ }
+
+ public void runTask(Task task) {
+ if (task instanceof Job) {
+ Job job = (Job)task;
+ if( job.detail.get("runnable") != null ) {
+ runPolledRunnable(job);
+ } else {
+ runJob((Job) task);
+ }
+ } else if (task instanceof SchedulerTask)
+ ((SchedulerTask) task).run();
+ }
+
+ public void updateHeartBeat(String nodeId) {
+ if (nodeId == null)
+ return;
+
+ if (_nodeId.equals(nodeId))
+ return;
+
+ _lastHeartBeat.put(nodeId, System.currentTimeMillis());
+ _knownNodes.add(nodeId);
+ }
+
+ boolean doLoadImmediate() {
+ __log.debug("LOAD IMMEDIATE started");
+
+ /*
+ // don't load anything if we're already half-full; we've got plenty to do already
+ if (_todo.size() > _todoLimit/2) return true;
+
+ List<Job> jobs;
+ try {
+ final int batch = (int) (_immediateInterval * _tps / 1000);
+ jobs = execTransaction(new Callable<List<Job>>() {
+ public List<Job> call() throws Exception {
+ return _db.dequeueImmediate(_nodeId, System.currentTimeMillis() + _immediateInterval, batch);
+ }
+ });
+ for (Job j : jobs) {
+ if (__log.isDebugEnabled())
+ __log.debug("todo.enqueue job from db: " + j.jobId + " for " + j.schedDate);
+
+ if (_todo.size() < _todoLimit)
+ _todo.enqueue(j);
+ }
+ return true;
+ } catch (Exception ex) {
+ __log.error("Error loading immediate jobs from database.", ex);
+ return false;
+ } finally {
+ __log.debug("LOAD IMMEDIATE complete");
+ }
+ */
+ return(false);
+ }
+
+ boolean doUpgrade() {
+ __log.debug("UPGRADE started");
+ /*
+ final ArrayList<String> knownNodes = new ArrayList<String>(_knownNodes);
+ // Don't forget about self.
+ knownNodes.add(_nodeId);
+ Collections.sort(knownNodes);
+
+ // We're going to try to upgrade near future jobs using the db only.
+ // We assume that the distribution of the trailing digits in the
+ // scheduled time are uniformly distributed, and use modular division
+ // of the time by the number of nodes to create the node assignment.
+ // This can be done in a single update statement.
+ final long maxtime = System.currentTimeMillis() + _nearFutureInterval;
+ try {
+ return execTransaction(new Callable<Boolean>() {
+
+ public Boolean call() throws Exception {
+ int numNodes = knownNodes.size();
+ for (int i = 0; i < numNodes; ++i) {
+ String node = knownNodes.get(i);
+ _db.updateAssignToNode(node, i, numNodes, maxtime);
+ }
+ return true;
+ }
+
+ });
+
+ } catch (Exception ex) {
+ __log.error("Database error upgrading jobs.", ex);
+ return false;
+ } finally {
+ __log.debug("UPGRADE complete");
+ }
+*/
+ return(false);
+ }
+
+ /**
+ * Re-assign stale node's jobs to self.
+ * @param nodeId
+ */
+ void recoverStaleNode(final String nodeId) {
+ __log.debug("recovering stale node " + nodeId);
+ /*
+ try {
+ int numrows = execTransaction(new Callable<Integer>() {
+ public Integer call() throws Exception {
+ return _db.updateReassign(nodeId, _nodeId);
+ }
+ });
+
+ __log.debug("reassigned " + numrows + " jobs to self. ");
+
+ // We can now forget about this node, if we see it again, it will be
+ // "new to us"
+ _knownNodes.remove(nodeId);
+ _lastHeartBeat.remove(nodeId);
+
+ // Force a load-immediate to catch anything new from the recovered node.
+ doLoadImmediate();
+
+ } catch (Exception ex) {
+ __log.error("Database error reassigning node.", ex);
+ } finally {
+ __log.debug("node recovery complete");
+ }
+*/
+ }
+
+ /*
+ private long doRetry(Job job) throws DatabaseException {
+ int retry = job.detail.get("retry") != null ? (((Integer)job.detail.get("retry")) + 1) : 0;
+ job.detail.put("retry", retry);
+ long delay = (long)(Math.pow(5, retry));
+ Job jobRetry = new Job(System.currentTimeMillis() + delay*1000, true, job.detail);
+ _db.insertJob(jobRetry, _nodeId, false);
+ return delay;
+ }
+ */
+
+ private abstract class SchedulerTask extends Task implements Runnable {
+ SchedulerTask(long schedDate) {
+ super(schedDate);
+ }
+ }
+
+ private class LoadImmediateTask extends SchedulerTask {
+ LoadImmediateTask(long schedDate) {
+ super(schedDate);
+ }
+
+ public void run() {
+ boolean success = false;
+ try {
+ success = doLoadImmediate();
+ } finally {
+ if (success)
+ _todo.enqueue(new LoadImmediateTask(System.currentTimeMillis() + (long) (_immediateInterval * .90)));
+ else
+ _todo.enqueue(new LoadImmediateTask(System.currentTimeMillis() + 1000));
+ }
+ }
+
+ }
+
+ /**
+ * Upgrade jobs from far future to immediate future (basically, assign them to a node).
+ * @author mszefler
+ *
+ */
+ private class UpgradeJobsTask extends SchedulerTask {
+ UpgradeJobsTask(long schedDate) {
+ super(schedDate);
+ }
+
+ public void run() {
+ long ctime = System.currentTimeMillis();
+ long ntime = _nextUpgrade.get();
+ __log.debug("UPGRADE task for " + schedDate + " fired at " + ctime);
+
+ // We could be too early, this can happen if upgrade gets delayed due to another
+ // node
+ if (_nextUpgrade.get() > System.currentTimeMillis()) {
+ __log.debug("UPGRADE skipped -- wait another " + (ntime - ctime) + "ms");
+ _todo.enqueue(new UpgradeJobsTask(ntime));
+ return;
+ }
+
+ boolean success = false;
+ try {
+ success = doUpgrade();
+ } finally {
+ long future = System.currentTimeMillis() + (success ? (long) (_nearFutureInterval * .50) : 1000);
+ _nextUpgrade.set(future);
+ _todo.enqueue(new UpgradeJobsTask(future));
+ __log.debug("UPGRADE completed, success = " + success + "; next time in " + (future - ctime) + "ms");
+ }
+ }
+ }
+
+ /**
+ * Check if any of the nodes in our cluster are stale.
+ */
+ private class CheckStaleNodes extends SchedulerTask {
+ CheckStaleNodes(long schedDate) {
+ super(schedDate);
+ }
+
+ public void run() {
+ _todo.enqueue(new CheckStaleNodes(System.currentTimeMillis() + _staleInterval));
+ __log.debug("CHECK STALE NODES started");
+ for (String nodeId : _knownNodes) {
+ Long lastSeen = _lastHeartBeat.get(nodeId);
+ if ((lastSeen == null || (System.currentTimeMillis() - lastSeen) > _staleInterval)
+ && !_nodeId.equals(nodeId))
+ {
+ recoverStaleNode(nodeId);
+ }
+ }
+ }
+ }
+}
14 years, 9 months
riftsaw SVN: r617 - branches.
by riftsaw-commits@lists.jboss.org
Author: objectiser
Date: 2010-04-08 10:23:33 -0400 (Thu, 08 Apr 2010)
New Revision: 617
Added:
branches/DBIssue/
Log:
Branch to experiment with db related issue and scheduler.
Copied: branches/DBIssue (from rev 616, trunk)
14 years, 9 months
riftsaw SVN: r616 - trunk.
by riftsaw-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2010-04-07 07:43:29 -0400 (Wed, 07 Apr 2010)
New Revision: 616
Modified:
trunk/pom.xml
Log:
set console version 2.1-SNAPSHOT
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-04-06 01:33:32 UTC (rev 615)
+++ trunk/pom.xml 2010-04-07 11:43:29 UTC (rev 616)
@@ -68,7 +68,7 @@
<properties>
<riftsaw.ode.version>2.0.0.Final</riftsaw.ode.version>
<riftsaw.engine.version>2.0.1-SNAPSHOT</riftsaw.engine.version>
- <bpm.console.version>2.0.3</bpm.console.version>
+ <bpm.console.version>2.1-SNAPSHOT</bpm.console.version>
<commons.logging.version>1.1.1</commons.logging.version>
<junit.version>3.8.1</junit.version>
<jboss.version>5.1.0.GA</jboss.version>
14 years, 9 months
riftsaw SVN: r615 - in trunk: console and 19 other directories.
by riftsaw-commits@lists.jboss.org
Author: jeff.yuchang
Date: 2010-04-05 21:33:32 -0400 (Mon, 05 Apr 2010)
New Revision: 615
Modified:
trunk/console/identity/pom.xml
trunk/console/integration/pom.xml
trunk/console/pom.xml
trunk/distribution/pom.xml
trunk/distribution/src/main/release/version.properties
trunk/docs/docbook/gettingstartedguide/pom.xml
trunk/docs/docbook/gettingstartedguide/src/main/master.xml
trunk/docs/docbook/pom.xml
trunk/docs/docbook/userguide/pom.xml
trunk/docs/docbook/userguide/src/main/master.xml
trunk/integration-tests/pom.xml
trunk/pom.xml
trunk/qa/build.xml
trunk/qa/hudson-riftsaw-db.sh
trunk/qa/hudson-riftsaw-jboss.sh
trunk/qa/hudson-riftsaw-jdk5.sh
trunk/qa/hudson-riftsaw-soa-p.sh
trunk/qa/hudson-riftsaw-ws.sh
trunk/runtime/deployer/pom.xml
trunk/runtime/engine-assembly/pom.xml
trunk/runtime/engine/pom.xml
trunk/runtime/jbossesb-bpel-assembly/pom.xml
trunk/runtime/jbossesb-bpel/pom.xml
trunk/runtime/pom.xml
trunk/runtime/uddi/pom.xml
trunk/runtime/uddi300/pom.xml
Log:
* update version to 2.0.1-SNAPSHOT
Modified: trunk/console/identity/pom.xml
===================================================================
--- trunk/console/identity/pom.xml 2010-03-31 15:21:00 UTC (rev 614)
+++ trunk/console/identity/pom.xml 2010-04-06 01:33:32 UTC (rev 615)
@@ -4,13 +4,13 @@
<groupId>org.jboss.soa.bpel.console</groupId>
<artifactId>identity</artifactId>
<packaging>jar</packaging>
- <version>2.0.0.Final</version>
+ <version>2.0.1-SNAPSHOT</version>
<name>RiftSaw::Console::Identity</name>
<parent>
<groupId>org.jboss.soa.bpel.console</groupId>
<artifactId>parent</artifactId>
- <version>2.0.0.Final</version>
+ <version>2.0.1-SNAPSHOT</version>
</parent>
<build>
Modified: trunk/console/integration/pom.xml
===================================================================
--- trunk/console/integration/pom.xml 2010-03-31 15:21:00 UTC (rev 614)
+++ trunk/console/integration/pom.xml 2010-04-06 01:33:32 UTC (rev 615)
@@ -4,13 +4,13 @@
<groupId>org.jboss.soa.bpel.console</groupId>
<artifactId>integration</artifactId>
<packaging>jar</packaging>
- <version>2.0.0.Final</version>
+ <version>2.0.1-SNAPSHOT</version>
<name>RiftSaw::Console::Integration</name>
<parent>
<groupId>org.jboss.soa.bpel.console</groupId>
<artifactId>parent</artifactId>
- <version>2.0.0.Final</version>
+ <version>2.0.1-SNAPSHOT</version>
</parent>
<!-- Properties -->
Modified: trunk/console/pom.xml
===================================================================
--- trunk/console/pom.xml 2010-03-31 15:21:00 UTC (rev 614)
+++ trunk/console/pom.xml 2010-04-06 01:33:32 UTC (rev 615)
@@ -5,13 +5,13 @@
<groupId>org.jboss.soa.bpel.console</groupId>
<artifactId>parent</artifactId>
<packaging>pom</packaging>
- <version>2.0.0.Final</version>
+ <version>2.0.1-SNAPSHOT</version>
<name>RiftSaw::Console</name>
<parent>
<groupId>org.jboss.soa</groupId>
<artifactId>bpel</artifactId>
- <version>2.0.0.Final</version>
+ <version>2.0.1-SNAPSHOT</version>
</parent>
<modules>
Modified: trunk/distribution/pom.xml
===================================================================
--- trunk/distribution/pom.xml 2010-03-31 15:21:00 UTC (rev 614)
+++ trunk/distribution/pom.xml 2010-04-06 01:33:32 UTC (rev 615)
@@ -23,12 +23,12 @@
<artifactId>distribution</artifactId>
<packaging>pom</packaging>
<name>RiftSaw::Distribution</name>
- <version>2.0.0.Final</version>
+ <version>2.0.1-SNAPSHOT</version>
<parent>
<groupId>org.jboss.soa</groupId>
<artifactId>bpel</artifactId>
- <version>2.0.0.Final</version>
+ <version>2.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
Modified: trunk/distribution/src/main/release/version.properties
===================================================================
--- trunk/distribution/src/main/release/version.properties 2010-03-31 15:21:00 UTC (rev 614)
+++ trunk/distribution/src/main/release/version.properties 2010-04-06 01:33:32 UTC (rev 615)
@@ -1 +1 @@
-riftsaw.version=2.0.0.Final
+riftsaw.version=2.0.1-SNAPSHOT
Modified: trunk/docs/docbook/gettingstartedguide/pom.xml
===================================================================
--- trunk/docs/docbook/gettingstartedguide/pom.xml 2010-03-31 15:21:00 UTC (rev 614)
+++ trunk/docs/docbook/gettingstartedguide/pom.xml 2010-04-06 01:33:32 UTC (rev 615)
@@ -6,14 +6,14 @@
<groupId>org.jboss.soa.bpel.docs</groupId>
<artifactId>gettingstartedguide</artifactId>
- <version>2.0.0.Final</version>
+ <version>2.0.1-SNAPSHOT</version>
<packaging>jdocbook</packaging>
<name>RiftSaw::Docs::gettingstartedguide</name>
<parent>
<groupId>org.jboss.soa.bpel</groupId>
<artifactId>docs</artifactId>
- <version>2.0.0.Final</version>
+ <version>2.0.1-SNAPSHOT</version>
</parent>
Modified: trunk/docs/docbook/gettingstartedguide/src/main/master.xml
===================================================================
--- trunk/docs/docbook/gettingstartedguide/src/main/master.xml 2010-03-31 15:21:00 UTC (rev 614)
+++ trunk/docs/docbook/gettingstartedguide/src/main/master.xml 2010-04-06 01:33:32 UTC (rev 615)
@@ -5,7 +5,7 @@
<book lang="en">
<bookinfo>
- <title>RiftSaw 2.0.0.Final</title>
+ <title>RiftSaw 2.0.1-SNAPSHOT</title>
<subtitle>Getting Started Guide</subtitle>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="module/author_group.xml"/>
</bookinfo>
Modified: trunk/docs/docbook/pom.xml
===================================================================
--- trunk/docs/docbook/pom.xml 2010-03-31 15:21:00 UTC (rev 614)
+++ trunk/docs/docbook/pom.xml 2010-04-06 01:33:32 UTC (rev 615)
@@ -6,14 +6,14 @@
<groupId>org.jboss.soa.bpel</groupId>
<artifactId>docs</artifactId>
- <version>2.0.0.Final</version>
+ <version>2.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>RiftSaw::Docs</name>
<parent>
<groupId>org.jboss.soa</groupId>
<artifactId>bpel</artifactId>
- <version>2.0.0.Final</version>
+ <version>2.0.1-SNAPSHOT</version>
</parent>
<profiles>
Modified: trunk/docs/docbook/userguide/pom.xml
===================================================================
--- trunk/docs/docbook/userguide/pom.xml 2010-03-31 15:21:00 UTC (rev 614)
+++ trunk/docs/docbook/userguide/pom.xml 2010-04-06 01:33:32 UTC (rev 615)
@@ -6,14 +6,14 @@
<groupId>org.jboss.soa.bpel.docs</groupId>
<artifactId>userguide</artifactId>
- <version>2.0.0.Final</version>
+ <version>2.0.1-SNAPSHOT</version>
<packaging>jdocbook</packaging>
<name>RiftSaw::Docs::userguide</name>
<parent>
<groupId>org.jboss.soa.bpel</groupId>
<artifactId>docs</artifactId>
- <version>2.0.0.Final</version>
+ <version>2.0.1-SNAPSHOT</version>
</parent>
Modified: trunk/docs/docbook/userguide/src/main/master.xml
===================================================================
--- trunk/docs/docbook/userguide/src/main/master.xml 2010-03-31 15:21:00 UTC (rev 614)
+++ trunk/docs/docbook/userguide/src/main/master.xml 2010-04-06 01:33:32 UTC (rev 615)
@@ -5,7 +5,7 @@
<book lang="en">
<bookinfo>
- <title>RiftSaw 2.0.0.Final</title>
+ <title>RiftSaw 2.0.1-SNAPSHOT</title>
<subtitle>User Guide</subtitle>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="module/author_group.xml"/>
</bookinfo>
Modified: trunk/integration-tests/pom.xml
===================================================================
--- trunk/integration-tests/pom.xml 2010-03-31 15:21:00 UTC (rev 614)
+++ trunk/integration-tests/pom.xml 2010-04-06 01:33:32 UTC (rev 615)
@@ -4,12 +4,12 @@
<groupId>org.jboss.soa.bpel</groupId>
<artifactId>integration-tests</artifactId>
<packaging>pom</packaging>
- <version>2.0.0.Final</version>
+ <version>2.0.1-SNAPSHOT</version>
<name>RiftSaw::Integration-Tests</name>
<parent>
<groupId>org.jboss.soa</groupId>
<artifactId>bpel</artifactId>
- <version>2.0.0.Final</version>
+ <version>2.0.1-SNAPSHOT</version>
</parent>
<properties>
<jboss.jbosssx.version>2.0.2.SP3</jboss.jbosssx.version>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-03-31 15:21:00 UTC (rev 614)
+++ trunk/pom.xml 2010-04-06 01:33:32 UTC (rev 615)
@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.soa</groupId>
<artifactId>bpel</artifactId>
- <version>2.0.0.Final</version>
+ <version>2.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>RiftSaw</name>
<url>http://www.jboss.org/riftsaw</url>
@@ -67,7 +67,7 @@
<properties>
<riftsaw.ode.version>2.0.0.Final</riftsaw.ode.version>
- <riftsaw.engine.version>2.0.0.Final</riftsaw.engine.version>
+ <riftsaw.engine.version>2.0.1-SNAPSHOT</riftsaw.engine.version>
<bpm.console.version>2.0.3</bpm.console.version>
<commons.logging.version>1.1.1</commons.logging.version>
<junit.version>3.8.1</junit.version>
Modified: trunk/qa/build.xml
===================================================================
--- trunk/qa/build.xml 2010-03-31 15:21:00 UTC (rev 614)
+++ trunk/qa/build.xml 2010-04-06 01:33:32 UTC (rev 615)
@@ -9,7 +9,7 @@
<!-- CONFIGURABLE PROPERTIES -->
<property name="database" value="hsqldb" />
- <property name="riftsaw.version" value="2.0.0.Final" />
+ <property name="riftsaw.version" value="2.0.1-SNAPSHOT" />
<property name="riftsaw.home" value="${riftsaw.parent.dir}/riftsaw-${riftsaw.version}" /> <!-- riftsaw.home should not be configured. change riftsaw.parent.dir instead -->
<property name="jboss.parent.dir" value="${riftsaw.home}" />
Modified: trunk/qa/hudson-riftsaw-db.sh
===================================================================
--- trunk/qa/hudson-riftsaw-db.sh 2010-03-31 15:21:00 UTC (rev 614)
+++ trunk/qa/hudson-riftsaw-db.sh 2010-04-06 01:33:32 UTC (rev 615)
@@ -7,7 +7,7 @@
RIFTSAW_PARENT_DIR="$WORKSPACE"
JBOSS_VERSION="5.1.0.GA"
-RIFTSAW_VERSION="2.0.0.Final"
+RIFTSAW_VERSION="2.0.1-SNAPSHOT"
AS_HOME="$RIFTSAW_PARENT_DIR/riftsaw-$RIFTSAW_VERSION/jboss-$JBOSS_VERSION"
AS_CONFIG="default"
REPLACE_QA_JDBC="true"
Modified: trunk/qa/hudson-riftsaw-jboss.sh
===================================================================
--- trunk/qa/hudson-riftsaw-jboss.sh 2010-03-31 15:21:00 UTC (rev 614)
+++ trunk/qa/hudson-riftsaw-jboss.sh 2010-04-06 01:33:32 UTC (rev 615)
@@ -7,7 +7,7 @@
RIFTSAW_PARENT_DIR="$WORKSPACE"
JBOSS_VERSION="5.1.0.GA"
-RIFTSAW_VERSION="2.0.0.Final"
+RIFTSAW_VERSION="2.0.1-SNAPSHOT"
AS_HOME="$RIFTSAW_PARENT_DIR/riftsaw-$RIFTSAW_VERSION/jboss-$JBOSS_VERSION"
AS_CONFIG="default"
REPLACE_QA_JDBC="true"
Modified: trunk/qa/hudson-riftsaw-jdk5.sh
===================================================================
--- trunk/qa/hudson-riftsaw-jdk5.sh 2010-03-31 15:21:00 UTC (rev 614)
+++ trunk/qa/hudson-riftsaw-jdk5.sh 2010-04-06 01:33:32 UTC (rev 615)
@@ -9,7 +9,7 @@
DATABASE="hsql"
JBOSS_FILENAME="jboss-$JBOSS_VERSION.zip"
REPLACE_QA_JDBC="true"
-RIFTSAW_VERSION="2.0.0.Final"
+RIFTSAW_VERSION="2.0.1-SNAPSHOT"
AS_HOME="$RIFTSAW_PARENT_DIR/riftsaw-$RIFTSAW_VERSION/jboss-$JBOSS_VERSION"
AS_CONFIG="default"
WS_STACK_DIR="$RIFTSAW_PARENT_DIR/downloads"
Modified: trunk/qa/hudson-riftsaw-soa-p.sh
===================================================================
--- trunk/qa/hudson-riftsaw-soa-p.sh 2010-03-31 15:21:00 UTC (rev 614)
+++ trunk/qa/hudson-riftsaw-soa-p.sh 2010-04-06 01:33:32 UTC (rev 615)
@@ -7,7 +7,7 @@
RIFTSAW_PARENT_DIR="$WORKSPACE"
DATABASE="hsql"
-RIFTSAW_VERSION="2.0.0.Final"
+RIFTSAW_VERSION="2.0.1-SNAPSHOT"
AS_HOME="$RIFTSAW_PARENT_DIR/riftsaw-$RIFTSAW_VERSION/jboss-soa-p.5.0.0/jboss-as"
AS_CONFIG="default"
REPLACE_QA_JDBC="true"
Modified: trunk/qa/hudson-riftsaw-ws.sh
===================================================================
--- trunk/qa/hudson-riftsaw-ws.sh 2010-03-31 15:21:00 UTC (rev 614)
+++ trunk/qa/hudson-riftsaw-ws.sh 2010-04-06 01:33:32 UTC (rev 615)
@@ -6,7 +6,7 @@
RIFTSAW_PARENT_DIR="$WORKSPACE"
JBOSS_VERSION="5.1.0.GA"
DATABASE="hsql"
-RIFTSAW_VERSION="2.0.0.Final"
+RIFTSAW_VERSION="2.0.1-SNAPSHOT"
AS_HOME="$RIFTSAW_PARENT_DIR/riftsaw-$RIFTSAW_VERSION/jboss-$JBOSS_VERSION"
AS_CONFIG="default"
WS_STACK_DIR="$RIFTSAW_PARENT_DIR/downloads"
Modified: trunk/runtime/deployer/pom.xml
===================================================================
--- trunk/runtime/deployer/pom.xml 2010-03-31 15:21:00 UTC (rev 614)
+++ trunk/runtime/deployer/pom.xml 2010-04-06 01:33:32 UTC (rev 615)
@@ -4,13 +4,13 @@
<groupId>org.jboss.soa.bpel.runtime</groupId>
<artifactId>deployer</artifactId>
<packaging>jar</packaging>
- <version>2.0.0.Final</version>
+ <version>2.0.1-SNAPSHOT</version>
<name>RiftSaw::Runtime::Deployer</name>
<parent>
<groupId>org.jboss.soa.bpel</groupId>
<artifactId>runtime</artifactId>
- <version>2.0.0.Final</version>
+ <version>2.0.1-SNAPSHOT</version>
</parent>
<dependencies>
Modified: trunk/runtime/engine/pom.xml
===================================================================
--- trunk/runtime/engine/pom.xml 2010-03-31 15:21:00 UTC (rev 614)
+++ trunk/runtime/engine/pom.xml 2010-04-06 01:33:32 UTC (rev 615)
@@ -4,13 +4,13 @@
<groupId>org.jboss.soa.bpel.runtime</groupId>
<artifactId>riftsaw-engine</artifactId>
<packaging>jar</packaging>
- <version>2.0.0.Final</version>
+ <version>2.0.1-SNAPSHOT</version>
<name>RiftSaw::Runtime::Engine</name>
<parent>
<groupId>org.jboss.soa.bpel</groupId>
<artifactId>runtime</artifactId>
- <version>2.0.0.Final</version>
+ <version>2.0.1-SNAPSHOT</version>
</parent>
<dependencies>
Modified: trunk/runtime/engine-assembly/pom.xml
===================================================================
--- trunk/runtime/engine-assembly/pom.xml 2010-03-31 15:21:00 UTC (rev 614)
+++ trunk/runtime/engine-assembly/pom.xml 2010-04-06 01:33:32 UTC (rev 615)
@@ -3,14 +3,14 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.soa.bpel.runtime</groupId>
<artifactId>riftsaw</artifactId>
- <version>2.0.0.Final</version>
+ <version>2.0.1-SNAPSHOT</version>
<packaging>jboss-sar</packaging>
<name>RiftSaw::Runtime::Engine-Assembly</name>
<parent>
<groupId>org.jboss.soa.bpel</groupId>
<artifactId>runtime</artifactId>
- <version>2.0.0.Final</version>
+ <version>2.0.1-SNAPSHOT</version>
</parent>
<dependencies>
Modified: trunk/runtime/jbossesb-bpel/pom.xml
===================================================================
--- trunk/runtime/jbossesb-bpel/pom.xml 2010-03-31 15:21:00 UTC (rev 614)
+++ trunk/runtime/jbossesb-bpel/pom.xml 2010-04-06 01:33:32 UTC (rev 615)
@@ -4,13 +4,13 @@
<groupId>org.jboss.soa.bpel.runtime</groupId>
<artifactId>jbossesb-bpel</artifactId>
<packaging>jar</packaging>
- <version>2.0.0.Final</version>
+ <version>2.0.1-SNAPSHOT</version>
<name>RiftSaw::Runtime::JBossESB-BPEL</name>
<parent>
<groupId>org.jboss.soa.bpel</groupId>
<artifactId>runtime</artifactId>
- <version>2.0.0.Final</version>
+ <version>2.0.1-SNAPSHOT</version>
</parent>
<dependencies>
Modified: trunk/runtime/jbossesb-bpel-assembly/pom.xml
===================================================================
--- trunk/runtime/jbossesb-bpel-assembly/pom.xml 2010-03-31 15:21:00 UTC (rev 614)
+++ trunk/runtime/jbossesb-bpel-assembly/pom.xml 2010-04-06 01:33:32 UTC (rev 615)
@@ -3,13 +3,13 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.soa.bpel.runtime</groupId>
<artifactId>bpel.esb</artifactId>
- <version>2.0.0.Final</version>
+ <version>2.0.1-SNAPSHOT</version>
<packaging>jboss-esb</packaging>
<name>RiftSaw::Runtime::JBossESB-BPEL-Assembly</name>
<parent>
<groupId>org.jboss.soa.bpel</groupId>
<artifactId>runtime</artifactId>
- <version>2.0.0.Final</version>
+ <version>2.0.1-SNAPSHOT</version>
</parent>
<dependencies>
Modified: trunk/runtime/pom.xml
===================================================================
--- trunk/runtime/pom.xml 2010-03-31 15:21:00 UTC (rev 614)
+++ trunk/runtime/pom.xml 2010-04-06 01:33:32 UTC (rev 615)
@@ -5,13 +5,13 @@
<groupId>org.jboss.soa.bpel</groupId>
<artifactId>runtime</artifactId>
<packaging>pom</packaging>
- <version>2.0.0.Final</version>
+ <version>2.0.1-SNAPSHOT</version>
<name>RiftSaw::Runtime</name>
<parent>
<groupId>org.jboss.soa</groupId>
<artifactId>bpel</artifactId>
- <version>2.0.0.Final</version>
+ <version>2.0.1-SNAPSHOT</version>
</parent>
<modules>
Modified: trunk/runtime/uddi/pom.xml
===================================================================
--- trunk/runtime/uddi/pom.xml 2010-03-31 15:21:00 UTC (rev 614)
+++ trunk/runtime/uddi/pom.xml 2010-04-06 01:33:32 UTC (rev 615)
@@ -4,13 +4,13 @@
<groupId>org.jboss.soa.bpel.runtime</groupId>
<artifactId>riftsaw-uddi</artifactId>
<packaging>jar</packaging>
- <version>2.0.0.Final</version>
+ <version>2.0.1-SNAPSHOT</version>
<name>RiftSaw::Runtime::UDDI</name>
<parent>
<groupId>org.jboss.soa.bpel</groupId>
<artifactId>runtime</artifactId>
- <version>2.0.0.Final</version>
+ <version>2.0.1-SNAPSHOT</version>
</parent>
<dependencies>
Modified: trunk/runtime/uddi300/pom.xml
===================================================================
--- trunk/runtime/uddi300/pom.xml 2010-03-31 15:21:00 UTC (rev 614)
+++ trunk/runtime/uddi300/pom.xml 2010-04-06 01:33:32 UTC (rev 615)
@@ -4,13 +4,13 @@
<groupId>org.jboss.soa.bpel.runtime</groupId>
<artifactId>riftsaw-uddi300</artifactId>
<packaging>jar</packaging>
- <version>2.0.0.Final</version>
+ <version>2.0.1-SNAPSHOT</version>
<name>RiftSaw::Runtime::UDDI300</name>
<parent>
<groupId>org.jboss.soa.bpel</groupId>
<artifactId>runtime</artifactId>
- <version>2.0.0.Final</version>
+ <version>2.0.1-SNAPSHOT</version>
</parent>
<dependencies>
14 years, 9 months