summaryrefslogtreecommitdiff
path: root/java/broker/src/xsl
diff options
context:
space:
mode:
authorRobert Gemmell <robbie@apache.org>2010-04-09 14:16:42 +0000
committerRobert Gemmell <robbie@apache.org>2010-04-09 14:16:42 +0000
commit2daf8e11866364ff4955ee69625bf401e9baa93c (patch)
treeaedfb1130a72c27e8926a883b3cc7d6ffc5fd728 /java/broker/src/xsl
parenta485a09a10e0ce6b7b8705cab9cd2322f80ad748 (diff)
downloadqpid-python-2daf8e11866364ff4955ee69625bf401e9baa93c.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/qpid@932430 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/broker/src/xsl')
-rw-r--r--java/broker/src/xsl/qmf.xsl30
1 files changed, 28 insertions, 2 deletions
diff --git a/java/broker/src/xsl/qmf.xsl b/java/broker/src/xsl/qmf.xsl
index b7690d233a..3a7e10dac8 100644
--- a/java/broker/src/xsl/qmf.xsl
+++ b/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>