org.apache.ode.bpel.compiler
Class BpelCompiler

java.lang.Object
  extended by org.apache.ode.bpel.compiler.BpelCompiler
All Implemented Interfaces:
CompilerContext
Direct Known Subclasses:
BpelCompiler11, BpelCompiler20, BpelCompiler20Draft

public abstract class BpelCompiler
extends java.lang.Object
implements CompilerContext

Compiler for converting BPEL process descriptions (and their associated WSDL and XSD documents) into compiled representations suitable for execution by the ODE BPEL Service Provider. TODO: Move process validation into this class.


Field Summary
protected static org.apache.commons.logging.Log __log
          Class-severity logger.
 
Method Summary
 void addWsdlImport(java.net.URI from, java.net.URI wsdlImport, SourceLocation sloc)
           
 void addXsdImport(java.net.URI from, java.net.URI location, SourceLocation sloc)
           
 org.apache.ode.bpel.o.OActivity compile(Activity source)
           
 void compile(org.apache.ode.bpel.o.OActivity context, BpelObject source, java.lang.Runnable run)
           
 org.apache.ode.bpel.o.OProcess compile(Process process, ResourceFinder rf, long version)
          Compile a process.
 org.apache.ode.bpel.o.OExpression compileExpr(Expression expression)
           
 org.apache.ode.bpel.o.OExpression compileExpr(Expression expression, org.apache.ode.bpel.o.OVarType rootNodeType, java.lang.Object requestedResultType, java.lang.Object[] resultType)
           
 org.apache.ode.bpel.o.OExpression compileExpr(java.lang.String expr, org.apache.ode.utils.NSContext nc)
          BPEL 1.1 legacy.
 org.apache.ode.bpel.o.OExpression compileJoinCondition(Expression expression)
           
 org.apache.ode.bpel.o.OLValueExpression compileLValueExpr(Expression expression)
           
 org.apache.ode.bpel.o.OLValueExpression compileLValueExpr(Expression expression, org.apache.ode.bpel.o.OVarType rootNodeType, java.lang.Object requestedResultType, java.lang.Object[] resultType)
           
 org.apache.ode.bpel.o.OScope compileSLC(ScopeLikeActivity source, org.apache.ode.bpel.o.OScope.Variable[] variables)
           
 org.apache.ode.bpel.o.OXslSheet compileXslt(java.lang.String docStrUri)
           
 org.apache.ode.bpel.o.OExpression constantExpr(boolean value)
          Produce a boolean OExpression expression that returns a constant value.
 java.util.List<org.apache.ode.bpel.o.OScope.Variable> getAccessibleVariables()
           
 java.util.List<org.apache.ode.bpel.o.OActivity> getActivityStack()
           
 java.net.URI getBaseResourceURI()
          Retrieves the base URI that the BPEL Process execution contextis running relative to.
protected abstract  java.lang.String getBpwsNamespace()
           
 CompileListener getCompileListener()
           
 org.apache.ode.bpel.o.OActivity getCurrent()
           
protected abstract  java.lang.String getDefaultExpressionLanguage()
           
 org.apache.ode.bpel.o.OProcess getOProcess()
           
 Process getProcessDef()
          Get the process definition.
 java.util.Map<java.net.URI,javax.xml.transform.Source> getSchemaSources()
           
 java.lang.String getSourceLocation()
           
static long getVersion(java.lang.String dirName)
           
 javax.wsdl.Definition[] getWsdlDefinitions()
           
 boolean isPartnerLinkAssigned(java.lang.String plink)
           
 void recoveredFromError(SourceLocation where, CompilationException bce)
           
protected  void registerActivityCompiler(java.lang.Class defClass, ActivityGenerator generator)
           
protected  void registerExpressionLanguage(java.lang.String expLangUri, ExpressionCompiler expressionCompiler)
           
protected  void registerExpressionLanguage(java.lang.String expLangUri, java.lang.String classname)
           
 org.apache.ode.bpel.o.OScope resolveCompensatableScope(java.lang.String scopeToCompensate)
           
 org.apache.ode.bpel.o.OScope.CorrelationSet resolveCorrelationSet(java.lang.String csetName)
           
 org.apache.ode.bpel.o.OMessageVarType.Part resolveHeaderPart(org.apache.ode.bpel.o.OScope.Variable var, java.lang.String partname)
           
 org.apache.ode.bpel.o.OLink resolveLink(java.lang.String linkName)
           
 org.apache.ode.bpel.o.OMessageVarType resolveMessageType(javax.xml.namespace.QName messageType)
           
 org.apache.ode.bpel.o.OScope.Variable resolveMessageVariable(java.lang.String inputVar)
           
 org.apache.ode.bpel.o.OScope.Variable resolveMessageVariable(java.lang.String inputVar, javax.xml.namespace.QName messageType)
           
 javax.wsdl.Operation resolveMyRoleOperation(org.apache.ode.bpel.o.OPartnerLink partnerLink, java.lang.String operationName)
           
 org.apache.ode.bpel.o.OMessageVarType.Part resolvePart(org.apache.ode.bpel.o.OScope.Variable var, java.lang.String partname)
           
 org.apache.ode.bpel.o.OPartnerLink resolvePartnerLink(java.lang.String name)
           
 PartnerLinkType resolvePartnerLinkType(javax.xml.namespace.QName partnerLinkType)
           
 javax.wsdl.Operation resolvePartnerRoleOperation(org.apache.ode.bpel.o.OPartnerLink partnerLink, java.lang.String operationName)
           
 javax.wsdl.PortType resolvePortType(javax.xml.namespace.QName portTypeName)
           
 org.apache.ode.bpel.o.OProcess.OProperty resolveProperty(javax.xml.namespace.QName name)
           
 org.apache.ode.bpel.o.OProcess.OPropertyAlias resolvePropertyAlias(org.apache.ode.bpel.o.OScope.Variable variable, javax.xml.namespace.QName propertyName)
           
 org.apache.ode.bpel.o.OScope.Variable resolveVariable(java.lang.String varName)
           
 org.apache.ode.bpel.o.OXsdTypeVarType resolveXsdType(javax.xml.namespace.QName typeName)
           
 void setCompileListener(CompileListener compileListener)
           
 void setCustomProperties(java.util.Map<javax.xml.namespace.QName,org.w3c.dom.Node> customProperties)
           
 void setResourceFinder(ResourceFinder finder)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

__log

protected static final org.apache.commons.logging.Log __log
Class-severity logger.

Method Detail

addWsdlImport

public void addWsdlImport(java.net.URI from,
                          java.net.URI wsdlImport,
                          SourceLocation sloc)

addXsdImport

public void addXsdImport(java.net.URI from,
                         java.net.URI location,
                         SourceLocation sloc)

setResourceFinder

public void setResourceFinder(ResourceFinder finder)

setCompileListener

public void setCompileListener(CompileListener compileListener)

getCompileListener

public CompileListener getCompileListener()

setCustomProperties

public void setCustomProperties(java.util.Map<javax.xml.namespace.QName,org.w3c.dom.Node> customProperties)

getProcessDef

public Process getProcessDef()
Get the process definition.

Returns:
the process definition

resolvePortType

public javax.wsdl.PortType resolvePortType(javax.xml.namespace.QName portTypeName)

resolveLink

public org.apache.ode.bpel.o.OLink resolveLink(java.lang.String linkName)
Specified by:
resolveLink in interface CompilerContext

resolveVariable

public org.apache.ode.bpel.o.OScope.Variable resolveVariable(java.lang.String varName)
Specified by:
resolveVariable in interface CompilerContext

getAccessibleVariables

public java.util.List<org.apache.ode.bpel.o.OScope.Variable> getAccessibleVariables()
Specified by:
getAccessibleVariables in interface CompilerContext

resolveMessageVariable

public org.apache.ode.bpel.o.OScope.Variable resolveMessageVariable(java.lang.String inputVar)
                                                             throws CompilationException
Specified by:
resolveMessageVariable in interface CompilerContext
Throws:
CompilationException

resolveMessageVariable

public org.apache.ode.bpel.o.OScope.Variable resolveMessageVariable(java.lang.String inputVar,
                                                                    javax.xml.namespace.QName messageType)
                                                             throws CompilationException
Specified by:
resolveMessageVariable in interface CompilerContext
Throws:
CompilationException

resolveProperty

public org.apache.ode.bpel.o.OProcess.OProperty resolveProperty(javax.xml.namespace.QName name)
Specified by:
resolveProperty in interface CompilerContext

resolvePropertyAlias

public org.apache.ode.bpel.o.OProcess.OPropertyAlias resolvePropertyAlias(org.apache.ode.bpel.o.OScope.Variable variable,
                                                                          javax.xml.namespace.QName propertyName)
Specified by:
resolvePropertyAlias in interface CompilerContext

resolveCompensatableScope

public org.apache.ode.bpel.o.OScope resolveCompensatableScope(java.lang.String scopeToCompensate)
                                                       throws CompilationException
Specified by:
resolveCompensatableScope in interface CompilerContext
Throws:
CompilationException

getSourceLocation

public java.lang.String getSourceLocation()
Specified by:
getSourceLocation in interface CompilerContext

resolveCorrelationSet

public org.apache.ode.bpel.o.OScope.CorrelationSet resolveCorrelationSet(java.lang.String csetName)
Specified by:
resolveCorrelationSet in interface CompilerContext

resolveMessageType

public org.apache.ode.bpel.o.OMessageVarType resolveMessageType(javax.xml.namespace.QName messageType)

resolveXsdType

public org.apache.ode.bpel.o.OXsdTypeVarType resolveXsdType(javax.xml.namespace.QName typeName)
                                                     throws CompilationException
Specified by:
resolveXsdType in interface CompilerContext
Throws:
CompilationException

resolvePart

public org.apache.ode.bpel.o.OMessageVarType.Part resolvePart(org.apache.ode.bpel.o.OScope.Variable var,
                                                              java.lang.String partname)
Specified by:
resolvePart in interface CompilerContext

resolveHeaderPart

public org.apache.ode.bpel.o.OMessageVarType.Part resolveHeaderPart(org.apache.ode.bpel.o.OScope.Variable var,
                                                                    java.lang.String partname)
Specified by:
resolveHeaderPart in interface CompilerContext

resolvePartnerLinkType

public PartnerLinkType resolvePartnerLinkType(javax.xml.namespace.QName partnerLinkType)

resolvePartnerLink

public org.apache.ode.bpel.o.OPartnerLink resolvePartnerLink(java.lang.String name)
Specified by:
resolvePartnerLink in interface CompilerContext

resolvePartnerRoleOperation

public javax.wsdl.Operation resolvePartnerRoleOperation(org.apache.ode.bpel.o.OPartnerLink partnerLink,
                                                        java.lang.String operationName)
Specified by:
resolvePartnerRoleOperation in interface CompilerContext

resolveMyRoleOperation

public javax.wsdl.Operation resolveMyRoleOperation(org.apache.ode.bpel.o.OPartnerLink partnerLink,
                                                   java.lang.String operationName)
Specified by:
resolveMyRoleOperation in interface CompilerContext

constantExpr

public org.apache.ode.bpel.o.OExpression constantExpr(boolean value)
Produce a boolean OExpression expression that returns a constant value.

Specified by:
constantExpr in interface CompilerContext
Parameters:
value - constant value to return
Returns:
OExpression returning a constant value.

compileLValueExpr

public org.apache.ode.bpel.o.OLValueExpression compileLValueExpr(Expression expression)
                                                          throws CompilationException
Specified by:
compileLValueExpr in interface CompilerContext
Throws:
CompilationException

compileLValueExpr

public org.apache.ode.bpel.o.OLValueExpression compileLValueExpr(Expression expression,
                                                                 org.apache.ode.bpel.o.OVarType rootNodeType,
                                                                 java.lang.Object requestedResultType,
                                                                 java.lang.Object[] resultType)
                                                          throws CompilationException
Specified by:
compileLValueExpr in interface CompilerContext
Throws:
CompilationException

compileJoinCondition

public org.apache.ode.bpel.o.OExpression compileJoinCondition(Expression expression)
                                                       throws CompilationException
Specified by:
compileJoinCondition in interface CompilerContext
Throws:
CompilationException

compileExpr

public org.apache.ode.bpel.o.OExpression compileExpr(Expression expression)
                                              throws CompilationException
Specified by:
compileExpr in interface CompilerContext
Throws:
CompilationException

compileExpr

public org.apache.ode.bpel.o.OExpression compileExpr(Expression expression,
                                                     org.apache.ode.bpel.o.OVarType rootNodeType,
                                                     java.lang.Object requestedResultType,
                                                     java.lang.Object[] resultType)
                                              throws CompilationException
Specified by:
compileExpr in interface CompilerContext
Throws:
CompilationException

compileExpr

public org.apache.ode.bpel.o.OExpression compileExpr(java.lang.String expr,
                                                     org.apache.ode.utils.NSContext nc)
Description copied from interface: CompilerContext
BPEL 1.1 legacy.

Specified by:
compileExpr in interface CompilerContext
Returns:

getOProcess

public org.apache.ode.bpel.o.OProcess getOProcess()
                                           throws CompilationException
Specified by:
getOProcess in interface CompilerContext
Throws:
CompilationException

recoveredFromError

public void recoveredFromError(SourceLocation where,
                               CompilationException bce)
                        throws CompilationException
Specified by:
recoveredFromError in interface CompilerContext
Throws:
CompilationException

getVersion

public static long getVersion(java.lang.String dirName)

compile

public org.apache.ode.bpel.o.OProcess compile(Process process,
                                              ResourceFinder rf,
                                              long version)
                                       throws CompilationException
Compile a process.

Throws:
CompilationException

compile

public org.apache.ode.bpel.o.OActivity compile(Activity source)
Specified by:
compile in interface CompilerContext

compileSLC

public org.apache.ode.bpel.o.OScope compileSLC(ScopeLikeActivity source,
                                               org.apache.ode.bpel.o.OScope.Variable[] variables)
Specified by:
compileSLC in interface CompilerContext

getCurrent

public org.apache.ode.bpel.o.OActivity getCurrent()
Specified by:
getCurrent in interface CompilerContext

compile

public void compile(org.apache.ode.bpel.o.OActivity context,
                    BpelObject source,
                    java.lang.Runnable run)

compileXslt

public org.apache.ode.bpel.o.OXslSheet compileXslt(java.lang.String docStrUri)
                                            throws CompilationException
Specified by:
compileXslt in interface CompilerContext
Throws:
CompilationException

isPartnerLinkAssigned

public boolean isPartnerLinkAssigned(java.lang.String plink)
Specified by:
isPartnerLinkAssigned in interface CompilerContext

getWsdlDefinitions

public javax.wsdl.Definition[] getWsdlDefinitions()

registerActivityCompiler

protected void registerActivityCompiler(java.lang.Class defClass,
                                        ActivityGenerator generator)

getDefaultExpressionLanguage

protected abstract java.lang.String getDefaultExpressionLanguage()

getBpwsNamespace

protected abstract java.lang.String getBpwsNamespace()

registerExpressionLanguage

protected void registerExpressionLanguage(java.lang.String expLangUri,
                                          ExpressionCompiler expressionCompiler)

registerExpressionLanguage

protected void registerExpressionLanguage(java.lang.String expLangUri,
                                          java.lang.String classname)
                                   throws java.lang.Exception
Throws:
java.lang.Exception

getActivityStack

public java.util.List<org.apache.ode.bpel.o.OActivity> getActivityStack()
Specified by:
getActivityStack in interface CompilerContext

getSchemaSources

public java.util.Map<java.net.URI,javax.xml.transform.Source> getSchemaSources()
Specified by:
getSchemaSources in interface CompilerContext

getBaseResourceURI

public java.net.URI getBaseResourceURI()
Retrieves the base URI that the BPEL Process execution contextis running relative to.

Specified by:
getBaseResourceURI in interface CompilerContext
Returns:
URI - the URI representing the absolute physical file path location that this process is defined within.
Throws:
java.io.IOException
java.net.MalformedURLException