From dbe4a93b83a193f4903b22692a89e2ca9959d337 Mon Sep 17 00:00:00 2001 From: Robert Greig Date: Thu, 23 Nov 2006 23:19:33 +0000 Subject: Start of merge from trunk - some manual restructuring git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/new_persistence@478708 13f79535-47bb-0310-9956-ffa450edef68 --- java/common/src/main/resources/xsl/framing.xsl | 61 ------ java/common/src/main/resources/xsl/java.xsl | 247 ------------------------ java/common/src/main/resources/xsl/prepare1.xsl | 111 ----------- java/common/src/main/resources/xsl/prepare2.xsl | 66 ------- java/common/src/main/resources/xsl/prepare3.xsl | 62 ------ java/common/src/main/resources/xsl/readme.txt | 52 ----- java/common/src/main/resources/xsl/registry.xsl | 29 --- java/common/src/main/resources/xsl/utils.xsl | 201 ------------------- java/common/src/main/xsl/framing.xsl | 61 ++++++ java/common/src/main/xsl/java.xsl | 247 ++++++++++++++++++++++++ java/common/src/main/xsl/prepare1.xsl | 111 +++++++++++ java/common/src/main/xsl/prepare2.xsl | 66 +++++++ java/common/src/main/xsl/prepare3.xsl | 62 ++++++ java/common/src/main/xsl/readme.txt | 52 +++++ java/common/src/main/xsl/registry.xsl | 29 +++ java/common/src/main/xsl/utils.xsl | 201 +++++++++++++++++++ 16 files changed, 829 insertions(+), 829 deletions(-) delete mode 100644 java/common/src/main/resources/xsl/framing.xsl delete mode 100644 java/common/src/main/resources/xsl/java.xsl delete mode 100644 java/common/src/main/resources/xsl/prepare1.xsl delete mode 100644 java/common/src/main/resources/xsl/prepare2.xsl delete mode 100644 java/common/src/main/resources/xsl/prepare3.xsl delete mode 100644 java/common/src/main/resources/xsl/readme.txt delete mode 100644 java/common/src/main/resources/xsl/registry.xsl delete mode 100644 java/common/src/main/resources/xsl/utils.xsl create mode 100644 java/common/src/main/xsl/framing.xsl create mode 100644 java/common/src/main/xsl/java.xsl create mode 100644 java/common/src/main/xsl/prepare1.xsl create mode 100644 java/common/src/main/xsl/prepare2.xsl create mode 100644 java/common/src/main/xsl/prepare3.xsl create mode 100644 java/common/src/main/xsl/readme.txt create mode 100644 java/common/src/main/xsl/registry.xsl create mode 100644 java/common/src/main/xsl/utils.xsl (limited to 'java') diff --git a/java/common/src/main/resources/xsl/framing.xsl b/java/common/src/main/resources/xsl/framing.xsl deleted file mode 100644 index bb17a72bce..0000000000 --- a/java/common/src/main/resources/xsl/framing.xsl +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/common/src/main/resources/xsl/java.xsl b/java/common/src/main/resources/xsl/java.xsl deleted file mode 100644 index df72bfb0c0..0000000000 --- a/java/common/src/main/resources/xsl/java.xsl +++ /dev/null @@ -1,247 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - wrote - - - - - - - - - - - - -package org.apache.qpid.framing; - -import org.apache.mina.common.ByteBuffer; -import org.apache.qpid.framing.AMQFrame; -import org.apache.qpid.framing.AMQFrameDecodingException; -import org.apache.qpid.framing.AMQMethodBody; -import org.apache.qpid.framing.EncodableAMQDataBlock; -import org.apache.qpid.framing.EncodingUtils; -import org.apache.qpid.framing.FieldTable; - -/** - * This class is autogenerated, do not modify. [From ] - */ -public class extends AMQMethodBody implements EncodableAMQDataBlock -{ - public static final int CLASS_ID = ; - public static final int METHOD_ID = ; - - - public - - ; - - - protected int getClazz() - { - return ; - } - - protected int getMethod() - { - return ; - } - - protected int getBodySize() - { - - - return - - + - - - - ; - - return 0; - - } - - protected void writeMethodPayload(ByteBuffer buffer) - { - - - ; - - - EncodingUtils.writeBooleans(buffer, new boolean[]{ - }); - - - } - - public void populateMethodBodyFromBuffer(ByteBuffer buffer) throws AMQFrameDecodingException - { - - ; - - } - - public String toString() - { - StringBuffer buf = new StringBuffer(super.toString()); - - buf.append(" : ").append(); - - return buf.toString(); - } - - public static AMQFrame createAMQFrame(int channelId, ) - { - body = new (); - - ; - - AMQFrame frame = new AMQFrame(); - frame.channel = channelId; - frame.bodyFrame = body; - return frame; - } -} - - - - Matching root for registry mode! - - - - - -Wrote MethodBodyDecoderRegistry.java - - - -package org.apache.qpid.framing; - -import java.util.Map; -import java.util.HashMap; -import org.apache.log4j.Logger; -import org.apache.qpid.AMQException; -import org.apache.qpid.framing.AMQFrameDecodingException; -import org.apache.qpid.framing.AMQMethodBody; - -/** - * This class is autogenerated, do not modify. - */ -public final class MethodBodyDecoderRegistry -{ - private static final Logger _log = Logger.getLogger(MethodBodyDecoderRegistry.class); - - private static final Map _classMethodProductToMethodBodyMap = new HashMap(); - - static - { - - ; - - } - - public static AMQMethodBody get(int clazz, int method) throws AMQFrameDecodingException - { - Class bodyClass = (Class) _classMethodProductToMethodBodyMap.get(new Integer(clazz * 1000 + method)); - if (bodyClass != null) - { - try - { - return (AMQMethodBody) bodyClass.newInstance(); - } - catch (Exception e) - { - throw new AMQFrameDecodingException(_log, - "Unable to instantiate body class for class " + clazz + " and method " + method + ": " + e, e); - } - } - else - { - throw new AMQFrameDecodingException(_log, - "Unable to find a suitable decoder for class " + clazz + " and method " + method); - } - } -} - - - - - - - - wrote - - - -package org.apache.qpid.framing; - -import java.util.Map; - -/** - * This class is autogenerated, do not modify. [From ] - */ -class -{ - static void register(Map map) - { - - map.put(new Integer( - - * 1000 + - - ), - ); - - } -} - - - - - - diff --git a/java/common/src/main/resources/xsl/prepare1.xsl b/java/common/src/main/resources/xsl/prepare1.xsl deleted file mode 100644 index 5b7641e408..0000000000 --- a/java/common/src/main/resources/xsl/prepare1.xsl +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - - - - - - - - - - - - - - ( - major= - , minor= - ) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Could not inherit from ; file not found. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/common/src/main/resources/xsl/prepare2.xsl b/java/common/src/main/resources/xsl/prepare2.xsl deleted file mode 100644 index 38110b0a33..0000000000 --- a/java/common/src/main/resources/xsl/prepare2.xsl +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/common/src/main/resources/xsl/prepare3.xsl b/java/common/src/main/resources/xsl/prepare3.xsl deleted file mode 100644 index 6d6d75d8f0..0000000000 --- a/java/common/src/main/resources/xsl/prepare3.xsl +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - - - - - - - - - - - - - - - - diff --git a/java/common/src/main/resources/xsl/readme.txt b/java/common/src/main/resources/xsl/readme.txt deleted file mode 100644 index b373055df9..0000000000 --- a/java/common/src/main/resources/xsl/readme.txt +++ /dev/null @@ -1,52 +0,0 @@ -This directory contains the xsl stylesheets used to generate the code from the -AMQP protocol specification. They require an XSLT2.0 processor, currently -Saxon 8 is used. - -The generation process is controlled by the framing.xsl stylesheet. This performs -several phases of transformation, using the other stylesheets. The transformation -in each phase is defined in a separate file, and these are designed to also allow -then to be run individually. - -The generation takes the amq.asl as input, it also requires that the path to the -directory where the base asl definitions reside (those definitions that the main -amq.asl defintion inherits from) be passed in via a paramter called asl_base. - -The files involved are as follows: - - framing.xsl The control file for the entire generation process - - prepare1.xsl Resolves the separate files that make up the protocol - definition, building a single tree containing all the - information as a set of 'frame' elements, each of which - has attributes for its name, and ids for the class and - method it refers to and contains zero or more field - elements. - - A method id is generated based on the order of the - method elements within the class elements in the original - specification. The class id is taken from the enclosing - class element. - - prepare2.xsl Resolves domains into their corresponding types. (This is - much easier when all the information is in a single tree, - hence the separate frame). - - prepare3.xsl Converts names into valid java names and augments the - tree to include information that makes the subsequent - generation phase simpler e.g. the index of boolean - fields as several boolean flags are combined into a - single byte. (This is easier once the domains have been - resolved, hence the separate phase). - - java.xsl Generates java classes for each frame, and a registry of - all the frames to a 'magic' number generated from their - class and method id. - - utils.xsl Contains some utility methods for e.g. producing valid - java names. - -For debugging the framing.xsl can output the intermediary files. This can be -enabled by uncommenting the relevant lines (a comment explaining this is -provided inline). - - \ No newline at end of file diff --git a/java/common/src/main/resources/xsl/registry.xsl b/java/common/src/main/resources/xsl/registry.xsl deleted file mode 100644 index eb382c296b..0000000000 --- a/java/common/src/main/resources/xsl/registry.xsl +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - diff --git a/java/common/src/main/resources/xsl/utils.xsl b/java/common/src/main/resources/xsl/utils.xsl deleted file mode 100644 index e6fda6c9d5..0000000000 --- a/java/common/src/main/resources/xsl/utils.xsl +++ /dev/null @@ -1,201 +0,0 @@ - - - - - - - -/** -* -* Copyright (c) 2006 The Apache Software Foundation -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* -*/ - - - - - - - char - short - int - String - byte[] - boolean - long - long - FieldTable - Object /*WARNING: undefined type*/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /* WARNING: COULD NOT DETERMINE FIELD SIZE */ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /* WARNING: COULD NOT DETERMINE ENCODER */ - - - - - - - - - - boolean[] bools = EncodingUtils.readBooleans(buffer); - - - - - - - - - - - - - - - - - - - - - - - - - - - - /* WARNING: COULD NOT DETERMINE DECODER */ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/common/src/main/xsl/framing.xsl b/java/common/src/main/xsl/framing.xsl new file mode 100644 index 0000000000..bb17a72bce --- /dev/null +++ b/java/common/src/main/xsl/framing.xsl @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/common/src/main/xsl/java.xsl b/java/common/src/main/xsl/java.xsl new file mode 100644 index 0000000000..df72bfb0c0 --- /dev/null +++ b/java/common/src/main/xsl/java.xsl @@ -0,0 +1,247 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + wrote + + + + + + + + + + + + +package org.apache.qpid.framing; + +import org.apache.mina.common.ByteBuffer; +import org.apache.qpid.framing.AMQFrame; +import org.apache.qpid.framing.AMQFrameDecodingException; +import org.apache.qpid.framing.AMQMethodBody; +import org.apache.qpid.framing.EncodableAMQDataBlock; +import org.apache.qpid.framing.EncodingUtils; +import org.apache.qpid.framing.FieldTable; + +/** + * This class is autogenerated, do not modify. [From ] + */ +public class extends AMQMethodBody implements EncodableAMQDataBlock +{ + public static final int CLASS_ID = ; + public static final int METHOD_ID = ; + + + public + + ; + + + protected int getClazz() + { + return ; + } + + protected int getMethod() + { + return ; + } + + protected int getBodySize() + { + + + return + + + + + + + ; + + return 0; + + } + + protected void writeMethodPayload(ByteBuffer buffer) + { + + + ; + + + EncodingUtils.writeBooleans(buffer, new boolean[]{ + }); + + + } + + public void populateMethodBodyFromBuffer(ByteBuffer buffer) throws AMQFrameDecodingException + { + + ; + + } + + public String toString() + { + StringBuffer buf = new StringBuffer(super.toString()); + + buf.append(" : ").append(); + + return buf.toString(); + } + + public static AMQFrame createAMQFrame(int channelId, ) + { + body = new (); + + ; + + AMQFrame frame = new AMQFrame(); + frame.channel = channelId; + frame.bodyFrame = body; + return frame; + } +} + + + + Matching root for registry mode! + + + + + +Wrote MethodBodyDecoderRegistry.java + + + +package org.apache.qpid.framing; + +import java.util.Map; +import java.util.HashMap; +import org.apache.log4j.Logger; +import org.apache.qpid.AMQException; +import org.apache.qpid.framing.AMQFrameDecodingException; +import org.apache.qpid.framing.AMQMethodBody; + +/** + * This class is autogenerated, do not modify. + */ +public final class MethodBodyDecoderRegistry +{ + private static final Logger _log = Logger.getLogger(MethodBodyDecoderRegistry.class); + + private static final Map _classMethodProductToMethodBodyMap = new HashMap(); + + static + { + + ; + + } + + public static AMQMethodBody get(int clazz, int method) throws AMQFrameDecodingException + { + Class bodyClass = (Class) _classMethodProductToMethodBodyMap.get(new Integer(clazz * 1000 + method)); + if (bodyClass != null) + { + try + { + return (AMQMethodBody) bodyClass.newInstance(); + } + catch (Exception e) + { + throw new AMQFrameDecodingException(_log, + "Unable to instantiate body class for class " + clazz + " and method " + method + ": " + e, e); + } + } + else + { + throw new AMQFrameDecodingException(_log, + "Unable to find a suitable decoder for class " + clazz + " and method " + method); + } + } +} + + + + + + + + wrote + + + +package org.apache.qpid.framing; + +import java.util.Map; + +/** + * This class is autogenerated, do not modify. [From ] + */ +class +{ + static void register(Map map) + { + + map.put(new Integer( + + * 1000 + + + ), + ); + + } +} + + + + + + diff --git a/java/common/src/main/xsl/prepare1.xsl b/java/common/src/main/xsl/prepare1.xsl new file mode 100644 index 0000000000..5b7641e408 --- /dev/null +++ b/java/common/src/main/xsl/prepare1.xsl @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + ( + major= + , minor= + ) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Could not inherit from ; file not found. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/common/src/main/xsl/prepare2.xsl b/java/common/src/main/xsl/prepare2.xsl new file mode 100644 index 0000000000..38110b0a33 --- /dev/null +++ b/java/common/src/main/xsl/prepare2.xsl @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/common/src/main/xsl/prepare3.xsl b/java/common/src/main/xsl/prepare3.xsl new file mode 100644 index 0000000000..6d6d75d8f0 --- /dev/null +++ b/java/common/src/main/xsl/prepare3.xsl @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + diff --git a/java/common/src/main/xsl/readme.txt b/java/common/src/main/xsl/readme.txt new file mode 100644 index 0000000000..b373055df9 --- /dev/null +++ b/java/common/src/main/xsl/readme.txt @@ -0,0 +1,52 @@ +This directory contains the xsl stylesheets used to generate the code from the +AMQP protocol specification. They require an XSLT2.0 processor, currently +Saxon 8 is used. + +The generation process is controlled by the framing.xsl stylesheet. This performs +several phases of transformation, using the other stylesheets. The transformation +in each phase is defined in a separate file, and these are designed to also allow +then to be run individually. + +The generation takes the amq.asl as input, it also requires that the path to the +directory where the base asl definitions reside (those definitions that the main +amq.asl defintion inherits from) be passed in via a paramter called asl_base. + +The files involved are as follows: + + framing.xsl The control file for the entire generation process + + prepare1.xsl Resolves the separate files that make up the protocol + definition, building a single tree containing all the + information as a set of 'frame' elements, each of which + has attributes for its name, and ids for the class and + method it refers to and contains zero or more field + elements. + + A method id is generated based on the order of the + method elements within the class elements in the original + specification. The class id is taken from the enclosing + class element. + + prepare2.xsl Resolves domains into their corresponding types. (This is + much easier when all the information is in a single tree, + hence the separate frame). + + prepare3.xsl Converts names into valid java names and augments the + tree to include information that makes the subsequent + generation phase simpler e.g. the index of boolean + fields as several boolean flags are combined into a + single byte. (This is easier once the domains have been + resolved, hence the separate phase). + + java.xsl Generates java classes for each frame, and a registry of + all the frames to a 'magic' number generated from their + class and method id. + + utils.xsl Contains some utility methods for e.g. producing valid + java names. + +For debugging the framing.xsl can output the intermediary files. This can be +enabled by uncommenting the relevant lines (a comment explaining this is +provided inline). + + \ No newline at end of file diff --git a/java/common/src/main/xsl/registry.xsl b/java/common/src/main/xsl/registry.xsl new file mode 100644 index 0000000000..eb382c296b --- /dev/null +++ b/java/common/src/main/xsl/registry.xsl @@ -0,0 +1,29 @@ + + + + + + + + + + + + + diff --git a/java/common/src/main/xsl/utils.xsl b/java/common/src/main/xsl/utils.xsl new file mode 100644 index 0000000000..e6fda6c9d5 --- /dev/null +++ b/java/common/src/main/xsl/utils.xsl @@ -0,0 +1,201 @@ + + + + + + + +/** +* +* Copyright (c) 2006 The Apache Software Foundation +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* +*/ + + + + + + + char + short + int + String + byte[] + boolean + long + long + FieldTable + Object /*WARNING: undefined type*/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /* WARNING: COULD NOT DETERMINE FIELD SIZE */ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /* WARNING: COULD NOT DETERMINE ENCODER */ + + + + + + + + + + boolean[] bools = EncodingUtils.readBooleans(buffer); + + + + + + + + + + + + + + + + + + + + + + + + + + + + /* WARNING: COULD NOT DETERMINE DECODER */ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.1