diff options
| author | Robert Gemmell <robbie@apache.org> | 2010-04-09 14:16:42 +0000 |
|---|---|---|
| committer | Robert Gemmell <robbie@apache.org> | 2010-04-09 14:16:42 +0000 |
| commit | 08dfca659546aac8184383259fb9bec583a88927 (patch) | |
| tree | 4ea6e9f38576b56d05d4114be975f093f0579da2 /qpid/java/broker/src/xsl | |
| parent | fb326be4a7956a1ee1f959aa36cfa2223d8b7ee3 (diff) | |
| download | qpid-python-08dfca659546aac8184383259fb9bec583a88927.tar.gz | |
QPID-2379: add ability to respond to method requests with non-zero status codes, use to signal unimplemented methods.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@932430 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/broker/src/xsl')
| -rw-r--r-- | qpid/java/broker/src/xsl/qmf.xsl | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/qpid/java/broker/src/xsl/qmf.xsl b/qpid/java/broker/src/xsl/qmf.xsl index b7690d233a..3a7e10dac8 100644 --- a/qpid/java/broker/src/xsl/qmf.xsl +++ b/qpid/java/broker/src/xsl/qmf.xsl @@ -540,6 +540,16 @@ public class <xsl:value-of select="$ClassName"/> extends QMFPackage _requestCmd = cmd; } + public <xsl:value-of select="$ClassName"/>ResponseCommand createResponseCommand(CompletionCode status) + { + return new <xsl:value-of select="$ClassName"/>ResponseCommand(_requestCmd, status, null); + } + + public <xsl:value-of select="$ClassName"/>ResponseCommand createResponseCommand(CompletionCode status, String msg) + { + return new <xsl:value-of select="$ClassName"/>ResponseCommand(_requestCmd, status, msg); + } + public <xsl:value-of select="$ClassName"/>ResponseCommand createResponseCommand( <xsl:apply-templates select="node()[name()='arg' and ( @dir='O' or @dir='IO' ) ]" mode="methodArgList"><xsl:with-param name="includeType">yes</xsl:with-param><xsl:with-param name="direction">O</xsl:with-param></xsl:apply-templates> ) { return new <xsl:value-of select="$ClassName"/>ResponseCommand(_requestCmd<xsl:if test="node()[name()='arg' and ( @dir='O' or @dir='IO' ) ]">, <xsl:apply-templates select="node()[name()='arg' and ( @dir='O' or @dir='IO' ) ]" mode="methodArgList"><xsl:with-param name="direction">O</xsl:with-param></xsl:apply-templates></xsl:if>); @@ -551,17 +561,29 @@ public class <xsl:value-of select="$ClassName"/> extends QMFPackage <xsl:apply-templates select="node()[name()='arg' and ( @dir='O' or @dir='IO' ) ]" mode="methodInputArgDecl"/> private <xsl:value-of select="$ClassName"/>ResponseCommand(QMFMethodRequestCommand cmd<xsl:if test="node()[name()='arg' and ( @dir='O' or @dir='IO' ) ]">, <xsl:apply-templates select="node()[name()='arg' and ( @dir='O' or @dir='IO' ) ]" mode="methodArgList"><xsl:with-param name="includeType">yes</xsl:with-param><xsl:with-param name="direction">O</xsl:with-param></xsl:apply-templates></xsl:if>) { - super(cmd); + super(cmd, CompletionCode.OK, "OK"); <xsl:apply-templates select="node()[name()='arg' and ( @dir='O' or @dir='IO' ) ]" mode="methodInputArgAssign"/> } + private <xsl:value-of select="$ClassName"/>ResponseCommand(QMFMethodRequestCommand cmd, CompletionCode status, String msg) + { + super(cmd, status, msg); + + <xsl:apply-templates select="node()[name()='arg' and ( @dir='O' or @dir='IO' ) ]" mode="methodInputArgAssignNull"/> + } + @Override public void encode(final BBEncoder encoder) { super.encode(encoder); - <xsl:apply-templates select="node()[name()='arg' and ( @dir='O' or @dir='IO' ) ]" mode="encodeArg"/> + <xsl:if test="node()[name()='arg' and ( @dir='O' or @dir='IO' ) ]"> + if(getStatus().equals(CompletionCode.OK)) + { + <xsl:apply-templates select="node()[name()='arg' and ( @dir='O' or @dir='IO' ) ]" mode="encodeArg"/> + } + </xsl:if> } } @@ -600,6 +622,10 @@ public class <xsl:value-of select="$ClassName"/> extends QMFPackage <xsl:template match="node()[name()='arg']" mode="methodInputArgAssign"> _<xsl:value-of select="@name"/> = <xsl:value-of select="@name"/>; </xsl:template> + <xsl:template match="node()[name()='arg']" mode="methodInputArgAssignNull"> + _<xsl:value-of select="@name"/> = null; + </xsl:template> + <xsl:template match="node()[name()='class']" mode="classList">_<xsl:call-template name="initLower"><xsl:with-param name="input" select="@name"/></xsl:call-template>Class<xsl:if test="following-sibling::node()[name()='class']">, </xsl:if></xsl:template> <xsl:template match="node()[name()='event']" mode="eventList">_<xsl:call-template name="initLower"><xsl:with-param name="input" select="@name"/></xsl:call-template>EventClass<xsl:if test="following-sibling::node()[name()='event']">, </xsl:if></xsl:template> |
