You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by va...@apache.org on 2010/05/27 17:52:38 UTC
svn commit: r948869 [2/20] - in /ode/trunk: ./
agents/src/main/java/org/apache/ode/agents/memory/ axis2-war/
axis2-war/src/main/assembly/ axis2-war/src/main/webapp/WEB-INF/conf/
axis2-war/src/main/webapp/js/ axis2-war/src/test/java/org/apache/ode/axis2...
Modified: ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/HelloWorld2.wsdl
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/HelloWorld2.wsdl?rev=948869&r1=948868&r2=948869&view=diff
==============================================================================
--- ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/HelloWorld2.wsdl (original)
+++ ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/HelloWorld2.wsdl Thu May 27 15:52:24 2010
@@ -67,9 +67,9 @@
</wsdl:binding>
<wsdl:service name="HelloService">
- <wsdl:port name="HelloPort" binding="tns:HelloSoapBinding">
- <soap:address location="http://localhost:4000/please_externalize_url_in_endpoint_file"/>
- </wsdl:port>
+ <wsdl:port name="HelloPort" binding="tns:HelloSoapBinding">
+ <soap:address location="http://localhost:4000/please_externalize_url_in_endpoint_file"/>
+ </wsdl:port>
</wsdl:service>
<plnk:partnerLinkType name="HelloPartnerLinkType">
Modified: ode/trunk/axis2/pom.xml
URL: http://svn.apache.org/viewvc/ode/trunk/axis2/pom.xml?rev=948869&r1=948868&r2=948869&view=diff
==============================================================================
--- ode/trunk/axis2/pom.xml (original)
+++ ode/trunk/axis2/pom.xml Thu May 27 15:52:24 2010
@@ -106,7 +106,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <scope>test</scope>
+ <scope>test</scope>
</dependency>
</dependencies>
@@ -114,13 +114,13 @@
<build>
<plugins>
<plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <excludes>
- <exclude>**/ProcessManagementTest.java</exclude>
- <exclude>**/ExecutionPathTest.java</exclude>
- </excludes>
- </configuration>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>**/ProcessManagementTest.java</exclude>
+ <exclude>**/ExecutionPathTest.java</exclude>
+ </excludes>
+ </configuration>
</plugin>
</plugins>
</build>
Modified: ode/trunk/axis2/src/main/java/org/apache/ode/axis2/BindingContextImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/BindingContextImpl.java?rev=948869&r1=948868&r2=948869&view=diff
==============================================================================
--- ode/trunk/axis2/src/main/java/org/apache/ode/axis2/BindingContextImpl.java (original)
+++ ode/trunk/axis2/src/main/java/org/apache/ode/axis2/BindingContextImpl.java Thu May 27 15:52:24 2010
@@ -87,7 +87,7 @@ public class BindingContextImpl implemen
public void deactivateMyRoleEndpoint(Endpoint myRoleEndpoint) {
ODEService service = destroyService(myRoleEndpoint.serviceName, myRoleEndpoint.portName);
if (service != null) {
- _serviceEprMap.remove(service);
+ _serviceEprMap.remove(service);
}
}
@@ -104,17 +104,17 @@ public class BindingContextImpl implemen
return createExternalService(pconf, initialPartnerEndpoint.serviceName, initialPartnerEndpoint.portName);
}
- public long calculateSizeofService(EndpointReference epr) {
- if (_server._odeConfig.isProcessSizeThrottled()) {
- for (ODEService service : _serviceEprMap.keySet()) {
- if (epr.equals(_serviceEprMap.get(epr))) {
- return SizingAgent.deepSizeOf(service);
- }
- }
- }
- return 0;
- }
-
+ public long calculateSizeofService(EndpointReference epr) {
+ if (_server._odeConfig.isProcessSizeThrottled()) {
+ for (ODEService service : _serviceEprMap.keySet()) {
+ if (epr.equals(_serviceEprMap.get(epr))) {
+ return SizingAgent.deepSizeOf(service);
+ }
+ }
+ }
+ return 0;
+ }
+
protected ODEService createService(ProcessConf pconf, QName serviceName, String portName) throws AxisFault {
AxisService axisService = ODEAxisService.createService(_server._axisConfig, pconf, serviceName, portName);
ODEService odeService = new ODEService(axisService, pconf, serviceName, portName, _server._bpelServer, _server._txMgr);
Modified: ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java
URL: http://svn.apache.org/viewvc/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java?rev=948869&r1=948868&r2=948869&view=diff
==============================================================================
--- ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java (original)
+++ ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java Thu May 27 15:52:24 2010
@@ -446,9 +446,9 @@ public class ODEServer {
_store = createProcessStore(eprContext, _db.getDataSource());
_store.registerListener(new ProcessStoreListenerImpl());
_store.setDeployDir(
- _odeConfig.getDeployDir() != null ?
- new File(_odeConfig.getDeployDir()) :
- new File(_workRoot, "processes"));
+ _odeConfig.getDeployDir() != null ?
+ new File(_odeConfig.getDeployDir()) :
+ new File(_workRoot, "processes"));
_store.setConfigDir(_configRoot);
}
Modified: ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEService.java
URL: http://svn.apache.org/viewvc/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEService.java?rev=948869&r1=948868&r2=948869&view=diff
==============================================================================
--- ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEService.java (original)
+++ ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEService.java Thu May 27 15:52:24 2010
@@ -93,7 +93,7 @@ public class ODEService {
}
public String getName() {
- return _axisService.getName();
+ return _axisService.getName();
}
public void onAxisMessageExchange(MessageContext msgContext, MessageContext outMsgContext, SOAPFactory soapFactory)
@@ -141,7 +141,7 @@ public class ODEService {
success = false;
String message = e.getMessage();
if (message == null) {
- message = "An exception occured while invoking ODE.";
+ message = "An exception occured while invoking ODE.";
}
throw new OdeFault(message, e);
} finally {
Modified: ode/trunk/axis2/src/main/java/org/apache/ode/axis2/SoapExternalService.java
URL: http://svn.apache.org/viewvc/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/SoapExternalService.java?rev=948869&r1=948868&r2=948869&view=diff
==============================================================================
--- ode/trunk/axis2/src/main/java/org/apache/ode/axis2/SoapExternalService.java (original)
+++ ode/trunk/axis2/src/main/java/org/apache/ode/axis2/SoapExternalService.java Thu May 27 15:52:24 2010
@@ -370,43 +370,43 @@ public class SoapExternalService impleme
+ address);
}
if (address != null) {
- String url = address.getTextContent();
- String jmsDestination = (String) options.getProperty(JMSConstants.PARAM_REPLY_DESTINATION);
+ String url = address.getTextContent();
+ String jmsDestination = (String) options.getProperty(JMSConstants.PARAM_REPLY_DESTINATION);
if (__log.isDebugEnabled()) {
__log.debug("The user-defined JMS replyTo destination is: "
+ jmsDestination);
__log.debug("The user-defined JMS wait timeout is: "
+ options.getProperty(JMSConstants.JMS_WAIT_REPLY));
}
- if (jmsDestination == null || "".equals(jmsDestination.trim())) {
- // If the REPLY_PARAM property is not user-defined, then use the default value from myRole EPR
- int startIndex = url.indexOf("jms:/");
- if (startIndex != -1) {
- startIndex += "jms:/".length();
- if (url.charAt(startIndex + 1) == '/') {
- startIndex++;
- }
- if (url.startsWith("dynamic")) {
- startIndex += "dynamicQueues".length();
- }
- int jmsEndIndex = url.indexOf("?", startIndex);
- if (jmsEndIndex == -1) {
- jmsEndIndex = url.length();
- }
- jmsDestination = url.substring(startIndex, jmsEndIndex);
- options.setProperty(JMSConstants.PARAM_REPLY_DESTINATION, jmsDestination);
- } else {
- startIndex = url.indexOf("http://");
- if (startIndex != -1) {
- startIndex = url.indexOf("/processes/");
- if (startIndex != -1) {
- startIndex += "/processes/".length();
- jmsDestination = url.substring(startIndex);
- options.setProperty(JMSConstants.PARAM_REPLY_DESTINATION, jmsDestination);
- }
- }
- }
- }
+ if (jmsDestination == null || "".equals(jmsDestination.trim())) {
+ // If the REPLY_PARAM property is not user-defined, then use the default value from myRole EPR
+ int startIndex = url.indexOf("jms:/");
+ if (startIndex != -1) {
+ startIndex += "jms:/".length();
+ if (url.charAt(startIndex + 1) == '/') {
+ startIndex++;
+ }
+ if (url.startsWith("dynamic")) {
+ startIndex += "dynamicQueues".length();
+ }
+ int jmsEndIndex = url.indexOf("?", startIndex);
+ if (jmsEndIndex == -1) {
+ jmsEndIndex = url.length();
+ }
+ jmsDestination = url.substring(startIndex, jmsEndIndex);
+ options.setProperty(JMSConstants.PARAM_REPLY_DESTINATION, jmsDestination);
+ } else {
+ startIndex = url.indexOf("http://");
+ if (startIndex != -1) {
+ startIndex = url.indexOf("/processes/");
+ if (startIndex != -1) {
+ startIndex += "/processes/".length();
+ jmsDestination = url.substring(startIndex);
+ options.setProperty(JMSConstants.PARAM_REPLY_DESTINATION, jmsDestination);
+ }
+ }
+ }
+ }
}
} else {
__log.debug("My-Role EPR not specified, SEP will not be used.");
Modified: ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/BpelEngine.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/BpelEngine.java?rev=948869&r1=948868&r2=948869&view=diff
==============================================================================
--- ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/BpelEngine.java (original)
+++ ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/BpelEngine.java Thu May 27 15:52:24 2010
@@ -58,14 +58,14 @@ public interface BpelEngine extends Sche
*/
MessageExchange getMessageExchange(String mexId);
- int getProcessThrottledMaximumCount();
-
- long getProcessThrottledMaximumSize();
-
- int getHydratedProcessCount(QName processName);
+ int getProcessThrottledMaximumCount();
+
+ long getProcessThrottledMaximumSize();
+
+ int getHydratedProcessCount(QName processName);
- long getHydratedProcessSize(QName processName);
+ long getHydratedProcessSize(QName processName);
- boolean dehydrateLastUnusedProcess();
+ boolean dehydrateLastUnusedProcess();
}
Modified: ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/DebuggerContext.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/DebuggerContext.java?rev=948869&r1=948868&r2=948869&view=diff
==============================================================================
--- ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/DebuggerContext.java (original)
+++ ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/DebuggerContext.java Thu May 27 15:52:24 2010
@@ -33,26 +33,26 @@ import org.apache.ode.bpel.bdi.breaks.Br
*/
public interface DebuggerContext {
- boolean step(Long iid);
-
- boolean resume(final Long iid);
-
- void suspend(final Long iid);
-
- void terminate(final Long iid);
-
- Breakpoint[] getGlobalBreakpoints();
-
- Breakpoint[] getBreakpoints(Long iid);
-
- void addGlobalBreakpoint(Breakpoint breakpoint);
-
- void addBreakpoint(Long pid, Breakpoint breakpoint);
-
- void removeGlobalBreakpoint(Breakpoint breakpoint);
-
- void removeBreakpoint(Long iid, Breakpoint breakpoint);
-
+ boolean step(Long iid);
+
+ boolean resume(final Long iid);
+
+ void suspend(final Long iid);
+
+ void terminate(final Long iid);
+
+ Breakpoint[] getGlobalBreakpoints();
+
+ Breakpoint[] getBreakpoints(Long iid);
+
+ void addGlobalBreakpoint(Breakpoint breakpoint);
+
+ void addBreakpoint(Long pid, Breakpoint breakpoint);
+
+ void removeGlobalBreakpoint(Breakpoint breakpoint);
+
+ void removeBreakpoint(Long iid, Breakpoint breakpoint);
+
/**
* @return the process model.
* Currently an {@link org.apache.ode.bpel.o.OProcess}
Modified: ode/trunk/bpel-compiler/pom.xml
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-compiler/pom.xml?rev=948869&r1=948868&r2=948869&view=diff
==============================================================================
--- ode/trunk/bpel-compiler/pom.xml (original)
+++ ode/trunk/bpel-compiler/pom.xml Thu May 27 15:52:24 2010
@@ -105,7 +105,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <scope>test</scope>
+ <scope>test</scope>
</dependency>
</dependencies>
Modified: ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/CommonCompilationMessages.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/CommonCompilationMessages.java?rev=948869&r1=948868&r2=948869&view=diff
==============================================================================
--- ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/CommonCompilationMessages.java (original)
+++ ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/CommonCompilationMessages.java Thu May 27 15:52:24 2010
@@ -479,20 +479,20 @@ public class CommonCompilationMessages e
return this.formatCompilationMessage("Empty scopes are forbidden.");
}
- public CompilationMessage errEmptyCatch() {
- return this.formatCompilationMessage("Empty catch faut handlers are forbidden.");
- }
+ public CompilationMessage errEmptyCatch() {
+ return this.formatCompilationMessage("Empty catch faut handlers are forbidden.");
+ }
- public CompilationMessage errMustSpecifyRelatedVariable(String name) {
- return this.formatCompilationMessage("The external variable declaration for \"{0}\" must specify a related variable.", name);
- }
+ public CompilationMessage errMustSpecifyRelatedVariable(String name) {
+ return this.formatCompilationMessage("The external variable declaration for \"{0}\" must specify a related variable.", name);
+ }
- public CompilationMessage errMustSpecifyExternalVariableId(String name) {
- return this.formatCompilationMessage("The external variable declaration for \"{0}\" must specify an external variable identifier.", name);
- }
+ public CompilationMessage errMustSpecifyExternalVariableId(String name) {
+ return this.formatCompilationMessage("The external variable declaration for \"{0}\" must specify an external variable identifier.", name);
+ }
- public CompilationMessage errEmptySequence() {
- return this.formatCompilationMessage("Empty sequences are forbidden.");
- }
+ public CompilationMessage errEmptySequence() {
+ return this.formatCompilationMessage("Empty sequences are forbidden.");
+ }
}
Modified: ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ExpressionValidatorFactory.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ExpressionValidatorFactory.java?rev=948869&r1=948868&r2=948869&view=diff
==============================================================================
--- ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ExpressionValidatorFactory.java (original)
+++ ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ExpressionValidatorFactory.java Thu May 27 15:52:24 2010
@@ -31,28 +31,28 @@ import org.apache.ode.bpel.o.OVarType;
public class ExpressionValidatorFactory {
private static final Log __log = LogFactory.getLog(ExpressionValidatorFactory.class);
- private ExpressionValidator _validator = new EmptyValidator();
+ private ExpressionValidator _validator = new EmptyValidator();
- public ExpressionValidatorFactory(Properties config) {
- String propertyName = "org.apache.ode.validator";
- String validatorClass = (String) config.getProperty(propertyName, "");
- __log.debug("Trying property " + propertyName + " got value: " + validatorClass);
- if (!validatorClass.equals("")) {
- try {
- _validator = (ExpressionValidator) getClass().forName(validatorClass).newInstance();
- } catch (Exception e) {
- __log.warn("Cannot instantiate expression validator of class " + validatorClass);
- }
- }
- }
-
- public ExpressionValidator getValidator() {
- return _validator;
- }
-
- private static class EmptyValidator implements ExpressionValidator {
+ public ExpressionValidatorFactory(Properties config) {
+ String propertyName = "org.apache.ode.validator";
+ String validatorClass = (String) config.getProperty(propertyName, "");
+ __log.debug("Trying property " + propertyName + " got value: " + validatorClass);
+ if (!validatorClass.equals("")) {
+ try {
+ _validator = (ExpressionValidator) getClass().forName(validatorClass).newInstance();
+ } catch (Exception e) {
+ __log.warn("Cannot instantiate expression validator of class " + validatorClass);
+ }
+ }
+ }
+
+ public ExpressionValidator getValidator() {
+ return _validator;
+ }
+
+ private static class EmptyValidator implements ExpressionValidator {
public void bpelImportsLoaded(Process source, CompilerContext compilerContext) throws CompilationException {}
public void bpelCompilationCompleted(Process source) throws CompilationException {}
public Object validate(Expression source, OVarType rootNodeType, Object requestedResultType) throws CompilationException { return null; }
- }
+ }
}
Modified: ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/InvokeGenerator.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/InvokeGenerator.java?rev=948869&r1=948868&r2=948869&view=diff
==============================================================================
--- ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/InvokeGenerator.java (original)
+++ ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/InvokeGenerator.java Thu May 27 15:52:24 2010
@@ -127,12 +127,12 @@ class InvokeGenerator extends DefaultAct
Collection<OScope.CorrelationSet> joinCorrelations) {
Set<String> csetNames = new HashSet<String>(); // prevents duplicate cset in on one set of correlations
for (Correlation correlation : correlations) {
- if( csetNames.contains(correlation.getCorrelationSet() ) ) {
+ if( csetNames.contains(correlation.getCorrelationSet() ) ) {
throw new CompilationException(__cmsgsGeneral.errDuplicateUseCorrelationSet(correlation
.getCorrelationSet()));
- }
+ }
- OScope.CorrelationSet cset = _context.resolveCorrelationSet(correlation.getCorrelationSet());
+ OScope.CorrelationSet cset = _context.resolveCorrelationSet(correlation.getCorrelationSet());
switch (correlation.getInitiate()) {
case NO:
assertCorrelations.add(cset);
@@ -141,7 +141,7 @@ class InvokeGenerator extends DefaultAct
initCorrelations.add(cset);
break;
case JOIN:
- cset.hasJoinUseCases = true;
+ cset.hasJoinUseCases = true;
joinCorrelations.add(cset);
}
for (OProcess.OProperty property : cset.properties) {
Modified: ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/PickGenerator.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/PickGenerator.java?rev=948869&r1=948868&r2=948869&view=diff
==============================================================================
--- ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/PickGenerator.java (original)
+++ ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/PickGenerator.java Thu May 27 15:52:24 2010
@@ -40,41 +40,41 @@ class PickGenerator extends PickReceiveG
OPickReceive opick = (OPickReceive) output;
PickActivity pickDef = (PickActivity) src;
- opick.createInstanceFlag = pickDef.isCreateInstance();
- for (OnMessage sOnMessage : pickDef.getOnMessages()) {
- OPickReceive.OnMessage oOnMessage = compileOnMessage(sOnMessage.getVariable(),
- sOnMessage.getPartnerLink(),
- sOnMessage.getOperation(),
- sOnMessage.getMessageExchangeId(),
- sOnMessage.getPortType(),
- pickDef.isCreateInstance(),
- sOnMessage.getCorrelations(),
- sOnMessage.getRoute());
- if (sOnMessage.getActivity() == null)
- throw new CompilationException(__cmsgs.errEmptyOnMessage().setSource(sOnMessage));
- oOnMessage.activity = _context.compile(sOnMessage.getActivity());
- opick.onMessages.add(oOnMessage);
- }
-
- try {
- for(OnAlarm onAlarmDef : pickDef.getOnAlarms()){
- OPickReceive.OnAlarm oalarm = new OPickReceive.OnAlarm(_context.getOProcess());
- oalarm.activity = _context.compile(onAlarmDef.getActivity());
- if (onAlarmDef.getFor() != null && onAlarmDef.getUntil() == null) {
- oalarm.forExpr = _context.compileExpr(onAlarmDef.getFor());
- } else if (onAlarmDef.getFor() == null && onAlarmDef.getUntil() != null) {
- oalarm.untilExpr = _context.compileExpr(onAlarmDef.getUntil());
- } else {
- throw new CompilationException(__cmsgs.errForOrUntilMustBeGiven().setSource(onAlarmDef));
- }
-
- if (pickDef.isCreateInstance())
- throw new CompilationException(__cmsgs.errOnAlarmWithCreateInstance().setSource(onAlarmDef));
-
- opick.onAlarms.add(oalarm);
- }
- } catch (CompilationException ce) {
- _context.recoveredFromError(pickDef, ce);
- }
+ opick.createInstanceFlag = pickDef.isCreateInstance();
+ for (OnMessage sOnMessage : pickDef.getOnMessages()) {
+ OPickReceive.OnMessage oOnMessage = compileOnMessage(sOnMessage.getVariable(),
+ sOnMessage.getPartnerLink(),
+ sOnMessage.getOperation(),
+ sOnMessage.getMessageExchangeId(),
+ sOnMessage.getPortType(),
+ pickDef.isCreateInstance(),
+ sOnMessage.getCorrelations(),
+ sOnMessage.getRoute());
+ if (sOnMessage.getActivity() == null)
+ throw new CompilationException(__cmsgs.errEmptyOnMessage().setSource(sOnMessage));
+ oOnMessage.activity = _context.compile(sOnMessage.getActivity());
+ opick.onMessages.add(oOnMessage);
+ }
+
+ try {
+ for(OnAlarm onAlarmDef : pickDef.getOnAlarms()){
+ OPickReceive.OnAlarm oalarm = new OPickReceive.OnAlarm(_context.getOProcess());
+ oalarm.activity = _context.compile(onAlarmDef.getActivity());
+ if (onAlarmDef.getFor() != null && onAlarmDef.getUntil() == null) {
+ oalarm.forExpr = _context.compileExpr(onAlarmDef.getFor());
+ } else if (onAlarmDef.getFor() == null && onAlarmDef.getUntil() != null) {
+ oalarm.untilExpr = _context.compileExpr(onAlarmDef.getUntil());
+ } else {
+ throw new CompilationException(__cmsgs.errForOrUntilMustBeGiven().setSource(onAlarmDef));
+ }
+
+ if (pickDef.isCreateInstance())
+ throw new CompilationException(__cmsgs.errOnAlarmWithCreateInstance().setSource(onAlarmDef));
+
+ opick.onAlarms.add(oalarm);
+ }
+ } catch (CompilationException ce) {
+ _context.recoveredFromError(pickDef, ce);
+ }
}
}
Modified: ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/PickReceiveGenerator.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/PickReceiveGenerator.java?rev=948869&r1=948868&r2=948869&view=diff
==============================================================================
--- ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/PickReceiveGenerator.java (original)
+++ ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/PickReceiveGenerator.java Thu May 27 15:52:24 2010
@@ -85,11 +85,11 @@ abstract class PickReceiveGenerator exte
Set<String> csetNames = new HashSet<String>(); // prevents duplicate cset in on one set of correlations
for (Correlation correlation : correlations) {
- if( csetNames.contains(correlation.getCorrelationSet() ) ) {
+ if( csetNames.contains(correlation.getCorrelationSet() ) ) {
throw new CompilationException(__cmsgsGeneral.errDuplicateUseCorrelationSet(correlation
.getCorrelationSet()));
- }
-
+ }
+
OScope.CorrelationSet cset = _context.resolveCorrelationSet(correlation.getCorrelationSet());
switch (correlation.getInitiate()) {
@@ -105,8 +105,8 @@ abstract class PickReceiveGenerator exte
onMessage.initCorrelations.add(cset);
break;
case JOIN:
- cset.hasJoinUseCases = true;
- onMessage.joinCorrelations.add(cset);
+ cset.hasJoinUseCases = true;
+ onMessage.joinCorrelations.add(cset);
onMessage.partnerLink.addCorrelationSetForOperation(onMessage.operation, cset, true);
break;
Modified: ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ReplyGenerator.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ReplyGenerator.java?rev=948869&r1=948868&r2=948869&view=diff
==============================================================================
--- ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ReplyGenerator.java (original)
+++ ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ReplyGenerator.java Thu May 27 15:52:24 2010
@@ -92,12 +92,12 @@ class ReplyGenerator extends DefaultActi
Set<String> csetNames = new HashSet<String>(); // prevents duplicate cset in on one set of correlations
for (Correlation correlation : replyDef.getCorrelations()) {
- if( csetNames.contains(correlation.getCorrelationSet() ) ) {
+ if( csetNames.contains(correlation.getCorrelationSet() ) ) {
throw new CompilationException(_cmsgsGeneral.errDuplicateUseCorrelationSet(correlation
.getCorrelationSet()));
- }
+ }
- OScope.CorrelationSet cset = _context.resolveCorrelationSet(correlation.getCorrelationSet());
+ OScope.CorrelationSet cset = _context.resolveCorrelationSet(correlation.getCorrelationSet());
switch (correlation.getInitiate()) {
case UNSET:
@@ -108,9 +108,9 @@ class ReplyGenerator extends DefaultActi
oreply.initCorrelations.add(cset);
break;
case JOIN:
- cset.hasJoinUseCases = true;
- oreply.joinCorrelations.add(cset);
- break;
+ cset.hasJoinUseCases = true;
+ oreply.joinCorrelations.add(cset);
+ break;
default:
// TODO: Make error for this.
throw new AssertionError();
Modified: ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WSDLRegistry.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WSDLRegistry.java?rev=948869&r1=948868&r2=948869&view=diff
==============================================================================
--- ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WSDLRegistry.java (original)
+++ ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WSDLRegistry.java Thu May 27 15:52:24 2010
@@ -134,20 +134,20 @@ class WSDLRegistry {
__log.info("WSDL at " + defuri + " is a duplicate import, your documents " +
"should all be in different namespaces (its's not nice but will still work).");
}
- boolean alreadyProcessed = false;
- for (Definition4BPEL aDef : _definitions.get(def.getTargetNamespace())) {
- if (aDef.getDocumentBaseURI().equals(def.getDocumentBaseURI())) {
- alreadyProcessed = true;
- break;
- }
- }
- if (alreadyProcessed) {
- if (__log.isInfoEnabled()) {
- __log.info("WSDL at " + defuri + " is already imported, this denotes a circular reference.");
- // no need to keep going: either return or throw an error
- }
- return;
- }
+ boolean alreadyProcessed = false;
+ for (Definition4BPEL aDef : _definitions.get(def.getTargetNamespace())) {
+ if (aDef.getDocumentBaseURI().equals(def.getDocumentBaseURI())) {
+ alreadyProcessed = true;
+ break;
+ }
+ }
+ if (alreadyProcessed) {
+ if (__log.isInfoEnabled()) {
+ __log.info("WSDL at " + defuri + " is already imported, this denotes a circular reference.");
+ // no need to keep going: either return or throw an error
+ }
+ return;
+ }
}
ArrayList<Definition4BPEL> defs = null;
@@ -316,14 +316,14 @@ class WSDLRegistry {
/**
* @return All parsed schemas. This doesn't include schemas from bpel imports.
*/
- Map<URI, Document> getSchemaDocuments() {
- return _documentSchemas;
- }
-
- /**
- * @return All captured schema sources including those from bpel imports.
- */
- Map<URI, Source> getSchemaSources() {
+ Map<URI, Document> getSchemaDocuments() {
+ return _documentSchemas;
+ }
+
+ /**
+ * @return All captured schema sources including those from bpel imports.
+ */
+ Map<URI, Source> getSchemaSources() {
Map<URI, Source> schemaSources = new HashMap<URI, Source>();
for (URI uri : _documentSchemas.keySet()) {
Document document = _documentSchemas.get(uri);
@@ -335,5 +335,5 @@ class WSDLRegistry {
}
return schemaSources;
- }
+ }
}
Modified: ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/CompilerContext.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/CompilerContext.java?rev=948869&r1=948868&r2=948869&view=diff
==============================================================================
--- ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/CompilerContext.java (original)
+++ ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/CompilerContext.java Thu May 27 15:52:24 2010
@@ -146,10 +146,10 @@ public interface CompilerContext {
Map<URI, Source> getSchemaSources();
- /**
- * Retrieves the base URI that the BPEL Process execution contextis running relative to.
- *
- * @return URI - the URI representing the absolute physical file path location that this process is defined within.
- */
- URI getBaseResourceURI();
+ /**
+ * Retrieves the base URI that the BPEL Process execution contextis running relative to.
+ *
+ * @return URI - the URI representing the absolute physical file path location that this process is defined within.
+ */
+ URI getBaseResourceURI();
}
Modified: ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/ExpressionCompiler.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/ExpressionCompiler.java?rev=948869&r1=948868&r2=948869&view=diff
==============================================================================
--- ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/ExpressionCompiler.java (original)
+++ ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/ExpressionCompiler.java Thu May 27 15:52:24 2010
@@ -50,7 +50,7 @@ public interface ExpressionCompiler {
* @throws CompilationException
*/
OLValueExpression compileLValue(Object source)
- throws CompilationException;
+ throws CompilationException;
/**
* Compile a join condition into a {@link org.apache.ode.bpel.o.OExpression} object.
Modified: ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/BpelObject.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/BpelObject.java?rev=948869&r1=948868&r2=948869&view=diff
==============================================================================
--- ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/BpelObject.java (original)
+++ ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/BpelObject.java Thu May 27 15:52:24 2010
@@ -131,12 +131,12 @@ public class BpelObject implements Sourc
}
public Element getFirstExtensibilityElementElement() {
- Element child = null;
- NodeList nl = getElement().getChildNodes();
+ Element child = null;
+ NodeList nl = getElement().getChildNodes();
for (int i = 0; i < nl.getLength(); ++i) {
Node node = nl.item(i);
if (node.getNodeType() == Node.ELEMENT_NODE &&
- !getType().getNamespaceURI().equals(node.getNamespaceURI())) {
+ !getType().getNamespaceURI().equals(node.getNamespaceURI())) {
child = (Element)node;
break;
}
@@ -194,7 +194,7 @@ public class BpelObject implements Sourc
}
protected QName rewriteTargetNS(QName target) {
- return new QName(getType().getNamespaceURI(), target.getLocalPart());
+ return new QName(getType().getNamespaceURI(), target.getLocalPart());
}
protected List<BpelObject> getChildren() {
Modified: ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/ExtensibilityQNames.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/ExtensibilityQNames.java?rev=948869&r1=948868&r2=948869&view=diff
==============================================================================
--- ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/ExtensibilityQNames.java (original)
+++ ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/ExtensibilityQNames.java Thu May 27 15:52:24 2010
@@ -44,7 +44,7 @@ public abstract class ExtensibilityQName
public static final QName EXTVAR_ATTR = new QName(EXTVAR_NS, "id");
/** Attribute holding the name of the "related" variable. */
- public static final QName EXTVAR_RELATED = new QName(EXTVAR_NS, "relates-to");
+ public static final QName EXTVAR_RELATED = new QName(EXTVAR_NS, "relates-to");
}
Modified: ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/OnMessage.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/OnMessage.java?rev=948869&r1=948868&r2=948869&view=diff
==============================================================================
--- ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/OnMessage.java (original)
+++ ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/OnMessage.java Thu May 27 15:52:24 2010
@@ -69,7 +69,7 @@ public class OnMessage extends BpelObjec
}
public String getRoute() {
- return getAttribute("route", "one");
+ return getAttribute("route", "one");
}
/**
Modified: ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/ReceiveActivity.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/ReceiveActivity.java?rev=948869&r1=948868&r2=948869&view=diff
==============================================================================
--- ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/ReceiveActivity.java (original)
+++ ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/ReceiveActivity.java Thu May 27 15:52:24 2010
@@ -54,7 +54,7 @@ public class ReceiveActivity extends Cre
}
public String getRoute() {
- return getAttribute("route", "one");
+ return getAttribute("route", "one");
}
public String getOperation() {
Modified: ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Variable.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Variable.java?rev=948869&r1=948868&r2=948869&view=diff
==============================================================================
--- ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Variable.java (original)
+++ ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Variable.java Thu May 27 15:52:24 2010
@@ -111,6 +111,6 @@ public class Variable extends BpelObject
* @return
*/
public String getRelated() {
- return getAttribute(ExtensibilityQNames.EXTVAR_RELATED, null);
+ return getAttribute(ExtensibilityQNames.EXTVAR_RELATED, null);
}
}
Modified: ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/WaitActivity.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/WaitActivity.java?rev=948869&r1=948868&r2=948869&view=diff
==============================================================================
--- ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/WaitActivity.java (original)
+++ ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/WaitActivity.java Thu May 27 15:52:24 2010
@@ -35,7 +35,7 @@ public class WaitActivity extends Activi
* @return Returns the for.
*/
public Expression getFor() {
- return (Expression) getFirstChild(rewriteTargetNS(Bpel20QNames.FOR));
+ return (Expression) getFirstChild(rewriteTargetNS(Bpel20QNames.FOR));
}
/**
@@ -44,6 +44,6 @@ public class WaitActivity extends Activi
* @return the "until" expression
*/
public Expression getUntil() {
- return (Expression) getFirstChild(rewriteTargetNS(Bpel20QNames.UNTIL));
+ return (Expression) getFirstChild(rewriteTargetNS(Bpel20QNames.UNTIL));
}
}
Modified: ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/wsdl/InvalidBpelPartnerLinkTypeException.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/wsdl/InvalidBpelPartnerLinkTypeException.java?rev=948869&r1=948868&r2=948869&view=diff
==============================================================================
--- ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/wsdl/InvalidBpelPartnerLinkTypeException.java (original)
+++ ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/wsdl/InvalidBpelPartnerLinkTypeException.java Thu May 27 15:52:24 2010
@@ -27,7 +27,7 @@ import javax.wsdl.WSDLException;
*/
public class InvalidBpelPartnerLinkTypeException extends WSDLException {
private static final long serialVersionUID = 1L;
- /**
+ /**
* Construct a new instance with the specified explanatory message.
* @param msg an explanatory message.
* @see WSDLException#WSDLException(java.lang.String, java.lang.String)
Modified: ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/wsdl/InvalidBpelPropertyAliasException.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/wsdl/InvalidBpelPropertyAliasException.java?rev=948869&r1=948868&r2=948869&view=diff
==============================================================================
--- ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/wsdl/InvalidBpelPropertyAliasException.java (original)
+++ ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/wsdl/InvalidBpelPropertyAliasException.java Thu May 27 15:52:24 2010
@@ -28,7 +28,7 @@ import javax.wsdl.WSDLException;
public class InvalidBpelPropertyAliasException extends WSDLException {
private static final long serialVersionUID = 1L;
- /**
+ /**
* Construct a new instance with the specified explanatory message.
* @param msg an explanatory message.
* @see WSDLException#WSDLException(java.lang.String, java.lang.String)
Modified: ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/wsdl/InvalidBpelPropertyException.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/wsdl/InvalidBpelPropertyException.java?rev=948869&r1=948868&r2=948869&view=diff
==============================================================================
--- ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/wsdl/InvalidBpelPropertyException.java (original)
+++ ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/wsdl/InvalidBpelPropertyException.java Thu May 27 15:52:24 2010
@@ -27,7 +27,7 @@ import javax.wsdl.WSDLException;
*/
public class InvalidBpelPropertyException extends WSDLException {
private static final long serialVersionUID = 1L;
- /**
+ /**
* Construct a new instance with the specified explanatory message.
* @param msg an explanatory message.
* @see WSDLException#WSDLException(java.lang.String, java.lang.String)
Modified: ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/wsdl/InvalidBpelRoleException.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/wsdl/InvalidBpelRoleException.java?rev=948869&r1=948868&r2=948869&view=diff
==============================================================================
--- ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/wsdl/InvalidBpelRoleException.java (original)
+++ ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/wsdl/InvalidBpelRoleException.java Thu May 27 15:52:24 2010
@@ -27,7 +27,7 @@ import javax.wsdl.WSDLException;
*/
public class InvalidBpelRoleException extends WSDLException {
private static final long serialVersionUID = 1L;
- /**
+ /**
* Construct a new instance with the specified explanatory message.
* @param msg an explanatory message.
* @see WSDLException#WSDLException(java.lang.String, java.lang.String)
Modified: ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/CompilationExceptionWrapper.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/CompilationExceptionWrapper.java?rev=948869&r1=948868&r2=948869&view=diff
==============================================================================
--- ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/CompilationExceptionWrapper.java (original)
+++ ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/CompilationExceptionWrapper.java Thu May 27 15:52:24 2010
@@ -28,14 +28,14 @@ import org.jaxen.JaxenException;
*/
class CompilationExceptionWrapper extends JaxenException {
- private static final long serialVersionUID = -6918197147269316065L;
+ private static final long serialVersionUID = -6918197147269316065L;
- public CompilationExceptionWrapper(CompilationException cause) {
- super(cause);
- assert getCompilationException() != null;
- }
+ public CompilationExceptionWrapper(CompilationException cause) {
+ super(cause);
+ assert getCompilationException() != null;
+ }
- public CompilationException getCompilationException() {
- return (CompilationException) getCause();
- }
+ public CompilationException getCompilationException() {
+ return (CompilationException) getCause();
+ }
}
Modified: ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/JaxenBpelHandler.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/JaxenBpelHandler.java?rev=948869&r1=948868&r2=948869&view=diff
==============================================================================
--- ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/JaxenBpelHandler.java (original)
+++ ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/JaxenBpelHandler.java Thu May 27 15:52:24 2010
@@ -64,9 +64,9 @@ class JaxenBpelHandler extends JaxenHand
assert out != null;
}
- public void variableReference(String prefix, String variableName)
- throws JaxenException {
- super.variableReference(prefix, variableName);
+ public void variableReference(String prefix, String variableName)
+ throws JaxenException {
+ super.variableReference(prefix, variableName);
// Custom variables
if ("ode".equals(prefix)) {
@@ -74,24 +74,24 @@ class JaxenBpelHandler extends JaxenHand
}
if(_out instanceof OXPath10ExpressionBPEL20){
- OXPath10ExpressionBPEL20 out = (OXPath10ExpressionBPEL20)_out;
- try{
- if(out.isJoinExpression){
- // these resolve to links
- OLink olink = _cctx.resolveLink(variableName);
- _out.links.put(variableName, olink);
- }else{
- int dot = variableName.indexOf('.');
- if (dot != -1)
- variableName = variableName.substring(0,dot);
- OScope.Variable var = _cctx.resolveVariable(variableName);
- _out.vars.put(variableName, var);
- }
- }catch(CompilationException ce){
- throw new CompilationExceptionWrapper(ce);
- }
- }
- }
+ OXPath10ExpressionBPEL20 out = (OXPath10ExpressionBPEL20)_out;
+ try{
+ if(out.isJoinExpression){
+ // these resolve to links
+ OLink olink = _cctx.resolveLink(variableName);
+ _out.links.put(variableName, olink);
+ }else{
+ int dot = variableName.indexOf('.');
+ if (dot != -1)
+ variableName = variableName.substring(0,dot);
+ OScope.Variable var = _cctx.resolveVariable(variableName);
+ _out.vars.put(variableName, var);
+ }
+ }catch(CompilationException ce){
+ throw new CompilationExceptionWrapper(ce);
+ }
+ }
+ }
public void endXPath() throws JaxenException {
super.endXPath();
Modified: ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/XPath10ExpressionCompilerBPEL11.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/XPath10ExpressionCompilerBPEL11.java?rev=948869&r1=948868&r2=948869&view=diff
==============================================================================
--- ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/XPath10ExpressionCompilerBPEL11.java (original)
+++ ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/XPath10ExpressionCompilerBPEL11.java Thu May 27 15:52:24 2010
@@ -37,11 +37,11 @@ public class XPath10ExpressionCompilerBP
* @see org.apache.ode.bpel.compiler.api.ExpressionCompiler#compileJoinCondition(java.lang.Object)
*/
public OExpression compileJoinCondition(Object source) throws CompilationException {
- return compile(source);
+ return compile(source);
}
public OLValueExpression compileLValue(Object source) throws CompilationException {
- throw new UnsupportedOperationException("Not supported for bpel 1.1");
+ throw new UnsupportedOperationException("Not supported for bpel 1.1");
}
/**
Modified: ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/XPath10ExpressionCompilerImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/XPath10ExpressionCompilerImpl.java?rev=948869&r1=948868&r2=948869&view=diff
==============================================================================
--- ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/XPath10ExpressionCompilerImpl.java (original)
+++ ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/XPath10ExpressionCompilerImpl.java Thu May 27 15:52:24 2010
@@ -112,7 +112,7 @@ public abstract class XPath10ExpressionC
xpathStr = node.getNodeValue();
xpathStr = xpathStr.trim();
if (xpathStr.length() == 0) {
- throw new CompilationException(__msgs.errXPathSyntax(xpathStr));
+ throw new CompilationException(__msgs.errXPathSyntax(xpathStr));
}
try {
Modified: ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/JaxpFunctionResolver.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/JaxpFunctionResolver.java?rev=948869&r1=948868&r2=948869&view=diff
==============================================================================
--- ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/JaxpFunctionResolver.java (original)
+++ ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/JaxpFunctionResolver.java Thu May 27 15:52:24 2010
@@ -75,10 +75,10 @@ public class JaxpFunctionResolver implem
} else if (functionName.getNamespaceURI().equals(Namespaces.ODE_EXTENSION_NS)) {
String localName = functionName.getLocalPart();
if (Constants.NON_STDRD_FUNCTION_SPLIT_TO_ELEMENTS.equals(localName) ||
- Constants.NON_STDRD_FUNCTION_DEPRECATED_SPLIT_TO_ELEMENTS.equals(localName)) {
+ Constants.NON_STDRD_FUNCTION_DEPRECATED_SPLIT_TO_ELEMENTS.equals(localName)) {
return new SplitToElements();
} else if (Constants.NON_STDRD_FUNCTION_COMBINE_URL.equals(localName) ||
- Constants.NON_STDRD_FUNCTION_DEPRECATED_COMBINE_URL.equals(localName)) {
+ Constants.NON_STDRD_FUNCTION_DEPRECATED_COMBINE_URL.equals(localName)) {
return new CombineUrl();
} else if (Constants.NON_STDRD_FUNCTION_COMPOSE_URL.equals(localName) ||
Constants.NON_STDRD_FUNCTION_EXPAND_TEMPLATE.equals(localName) ||
@@ -86,22 +86,22 @@ public class JaxpFunctionResolver implem
Constants.NON_STDRD_FUNCTION_DEPRECATED_EXPAND_TEMPLATE.equals(localName)) {
return new ComposeUrl();
} else if (Constants.NON_STDRD_FUNCTION_DOM_TO_STRING.equals(localName) ||
- Constants.NON_STDRD_FUNCTION_DEPRECATED_DOM_TO_STRING.equals(localName)) {
- return new DomToString();
+ Constants.NON_STDRD_FUNCTION_DEPRECATED_DOM_TO_STRING.equals(localName)) {
+ return new DomToString();
} else if (Constants.NON_STDRD_FUNCTION_INSERT_AFTER.equals(localName)) {
- return new InsertAfter();
+ return new InsertAfter();
} else if (Constants.NON_STDRD_FUNCTION_INSERT_AS_FIRST_INTO.equals(localName)) {
- return new InsertAsFirstInto();
+ return new InsertAsFirstInto();
} else if (Constants.NON_STDRD_FUNCTION_INSERT_AS_LAST_INTO.equals(localName)) {
- return new InsertAsLastInto();
+ return new InsertAsLastInto();
} else if (Constants.NON_STDRD_FUNCTION_INSERT_BEFORE.equals(localName)) {
- return new InsertBefore();
+ return new InsertBefore();
} else if (Constants.NON_STDRD_FUNCTION_DELETE.equals(localName)) {
- return new Delete();
+ return new Delete();
} else if (Constants.NON_STDRD_FUNCTION_RENAME.equals(localName)) {
- return new Rename();
+ return new Rename();
} else if (Constants.NON_STDRD_FUNCTION_PROCESS_PROPERTY.equals(localName)) {
- return new ProcessProperty();
+ return new ProcessProperty();
}
} else if (functionName.getNamespaceURI().equals(Namespaces.DEPRECATED_XDT_NS)) {
String localName = functionName.getLocalPart();
@@ -206,93 +206,93 @@ public class JaxpFunctionResolver implem
}
public static class InsertInto implements XPathFunction {
- public Object evaluate(List args) throws XPathFunctionException {
+ public Object evaluate(List args) throws XPathFunctionException {
if (args.size() != 3) {
throw new CompilationException(__msgs.errInvalidNumberOfArguments(Constants.NON_STDRD_FUNCTION_INSERT_AFTER));
}
return "";
- }
+ }
}
public static class InsertAfter implements XPathFunction {
- public Object evaluate(List args) throws XPathFunctionException {
+ public Object evaluate(List args) throws XPathFunctionException {
if (args.size() < 2 || args.size() > 3) {
throw new CompilationException(__msgs.errInvalidNumberOfArguments(Constants.NON_STDRD_FUNCTION_INSERT_AFTER));
}
return "";
- }
+ }
}
public static class InsertBefore implements XPathFunction {
- public Object evaluate(List args) throws XPathFunctionException {
+ public Object evaluate(List args) throws XPathFunctionException {
if (args.size() < 2 || args.size() > 3) {
throw new CompilationException(__msgs.errInvalidNumberOfArguments(Constants.NON_STDRD_FUNCTION_INSERT_BEFORE));
}
return "";
- }
+ }
}
public static class InsertAsFirstInto implements XPathFunction {
- public Object evaluate(List args) throws XPathFunctionException {
+ public Object evaluate(List args) throws XPathFunctionException {
if (args.size() != 2) {
throw new CompilationException(__msgs.errInvalidNumberOfArguments(Constants.NON_STDRD_FUNCTION_INSERT_AS_FIRST_INTO));
}
return "";
- }
+ }
}
public static class InsertAsLastInto implements XPathFunction {
- public Object evaluate(List args) throws XPathFunctionException {
+ public Object evaluate(List args) throws XPathFunctionException {
if (args.size() != 2) {
throw new CompilationException(__msgs.errInvalidNumberOfArguments(Constants.NON_STDRD_FUNCTION_INSERT_AS_LAST_INTO));
}
return "";
- }
+ }
}
public static class Delete implements XPathFunction {
- public Object evaluate(List args) throws XPathFunctionException {
+ public Object evaluate(List args) throws XPathFunctionException {
if (args.size() < 1 || args.size() > 2) {
throw new CompilationException(__msgs.errInvalidNumberOfArguments(Constants.NON_STDRD_FUNCTION_DELETE));
}
return "";
- }
+ }
}
public static class Rename implements XPathFunction {
- public Object evaluate(List args) throws XPathFunctionException {
+ public Object evaluate(List args) throws XPathFunctionException {
if (args.size() < 2) {
throw new CompilationException(__msgs.errInvalidNumberOfArguments(Constants.NON_STDRD_FUNCTION_RENAME));
}
return "";
- }
+ }
}
public static class ProcessProperty implements XPathFunction {
- public Object evaluate(List args) throws XPathFunctionException {
+ public Object evaluate(List args) throws XPathFunctionException {
if (args.size() != 1) {
throw new CompilationException(__msgs.errInvalidNumberOfArguments(Constants.NON_STDRD_FUNCTION_PROCESS_PROPERTY));
}
return "";
- }
+ }
}
public static class DayTimeDuration implements XPathFunction {
- public Object evaluate(List args) throws XPathFunctionException {
+ public Object evaluate(List args) throws XPathFunctionException {
if (args.size() != 1) {
throw new CompilationException(__msgs.errInvalidNumberOfArguments(Constants.NON_STDRD_FUNCTION_DAY_TIME_DURATION));
}
return "";
- }
+ }
}
public static class YearMonthDuration implements XPathFunction {
- public Object evaluate(List args) throws XPathFunctionException {
+ public Object evaluate(List args) throws XPathFunctionException {
if (args.size() != 1) {
throw new CompilationException(__msgs.errInvalidNumberOfArguments(Constants.NON_STDRD_FUNCTION_YEAR_MONTH_DURATION));
}
return "";
- }
+ }
}
}
Modified: ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/XPath20ExpressionCompilerImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/XPath20ExpressionCompilerImpl.java?rev=948869&r1=948868&r2=948869&view=diff
==============================================================================
--- ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/XPath20ExpressionCompilerImpl.java (original)
+++ ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/XPath20ExpressionCompilerImpl.java Thu May 27 15:52:24 2010
@@ -154,25 +154,25 @@ public class XPath20ExpressionCompilerIm
XPathExpression expr = xpe.compile(xpathStr);
// evaluate the expression so as to initialize the variables
try {
- expr.evaluate(node);
+ expr.evaluate(node);
} catch (XPathExpressionException xpee) {
- // swallow errors caused by uninitialized variable
+ // swallow errors caused by uninitialized variable
}
for (String varExpr : extractVariableExprs(xpathStr)) {
expr = xpe.compile(varExpr);
- try {
- expr.evaluate(node);
- } catch (XPathExpressionException xpee) {
- // swallow errors caused by uninitialized variable
- }
+ try {
+ expr.evaluate(node);
+ } catch (XPathExpressionException xpee) {
+ // swallow errors caused by uninitialized variable
+ }
}
for (String functionExpr : extractFunctionExprs(xpathStr)) {
expr = xpe.compile(functionExpr);
- try {
- expr.evaluate(node);
- } catch (XPathExpressionException xpee) {
- // swallow errors caused by uninitialized variable
- }
+ try {
+ expr.evaluate(node);
+ } catch (XPathExpressionException xpee) {
+ // swallow errors caused by uninitialized variable
+ }
}
} catch (XPathExpressionException e) {
__log.debug(e);
@@ -195,55 +195,55 @@ public class XPath20ExpressionCompilerIm
* @return list of variable expressions that may not have been resolved properly
*/
private List<String> extractVariableExprs(String xpathStr) {
- ArrayList<String> variableExprs = new ArrayList<String>();
- int firstVariable = xpathStr.indexOf("$"),
- lastVariable = xpathStr.lastIndexOf("$"),
- firstFunction = xpathStr.indexOf("(");
- StringBuffer variableExpr = new StringBuffer();
- if ((firstVariable > 0 && // the xpath references a variable
- firstFunction > 0) || // the xpath contains a function
- (firstVariable < lastVariable)) { // the xpath references multiple variables
- // most likely, the variable reference has not been resolved, so make that happen
- boolean quoted = false, doubleQuoted = false, variable = false;
- Name11Checker nameChecker = Name11Checker.getInstance();
- for (int index = 0; index < xpathStr.length(); index++) {
- char ch = xpathStr.charAt(index);
- if (ch == '\''){
- quoted = !quoted;
- }
- if (ch == '\"') {
- doubleQuoted = !doubleQuoted;
- }
- if (quoted || doubleQuoted){
- continue;
- }
- if (ch == '$') {
- variable = true;
- variableExpr.setLength(0);
- variableExpr.append(ch);
- } else {
- if (variable) {
- variableExpr.append(ch);
- // in the name is qualified, don't check if its a qname when we're at the ":" character
- if (ch == ':') {
- continue;
- }
- if (index == xpathStr.length() ||
- !nameChecker.isQName(variableExpr.substring(1))) {
- variable = false;
- variableExpr.setLength(variableExpr.length() - 1);
- variableExprs.add(variableExpr.toString());
- variableExpr.setLength(0);
- }
- }
- }
- }
- if (variableExpr.length() > 0) {
- variableExprs.add(variableExpr.toString());
- }
- }
- return variableExprs;
- }
+ ArrayList<String> variableExprs = new ArrayList<String>();
+ int firstVariable = xpathStr.indexOf("$"),
+ lastVariable = xpathStr.lastIndexOf("$"),
+ firstFunction = xpathStr.indexOf("(");
+ StringBuffer variableExpr = new StringBuffer();
+ if ((firstVariable > 0 && // the xpath references a variable
+ firstFunction > 0) || // the xpath contains a function
+ (firstVariable < lastVariable)) { // the xpath references multiple variables
+ // most likely, the variable reference has not been resolved, so make that happen
+ boolean quoted = false, doubleQuoted = false, variable = false;
+ Name11Checker nameChecker = Name11Checker.getInstance();
+ for (int index = 0; index < xpathStr.length(); index++) {
+ char ch = xpathStr.charAt(index);
+ if (ch == '\''){
+ quoted = !quoted;
+ }
+ if (ch == '\"') {
+ doubleQuoted = !doubleQuoted;
+ }
+ if (quoted || doubleQuoted){
+ continue;
+ }
+ if (ch == '$') {
+ variable = true;
+ variableExpr.setLength(0);
+ variableExpr.append(ch);
+ } else {
+ if (variable) {
+ variableExpr.append(ch);
+ // in the name is qualified, don't check if its a qname when we're at the ":" character
+ if (ch == ':') {
+ continue;
+ }
+ if (index == xpathStr.length() ||
+ !nameChecker.isQName(variableExpr.substring(1))) {
+ variable = false;
+ variableExpr.setLength(variableExpr.length() - 1);
+ variableExprs.add(variableExpr.toString());
+ variableExpr.setLength(0);
+ }
+ }
+ }
+ }
+ if (variableExpr.length() > 0) {
+ variableExprs.add(variableExpr.toString());
+ }
+ }
+ return variableExprs;
+ }
/**
* Returns the list of function references in the given XPath expression
@@ -254,24 +254,24 @@ public class XPath20ExpressionCompilerIm
* @return list of function expressions that may not have been resolved properly
*/
private List<String> extractFunctionExprs(String xpathStr) {
- ArrayList<String> functionExprs = new ArrayList<String>();
- // Match the prefix : function name ( all contents except the ) and the closing )'s that may occur
- final String FUNCTION_REGEX = "\\w+:\\w+\\([.[^\\)]]*\\)*";
- int firstFunction = xpathStr.indexOf("("),
- lastFunction = xpathStr.lastIndexOf("(");
- if ((firstFunction > 0 && firstFunction < lastFunction)) {
- Pattern regex = Pattern.compile(FUNCTION_REGEX);
- Matcher matcher = regex.matcher(xpathStr);
-
- while (matcher.find()) {
- String function = matcher.group();
- functionExprs.add(function);
- }
- }
- return functionExprs;
- }
+ ArrayList<String> functionExprs = new ArrayList<String>();
+ // Match the prefix : function name ( all contents except the ) and the closing )'s that may occur
+ final String FUNCTION_REGEX = "\\w+:\\w+\\([.[^\\)]]*\\)*";
+ int firstFunction = xpathStr.indexOf("("),
+ lastFunction = xpathStr.lastIndexOf("(");
+ if ((firstFunction > 0 && firstFunction < lastFunction)) {
+ Pattern regex = Pattern.compile(FUNCTION_REGEX);
+ Matcher matcher = regex.matcher(xpathStr);
+
+ while (matcher.find()) {
+ String function = matcher.group();
+ functionExprs.add(function);
+ }
+ }
+ return functionExprs;
+ }
- public Map<String, String> getProperties() {
+ public Map<String, String> getProperties() {
return _properties;
}
Modified: ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xquery10/compiler/XQuery10ExpressionCompilerImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xquery10/compiler/XQuery10ExpressionCompilerImpl.java?rev=948869&r1=948868&r2=948869&view=diff
==============================================================================
--- ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xquery10/compiler/XQuery10ExpressionCompilerImpl.java (original)
+++ ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xquery10/compiler/XQuery10ExpressionCompilerImpl.java Thu May 27 15:52:24 2010
@@ -137,7 +137,7 @@ public class XQuery10ExpressionCompilerI
*/
private OExpression _compile(org.apache.ode.bpel.compiler.bom.Expression xquery, boolean isJoinCondition)
throws CompilationException {
- OXQuery10ExpressionBPEL20 oexp = new OXQuery10ExpressionBPEL20(_compilerContext.getOProcess(), _qnVarData,
+ OXQuery10ExpressionBPEL20 oexp = new OXQuery10ExpressionBPEL20(_compilerContext.getOProcess(), _qnVarData,
_qnVarProp, _qnLinkStatus, _qnXslTransform, isJoinCondition);
oexp.namespaceCtx = xquery.getNamespaceContext();
doJaxpCompile(oexp, xquery);
@@ -151,8 +151,8 @@ public class XQuery10ExpressionCompilerI
throw new CompilationException(__msgs.errEmptyExpression(source.getURI(), new QName(source.getElement().getNamespaceURI(), source.getElement().getNodeName())));
}
if (node.getNodeType() != Node.TEXT_NODE &&
- node.getNodeType() != Node.ELEMENT_NODE &&
- node.getNodeType() != Node.CDATA_SECTION_NODE) {
+ node.getNodeType() != Node.ELEMENT_NODE &&
+ node.getNodeType() != Node.CDATA_SECTION_NODE) {
throw new CompilationException(__msgs.errUnexpectedNodeTypeForXPath(DOMUtils.domToString(node)));
}
xqueryStr = DOMUtils.domToString(node);
@@ -162,7 +162,7 @@ public class XQuery10ExpressionCompilerI
}
try {
- XQDataSource xqds = new SaxonXQDataSource(new Configuration());
+ XQDataSource xqds = new SaxonXQDataSource(new Configuration());
XQConnection xqconn = xqds.getConnection();
__log.debug("Compiling expression " + xqueryStr);
@@ -174,28 +174,28 @@ public class XQuery10ExpressionCompilerI
JaxpFunctionResolver funcResolver = new JaxpFunctionResolver(
_compilerContext, out, source.getNamespaceContext(), _bpelNS);
JaxpVariableResolver variableResolver = new JaxpVariableResolver(
- _compilerContext, out);
+ _compilerContext, out);
XQueryDeclarations declarations = new XQueryDeclarations();
NSContext nsContext = source.getNamespaceContext();
- Set<String> prefixes = nsContext.getPrefixes();
- if (!nsContext.getUriSet().contains(Namespaces.ODE_EXTENSION_NS)) {
- nsContext.register("ode", Namespaces.ODE_EXTENSION_NS);
- }
- for (String prefix : prefixes) {
- String uri = nsContext.getNamespaceURI(prefix);
- staticContext.declareNamespace(prefix, uri);
- if ("".equals(prefix)) {
- declarations.declareDefaultElementNamespace(uri);
- } else if ("bpws".equals(prefix)) {
+ Set<String> prefixes = nsContext.getPrefixes();
+ if (!nsContext.getUriSet().contains(Namespaces.ODE_EXTENSION_NS)) {
+ nsContext.register("ode", Namespaces.ODE_EXTENSION_NS);
+ }
+ for (String prefix : prefixes) {
+ String uri = nsContext.getNamespaceURI(prefix);
+ staticContext.declareNamespace(prefix, uri);
+ if ("".equals(prefix)) {
+ declarations.declareDefaultElementNamespace(uri);
+ } else if ("bpws".equals(prefix)) {
declarations.declareNamespace("bpws", "java:" + Constants.XQUERY_FUNCTION_HANDLER_COMPILER);
- } else {
- declarations.declareNamespace(prefix, uri);
- }
- }
+ } else {
+ declarations.declareNamespace(prefix, uri);
+ }
+ }
declarations.declareVariable(
- getQName(nsContext, Namespaces.ODE_EXTENSION_NS, "pid"),
- getQName(nsContext, Namespaces.XML_SCHEMA, "integer"));
+ getQName(nsContext, Namespaces.ODE_EXTENSION_NS, "pid"),
+ getQName(nsContext, Namespaces.XML_SCHEMA, "integer"));
// Map<URI, Source> schemaDocuments = _compilerContext.getSchemaSources();
// for (URI schemaUri : schemaDocuments.keySet()) {
// Source schemaSource = schemaDocuments.get(schemaUri);
@@ -206,17 +206,17 @@ public class XQuery10ExpressionCompilerI
List<OScope.Variable> variables = _compilerContext.getAccessibleVariables();
Map<QName, QName> variableTypes = new HashMap<QName, QName>();
for (String variableName : getVariableNames(xqueryStr)) {
- OScope.Variable variable = getVariable(variables, variableName);
- if (variable == null) {
- continue;
- }
+ OScope.Variable variable = getVariable(variables, variableName);
+ if (variable == null) {
+ continue;
+ }
OVarType type = variable.type;
QName nameQName = getNameQName(variableName);
QName typeQName = getTypeQName(variableName, type);
variableTypes.put(nameQName, typeQName);
String prefix = typeQName.getPrefix();
if (prefix == null || "".equals(prefix.trim())) {
- prefix = getPrefixForUri(nsContext, typeQName.getNamespaceURI());
+ prefix = getPrefixForUri(nsContext, typeQName.getNamespaceURI());
}
// don't declare typed variables, as our engine is not schema-aware
// declarations.declareVariable(variable.name, typeQName);
@@ -232,41 +232,41 @@ public class XQuery10ExpressionCompilerI
// Pre-evaluate variables and functions by executing query
node.setUserData(XQuery10BpelFunctions.USER_DATA_KEY_FUNCTION_RESOLVER,
- funcResolver, null);
+ funcResolver, null);
exp.bindItem(XQConstants.CONTEXT_ITEM,
xqconn.createItemFromNode(node, xqconn.createNodeType()));
// Bind external variables to dummy runtime values
for (QName variable : exp.getAllUnboundExternalVariables()) {
- QName typeQName = variableTypes.get(variable);
+ QName typeQName = variableTypes.get(variable);
Object value = variableResolver.resolveVariable(variable);
- if (typeQName != null) {
- if (value.getClass().getName().startsWith("java.lang")) {
- exp.bindAtomicValue(variable, value.toString(),
- xqconn.createAtomicType(XQItemType.XQBASETYPE_ANYATOMICTYPE));
- } else if (value instanceof Node) {
- exp.bindNode(variable, (Node) value, xqconn.createNodeType());
- } else if (value instanceof NodeList) {
- NodeList nodeList = (NodeList) value;
- ArrayList nodeArray = new ArrayList();
- for (int i = 0; i < nodeList.getLength(); i++) {
- nodeArray.add(nodeList.item(i));
- }
- XQSequence sequence = xqconn.createSequence(nodeArray.iterator());
- exp.bindSequence(variable, sequence);
- }
- }
+ if (typeQName != null) {
+ if (value.getClass().getName().startsWith("java.lang")) {
+ exp.bindAtomicValue(variable, value.toString(),
+ xqconn.createAtomicType(XQItemType.XQBASETYPE_ANYATOMICTYPE));
+ } else if (value instanceof Node) {
+ exp.bindNode(variable, (Node) value, xqconn.createNodeType());
+ } else if (value instanceof NodeList) {
+ NodeList nodeList = (NodeList) value;
+ ArrayList nodeArray = new ArrayList();
+ for (int i = 0; i < nodeList.getLength(); i++) {
+ nodeArray.add(nodeList.item(i));
+ }
+ XQSequence sequence = xqconn.createSequence(nodeArray.iterator());
+ exp.bindSequence(variable, sequence);
+ }
+ }
}
// evaluate the expression so as to initialize the variables
try {
exp.executeQuery();
} catch (XQException xpee) {
- // swallow errors caused by uninitialized variables
+ // swallow errors caused by uninitialized variables
} finally {
- // reset the expression's user data, in order to avoid
- // serializing the function resolver in the compiled bpel file.
- if (node != null) {
- node.setUserData(XQuery10BpelFunctions.USER_DATA_KEY_FUNCTION_RESOLVER, null, null);
- }
+ // reset the expression's user data, in order to avoid
+ // serializing the function resolver in the compiled bpel file.
+ if (node != null) {
+ node.setUserData(XQuery10BpelFunctions.USER_DATA_KEY_FUNCTION_RESOLVER, null, null);
+ }
}
} catch (XQException xqe) {
__log.debug(xqe);
@@ -286,128 +286,128 @@ public class XQuery10ExpressionCompilerI
}
private String getQName(NSContext nsContext, String uri, String localPart) {
- String prefix = getPrefixForUri(nsContext, uri);
- return (prefix == null ? localPart : (prefix + ":" + localPart));
+ String prefix = getPrefixForUri(nsContext, uri);
+ return (prefix == null ? localPart : (prefix + ":" + localPart));
}
private String getPrefixForUri(NSContext nsContext, String uri) {
- Set<String> prefixes = nsContext.getPrefixes();
- for (String prefix : prefixes) {
- String anUri = (nsContext.getNamespaceURI(prefix));
- if (anUri != null && anUri.equals(uri)) {
- return prefix;
- }
- }
- return null;
+ Set<String> prefixes = nsContext.getPrefixes();
+ for (String prefix : prefixes) {
+ String anUri = (nsContext.getNamespaceURI(prefix));
+ if (anUri != null && anUri.equals(uri)) {
+ return prefix;
+ }
+ }
+ return null;
}
protected static Collection<String> getVariableNames(String xquery) {
- Collection<String> variableNames = new LinkedHashSet<String>();
- for (int index = xquery.indexOf("$"); index != -1; index = xquery.indexOf("$")) {
- StringBuilder variableName = new StringBuilder();
- index++;
- while(index < xquery.length() && XMLChar.isNCName(xquery.charAt(index))) {
- variableName.append(xquery.charAt(index++));
- }
- variableNames.add(variableName.toString());
- xquery = xquery.substring(index);
- }
- return variableNames;
+ Collection<String> variableNames = new LinkedHashSet<String>();
+ for (int index = xquery.indexOf("$"); index != -1; index = xquery.indexOf("$")) {
+ StringBuilder variableName = new StringBuilder();
+ index++;
+ while(index < xquery.length() && XMLChar.isNCName(xquery.charAt(index))) {
+ variableName.append(xquery.charAt(index++));
+ }
+ variableNames.add(variableName.toString());
+ xquery = xquery.substring(index);
+ }
+ return variableNames;
}
private OScope.Variable getVariable(List<OScope.Variable> variables, String variableName) {
- String declaredVariable = getVariableDeclaredName(variableName);
- for (OScope.Variable variable : variables) {
- if (variable.name.equals(declaredVariable)) {
- return variable;
- }
- }
- return null;
+ String declaredVariable = getVariableDeclaredName(variableName);
+ for (OScope.Variable variable : variables) {
+ if (variable.name.equals(declaredVariable)) {
+ return variable;
+ }
+ }
+ return null;
}
private String getVariableDeclaredName(String variableReference) {
- int dotIndex = variableReference.indexOf(".");
- return dotIndex >= 0 ? variableReference.substring(0, dotIndex) : variableReference;
+ int dotIndex = variableReference.indexOf(".");
+ return dotIndex >= 0 ? variableReference.substring(0, dotIndex) : variableReference;
}
private String getVariablePartName(String variableReference) {
- int dotIndex = variableReference.indexOf(".");
- return dotIndex >= 0 ? variableReference.substring(dotIndex + 1) : "";
+ int dotIndex = variableReference.indexOf(".");
+ return dotIndex >= 0 ? variableReference.substring(dotIndex + 1) : "";
}
private QName getNameQName(String variableName) {
String prefix = null, localName = null;;
- int colonIndex = variableName.indexOf(":");
+ int colonIndex = variableName.indexOf(":");
if (colonIndex >= 0) {
- prefix = variableName.substring(0, colonIndex);
- localName = variableName.substring(colonIndex + 1);
+ prefix = variableName.substring(0, colonIndex);
+ localName = variableName.substring(colonIndex + 1);
} else {
- prefix = "";
- localName = variableName;
+ prefix = "";
+ localName = variableName;
}
return new QName(prefix, localName);
}
private QName getTypeQName(String variableName, OVarType type) {
- QName typeQName = null;
+ QName typeQName = null;
if (type instanceof OConstantVarType) {
- typeQName = new QName(Namespaces.XML_SCHEMA, "string", "xs");
+ typeQName = new QName(Namespaces.XML_SCHEMA, "string", "xs");
} else if (type instanceof OElementVarType) {
- typeQName = ((OElementVarType) type).elementType;
+ typeQName = ((OElementVarType) type).elementType;
} else if (type instanceof OMessageVarType) {
- Part part = ((OMessageVarType) type).parts.get(getVariablePartName(variableName));
- if (part != null) {
- typeQName = getTypeQName(variableName, part.type);
- }
+ Part part = ((OMessageVarType) type).parts.get(getVariablePartName(variableName));
+ if (part != null) {
+ typeQName = getTypeQName(variableName, part.type);
+ }
} else if (type instanceof OXsdTypeVarType) {
- typeQName = ((OXsdTypeVarType) type).xsdType;
+ typeQName = ((OXsdTypeVarType) type).xsdType;
}
- return typeQName;
+ return typeQName;
}
private static class XQueryDeclarations {
- StringBuffer declarations = new StringBuffer();
-
- public XQueryDeclarations() {}
-
- public void declareVariable(String name, QName type) {
- declareVariable(name, type.getPrefix() + ":" + type.getLocalPart());
- }
-
- public void declareVariable(String name, String type) {
- declarations.append("declare variable ")
- .append("$")
- .append(name)
- .append(" as ")
- .append(type)
- .append(" external ")
- .append(";\n");
- }
-
- public void declareVariable(String name) {
- declarations.append("declare variable ")
- .append("$")
- .append(name)
- .append(" external ")
- .append(";\n");
- }
-
- public void declareNamespace(String prefix, String uri) {
+ StringBuffer declarations = new StringBuffer();
+
+ public XQueryDeclarations() {}
+
+ public void declareVariable(String name, QName type) {
+ declareVariable(name, type.getPrefix() + ":" + type.getLocalPart());
+ }
+
+ public void declareVariable(String name, String type) {
+ declarations.append("declare variable ")
+ .append("$")
+ .append(name)
+ .append(" as ")
+ .append(type)
+ .append(" external ")
+ .append(";\n");
+ }
+
+ public void declareVariable(String name) {
+ declarations.append("declare variable ")
+ .append("$")
+ .append(name)
+ .append(" external ")
+ .append(";\n");
+ }
+
+ public void declareNamespace(String prefix, String uri) {
declarations.append("declare namespace ")
- .append(prefix)
- .append("=")
- .append("\"" + uri + "\"")
- .append(";\n");
- }
-
- public void declareDefaultElementNamespace(String uri) {
+ .append(prefix)
+ .append("=")
+ .append("\"" + uri + "\"")
+ .append(";\n");
+ }
+
+ public void declareDefaultElementNamespace(String uri) {
declarations.append("declare default element namespace ")
- .append("\"" + uri + "\"")
- .append(";\n");
- }
+ .append("\"" + uri + "\"")
+ .append(";\n");
+ }
- public String toString() {
- return declarations.toString();
- }
+ public String toString() {
+ return declarations.toString();
+ }
}
}