├── openwire-core ├── .gitignore └── src │ ├── main │ └── java │ │ └── org │ │ └── apache │ │ └── activemq │ │ └── openwire │ │ ├── commands │ │ ├── package.html │ │ ├── MarshallAware.java │ │ ├── TransactionId.java │ │ ├── ShutdownInfo.java │ │ ├── FlushCommand.java │ │ ├── DataStructure.java │ │ ├── LastPartialCommand.java │ │ ├── OpenWireQueue.java │ │ ├── OpenWireTopic.java │ │ ├── IntegerResponse.java │ │ ├── DataResponse.java │ │ ├── DataArrayResponse.java │ │ ├── Command.java │ │ ├── ControlCommand.java │ │ ├── ExceptionResponse.java │ │ ├── OpenWireTempTopic.java │ │ ├── Response.java │ │ ├── OpenWireTempQueue.java │ │ ├── JournalTrace.java │ │ ├── ConnectionError.java │ │ ├── JournalQueueAck.java │ │ ├── BrokerId.java │ │ ├── KeepAliveInfo.java │ │ ├── DiscoveryEvent.java │ │ ├── SessionInfo.java │ │ ├── RemoveSubscriptionInfo.java │ │ ├── ProducerAck.java │ │ ├── ConnectionId.java │ │ ├── MessageDispatch.java │ │ └── JournalTransaction.java │ │ ├── codec │ │ └── DataStreamMarshaller.java │ │ └── utils │ │ ├── IOExceptionSupport.java │ │ └── OpenWireValidationSupport.java │ └── test │ ├── java │ └── org │ │ └── apache │ │ └── activemq │ │ └── openwire │ │ ├── utils │ │ ├── OpenWireMarshallingSupportTest.java │ │ └── MarshallingSupport.java │ │ └── commands │ │ └── OpenWireObjectMessageTest.java │ └── resources │ └── log4j2-test.properties ├── openwire-legacy ├── .gitignore ├── pom.xml └── src │ └── main │ └── java │ └── org │ └── apache │ └── activemq │ └── openwire │ └── codec │ ├── v12 │ └── OpenWireTempDestinationMarshaller.java │ ├── v1 │ └── OpenWireTempDestinationMarshaller.java │ ├── v10 │ └── OpenWireTempDestinationMarshaller.java │ ├── v11 │ └── OpenWireTempDestinationMarshaller.java │ ├── v2 │ └── OpenWireTempDestinationMarshaller.java │ ├── v3 │ └── OpenWireTempDestinationMarshaller.java │ └── v4 │ └── OpenWireTempDestinationMarshaller.java ├── openwire-generator ├── .gitignore ├── src │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── apache │ │ │ │ └── activemq │ │ │ │ └── openwire │ │ │ │ └── generator │ │ │ │ ├── Generator.java │ │ │ │ ├── Generators.java │ │ │ │ └── AbstractGenerator.java │ │ └── resources │ │ │ └── log4j2.properties │ └── test │ │ └── java │ │ └── org │ │ └── apache │ │ └── activenq │ │ └── openwire │ │ └── generator │ │ └── IDERunner.java └── pom.xml ├── openwire-website ├── .gitignore ├── src │ ├── images │ │ ├── rss.gif │ │ ├── project-logo.png │ │ ├── module-deps-graph.png │ │ └── project-logo-vector.png │ ├── blog │ │ ├── index.rss.feed │ │ ├── index.page │ │ └── releases │ │ │ └── release-1.0.page │ ├── _navigation.ssp.md │ ├── community │ │ ├── _creating_patches.ssp.md │ │ ├── support.page │ │ ├── developers.page │ │ ├── release-guide.page │ │ ├── faq.page │ │ ├── building.page │ │ ├── site.page │ │ ├── source.page │ │ └── contributing.page │ ├── documentation │ │ ├── index.page │ │ ├── getting-started.md │ │ └── module-organization.page │ ├── styles │ │ └── impact │ │ │ └── blog.template │ ├── versions │ │ └── index.page │ ├── index.page │ ├── WEB-INF │ │ └── web.xml │ └── privacy-policy.page ├── README.md └── ext │ ├── ScalatePackage.scala │ ├── Website.scala │ └── scalate │ └── Boot.scala ├── openwire-annotations ├── .gitignore ├── src │ └── main │ │ └── java │ │ └── org │ │ └── apache │ │ └── activemq │ │ └── openwire │ │ └── annotations │ │ ├── OpenWireType.java │ │ ├── OpenWireDocumentation.java │ │ ├── OpenWireProperty.java │ │ └── OpenWireExtension.java └── pom.xml ├── openwire-interop-tests ├── .gitignore ├── src │ └── test │ │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── activemq │ │ │ └── openwire │ │ │ ├── codec │ │ │ ├── v1 │ │ │ │ ├── WireFormatInfoV1MarshaledSizeTest.java │ │ │ │ └── OpenWireV1Test.java │ │ │ ├── v2 │ │ │ │ ├── WireFormatInfoV2MarshaledSizeTest.java │ │ │ │ └── OpenWireV2Test.java │ │ │ ├── v3 │ │ │ │ ├── WireFormatInfoV3MarshaledSizeTest.java │ │ │ │ └── OpenWireV3Test.java │ │ │ ├── v4 │ │ │ │ ├── WireFormatInfoV4MarshaledSizeTest.java │ │ │ │ └── OpenWireV4Test.java │ │ │ ├── v5 │ │ │ │ ├── WireFormatInfoV5MarshaledSizeTest.java │ │ │ │ └── OpenWireV5Test.java │ │ │ ├── v6 │ │ │ │ ├── WireFormatInfoV6MarshaledSizeTest.java │ │ │ │ └── OpenWireV6Test.java │ │ │ ├── v7 │ │ │ │ ├── WireFormatInfoV7MarshaledSizeTest.java │ │ │ │ └── OpenWireV7Test.java │ │ │ ├── v8 │ │ │ │ ├── WireFormatInfoV8MarshaledSizeTest.java │ │ │ │ └── OpenWireV8Test.java │ │ │ ├── v9 │ │ │ │ ├── WireFormatInfoV9MarshaledSizeTest.java │ │ │ │ └── OpenWireV9Test.java │ │ │ ├── v10 │ │ │ │ ├── WireFormatInfoV10MarshaledSizeTest.java │ │ │ │ └── OpenWireV10Test.java │ │ │ ├── v11 │ │ │ │ ├── WireFormatInfoV11MarshaledSizeTest.java │ │ │ │ └── OpenWireV11Test.java │ │ │ └── v12 │ │ │ │ └── WireFormatInfoV12MarshaledSizeTest.java │ │ │ └── util │ │ │ ├── TransportListener.java │ │ │ └── Wait.java │ │ └── resources │ │ └── log4j2-test.properties └── pom.xml ├── NOTICE ├── README.md └── .gitignore /openwire-core/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /openwire-legacy/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /openwire-generator/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /openwire-website/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /openwire-annotations/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /openwire-interop-tests/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /openwire-website/src/images/rss.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/activemq-openwire/main/openwire-website/src/images/rss.gif -------------------------------------------------------------------------------- /openwire-website/src/images/project-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/activemq-openwire/main/openwire-website/src/images/project-logo.png -------------------------------------------------------------------------------- /openwire-website/src/images/module-deps-graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/activemq-openwire/main/openwire-website/src/images/module-deps-graph.png -------------------------------------------------------------------------------- /openwire-website/src/images/project-logo-vector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/activemq-openwire/main/openwire-website/src/images/project-logo-vector.png -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Apache ActiveMQ Copyright 2005-2013 Apache Software Foundation 2 | 3 | This product includes software developed by 4 | The Apache Software Foundation (http://www.apache.org/). 5 | 6 | -------------------------------------------------------------------------------- /openwire-website/src/blog/index.rss.feed: -------------------------------------------------------------------------------- 1 | --- 2 | link: ${website_base_url}/blog/ 3 | author: "${project_name} Team" 4 | title: "The ${project_name} Blog" 5 | description: "${project_slogan}" 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ActiveMQ OpenWire 2 | ------------------------------ 3 | This library provides an implementation of the OpenWire protocol which is the native wire protocol for ActiveMQ Brokers and Clients. 4 | -------------------------------------------------------------------------------- /openwire-website/src/_navigation.ssp.md: -------------------------------------------------------------------------------- 1 | 2 | * [${project_name} ${project_version}](${uri("/")}) 3 | * [Developers](${uri("/community/developers.html")}) 4 | * [Community](${uri("/community/index.html")}) 5 | * [Download](${uri("/download.html")}) 6 | 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | 3 | # Mobile Tools for Java (J2ME) 4 | .mtj.tmp/ 5 | 6 | # Package Files # 7 | *.jar 8 | *.war 9 | *.ear 10 | 11 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 12 | hs_err_pid* 13 | 14 | /target 15 | .DS_Store 16 | .project 17 | .classpath 18 | .settings 19 | .idea 20 | .idea/* 21 | *.iml 22 | *.ipr 23 | *.iws 24 | .metadata/ 25 | -------------------------------------------------------------------------------- /openwire-website/README.md: -------------------------------------------------------------------------------- 1 | ## OpenWire Protocol Library website 2 | 3 | This maven project builds the OpenWire protocol library website content. Its mostly consists of markdown files you can view/edit directly or via github. 4 | 5 | If you want to build the HTML yourself try: 6 | 7 | ``` 8 | mvn jetty:run 9 | ``` 10 | 11 | To generate the static html try: 12 | ``` 13 | mvn scalate:sitegen 14 | ``` 15 | -------------------------------------------------------------------------------- /openwire-website/src/community/_creating_patches.ssp.md: -------------------------------------------------------------------------------- 1 | We gladly accept patches if you can find ways to improve, tune or fix 2 | ${project_name} in some way. 3 | 4 | Most IDEs can create nice patches now very easily. e.g. in Eclipse just 5 | right click on a file/directory and select `Team -> Create Patch`. Then 6 | just save the patch as a file and then submit it. (You may have to click 7 | on `Team -> Share...` first to enable the Subversion options). 8 | Incidentally if you are an Eclipse user you should install the 9 | [subclipse](http://subclipse.tigris.org/) plugin. 10 | 11 | If you're a command line person try the following to create the patch 12 | 13 | diff -u Main.java.orig Main.java >> patchfile.txt 14 | 15 | or 16 | svn diff Main.java >> patchfile.txt 17 | 18 | ### Submitting patches 19 | 20 | The easiest way to submit a patch is to create a new issue at our [Issue 21 | Tracker](${project_issue_url}), attach the patch, tick the Patch 22 | Attached button on the issue then fire off an email to the mailing 23 | lists. 24 | -------------------------------------------------------------------------------- /openwire-core/src/main/java/org/apache/activemq/openwire/commands/package.html: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 |

21 | Represents the Object Model for the OpenWire protocol. 22 |

23 | 24 | -------------------------------------------------------------------------------- /openwire-website/src/documentation/index.page: -------------------------------------------------------------------------------- 1 | --- 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | title: Documentation 18 | --- name:overview 19 | 20 | ${project_slogan} 21 | 22 | --- name:content 23 | 24 | # Documentation 25 | 26 | * [Getting Started Guide](getting-started.html) 27 | * [OpenWire Protocol Manual](openwire-manual.html) 28 | 29 | -------------------------------------------------------------------------------- /openwire-website/src/styles/impact/blog.template: -------------------------------------------------------------------------------- 1 | --- 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | template: main.template 18 | --- 19 |
20 |

{title:}

21 |
Posted by {author:} on {created_at:}
22 | 23 | <% if context.node.node_info[:page].blocks.has_key?('full_story') %> 24 | 25 | <% end %> 26 |
27 | -------------------------------------------------------------------------------- /openwire-generator/src/main/java/org/apache/activemq/openwire/generator/Generator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.generator; 18 | 19 | import java.util.List; 20 | 21 | /** 22 | * Interface used for all Generator types. 23 | */ 24 | public interface Generator { 25 | 26 | public void run(List typeDescriptors) throws Exception; 27 | 28 | public void setBaseDir(String baseDir); 29 | 30 | public String getBaseDir(); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /openwire-website/ext/ScalatePackage.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | import org.fusesource.scalate.support.TemplatePackage 18 | import org.fusesource.scalate.{Binding, TemplateSource} 19 | 20 | /** 21 | * Defines the template package of reusable imports, attributes and methods across templates 22 | */ 23 | class ScalatePackage extends TemplatePackage { 24 | def header(source: TemplateSource, bindings: List[Binding]) = 25 | """ 26 | // common imports go here 27 | import _root_.Website._; 28 | """ 29 | } 30 | -------------------------------------------------------------------------------- /openwire-interop-tests/src/test/java/org/apache/activemq/openwire/codec/v1/WireFormatInfoV1MarshaledSizeTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.codec.v1; 18 | 19 | import org.apache.activemq.openwire.codec.WireFormatInfoMarshaledSizeTest; 20 | 21 | /** 22 | * Test marshaling with WireFormatInfo for this Version. 23 | */ 24 | public class WireFormatInfoV1MarshaledSizeTest extends WireFormatInfoMarshaledSizeTest { 25 | 26 | @Override 27 | public int getVersion() { 28 | return 1; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /openwire-interop-tests/src/test/java/org/apache/activemq/openwire/codec/v2/WireFormatInfoV2MarshaledSizeTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.codec.v2; 18 | 19 | import org.apache.activemq.openwire.codec.WireFormatInfoMarshaledSizeTest; 20 | 21 | /** 22 | * Test marshaling with WireFormatInfo for this Version. 23 | */ 24 | public class WireFormatInfoV2MarshaledSizeTest extends WireFormatInfoMarshaledSizeTest { 25 | 26 | @Override 27 | public int getVersion() { 28 | return 2; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /openwire-interop-tests/src/test/java/org/apache/activemq/openwire/codec/v3/WireFormatInfoV3MarshaledSizeTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.codec.v3; 18 | 19 | import org.apache.activemq.openwire.codec.WireFormatInfoMarshaledSizeTest; 20 | 21 | /** 22 | * Test marshaling with WireFormatInfo for this Version. 23 | */ 24 | public class WireFormatInfoV3MarshaledSizeTest extends WireFormatInfoMarshaledSizeTest { 25 | 26 | @Override 27 | public int getVersion() { 28 | return 3; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /openwire-interop-tests/src/test/java/org/apache/activemq/openwire/codec/v4/WireFormatInfoV4MarshaledSizeTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.codec.v4; 18 | 19 | import org.apache.activemq.openwire.codec.WireFormatInfoMarshaledSizeTest; 20 | 21 | /** 22 | * Test marshaling with WireFormatInfo for this Version. 23 | */ 24 | public class WireFormatInfoV4MarshaledSizeTest extends WireFormatInfoMarshaledSizeTest { 25 | 26 | @Override 27 | public int getVersion() { 28 | return 4; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /openwire-interop-tests/src/test/java/org/apache/activemq/openwire/codec/v5/WireFormatInfoV5MarshaledSizeTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.codec.v5; 18 | 19 | import org.apache.activemq.openwire.codec.WireFormatInfoMarshaledSizeTest; 20 | 21 | /** 22 | * Test marshaling with WireFormatInfo for this Version. 23 | */ 24 | public class WireFormatInfoV5MarshaledSizeTest extends WireFormatInfoMarshaledSizeTest { 25 | 26 | @Override 27 | public int getVersion() { 28 | return 5; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /openwire-interop-tests/src/test/java/org/apache/activemq/openwire/codec/v6/WireFormatInfoV6MarshaledSizeTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.codec.v6; 18 | 19 | import org.apache.activemq.openwire.codec.WireFormatInfoMarshaledSizeTest; 20 | 21 | /** 22 | * Test marshaling with WireFormatInfo for this Version. 23 | */ 24 | public class WireFormatInfoV6MarshaledSizeTest extends WireFormatInfoMarshaledSizeTest { 25 | 26 | @Override 27 | public int getVersion() { 28 | return 6; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /openwire-interop-tests/src/test/java/org/apache/activemq/openwire/codec/v7/WireFormatInfoV7MarshaledSizeTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.codec.v7; 18 | 19 | import org.apache.activemq.openwire.codec.WireFormatInfoMarshaledSizeTest; 20 | 21 | /** 22 | * Test marshaling with WireFormatInfo for this Version. 23 | */ 24 | public class WireFormatInfoV7MarshaledSizeTest extends WireFormatInfoMarshaledSizeTest { 25 | 26 | @Override 27 | public int getVersion() { 28 | return 7; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /openwire-interop-tests/src/test/java/org/apache/activemq/openwire/codec/v8/WireFormatInfoV8MarshaledSizeTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.codec.v8; 18 | 19 | import org.apache.activemq.openwire.codec.WireFormatInfoMarshaledSizeTest; 20 | 21 | /** 22 | * Test marshaling with WireFormatInfo for this Version. 23 | */ 24 | public class WireFormatInfoV8MarshaledSizeTest extends WireFormatInfoMarshaledSizeTest { 25 | 26 | @Override 27 | public int getVersion() { 28 | return 8; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /openwire-interop-tests/src/test/java/org/apache/activemq/openwire/codec/v9/WireFormatInfoV9MarshaledSizeTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.codec.v9; 18 | 19 | import org.apache.activemq.openwire.codec.WireFormatInfoMarshaledSizeTest; 20 | 21 | /** 22 | * Test marshaling with WireFormatInfo for this Version. 23 | */ 24 | public class WireFormatInfoV9MarshaledSizeTest extends WireFormatInfoMarshaledSizeTest { 25 | 26 | @Override 27 | public int getVersion() { 28 | return 9; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /openwire-interop-tests/src/test/java/org/apache/activemq/openwire/codec/v10/WireFormatInfoV10MarshaledSizeTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.codec.v10; 18 | 19 | import org.apache.activemq.openwire.codec.WireFormatInfoMarshaledSizeTest; 20 | 21 | /** 22 | * Test marshaling with WireFormatInfo for this Version. 23 | */ 24 | public class WireFormatInfoV10MarshaledSizeTest extends WireFormatInfoMarshaledSizeTest { 25 | 26 | @Override 27 | public int getVersion() { 28 | return 10; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /openwire-interop-tests/src/test/java/org/apache/activemq/openwire/codec/v11/WireFormatInfoV11MarshaledSizeTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.codec.v11; 18 | 19 | import org.apache.activemq.openwire.codec.WireFormatInfoMarshaledSizeTest; 20 | 21 | /** 22 | * Test marshaling with WireFormatInfo for this Version. 23 | */ 24 | public class WireFormatInfoV11MarshaledSizeTest extends WireFormatInfoMarshaledSizeTest { 25 | 26 | @Override 27 | public int getVersion() { 28 | return 11; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /openwire-interop-tests/src/test/java/org/apache/activemq/openwire/codec/v12/WireFormatInfoV12MarshaledSizeTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.codec.v12; 18 | 19 | import org.apache.activemq.openwire.codec.WireFormatInfoMarshaledSizeTest; 20 | 21 | /** 22 | * Test marshaling with WireFormatInfo for this Version. 23 | */ 24 | public class WireFormatInfoV12MarshaledSizeTest extends WireFormatInfoMarshaledSizeTest { 25 | 26 | @Override 27 | public int getVersion() { 28 | return 12; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /openwire-annotations/src/main/java/org/apache/activemq/openwire/annotations/OpenWireType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.annotations; 18 | 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | @Retention(RetentionPolicy.RUNTIME) 25 | @Target({ElementType.TYPE}) 26 | public @interface OpenWireType { 27 | 28 | int typeCode(); 29 | 30 | int version() default 1; 31 | 32 | boolean marshalAware() default false; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /openwire-generator/src/test/java/org/apache/activenq/openwire/generator/IDERunner.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activenq.openwire.generator; 18 | 19 | import org.apache.activemq.openwire.generator.GeneratorTask; 20 | 21 | /** 22 | * Runs the Generator Task from the IDE, output to target. 23 | */ 24 | public class IDERunner { 25 | 26 | public static void main(String[] args) throws Exception { 27 | 28 | GeneratorTask task = new GeneratorTask(); 29 | 30 | task.setBaseDir("./target/generated-sources/openwire"); 31 | 32 | task.execute(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /openwire-interop-tests/src/test/java/org/apache/activemq/openwire/codec/v1/OpenWireV1Test.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.codec.v1; 18 | 19 | import org.apache.activemq.openwire.codec.OpenWireInteropTests; 20 | 21 | public class OpenWireV1Test extends OpenWireInteropTests { 22 | 23 | /** 24 | * @param tightEncodingEnabled 25 | */ 26 | public OpenWireV1Test(boolean tightEncodingEnabled) { 27 | super(tightEncodingEnabled); 28 | } 29 | 30 | @Override 31 | protected int getOpenWireVersion() { 32 | return 1; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /openwire-interop-tests/src/test/java/org/apache/activemq/openwire/codec/v2/OpenWireV2Test.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.codec.v2; 18 | 19 | import org.apache.activemq.openwire.codec.OpenWireInteropTests; 20 | 21 | public class OpenWireV2Test extends OpenWireInteropTests { 22 | 23 | /** 24 | * @param tightEncodingEnabled 25 | */ 26 | public OpenWireV2Test(boolean tightEncodingEnabled) { 27 | super(tightEncodingEnabled); 28 | } 29 | 30 | @Override 31 | protected int getOpenWireVersion() { 32 | return 2; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /openwire-interop-tests/src/test/java/org/apache/activemq/openwire/codec/v3/OpenWireV3Test.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.codec.v3; 18 | 19 | import org.apache.activemq.openwire.codec.OpenWireInteropTests; 20 | 21 | public class OpenWireV3Test extends OpenWireInteropTests { 22 | 23 | /** 24 | * @param tightEncodingEnabled 25 | */ 26 | public OpenWireV3Test(boolean tightEncodingEnabled) { 27 | super(tightEncodingEnabled); 28 | } 29 | 30 | @Override 31 | protected int getOpenWireVersion() { 32 | return 3; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /openwire-interop-tests/src/test/java/org/apache/activemq/openwire/codec/v4/OpenWireV4Test.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.codec.v4; 18 | 19 | import org.apache.activemq.openwire.codec.OpenWireInteropTests; 20 | 21 | public class OpenWireV4Test extends OpenWireInteropTests { 22 | 23 | /** 24 | * @param tightEncodingEnabled 25 | */ 26 | public OpenWireV4Test(boolean tightEncodingEnabled) { 27 | super(tightEncodingEnabled); 28 | } 29 | 30 | @Override 31 | protected int getOpenWireVersion() { 32 | return 4; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /openwire-interop-tests/src/test/java/org/apache/activemq/openwire/codec/v5/OpenWireV5Test.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.codec.v5; 18 | 19 | import org.apache.activemq.openwire.codec.OpenWireInteropTests; 20 | 21 | public class OpenWireV5Test extends OpenWireInteropTests { 22 | 23 | /** 24 | * @param tightEncodingEnabled 25 | */ 26 | public OpenWireV5Test(boolean tightEncodingEnabled) { 27 | super(tightEncodingEnabled); 28 | } 29 | 30 | @Override 31 | protected int getOpenWireVersion() { 32 | return 5; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /openwire-interop-tests/src/test/java/org/apache/activemq/openwire/codec/v6/OpenWireV6Test.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.codec.v6; 18 | 19 | import org.apache.activemq.openwire.codec.OpenWireInteropTests; 20 | 21 | public class OpenWireV6Test extends OpenWireInteropTests { 22 | 23 | /** 24 | * @param tightEncodingEnabled 25 | */ 26 | public OpenWireV6Test(boolean tightEncodingEnabled) { 27 | super(tightEncodingEnabled); 28 | } 29 | 30 | @Override 31 | protected int getOpenWireVersion() { 32 | return 6; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /openwire-interop-tests/src/test/java/org/apache/activemq/openwire/codec/v7/OpenWireV7Test.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.codec.v7; 18 | 19 | import org.apache.activemq.openwire.codec.OpenWireInteropTests; 20 | 21 | public class OpenWireV7Test extends OpenWireInteropTests { 22 | 23 | /** 24 | * @param tightEncodingEnabled 25 | */ 26 | public OpenWireV7Test(boolean tightEncodingEnabled) { 27 | super(tightEncodingEnabled); 28 | } 29 | 30 | @Override 31 | protected int getOpenWireVersion() { 32 | return 7; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /openwire-interop-tests/src/test/java/org/apache/activemq/openwire/codec/v8/OpenWireV8Test.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.codec.v8; 18 | 19 | import org.apache.activemq.openwire.codec.OpenWireInteropTests; 20 | 21 | public class OpenWireV8Test extends OpenWireInteropTests { 22 | 23 | /** 24 | * @param tightEncodingEnabled 25 | */ 26 | public OpenWireV8Test(boolean tightEncodingEnabled) { 27 | super(tightEncodingEnabled); 28 | } 29 | 30 | @Override 31 | protected int getOpenWireVersion() { 32 | return 8; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /openwire-interop-tests/src/test/java/org/apache/activemq/openwire/codec/v9/OpenWireV9Test.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.codec.v9; 18 | 19 | import org.apache.activemq.openwire.codec.OpenWireInteropTests; 20 | 21 | public class OpenWireV9Test extends OpenWireInteropTests { 22 | 23 | /** 24 | * @param tightEncodingEnabled 25 | */ 26 | public OpenWireV9Test(boolean tightEncodingEnabled) { 27 | super(tightEncodingEnabled); 28 | } 29 | 30 | @Override 31 | protected int getOpenWireVersion() { 32 | return 9; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /openwire-interop-tests/src/test/java/org/apache/activemq/openwire/codec/v10/OpenWireV10Test.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.codec.v10; 18 | 19 | import org.apache.activemq.openwire.codec.OpenWireInteropTests; 20 | 21 | public class OpenWireV10Test extends OpenWireInteropTests { 22 | 23 | /** 24 | * @param tightEncodingEnabled 25 | */ 26 | public OpenWireV10Test(boolean tightEncodingEnabled) { 27 | super(tightEncodingEnabled); 28 | } 29 | 30 | @Override 31 | protected int getOpenWireVersion() { 32 | return 10; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /openwire-interop-tests/src/test/java/org/apache/activemq/openwire/codec/v11/OpenWireV11Test.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.codec.v11; 18 | 19 | import org.apache.activemq.openwire.codec.OpenWireInteropTests; 20 | 21 | public class OpenWireV11Test extends OpenWireInteropTests { 22 | 23 | /** 24 | * @param tightEncodingEnabled 25 | */ 26 | public OpenWireV11Test(boolean tightEncodingEnabled) { 27 | super(tightEncodingEnabled); 28 | } 29 | 30 | @Override 31 | protected int getOpenWireVersion() { 32 | return 11; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /openwire-core/src/main/java/org/apache/activemq/openwire/commands/MarshallAware.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.commands; 18 | 19 | import java.io.IOException; 20 | 21 | import org.apache.activemq.openwire.codec.OpenWireFormat; 22 | 23 | public interface MarshallAware { 24 | 25 | void beforeMarshall(OpenWireFormat wireFormat) throws IOException; 26 | 27 | void afterMarshall(OpenWireFormat wireFormat) throws IOException; 28 | 29 | void beforeUnmarshall(OpenWireFormat wireFormat) throws IOException; 30 | 31 | void afterUnmarshall(OpenWireFormat wireFormat) throws IOException; 32 | 33 | } 34 | -------------------------------------------------------------------------------- /openwire-core/src/main/java/org/apache/activemq/openwire/commands/TransactionId.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.commands; 18 | 19 | import org.apache.activemq.openwire.annotations.OpenWireType; 20 | 21 | /** 22 | * @openwire:marshaller 23 | */ 24 | @OpenWireType(typeCode = 0) 25 | public abstract class TransactionId implements DataStructure { 26 | 27 | public abstract boolean isXATransaction(); 28 | public abstract boolean isLocalTransaction(); 29 | public abstract String getTransactionKey(); 30 | 31 | @Override 32 | public boolean isMarshallAware() { 33 | return false; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /openwire-website/src/community/support.page: -------------------------------------------------------------------------------- 1 | --- 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | title: Support 18 | in_menu: true 19 | sort_info: 55 20 | --- name:overview 21 | 22 | # You Are Not Alone 23 | We can help! 24 | 25 | --- name:content 26 | 27 | You may find the [Frequently Asked Questions (FAQ)](faq.html) useful. 28 | 29 | We love feedback of all kinds; whether it's thoughts, ideas, suggestions 30 | or bug reports! 31 | 32 | To submit feedback please contact the [community](index.html), 33 | or use the [${project_name} Issue Tracker](${project_issue_url}). 34 | 35 | ### See Also 36 | 37 | * [FAQ](faq.html) 38 | * [Community](index.html) 39 | * [Issue Tracker](${project_issue_url}) 40 | -------------------------------------------------------------------------------- /openwire-website/src/community/developers.page: -------------------------------------------------------------------------------- 1 | --- 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | title: Developers 18 | in_menu: false 19 | --- name:overview 20 | 21 | # Developers 22 | Ready to start hacking on ${project_name}? 23 | 24 | --- name:content 25 | 26 | # Developer Links 27 | 28 | * [Source Code](source.html) 29 | * [Building](building.html) 30 | * [Contributing](contributing.html) 31 | * [Release Guide](release-guide.html) 32 | * [Maven Site Reports](${website_base_url}/versions/${project_version}/maven/) 33 | 34 | # API Reference 35 | 36 | * [`openwire-core` API](../documentation/api/openwire-core/index.html) 37 | 38 | Looking for the website documentation of a different ${project_name} [version](${website_base_url}/versions/index.html)? 39 | -------------------------------------------------------------------------------- /openwire-website/src/blog/index.page: -------------------------------------------------------------------------------- 1 | --- 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | title: The ${project_name} Blog 18 | in_menu: false 19 | sort_info: 7 20 | 21 | --- name:head pipeline:ssp 22 | 23 | 24 | --- name:overview 25 | 26 | The latest and greatest news from the ${project_name} team 27 | 28 | --- name:blog pipeline:jade 29 | 30 | :ssp 31 |

${project_name} Blog

32 | 33 | - import org.fusesource.scalate.page.BlogHelper._ 34 | - for(post <- posts) 35 | .post 36 | a(href={post.link}) 37 | h2= post.title 38 | .details Posted by #{post.author} on #{post.createdAt} 39 | !~~ post.render() -------------------------------------------------------------------------------- /openwire-annotations/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 4.0.0 20 | 21 | org.apache.activemq 22 | openwire-protocol 23 | 1.0.0-SNAPSHOT 24 | 25 | 26 | openwire-annotations 27 | openwire-annotations 28 | The main OpenWire protocol implementation providing current versions of the codec. 29 | jar 30 | 31 | 32 | -------------------------------------------------------------------------------- /openwire-website/src/versions/index.page: -------------------------------------------------------------------------------- 1 | --- 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | title: Website Versions 18 | in_menu: false 19 | sort_info: 5 20 | 21 | --- name:content pipeline:ssp,jade 22 | 23 | :markdown 24 | # Released Websites 25 | 26 | We version our website content along with the project so that you 27 | can easily get to the documentation that's most appropriate for the 28 | version of the project your using. 29 | 30 | ul 31 | - for( version <- project_versions ) 32 | li 33 | a(href = "#{website_base_url}/versions/#{version}/website/index.html") #{version} Website 34 | 35 | :markdown 36 | # Nightly Development Snapshots 37 | 38 | * [${project_snapshot_version} Website](${website_base_url}/versions/${project_snapshot_version}/website/index.html) 39 | -------------------------------------------------------------------------------- /openwire-annotations/src/main/java/org/apache/activemq/openwire/annotations/OpenWireDocumentation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.annotations; 18 | 19 | import java.lang.annotation.Retention; 20 | import java.lang.annotation.RetentionPolicy; 21 | 22 | /** 23 | * Used to add documentation notes to an OpenWire command or one its properties. 24 | */ 25 | @Retention(RetentionPolicy.RUNTIME) 26 | public @interface OpenWireDocumentation { 27 | 28 | /** 29 | * @return a quick one sentence description of the element. 30 | */ 31 | String shortDescription(); 32 | 33 | /** 34 | * @return a longer more thorough description of the element. 35 | */ 36 | String longDescription() default ""; 37 | 38 | } 39 | -------------------------------------------------------------------------------- /openwire-generator/src/main/java/org/apache/activemq/openwire/generator/Generators.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.generator; 18 | 19 | import java.util.ArrayList; 20 | import java.util.List; 21 | 22 | import org.apache.activemq.openwire.generator.builtin.UniversalMarshallerFactoryGenerator; 23 | import org.apache.activemq.openwire.generator.builtin.UniversalMarshallerGenerator; 24 | 25 | /** 26 | * Directory of all generators in this library. 27 | */ 28 | public class Generators { 29 | 30 | public static List BUILTIN = new ArrayList(); 31 | 32 | static { 33 | BUILTIN.add(new UniversalMarshallerGenerator()); 34 | BUILTIN.add(new UniversalMarshallerFactoryGenerator()); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /openwire-annotations/src/main/java/org/apache/activemq/openwire/annotations/OpenWireProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.annotations; 18 | 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * Defines the annotation value for the properties of an OpenWire data type. 26 | */ 27 | @Retention(RetentionPolicy.RUNTIME) 28 | @Target({ElementType.FIELD}) 29 | public @interface OpenWireProperty { 30 | 31 | int version(); 32 | 33 | int sequence(); 34 | 35 | boolean cached() default false; 36 | 37 | boolean serialized() default true; 38 | 39 | boolean mandatory() default false; 40 | 41 | int size() default 0; 42 | 43 | } 44 | -------------------------------------------------------------------------------- /openwire-core/src/main/java/org/apache/activemq/openwire/commands/ShutdownInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.commands; 18 | 19 | import org.apache.activemq.openwire.annotations.OpenWireType; 20 | 21 | /** 22 | * @openwire:marshaller code="11" 23 | */ 24 | @OpenWireType(typeCode = 11) 25 | public class ShutdownInfo extends BaseCommand { 26 | 27 | public static final byte DATA_STRUCTURE_TYPE = CommandTypes.SHUTDOWN_INFO; 28 | 29 | @Override 30 | public byte getDataStructureType() { 31 | return DATA_STRUCTURE_TYPE; 32 | } 33 | 34 | @Override 35 | public Response visit(CommandVisitor visitor) throws Exception { 36 | return visitor.processShutdown(this); 37 | } 38 | 39 | @Override 40 | public boolean isShutdownInfo() { 41 | return true; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /openwire-core/src/main/java/org/apache/activemq/openwire/commands/FlushCommand.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.commands; 18 | 19 | import org.apache.activemq.openwire.annotations.OpenWireType; 20 | 21 | /** 22 | * An indication to the transport layer that a flush is required. 23 | * 24 | * @openwire:marshaller code="15" 25 | */ 26 | @OpenWireType(typeCode = 15) 27 | public class FlushCommand extends BaseCommand { 28 | 29 | public static final byte DATA_STRUCTURE_TYPE = CommandTypes.FLUSH_COMMAND; 30 | public static final Command COMMAND = new FlushCommand(); 31 | 32 | @Override 33 | public byte getDataStructureType() { 34 | return DATA_STRUCTURE_TYPE; 35 | } 36 | 37 | @Override 38 | public Response visit(CommandVisitor visitor) throws Exception { 39 | return visitor.processFlush(this); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /openwire-annotations/src/main/java/org/apache/activemq/openwire/annotations/OpenWireExtension.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.annotations; 18 | 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * Defines the annotation value to use to describes any extensions 26 | * to a given OpenWire data type that is not part of the marshaled 27 | * data for that type. 28 | */ 29 | @Retention(RetentionPolicy.RUNTIME) 30 | @Target({ElementType.FIELD}) 31 | public @interface OpenWireExtension { 32 | 33 | /** 34 | * Defines if the extension is transient or not. 35 | * 36 | * @return true if the value should not be marked as transient. 37 | */ 38 | boolean serialized() default false; 39 | 40 | } 41 | -------------------------------------------------------------------------------- /openwire-website/src/index.page: -------------------------------------------------------------------------------- 1 | --- 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | title: OpenWire 17 | --- name:overview pipeline:jade 18 | 19 | h1 OpenWire #{project_version} 20 | 21 | | #{project_slogan} 22 | 23 | --- name:content pipeline:markdown 24 | 25 | [ActiveMQ OpenWire](http://activemq.apache.org/openwire/) is a stand-alone 26 | library that provides the implementation of the native wire protocol used by 27 | [ActiveMQ](http://activemq.apache.org) and its various client libraries. 28 | 29 | ## Features 30 | 31 | * Small Core module with latest codecs only 32 | * External legacy module with support for all past OpenWire Versions. 33 | * JMS Wrappers around the OpenWire message types 34 | * Tight or loose encoding at the wire level for small or fast marshaling. 35 | * Message body compression. 36 | 37 | ## Documentation 38 | 39 | * [Getting Started Guide](documentation/getting-started.html) 40 | * [OpenWire Protocol Manual](documentation/openwire-manual.html) 41 | 42 | 43 | -------------------------------------------------------------------------------- /openwire-core/src/main/java/org/apache/activemq/openwire/commands/DataStructure.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.commands; 18 | 19 | /** 20 | * Base class for all the OpenWire commands and resource objects. 21 | */ 22 | public interface DataStructure { 23 | 24 | /** 25 | * @return The type of the data structure 26 | */ 27 | byte getDataStructureType(); 28 | 29 | /** 30 | * Returns true when a Data Structure instance want to be made aware of the 31 | * marshaling events associated with send and receive of the command. 32 | * 33 | * Any instance that is marshal aware will implement the MarshalAware interface 34 | * however this method provides a shortcut that can be faster than a direct 35 | * instance of check on each marshaled object. 36 | * 37 | * @return if the data structure is marshal aware. 38 | */ 39 | boolean isMarshallAware(); 40 | } 41 | -------------------------------------------------------------------------------- /openwire-interop-tests/src/test/java/org/apache/activemq/openwire/util/TransportListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.util; 18 | 19 | import java.io.IOException; 20 | 21 | /** 22 | * An asynchronous listener of commands 23 | */ 24 | public interface TransportListener { 25 | 26 | /** 27 | * called to process a command 28 | * 29 | * @param command 30 | */ 31 | void onCommand(Object command); 32 | 33 | /** 34 | * An unrecoverable exception has occurred on the transport 35 | * 36 | * @param error 37 | */ 38 | void onException(IOException error); 39 | 40 | /** 41 | * The transport has suffered an interruption from which it hopes to recover 42 | * 43 | */ 44 | void transportInterupted(); 45 | 46 | /** 47 | * The transport has resumed after an interruption 48 | * 49 | */ 50 | void transportResumed(); 51 | 52 | } 53 | -------------------------------------------------------------------------------- /openwire-website/src/documentation/getting-started.md: -------------------------------------------------------------------------------- 1 | 18 | # Getting Started Guide 19 | 20 | {:toc:2-5} 21 | 22 | This guide will help you get started using the OpenWire protocol library in your own applications. 23 | 24 | ## Maven dependencies 25 | 26 | To use the openwire library in your maven projects you need to add a dependency to your maven POM file for the core openwire library as follows: 27 | 28 | 29 | org.apache.activemq 30 | openwire-core 31 | ${project_version} 32 | 33 | 34 | If you need to communicate with client's or brokers using older versions of the protocol then you must also include the legacy codec module: 35 | 36 | 37 | org.apache.activemq 38 | openwire-legacy 39 | ${project_version} 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /openwire-core/src/main/java/org/apache/activemq/openwire/commands/LastPartialCommand.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.commands; 18 | 19 | import org.apache.activemq.openwire.annotations.OpenWireType; 20 | 21 | /** 22 | * Represents the end marker of a stream of {@link PartialCommand} instances. 23 | * 24 | * @openwire:marshaller code="61" 25 | */ 26 | @OpenWireType(typeCode = 61) 27 | public class LastPartialCommand extends PartialCommand { 28 | 29 | public static final byte DATA_STRUCTURE_TYPE = CommandTypes.PARTIAL_LAST_COMMAND; 30 | 31 | public LastPartialCommand() { 32 | } 33 | 34 | @Override 35 | public byte getDataStructureType() { 36 | return DATA_STRUCTURE_TYPE; 37 | } 38 | 39 | @Override 40 | public Response visit(CommandVisitor visitor) throws Exception { 41 | throw new IllegalStateException("The transport layer should filter out LastPartialCommand instances but received: " + this); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /openwire-core/src/main/java/org/apache/activemq/openwire/codec/DataStreamMarshaller.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.codec; 18 | 19 | import java.io.DataInput; 20 | import java.io.DataOutput; 21 | import java.io.IOException; 22 | 23 | import org.apache.activemq.openwire.commands.DataStructure; 24 | 25 | public interface DataStreamMarshaller { 26 | 27 | byte getDataStructureType(); 28 | 29 | DataStructure createObject(); 30 | 31 | int tightMarshal1(OpenWireFormat format, Object c, BooleanStream bs) throws IOException; 32 | 33 | void tightMarshal2(OpenWireFormat format, Object c, DataOutput ds, BooleanStream bs) throws IOException; 34 | 35 | void tightUnmarshal(OpenWireFormat format, Object data, DataInput dis, BooleanStream bs) throws IOException; 36 | 37 | void looseMarshal(OpenWireFormat format, Object c, DataOutput ds) throws IOException; 38 | 39 | void looseUnmarshal(OpenWireFormat format, Object data, DataInput dis) throws IOException; 40 | 41 | } 42 | -------------------------------------------------------------------------------- /openwire-website/src/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 25 | 26 | Website 27 | 28 | 29 | TemplateEngineFilter 30 | org.fusesource.scalate.servlet.TemplateEngineFilter 31 | 32 | 33 | TemplateEngineFilter 34 | /* 35 | 36 | 37 | 38 | index.page 39 | 40 | 41 | 42 | 500 43 | /WEB-INF/scalate/errors/500.scaml 44 | 45 | 46 | -------------------------------------------------------------------------------- /openwire-core/src/main/java/org/apache/activemq/openwire/commands/OpenWireQueue.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.commands; 18 | 19 | import org.apache.activemq.openwire.annotations.OpenWireType; 20 | 21 | @OpenWireType(typeCode = 100) 22 | public class OpenWireQueue extends OpenWireDestination { 23 | 24 | public static final byte DATA_STRUCTURE_TYPE = CommandTypes.OPENWIRE_QUEUE; 25 | 26 | public OpenWireQueue() { 27 | } 28 | 29 | public OpenWireQueue(String name) { 30 | super(name); 31 | } 32 | 33 | @Override 34 | public byte getDataStructureType() { 35 | return DATA_STRUCTURE_TYPE; 36 | } 37 | 38 | @Override 39 | public boolean isQueue() { 40 | return true; 41 | } 42 | 43 | @Override 44 | public byte getDestinationType() { 45 | return QUEUE_TYPE; 46 | } 47 | 48 | @Override 49 | protected String getQualifiedPrefix() { 50 | return QUEUE_QUALIFIED_PREFIX; 51 | } 52 | 53 | public String getQueueName() { 54 | return getPhysicalName(); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /openwire-core/src/main/java/org/apache/activemq/openwire/commands/OpenWireTopic.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.commands; 18 | 19 | import org.apache.activemq.openwire.annotations.OpenWireType; 20 | 21 | @OpenWireType(typeCode = 101) 22 | public class OpenWireTopic extends OpenWireDestination { 23 | 24 | public static final byte DATA_STRUCTURE_TYPE = CommandTypes.OPENWIRE_TOPIC; 25 | 26 | public OpenWireTopic() { 27 | } 28 | 29 | public OpenWireTopic(String name) { 30 | super(name); 31 | } 32 | 33 | @Override 34 | public byte getDataStructureType() { 35 | return DATA_STRUCTURE_TYPE; 36 | } 37 | 38 | @Override 39 | public boolean isTopic() { 40 | return true; 41 | } 42 | 43 | public String getTopicName() { 44 | return getPhysicalName(); 45 | } 46 | 47 | @Override 48 | public byte getDestinationType() { 49 | return TOPIC_TYPE; 50 | } 51 | 52 | @Override 53 | protected String getQualifiedPrefix() { 54 | return TOPIC_QUALIFIED_PREFIX; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /openwire-core/src/main/java/org/apache/activemq/openwire/commands/IntegerResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.commands; 18 | 19 | import org.apache.activemq.openwire.annotations.OpenWireType; 20 | import org.apache.activemq.openwire.annotations.OpenWireProperty; 21 | 22 | /** 23 | * @openwire:marshaller code="34" 24 | */ 25 | @OpenWireType(typeCode = 34) 26 | public class IntegerResponse extends Response { 27 | 28 | public static final byte DATA_STRUCTURE_TYPE = CommandTypes.INTEGER_RESPONSE; 29 | 30 | @OpenWireProperty(version = 1, sequence = 1) 31 | int result; 32 | 33 | public IntegerResponse() { 34 | } 35 | 36 | public IntegerResponse(int result) { 37 | this.result = result; 38 | } 39 | 40 | @Override 41 | public byte getDataStructureType() { 42 | return DATA_STRUCTURE_TYPE; 43 | } 44 | 45 | /** 46 | * @openwire:property version=1 47 | */ 48 | public int getResult() { 49 | return result; 50 | } 51 | 52 | public void setResult(int result) { 53 | this.result = result; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /openwire-core/src/main/java/org/apache/activemq/openwire/commands/DataResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.commands; 18 | 19 | import org.apache.activemq.openwire.annotations.OpenWireType; 20 | import org.apache.activemq.openwire.annotations.OpenWireProperty; 21 | 22 | /** 23 | * @openwire:marshaller code="32" 24 | */ 25 | @OpenWireType(typeCode = 32) 26 | public class DataResponse extends Response { 27 | 28 | public static final byte DATA_STRUCTURE_TYPE = CommandTypes.DATA_RESPONSE; 29 | 30 | @OpenWireProperty(version = 1, sequence = 1) 31 | DataStructure data; 32 | 33 | public DataResponse() { 34 | } 35 | 36 | public DataResponse(DataStructure data) { 37 | this.data = data; 38 | } 39 | 40 | @Override 41 | public byte getDataStructureType() { 42 | return DATA_STRUCTURE_TYPE; 43 | } 44 | 45 | /** 46 | * @openwire:property version=1 47 | */ 48 | public DataStructure getData() { 49 | return data; 50 | } 51 | 52 | public void setData(DataStructure data) { 53 | this.data = data; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /openwire-core/src/main/java/org/apache/activemq/openwire/commands/DataArrayResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.commands; 18 | 19 | import org.apache.activemq.openwire.annotations.OpenWireType; 20 | import org.apache.activemq.openwire.annotations.OpenWireProperty; 21 | 22 | /** 23 | * @openwire:marshaller code="33" 24 | */ 25 | @OpenWireType(typeCode = 33) 26 | public class DataArrayResponse extends Response { 27 | 28 | public static final byte DATA_STRUCTURE_TYPE = CommandTypes.DATA_ARRAY_RESPONSE; 29 | 30 | @OpenWireProperty(version = 1, sequence = 1) 31 | DataStructure data[]; 32 | 33 | public DataArrayResponse() { 34 | } 35 | 36 | public DataArrayResponse(DataStructure data[]) { 37 | this.data = data; 38 | } 39 | 40 | @Override 41 | public byte getDataStructureType() { 42 | return DATA_STRUCTURE_TYPE; 43 | } 44 | 45 | /** 46 | * @openwire:property version=1 47 | */ 48 | public DataStructure[] getData() { 49 | return data; 50 | } 51 | 52 | public void setData(DataStructure[] data) { 53 | this.data = data; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /openwire-website/src/documentation/module-organization.page: -------------------------------------------------------------------------------- 1 | --- 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | title: Module Organization 18 | --- name:overview 19 | 20 | ${project_slogan} 21 | 22 | --- name:content pipeline:markdown 23 | 24 | # Module Organization 25 | 26 | ActiveMQ OpenWire is composed of many loosely coupled jar files. This helps 27 | maintain a clear separations of concerns between the modules and allows 28 | end users to end up with smaller footprint configurations if they don't 29 | need all the optional features of the project. 30 | 31 | ## OpenWire Core 32 | 33 | The core library contains the OpenWire Command objects and a set marshalers that 34 | implement the initial 1.0 OpenWire protocol as well as the two most recent version 35 | marshalers for the protocol. This allows for a small library to be used when you 36 | only need to talk to the most up to date Broker instances. 37 | 38 | ## OpenWire Legacy 39 | 40 | The module provides all remaining protocol marshalers for versions of OpenWire that 41 | are no longer in common use. If you need to communicate with an older broker instance 42 | then you might need to include this library in order to communicate properly. 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /openwire-website/src/blog/releases/release-1.0.page: -------------------------------------------------------------------------------- 1 | --- 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | blog_post: true 18 | title: ActiveMQ OpenWire 1.0 19 | author: Timothy Bish 20 | author_url: http://activemq.apache.org 21 | created_at: 2012-02-02 12:06:40 -0000 22 | --- 23 | 24 | The [Apache ActiveMQ Project](http://activemq.apache.org) is pleased to announce the 25 | availability of OpenWire 1.0. ActiveMQ OpenWire is an implementation of ActiveMQ's own 26 | native wire protocol free of any dependencies on a the message Broker. This library 27 | can be used to implement new clients or brokers that can communicate with ActiveMQ and 28 | its various client libraries. 29 | 30 | OpenWire Features: 31 | 32 | * Tight or Loose wire encoding based on size or speed. 33 | * Message body compression. 34 | * Backwards protocol compatibility. 35 | 36 | Further information: 37 | 38 | * [Download](${website_base_url}/download.html) 39 | * [Issues Fixed](https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12315620&version=12327465) 40 | * [Documentation](${website_base_url}/versions/1.0/website/documentation) 41 | 42 | [Feedback](http://activemq.apache.org/community/index.html) is always welcome! 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /openwire-core/src/main/java/org/apache/activemq/openwire/commands/Command.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.commands; 18 | 19 | /** 20 | * The Command Pattern so that we can send and receive commands on the different 21 | * transports. 22 | */ 23 | public interface Command extends DataStructure { 24 | 25 | void setCommandId(int value); 26 | 27 | /** 28 | * @return the unique ID of this request used to map responses to requests 29 | */ 30 | int getCommandId(); 31 | 32 | void setResponseRequired(boolean responseRequired); 33 | 34 | boolean isResponseRequired(); 35 | 36 | boolean isResponse(); 37 | 38 | boolean isMessageDispatch(); 39 | 40 | boolean isBrokerInfo(); 41 | 42 | boolean isWireFormatInfo(); 43 | 44 | boolean isMessage(); 45 | 46 | boolean isMessageAck(); 47 | 48 | boolean isMessageDispatchNotification(); 49 | 50 | boolean isShutdownInfo(); 51 | 52 | boolean isConnectionControl(); 53 | 54 | boolean isConnectionInfo(); 55 | 56 | boolean isSessionInfo(); 57 | 58 | boolean isProducerInfo(); 59 | 60 | boolean isConsumerInfo(); 61 | 62 | Response visit(CommandVisitor visitor) throws Exception; 63 | 64 | } 65 | -------------------------------------------------------------------------------- /openwire-core/src/main/java/org/apache/activemq/openwire/commands/ControlCommand.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.commands; 18 | 19 | import org.apache.activemq.openwire.annotations.OpenWireType; 20 | import org.apache.activemq.openwire.annotations.OpenWireProperty; 21 | 22 | /** 23 | * Used by the Broker to send a specific named command to the client. 24 | * 25 | * @openwire:marshaller code="14" 26 | */ 27 | @OpenWireType(typeCode = 14) 28 | public class ControlCommand extends BaseCommand { 29 | 30 | public static final byte DATA_STRUCTURE_TYPE = CommandTypes.CONTROL_COMMAND; 31 | 32 | @OpenWireProperty(version = 1, sequence = 1) 33 | private String command; 34 | 35 | @Override 36 | public byte getDataStructureType() { 37 | return DATA_STRUCTURE_TYPE; 38 | } 39 | 40 | /** 41 | * @openwire:property version=1 42 | */ 43 | public String getCommand() { 44 | return command; 45 | } 46 | 47 | public void setCommand(String command) { 48 | this.command = command; 49 | } 50 | 51 | @Override 52 | public Response visit(CommandVisitor visitor) throws Exception { 53 | return visitor.processControlCommand(this); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /openwire-core/src/test/java/org/apache/activemq/openwire/utils/OpenWireMarshallingSupportTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.utils; 18 | 19 | import static org.junit.Assert.assertFalse; 20 | import static org.junit.Assert.assertTrue; 21 | 22 | import java.io.DataInputStream; 23 | 24 | import org.apache.activemq.openwire.buffer.DataByteArrayInputStream; 25 | import org.apache.activemq.openwire.buffer.DataByteArrayOutputStream; 26 | import org.junit.Test; 27 | 28 | public class OpenWireMarshallingSupportTest { 29 | 30 | @Test 31 | public void testMarshalBoolean() throws Exception { 32 | DataByteArrayOutputStream dataOut = new DataByteArrayOutputStream(); 33 | OpenWireMarshallingSupport.marshalBoolean(dataOut, false); 34 | OpenWireMarshallingSupport.marshalBoolean(dataOut, true); 35 | DataByteArrayInputStream input = new DataByteArrayInputStream(dataOut.toBuffer()); 36 | DataInputStream dataIn = new DataInputStream(input); 37 | Boolean result = (Boolean) OpenWireMarshallingSupport.unmarshalPrimitive(dataIn); 38 | assertFalse(result); 39 | result = (Boolean) OpenWireMarshallingSupport.unmarshalPrimitive(dataIn); 40 | assertTrue(result); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /openwire-core/src/main/java/org/apache/activemq/openwire/commands/ExceptionResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.commands; 18 | 19 | import org.apache.activemq.openwire.annotations.OpenWireType; 20 | import org.apache.activemq.openwire.annotations.OpenWireProperty; 21 | 22 | /** 23 | * @openwire:marshaller code="31" 24 | */ 25 | @OpenWireType(typeCode = 31) 26 | public class ExceptionResponse extends Response { 27 | 28 | public static final byte DATA_STRUCTURE_TYPE = CommandTypes.EXCEPTION_RESPONSE; 29 | 30 | @OpenWireProperty(version = 1, sequence = 1) 31 | Throwable exception; 32 | 33 | public ExceptionResponse() { 34 | } 35 | 36 | public ExceptionResponse(Throwable e) { 37 | setException(e); 38 | } 39 | 40 | @Override 41 | public byte getDataStructureType() { 42 | return DATA_STRUCTURE_TYPE; 43 | } 44 | 45 | /** 46 | * @openwire:property version=1 47 | */ 48 | public Throwable getException() { 49 | return exception; 50 | } 51 | 52 | public void setException(Throwable exception) { 53 | this.exception = exception; 54 | } 55 | 56 | @Override 57 | public boolean isException() { 58 | return true; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /openwire-core/src/main/java/org/apache/activemq/openwire/commands/OpenWireTempTopic.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.commands; 18 | 19 | import org.apache.activemq.openwire.annotations.OpenWireType; 20 | 21 | @OpenWireType(typeCode = 103) 22 | public class OpenWireTempTopic extends OpenWireTempDestination { 23 | 24 | public static final byte DATA_STRUCTURE_TYPE = CommandTypes.OPENWIRE_TEMP_TOPIC; 25 | 26 | public OpenWireTempTopic() { 27 | } 28 | 29 | public OpenWireTempTopic(String name) { 30 | super(name); 31 | } 32 | 33 | public OpenWireTempTopic(ConnectionId connectionId, long sequenceId) { 34 | super(connectionId.getValue(), sequenceId); 35 | } 36 | 37 | @Override 38 | public byte getDataStructureType() { 39 | return DATA_STRUCTURE_TYPE; 40 | } 41 | 42 | @Override 43 | public boolean isTopic() { 44 | return true; 45 | } 46 | 47 | @Override 48 | public byte getDestinationType() { 49 | return TEMP_TOPIC_TYPE; 50 | } 51 | 52 | @Override 53 | protected String getQualifiedPrefix() { 54 | return TEMP_TOPIC_QUALIFED_PREFIX; 55 | } 56 | 57 | public String getTopicName() { 58 | return getPhysicalName(); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /openwire-core/src/main/java/org/apache/activemq/openwire/commands/Response.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.commands; 18 | 19 | import org.apache.activemq.openwire.annotations.OpenWireType; 20 | import org.apache.activemq.openwire.annotations.OpenWireProperty; 21 | 22 | /** 23 | * @openwire:marshaller code="30" 24 | */ 25 | @OpenWireType(typeCode = 30) 26 | public class Response extends BaseCommand { 27 | 28 | public static final byte DATA_STRUCTURE_TYPE = CommandTypes.RESPONSE; 29 | 30 | @OpenWireProperty(version = 1, sequence = 1) 31 | int correlationId; 32 | 33 | @Override 34 | public byte getDataStructureType() { 35 | return DATA_STRUCTURE_TYPE; 36 | } 37 | 38 | /** 39 | * @openwire:property version=1 40 | */ 41 | public int getCorrelationId() { 42 | return correlationId; 43 | } 44 | 45 | public void setCorrelationId(int responseId) { 46 | this.correlationId = responseId; 47 | } 48 | 49 | @Override 50 | public boolean isResponse() { 51 | return true; 52 | } 53 | 54 | public boolean isException() { 55 | return false; 56 | } 57 | 58 | @Override 59 | public Response visit(CommandVisitor visitor) throws Exception { 60 | return null; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /openwire-core/src/main/java/org/apache/activemq/openwire/utils/IOExceptionSupport.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.utils; 18 | 19 | import java.io.IOException; 20 | 21 | /** 22 | * Exception support class. 23 | * 24 | * Factory class for creating IOException instances based on String messages or by 25 | * wrapping other causal exceptions. 26 | * 27 | * @since 1.0 28 | */ 29 | public final class IOExceptionSupport { 30 | 31 | private IOExceptionSupport() {} 32 | 33 | public static IOException create(String msg, Throwable cause) { 34 | IOException exception = new IOException(msg); 35 | exception.initCause(cause); 36 | return exception; 37 | } 38 | 39 | public static IOException create(Throwable cause) { 40 | if (cause instanceof IOException) { 41 | return (IOException) cause; 42 | } 43 | 44 | if (cause.getCause() instanceof IOException) { 45 | return (IOException) cause.getCause(); 46 | } 47 | 48 | String msg = cause.getMessage(); 49 | if (msg == null || msg.length() == 0) { 50 | msg = cause.toString(); 51 | } 52 | 53 | IOException exception = new IOException(msg); 54 | exception.initCause(cause); 55 | return exception; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /openwire-core/src/main/java/org/apache/activemq/openwire/utils/OpenWireValidationSupport.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.utils; 18 | 19 | public class OpenWireValidationSupport { 20 | 21 | private static final String jmsPackageToReplace = "javax.jms"; 22 | private static final String jmsPackageToUse = "jakarta.jms"; 23 | 24 | /** 25 | * Verify that the provided class extends {@link Throwable} and throw an 26 | * {@link IllegalArgumentException} if it does not. 27 | * 28 | * @param clazz 29 | */ 30 | public static void validateIsThrowable(Class clazz) { 31 | if (!Throwable.class.isAssignableFrom(clazz)) { 32 | throw new IllegalArgumentException("Class " + clazz + " is not assignable to Throwable"); 33 | } 34 | } 35 | 36 | /** 37 | * This method can be used to convert from javax -> jakarta or 38 | * vice versa depending on the version used by the client 39 | * 40 | * @param className 41 | * @return 42 | */ 43 | public static String convertJmsPackage(String className) { 44 | if (className != null && className.startsWith(jmsPackageToReplace)) { 45 | return className.replace(jmsPackageToReplace, jmsPackageToUse); 46 | } 47 | return className; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /openwire-interop-tests/src/test/java/org/apache/activemq/openwire/util/Wait.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.util; 18 | 19 | import java.util.concurrent.TimeUnit; 20 | 21 | public class Wait { 22 | 23 | public static final long MAX_WAIT_MILLIS = 30 * 1000; 24 | public static final int SLEEP_MILLIS = 1000; 25 | 26 | public interface Condition { 27 | boolean isSatisified() throws Exception; 28 | } 29 | 30 | public static boolean waitFor(Condition condition) throws Exception { 31 | return waitFor(condition, MAX_WAIT_MILLIS); 32 | } 33 | 34 | public static boolean waitFor(final Condition condition, final long duration) throws Exception { 35 | return waitFor(condition, duration, SLEEP_MILLIS); 36 | } 37 | 38 | public static boolean waitFor(final Condition condition, final long duration, final int sleepMillis) throws Exception { 39 | 40 | final long expiry = System.currentTimeMillis() + duration; 41 | boolean conditionSatisified = condition.isSatisified(); 42 | while (!conditionSatisified && System.currentTimeMillis() < expiry) { 43 | TimeUnit.MILLISECONDS.sleep(sleepMillis); 44 | conditionSatisified = condition.isSatisified(); 45 | } 46 | return conditionSatisified; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /openwire-core/src/main/java/org/apache/activemq/openwire/commands/OpenWireTempQueue.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.commands; 18 | 19 | import org.apache.activemq.openwire.annotations.OpenWireType; 20 | 21 | /** 22 | * Represents an OpenWire Temporary Queue. 23 | */ 24 | @OpenWireType(typeCode = 102) 25 | public class OpenWireTempQueue extends OpenWireTempDestination { 26 | 27 | public static final byte DATA_STRUCTURE_TYPE = CommandTypes.OPENWIRE_TEMP_QUEUE; 28 | 29 | public OpenWireTempQueue() { 30 | } 31 | 32 | public OpenWireTempQueue(String name) { 33 | super(name); 34 | } 35 | 36 | public OpenWireTempQueue(ConnectionId connectionId, long sequenceId) { 37 | super(connectionId.getValue(), sequenceId); 38 | } 39 | 40 | @Override 41 | public byte getDataStructureType() { 42 | return DATA_STRUCTURE_TYPE; 43 | } 44 | 45 | @Override 46 | public boolean isQueue() { 47 | return true; 48 | } 49 | 50 | @Override 51 | public byte getDestinationType() { 52 | return TEMP_QUEUE_TYPE; 53 | } 54 | 55 | @Override 56 | protected String getQualifiedPrefix() { 57 | return TEMP_QUEUE_QUALIFED_PREFIX; 58 | } 59 | 60 | public String getQueueName() { 61 | return getPhysicalName(); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /openwire-core/src/test/java/org/apache/activemq/openwire/commands/OpenWireObjectMessageTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.commands; 18 | 19 | import static org.junit.Assert.assertEquals; 20 | import static org.junit.Assert.assertNull; 21 | import static org.junit.Assert.assertTrue; 22 | 23 | import java.io.IOException; 24 | 25 | import org.junit.Test; 26 | 27 | public class OpenWireObjectMessageTest { 28 | 29 | @Test 30 | public void testBytes() throws Exception, IOException { 31 | OpenWireObjectMessage msg = new OpenWireObjectMessage(); 32 | String str = "testText"; 33 | msg.setObject(str); 34 | 35 | msg = msg.copy(); 36 | assertEquals(msg.getObject(), str); 37 | } 38 | 39 | @Test 40 | public void testSetObject() throws Exception { 41 | OpenWireObjectMessage msg = new OpenWireObjectMessage(); 42 | String str = "testText"; 43 | msg.setObject(str); 44 | assertTrue(msg.getObject() == str); 45 | } 46 | 47 | @Test 48 | public void testClearBody() throws Exception { 49 | OpenWireObjectMessage objectMessage = new OpenWireObjectMessage(); 50 | objectMessage.setObject("String"); 51 | objectMessage.clearBody(); 52 | assertNull(objectMessage.getObject()); 53 | objectMessage.setObject("String"); 54 | objectMessage.getObject(); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /openwire-legacy/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 4.0.0 20 | 21 | org.apache.activemq 22 | openwire-protocol 23 | 1.0.0-SNAPSHOT 24 | 25 | 26 | openwire-legacy 27 | openwire-legacy 28 | An OpenWire extension library that contains the legacy OpenWire Codecs 29 | jar 30 | 31 | UTF-8 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | org.apache.activemq 40 | openwire-core 41 | 42 | 43 | 44 | 45 | 46 | 47 | maven-surefire-plugin 48 | 49 | true 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /openwire-core/src/main/java/org/apache/activemq/openwire/commands/JournalTrace.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.commands; 18 | 19 | import org.apache.activemq.openwire.annotations.OpenWireType; 20 | import org.apache.activemq.openwire.annotations.OpenWireProperty; 21 | 22 | /** 23 | * @openwire:marshaller code="53" 24 | */ 25 | @OpenWireType(typeCode = 53) 26 | public class JournalTrace implements DataStructure { 27 | 28 | public static final byte DATA_STRUCTURE_TYPE = CommandTypes.JOURNAL_TRACE; 29 | 30 | @OpenWireProperty(version = 1, sequence = 1) 31 | private String message; 32 | 33 | public JournalTrace() { 34 | } 35 | 36 | public JournalTrace(String message) { 37 | this.message = message; 38 | } 39 | 40 | @Override 41 | public byte getDataStructureType() { 42 | return DATA_STRUCTURE_TYPE; 43 | } 44 | 45 | /** 46 | * @openwire:property version=1 47 | */ 48 | public String getMessage() { 49 | return message; 50 | } 51 | 52 | /** 53 | * @openwire:property version=1 54 | */ 55 | public void setMessage(String message) { 56 | this.message = message; 57 | } 58 | 59 | @Override 60 | public boolean isMarshallAware() { 61 | return false; 62 | } 63 | 64 | @Override 65 | public String toString() { 66 | return getClass().getSimpleName() + " { " + message + " }"; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /openwire-website/src/community/release-guide.page: -------------------------------------------------------------------------------- 1 | --- 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | title: Release Guide 18 | in_menu: false 19 | --- name:overview 20 | 21 | # Release Guide 22 | How to create releases of ${project_name} 23 | 24 | --- name:content 25 | 26 | ## Release Preparation Steps 27 | 28 | Various documentation changes first (which should be done before the release is cut) 29 | 30 | * update the **${project_id}-website/src/main/webapp/download.page** page for this release 31 | * edit the **${project_id}-website/src/main/scala/Website.scala** file and change the **project\_version** values 32 | * blog about the release by creating an entry in **${project_id}-website/src/blog/releases** 33 | * update the changelog.md file, copying and pasting the section the release highlights from the above blog post 34 | * add a link to the **${project_id}-website/src/main/webapp/versions.page** to the new version. 35 | 36 | ## Cutting the release 37 | 38 | * prepare the release 39 | 40 | {pygmentize:: text} 41 | mvn -P release release:prepare 42 | {pygmentize} 43 | 44 | * perform the release 45 | 46 | {pygmentize:: text} 47 | mvn -P release release:perform 48 | {pygmentize} 49 | 50 | * open [Nexus Staging](http://repository.apache.org/index.html#staging) 51 | and close the staged release of #{project_name} 52 | * now start a vote on the mailing lists and if it passes 53 | * promote the closed release in nexus 54 | * announce the release on the [mailing list](index.html) 55 | * drink beers! 56 | -------------------------------------------------------------------------------- /openwire-website/src/privacy-policy.page: -------------------------------------------------------------------------------- 1 | --- 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | title: Privacy Policy 18 | --- name:overview 19 | 20 | {project_slogan:} 21 | 22 | --- name:content 23 | 24 | Information about your use of this website is collected using server access 25 | logs and a tracking cookie. The collected information consists of the 26 | following: 27 | 28 | * The IP address from which you access the website 29 | * The type of browser and operating system you use to access our site 30 | * The date and time you access our site 31 | * The pages you visit 32 | * The addresses of pages from where you followed a link to our site 33 | 34 | Part of this information is gathered using a tracking cookie set by the 35 | [Google Analytics][] service and handled by Google as described in their 36 | [privacy policy][]. See your browser documentation for instructions on how to 37 | disable the cookie if you prefer not to share this data with Google. 38 | 39 | We use the gathered information to help us make our site more useful to 40 | visitors and to better understand how and when our site is used. We do not 41 | track or collect personally identifiable information or associate gathered 42 | data with any personally identifying information from other sources. 43 | 44 | By using this website, you consent to the collection of this data in the 45 | manner and for the purpose described above. 46 | 47 | [Google Analytics]:http://www.google.com/analytics/ 48 | [privacy policy]:http://www.google.com/privacy.html 49 | -------------------------------------------------------------------------------- /openwire-core/src/main/java/org/apache/activemq/openwire/commands/ConnectionError.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.commands; 18 | 19 | import org.apache.activemq.openwire.annotations.OpenWireType; 20 | import org.apache.activemq.openwire.annotations.OpenWireProperty; 21 | 22 | /** 23 | * @openwire:marshaller code="16" 24 | */ 25 | @OpenWireType(typeCode = 16) 26 | public class ConnectionError extends BaseCommand { 27 | 28 | public static final byte DATA_STRUCTURE_TYPE = CommandTypes.CONNECTION_ERROR; 29 | 30 | @OpenWireProperty(version = 1, sequence = 1) 31 | private Throwable exception; 32 | 33 | @OpenWireProperty(version = 1, sequence = 2) 34 | private ConnectionId connectionId; 35 | 36 | @Override 37 | public byte getDataStructureType() { 38 | return DATA_STRUCTURE_TYPE; 39 | } 40 | 41 | @Override 42 | public Response visit(CommandVisitor visitor) throws Exception { 43 | return visitor.processConnectionError(this); 44 | } 45 | 46 | /** 47 | * @openwire:property version=1 48 | */ 49 | public Throwable getException() { 50 | return exception; 51 | } 52 | 53 | public void setException(Throwable exception) { 54 | this.exception = exception; 55 | } 56 | 57 | /** 58 | * @openwire:property version=1 59 | */ 60 | public ConnectionId getConnectionId() { 61 | return connectionId; 62 | } 63 | 64 | public void setConnectionId(ConnectionId connectionId) { 65 | this.connectionId = connectionId; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /openwire-website/src/community/faq.page: -------------------------------------------------------------------------------- 1 | --- 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | title: FAQ 18 | in_menu: false 19 | sort_info: 41 20 | # FYI: 21 | # The fragments processor allows the TOC to generated by the menu tag. 22 | --- name:overview 23 | 24 | # Burning Questions? 25 | 26 | This page contains all the frequently asked questions about the 27 | ${project_name} project. 28 | 29 | --- name:content 30 | 31 | {:toc} 32 | 33 | ## General Questions 34 | 35 | General questions on the *${project_name}* project. 36 | 37 | ### Why the name ${project_name}? 38 | 39 | 40 | ### What is the license? 41 | 42 | The license is [Apache 2 43 | License](http://www.apache.org/licenses/LICENSE-2.0) 44 | 45 | ### How do I get support? 46 | 47 | See the [support guide](support.html) for more details. 48 | 49 | ### How do I build ${project_name}? 50 | 51 | First [get the source](source.html) then see the [building 52 | guide](building.html) 53 | 54 | ### How do I contribute or become a committer? 55 | 56 | We love [contributions](contributing.html)! More details on how to 57 | contribute and how to become a committer are in the [contributing 58 | guide](contributing.html). 59 | 60 | ### How do I register for the issue tracker? 61 | 62 | For more detail see the [support page](support.html). If you haven't done 63 | so already you can [register with the issue tracker 64 | here](https://www.assembla.com/user/signup) 65 | 66 | ### How does the website work? 67 | 68 | For details on how to edit the website and how it works see 69 | [How the Site works](site.html) 70 | 71 | ## Using ${project_name} 72 | 73 | ### How do I get started? 74 | 75 | -------------------------------------------------------------------------------- /openwire-core/src/main/java/org/apache/activemq/openwire/commands/JournalQueueAck.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.commands; 18 | 19 | import org.apache.activemq.openwire.annotations.OpenWireType; 20 | import org.apache.activemq.openwire.annotations.OpenWireProperty; 21 | 22 | /** 23 | * @openwire:marshaller code="52" 24 | */ 25 | @OpenWireType(typeCode = 52) 26 | public class JournalQueueAck implements DataStructure { 27 | 28 | public static final byte DATA_STRUCTURE_TYPE = CommandTypes.JOURNAL_REMOVE; 29 | 30 | @OpenWireProperty(version = 1, sequence = 1) 31 | OpenWireDestination destination; 32 | 33 | @OpenWireProperty(version = 1, sequence = 2) 34 | MessageAck messageAck; 35 | 36 | @Override 37 | public byte getDataStructureType() { 38 | return DATA_STRUCTURE_TYPE; 39 | } 40 | 41 | /** 42 | * @openwire:property version=1 43 | */ 44 | public OpenWireDestination getDestination() { 45 | return destination; 46 | } 47 | 48 | public void setDestination(OpenWireDestination destination) { 49 | this.destination = destination; 50 | } 51 | 52 | /** 53 | * @openwire:property version=1 54 | */ 55 | public MessageAck getMessageAck() { 56 | return messageAck; 57 | } 58 | 59 | public void setMessageAck(MessageAck messageAck) { 60 | this.messageAck = messageAck; 61 | } 62 | 63 | @Override 64 | public boolean isMarshallAware() { 65 | return false; 66 | } 67 | 68 | @Override 69 | public String toString() { 70 | return getClass().getSimpleName() + "{ " + destination + " }"; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /openwire-core/src/main/java/org/apache/activemq/openwire/commands/BrokerId.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.commands; 18 | 19 | import org.apache.activemq.openwire.annotations.OpenWireType; 20 | import org.apache.activemq.openwire.annotations.OpenWireProperty; 21 | 22 | /** 23 | * @openwire:marshaller code="124" 24 | */ 25 | @OpenWireType(typeCode = 124) 26 | public class BrokerId implements DataStructure { 27 | 28 | public static final byte DATA_STRUCTURE_TYPE = CommandTypes.BROKER_ID; 29 | 30 | @OpenWireProperty(version = 1, sequence = 1) 31 | protected String value; 32 | 33 | public BrokerId() { 34 | } 35 | 36 | public BrokerId(String brokerId) { 37 | this.value = brokerId; 38 | } 39 | 40 | @Override 41 | public int hashCode() { 42 | return value.hashCode(); 43 | } 44 | 45 | @Override 46 | public boolean equals(Object o) { 47 | if (this == o) { 48 | return true; 49 | } 50 | if (o == null || o.getClass() != BrokerId.class) { 51 | return false; 52 | } 53 | BrokerId id = (BrokerId)o; 54 | return value.equals(id.value); 55 | } 56 | 57 | @Override 58 | public byte getDataStructureType() { 59 | return DATA_STRUCTURE_TYPE; 60 | } 61 | 62 | @Override 63 | public String toString() { 64 | return value; 65 | } 66 | 67 | /** 68 | * @openwire:property version=1 69 | */ 70 | public String getValue() { 71 | return value; 72 | } 73 | 74 | public void setValue(String brokerId) { 75 | this.value = brokerId; 76 | } 77 | 78 | @Override 79 | public boolean isMarshallAware() { 80 | return false; 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /openwire-website/src/community/building.page: -------------------------------------------------------------------------------- 1 | --- 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | title: Building 18 | --- name:overview 19 | 20 | # How to Build ${project_name} 21 | The way most developers get started contributing to a project. 22 | 23 | --- name:content 24 | 25 | ## Building with Maven 26 | 27 | ${project_name} uses [Maven](http://maven.apache.org/) as its primary 28 | build tool for performing releases and uses the pom.xml to describe 29 | dependencies between modules. 30 | 31 | ### Prequisites 32 | 33 | *Required:* 34 | 35 | * Java 1.7 36 | * Download and [install Maven 3](http://maven.apache.org/download.html) 37 | * Get the latest [source](source.html) 38 | 39 | ### A normal build 40 | 41 | mvn install 42 | 43 | ### Doing a Quick Build 44 | 45 | The following avoids running all the unit test cases, we just skip the 46 | test running phase and not the building part 47 | 48 | mvn -Dtest=false install 49 | 50 | ### Using an IDE 51 | 52 | If you prefer to use an IDE then you can auto-generate the IDE's project 53 | files using maven plugins. e.g. 54 | 55 | mvn eclipse:eclipse 56 | 57 | or 58 | 59 | mvn idea:idea 60 | 61 | ### Importing into Eclipse 62 | 63 | If you have not already done so, you will need to make Eclipse aware of 64 | the Maven repository so that it can build everything. In the preferences, 65 | go to `Java -> Build Path -> Classpath` and define a new Classpath 66 | Variable named `M2_REPO` that points to your local Maven repository. i.e. 67 | `~/.m2/repository` on Unix and `c:\Documents and Settings\$username\.m2\repository` 68 | on Windows). 69 | 70 | You can also get Maven to do this for you: 71 | 72 | mvn eclipse:add-maven-repo -Declipse.workspace=/path/to/the/workspace/ 73 | 74 | ### See Also 75 | 76 | * [Source](source.html) 77 | * [Developer Links](developers.html) 78 | -------------------------------------------------------------------------------- /openwire-core/src/main/java/org/apache/activemq/openwire/commands/KeepAliveInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.commands; 18 | 19 | import org.apache.activemq.openwire.annotations.OpenWireType; 20 | 21 | /** 22 | * @openwire:marshaller code="10" 23 | */ 24 | @OpenWireType(typeCode = 10) 25 | public class KeepAliveInfo extends BaseCommand { 26 | 27 | public static final byte DATA_STRUCTURE_TYPE = CommandTypes.KEEP_ALIVE_INFO; 28 | 29 | @Override 30 | public byte getDataStructureType() { 31 | return DATA_STRUCTURE_TYPE; 32 | } 33 | 34 | @Override 35 | public boolean isResponse() { 36 | return false; 37 | } 38 | 39 | @Override 40 | public boolean isMessageDispatch() { 41 | return false; 42 | } 43 | 44 | @Override 45 | public boolean isMessage() { 46 | return false; 47 | } 48 | 49 | @Override 50 | public boolean isMessageAck() { 51 | return false; 52 | } 53 | 54 | @Override 55 | public boolean isBrokerInfo() { 56 | return false; 57 | } 58 | 59 | @Override 60 | public boolean isWireFormatInfo() { 61 | return false; 62 | } 63 | 64 | @Override 65 | public Response visit(CommandVisitor visitor) throws Exception { 66 | return visitor.processKeepAlive(this); 67 | } 68 | 69 | @Override 70 | public boolean isMarshallAware() { 71 | return false; 72 | } 73 | 74 | @Override 75 | public boolean isMessageDispatchNotification() { 76 | return false; 77 | } 78 | 79 | @Override 80 | public boolean isShutdownInfo() { 81 | return false; 82 | } 83 | 84 | @Override 85 | public String toString() { 86 | return this.getClass().getSimpleName(); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /openwire-core/src/main/java/org/apache/activemq/openwire/commands/DiscoveryEvent.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.commands; 18 | 19 | import org.apache.activemq.openwire.annotations.OpenWireType; 20 | import org.apache.activemq.openwire.annotations.OpenWireProperty; 21 | 22 | /** 23 | * Represents a discovery event containing the details of the service 24 | * 25 | * @openwire:marshaller code="40" 26 | */ 27 | @OpenWireType(typeCode = 40) 28 | public class DiscoveryEvent implements DataStructure { 29 | 30 | public static final byte DATA_STRUCTURE_TYPE = CommandTypes.DISCOVERY_EVENT; 31 | 32 | @OpenWireProperty(version = 1, sequence = 1) 33 | protected String serviceName; 34 | 35 | @OpenWireProperty(version = 1, sequence = 2) 36 | protected String brokerName; 37 | 38 | public DiscoveryEvent() { 39 | } 40 | 41 | public DiscoveryEvent(String serviceName) { 42 | this.serviceName = serviceName; 43 | } 44 | 45 | protected DiscoveryEvent(DiscoveryEvent copy) { 46 | serviceName = copy.serviceName; 47 | brokerName = copy.brokerName; 48 | } 49 | 50 | @Override 51 | public byte getDataStructureType() { 52 | return DATA_STRUCTURE_TYPE; 53 | } 54 | 55 | /** 56 | * @openwire:property version=1 57 | */ 58 | public String getServiceName() { 59 | return serviceName; 60 | } 61 | 62 | public void setServiceName(String serviceName) { 63 | this.serviceName = serviceName; 64 | } 65 | 66 | /** 67 | * @openwire:property version=1 68 | */ 69 | public String getBrokerName() { 70 | return brokerName; 71 | } 72 | 73 | public void setBrokerName(String name) { 74 | this.brokerName = name; 75 | } 76 | 77 | @Override 78 | public boolean isMarshallAware() { 79 | return false; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /openwire-core/src/main/java/org/apache/activemq/openwire/commands/SessionInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.commands; 18 | 19 | import org.apache.activemq.openwire.annotations.OpenWireType; 20 | import org.apache.activemq.openwire.annotations.OpenWireProperty; 21 | 22 | /** 23 | * @openwire:marshaller code="4" 24 | */ 25 | @OpenWireType(typeCode = 4) 26 | public class SessionInfo extends BaseCommand { 27 | 28 | public static final byte DATA_STRUCTURE_TYPE = CommandTypes.SESSION_INFO; 29 | 30 | @OpenWireProperty(version = 1, sequence = 1, cached = true) 31 | protected SessionId sessionId; 32 | 33 | public SessionInfo() { 34 | sessionId = new SessionId(); 35 | } 36 | 37 | public SessionInfo(ConnectionInfo connectionInfo, long sessionId) { 38 | this.sessionId = new SessionId(connectionInfo.getConnectionId(), sessionId); 39 | } 40 | 41 | public SessionInfo(SessionId sessionId) { 42 | this.sessionId = sessionId; 43 | } 44 | 45 | @Override 46 | public byte getDataStructureType() { 47 | return DATA_STRUCTURE_TYPE; 48 | } 49 | 50 | /** 51 | * @openwire:property version=1 cache=true 52 | */ 53 | public SessionId getSessionId() { 54 | return sessionId; 55 | } 56 | 57 | public void setSessionId(SessionId sessionId) { 58 | this.sessionId = sessionId; 59 | } 60 | 61 | public RemoveInfo createRemoveCommand() { 62 | RemoveInfo command = new RemoveInfo(getSessionId()); 63 | command.setResponseRequired(isResponseRequired()); 64 | return command; 65 | } 66 | 67 | @Override 68 | public Response visit(CommandVisitor visitor) throws Exception { 69 | return visitor.processAddSession(this); 70 | } 71 | 72 | @Override 73 | public boolean isSessionInfo() { 74 | return true; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /openwire-core/src/test/resources/log4j2-test.properties: -------------------------------------------------------------------------------- 1 | ## --------------------------------------------------------------------------- 2 | ## Licensed to the Apache Software Foundation (ASF) under one or more 3 | ## contributor license agreements. See the NOTICE file distributed with 4 | ## this work for additional information regarding copyright ownership. 5 | ## The ASF licenses this file to You under the Apache License, Version 2.0 6 | ## (the "License"); you may not use this file except in compliance with 7 | ## the License. You may obtain a copy of the License at 8 | ## 9 | ## http://www.apache.org/licenses/LICENSE-2.0 10 | ## 11 | ## Unless required by applicable law or agreed to in writing, software 12 | ## distributed under the License is distributed on an "AS IS" BASIS, 13 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | ## See the License for the specific language governing permissions and 15 | ## limitations under the License. 16 | ## --------------------------------------------------------------------------- 17 | 18 | # 19 | # The logging properties used during tests 20 | # 21 | rootLogger.level=INFO 22 | 23 | rootLogger.appenderRef.console.ref=Console 24 | rootLogger.appenderRef.logfile.ref=RollingFile 25 | 26 | # Tune the ActiveMQ and it's OpenWire transport as needed for debugging. 27 | logger.1.name=org.apache.activemq.openwire 28 | logger.1.level=DEBUG 29 | #logger.2.name=org.apache.activemq.broker 30 | #logger.2.level=DEBUG 31 | #logger.3.name=org.apache.activemq.transport.openwire 32 | #logger.3.level=TRACE 33 | #logger.4.name=org.apache.activemq.transport.openwire.FRAMES 34 | #logger.4.level=DEBUG 35 | 36 | # Console appender 37 | appender.console.type=Console 38 | appender.console.name=Console 39 | appender.console.layout.type=PatternLayout 40 | appender.console.layout.pattern=%d [%-15.15t] - %-5p %-30.30c{1} - %m%n 41 | #appender.console.layout.pattern=%d [%-15.15t] - %-5p %-30.30c{1} - %-10.10X{activemq.broker} %-20.20X{activemq.connector} %-10.10X{activemq.destination} - %m%n 42 | 43 | # RollingFile appender 44 | appender.logfile.type=RollingRandomAccessFile 45 | appender.logfile.name=RollingFile 46 | appender.logfile.fileName=target/activemq-test.log 47 | appender.logfile.filePattern=target/activemq-test.log.%i 48 | appender.logfile.append=true 49 | appender.logfile.layout.type=PatternLayout 50 | appender.logfile.layout.pattern=%d [%-15.15t] - %-5p %-30.30c{1} - %m%n 51 | #appender.logfile.layout.pattern=%d [%-15.15t] - %-5p %-30.30c{1} - %-10.10X{activemq.broker} %-20.20X{activemq.connector} %-10.10X{activemq.destination} - %m%n 52 | appender.logfile.policies.type=Policies 53 | appender.logfile.policies.size.type=SizeBasedTriggeringPolicy 54 | appender.logfile.policies.size.size=1MB 55 | -------------------------------------------------------------------------------- /openwire-generator/src/main/resources/log4j2.properties: -------------------------------------------------------------------------------- 1 | ## --------------------------------------------------------------------------- 2 | ## Licensed to the Apache Software Foundation (ASF) under one or more 3 | ## contributor license agreements. See the NOTICE file distributed with 4 | ## this work for additional information regarding copyright ownership. 5 | ## The ASF licenses this file to You under the Apache License, Version 2.0 6 | ## (the "License"); you may not use this file except in compliance with 7 | ## the License. You may obtain a copy of the License at 8 | ## 9 | ## http://www.apache.org/licenses/LICENSE-2.0 10 | ## 11 | ## Unless required by applicable law or agreed to in writing, software 12 | ## distributed under the License is distributed on an "AS IS" BASIS, 13 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | ## See the License for the specific language governing permissions and 15 | ## limitations under the License. 16 | ## --------------------------------------------------------------------------- 17 | 18 | # 19 | # The logging properties used during tests 20 | # 21 | rootLogger.level=INFO 22 | 23 | rootLogger.appenderRef.console.ref=Console 24 | rootLogger.appenderRef.logfile.ref=RollingFile 25 | 26 | # Tune the ActiveMQ and it's OpenWire transport as needed for debugging. 27 | logger.1.name=org.apache.activemq.openwire 28 | logger.1.level=DEBUG 29 | #logger.2.name=org.apache.activemq.broker 30 | #logger.2.level=DEBUG 31 | #logger.3.name=org.apache.activemq.transport.openwire 32 | #logger.3.level=TRACE 33 | #logger.4.name=org.apache.activemq.transport.openwire.FRAMES 34 | #logger.4.level=DEBUG 35 | 36 | # Console appender 37 | appender.console.type=Console 38 | appender.console.name=Console 39 | appender.console.layout.type=PatternLayout 40 | appender.console.layout.pattern=%d [%-15.15t] - %-5p %-30.30c{1} - %m%n 41 | #appender.console.layout.pattern=%d [%-15.15t] - %-5p %-30.30c{1} - %-10.10X{activemq.broker} %-20.20X{activemq.connector} %-10.10X{activemq.destination} - %m%n 42 | 43 | # RollingFile appender 44 | appender.logfile.type=RollingRandomAccessFile 45 | appender.logfile.name=RollingFile 46 | appender.logfile.fileName=target/activemq-test.log 47 | appender.logfile.filePattern=target/activemq-test.log.%i 48 | appender.logfile.append=true 49 | appender.logfile.layout.type=PatternLayout 50 | appender.logfile.layout.pattern=%d [%-15.15t] - %-5p %-30.30c{1} - %m%n 51 | #appender.logfile.layout.pattern=%d [%-15.15t] - %-5p %-30.30c{1} - %-10.10X{activemq.broker} %-20.20X{activemq.connector} %-10.10X{activemq.destination} - %m%n 52 | appender.logfile.policies.type=Policies 53 | appender.logfile.policies.size.type=SizeBasedTriggeringPolicy 54 | appender.logfile.policies.size.size=1MB 55 | -------------------------------------------------------------------------------- /openwire-interop-tests/src/test/resources/log4j2-test.properties: -------------------------------------------------------------------------------- 1 | ## --------------------------------------------------------------------------- 2 | ## Licensed to the Apache Software Foundation (ASF) under one or more 3 | ## contributor license agreements. See the NOTICE file distributed with 4 | ## this work for additional information regarding copyright ownership. 5 | ## The ASF licenses this file to You under the Apache License, Version 2.0 6 | ## (the "License"); you may not use this file except in compliance with 7 | ## the License. You may obtain a copy of the License at 8 | ## 9 | ## http://www.apache.org/licenses/LICENSE-2.0 10 | ## 11 | ## Unless required by applicable law or agreed to in writing, software 12 | ## distributed under the License is distributed on an "AS IS" BASIS, 13 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | ## See the License for the specific language governing permissions and 15 | ## limitations under the License. 16 | ## --------------------------------------------------------------------------- 17 | 18 | # 19 | # The logging properties used during tests 20 | # 21 | rootLogger.level=INFO 22 | 23 | rootLogger.appenderRef.console.ref=Console 24 | rootLogger.appenderRef.logfile.ref=RollingFile 25 | 26 | # Tune the ActiveMQ and it's OpenWire transport as needed for debugging. 27 | logger.1.name=org.apache.activemq.openwire 28 | logger.1.level=DEBUG 29 | #logger.2.name=org.apache.activemq.broker 30 | #logger.2.level=DEBUG 31 | #logger.3.name=org.apache.activemq.transport.openwire 32 | #logger.3.level=TRACE 33 | #logger.4.name=org.apache.activemq.transport.openwire.FRAMES 34 | #logger.4.level=DEBUG 35 | 36 | # Console appender 37 | appender.console.type=Console 38 | appender.console.name=Console 39 | appender.console.layout.type=PatternLayout 40 | appender.console.layout.pattern=%d [%-15.15t] - %-5p %-30.30c{1} - %m%n 41 | #appender.console.layout.pattern=%d [%-15.15t] - %-5p %-30.30c{1} - %-10.10X{activemq.broker} %-20.20X{activemq.connector} %-10.10X{activemq.destination} - %m%n 42 | 43 | # RollingFile appender 44 | appender.logfile.type=RollingRandomAccessFile 45 | appender.logfile.name=RollingFile 46 | appender.logfile.fileName=target/activemq-test.log 47 | appender.logfile.filePattern=target/activemq-test.log.%i 48 | appender.logfile.append=true 49 | appender.logfile.layout.type=PatternLayout 50 | appender.logfile.layout.pattern=%d [%-15.15t] - %-5p %-30.30c{1} - %m%n 51 | #appender.logfile.layout.pattern=%d [%-15.15t] - %-5p %-30.30c{1} - %-10.10X{activemq.broker} %-20.20X{activemq.connector} %-10.10X{activemq.destination} - %m%n 52 | appender.logfile.policies.type=Policies 53 | appender.logfile.policies.size.type=SizeBasedTriggeringPolicy 54 | appender.logfile.policies.size.size=1MB 55 | -------------------------------------------------------------------------------- /openwire-generator/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 4.0.0 20 | 21 | org.apache.activemq 22 | openwire-protocol 23 | 1.0.0-SNAPSHOT 24 | 25 | 26 | openwire-generator 27 | openwire-generator 28 | An OpenWire marshaller generator for the OpenWire Protocol library 29 | jar 30 | 31 | UTF-8 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | org.apache.activemq 40 | openwire-annotations 41 | 42 | 43 | org.reflections 44 | reflections 45 | 46 | 47 | org.slf4j 48 | slf4j-api 49 | 50 | 51 | org.apache.ant 52 | ant 53 | 54 | 55 | 56 | junit 57 | junit 58 | test 59 | 60 | 61 | org.apache.logging.log4j 62 | log4j-slf4j2-impl 63 | test 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /openwire-website/ext/Website.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | import org.fusesource.scalate.RenderContext 18 | 19 | package 20 | 21 | /** 22 | *

23 | *

24 | */ 25 | object Website { 26 | 27 | val project_name= "ActiveMQ OpenWire" 28 | val project_slogan= "ActiveMQ's OpenWire Protocol library" 29 | val project_id= "OpenWire" 30 | val project_jira_key= "OPENWIRE" 31 | val project_issue_url= "https://issues.apache.org/jira/browse/OPENWIRE" 32 | val project_forums_url= "http://activemq.2283324.n4.nabble.com/ActiveMQ-Dev-f2368404.html" 33 | val project_wiki_url= "https://cwiki.apache.org/confluence/display/ACTIVEMQ/Index" 34 | val project_logo= "/images/project-logo.png" 35 | val project_version= "1.0" 36 | val project_snapshot_version= "1.0-SNAPSHOT" 37 | val project_versions = List( 38 | project_version, 39 | "1.0" 40 | ) 41 | 42 | val project_keywords= "messaging,openwire,jms,activemq,apollo,protocol" 43 | 44 | // ------------------------------------------------------------------- 45 | val github_page= "https://github.com/apache/activemq-openwire" 46 | val git_user_url= "git://github.com/apache/activemq-openwire" 47 | val git_commiter_url= "https://git-wip-us.apache.org/repos/asf/activemq-openwire.git" 48 | val git_branch= "master" 49 | val git_edit_page_base = github_page+"/edit/"+git_branch+"/website/src" 50 | val disqus_shortname = project_id 51 | 52 | // REMOVE ME ------------------------------------------------------------------- 53 | val project_git_url= "https://git-wip-us.apache.org/repos/asf/activemq-openwire.git" 54 | val project_git_trunk_url= project_git_url +"/master" 55 | val project_git_branches_url= project_git_url + "/branches" 56 | val project_git_tags_url= project_git_url + "/tags" 57 | val project_git_commiter_url= project_git_trunk_url.replaceFirst("http","https") 58 | 59 | val project_maven_groupId= "org.apache.activemq" 60 | val project_maven_artifactId= "openwire-protocol" 61 | 62 | val website_base_url= "http://activemq.apache.org/openwire" 63 | } -------------------------------------------------------------------------------- /openwire-website/src/community/site.page: -------------------------------------------------------------------------------- 1 | --- 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | title: Building 18 | --- name:overview 19 | 20 | # ${project_name} Site 21 | How the website works 22 | 23 | --- name:content pipeline:jade 24 | 25 | .left 26 | h1 How it works 27 | .right 28 | :markdown 29 | 30 | The *${project_name}* documentation and site is created using Scalate 31 | and is stored in git in the same [source control system as the 32 | code](source.html) 33 | 34 | **Note:** For code highlighting you will need to 35 | [install](http://pygments.org/download/) 36 | [http://pygments.org/](http://pygments.org). 37 | 38 | .left 39 | h1 Editing the source code 40 | .right 41 | :markdown 42 | 43 | If you [grab the source code](source.html) you will find the site 44 | source in the *${project_id}-website* directory. The website is 45 | also built using Maven so, you would 46 | 47 | cd ${project_id}-website 48 | mvn install 49 | 50 | If you want to edit the files in your text editor and be able to 51 | immediately see the site re-rendered in a browser then use 52 | 53 | mvn jetty:run 54 | 55 | You can now surf the site and see changes immediately. 56 | 57 | If you are on OS X then we highly recommend 58 | [TextMate](http://macromates.com/) as a great editor which supports 59 | Textile and Markdown 60 | 61 | .left 62 | h1 Deploying the site 63 | .right 64 | :markdown 65 | 66 | The site is automatically deployed by the CI builds, so you can 67 | simply wait for the changes to be automatically pushed to the project 68 | site. 69 | 70 | You can manually deploy the site using Maven: 71 | 72 | mvn deploy 73 | 74 | Since deployment to our webserver requires proper authorization, 75 | you will need to add an entry to your ~/.m2/settings.xml file simlilar 76 | to: 77 | 78 | {pygmentize:: xml} 79 | 80 | ${project_id}-website 81 | xxxx 82 | xxxxx 83 | 84 | {pygmentize} -------------------------------------------------------------------------------- /openwire-interop-tests/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 4.0.0 20 | 21 | org.apache.activemq 22 | openwire-protocol 23 | 1.0.0-SNAPSHOT 24 | 25 | 26 | openwire-interop-tests 27 | openwire-interop-tests 28 | Set of interop tests to ensure that the OpenWire codec works with ActiveMQ 29 | jar 30 | 31 | UTF-8 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | org.apache.activemq 40 | openwire-core 41 | 42 | 43 | org.apache.activemq 44 | openwire-legacy 45 | 46 | 47 | org.slf4j 48 | slf4j-api 49 | 50 | 51 | org.apache.logging.log4j 52 | log4j-slf4j2-impl 53 | test 54 | 55 | 56 | junit 57 | junit 58 | test 59 | 60 | 61 | 62 | 63 | org.apache.activemq 64 | activemq-broker 65 | test 66 | 67 | 68 | org.apache.activemq 69 | activemq-kahadb-store 70 | test 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /openwire-core/src/main/java/org/apache/activemq/openwire/commands/RemoveSubscriptionInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.commands; 18 | 19 | import org.apache.activemq.openwire.annotations.OpenWireType; 20 | import org.apache.activemq.openwire.annotations.OpenWireProperty; 21 | 22 | /** 23 | * @openwire:marshaller code="9" 24 | */ 25 | @OpenWireType(typeCode = 9) 26 | public class RemoveSubscriptionInfo extends BaseCommand { 27 | 28 | public static final byte DATA_STRUCTURE_TYPE = CommandTypes.REMOVE_SUBSCRIPTION_INFO; 29 | 30 | @OpenWireProperty(version = 1, sequence = 1, cached = true) 31 | protected ConnectionId connectionId; 32 | 33 | @OpenWireProperty(version = 1, sequence = 2) 34 | protected String subscriptionName; 35 | 36 | @OpenWireProperty(version = 1, sequence = 3) 37 | protected String clientId; 38 | 39 | @Override 40 | public byte getDataStructureType() { 41 | return DATA_STRUCTURE_TYPE; 42 | } 43 | 44 | /** 45 | * @openwire:property version=1 cache=true 46 | */ 47 | public ConnectionId getConnectionId() { 48 | return connectionId; 49 | } 50 | 51 | public void setConnectionId(ConnectionId connectionId) { 52 | this.connectionId = connectionId; 53 | } 54 | 55 | /** 56 | * @openwire:property version=1 57 | */ 58 | public String getSubcriptionName() { 59 | return subscriptionName; 60 | } 61 | 62 | /** 63 | */ 64 | public void setSubcriptionName(String subscriptionName) { 65 | this.subscriptionName = subscriptionName; 66 | } 67 | 68 | public String getSubscriptionName() { 69 | return subscriptionName; 70 | } 71 | 72 | public void setSubscriptionName(String subscriptionName) { 73 | this.subscriptionName = subscriptionName; 74 | } 75 | 76 | /** 77 | * @openwire:property version=1 78 | */ 79 | public String getClientId() { 80 | return clientId; 81 | } 82 | 83 | public void setClientId(String clientId) { 84 | this.clientId = clientId; 85 | } 86 | 87 | @Override 88 | public Response visit(CommandVisitor visitor) throws Exception { 89 | return visitor.processRemoveSubscription(this); 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /openwire-website/ext/scalate/Boot.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package scalate 18 | 19 | import org.fusesource.scalate.util.Logging 20 | import java.util.concurrent.atomic.AtomicBoolean 21 | import _root_.Website._ 22 | import org.fusesource.scalate._ 23 | import org.fusesource.scalamd.{MacroDefinition, Markdown} 24 | import java.util.regex.Matcher 25 | import org.fusesource.scalate.wikitext.Pygmentize 26 | 27 | class Boot(engine: TemplateEngine) extends Logging { 28 | 29 | private var _initialised = new AtomicBoolean(false) 30 | 31 | def run: Unit = { 32 | if (_initialised.compareAndSet(false, true)) { 33 | def filter(m:Matcher):String = { 34 | val filter_name = m.group(1) 35 | val body = m.group(2) 36 | engine.filter(filter_name) match { 37 | case Some(filter)=> 38 | filter.filter(RenderContext(), body) 39 | case None=> 40 | error("filter not found: "+filter_name) 41 | body 42 | } 43 | } 44 | 45 | def pygmentize(m:Matcher):String = Pygmentize.pygmentize(m.group(2), m.group(1)) 46 | 47 | // add some macros to markdown. 48 | Markdown.macros :::= List( 49 | MacroDefinition("""\{filter::(.*?)\}(.*?)\{filter\}""", "s", filter, true), 50 | MacroDefinition("""\{pygmentize::(.*?)\}(.*?)\{pygmentize\}""", "s", pygmentize, true), 51 | MacroDefinition("""\{pygmentize\_and\_compare::(.*?)\}(.*?)\{pygmentize\_and\_compare\}""", "s", pygmentize, true), 52 | MacroDefinition("""\$\{project_version\}""", "", _ => project_version.toString, true), 53 | MacroDefinition("""\$\{project_name\}""", "", _ => project_name.toString, true), 54 | MacroDefinition("""\$\{project_id\}""", "", _ => project_id.toString, true), 55 | MacroDefinition("""\$\{project_issue_url\}""", "", _ => project_issue_url.toString, true), 56 | MacroDefinition("""\$\{website_base_url\}""", "", _ => website_base_url.toString, true) 57 | ) 58 | 59 | for( ssp <- engine.filter("ssp"); md <- engine.filter("markdown") ) { 60 | engine.pipelines += "ssp.md"-> List(ssp, md) 61 | engine.pipelines += "ssp.markdown"-> List(ssp, md) 62 | } 63 | info("Bootstrapped website gen for: %s".format(project_name)) 64 | } 65 | } 66 | } -------------------------------------------------------------------------------- /openwire-core/src/main/java/org/apache/activemq/openwire/commands/ProducerAck.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.commands; 18 | 19 | import org.apache.activemq.openwire.annotations.OpenWireType; 20 | import org.apache.activemq.openwire.annotations.OpenWireProperty; 21 | 22 | /** 23 | * A ProducerAck command is sent by a broker to a producer to let it know it has 24 | * received and processed messages that it has produced. The producer will be 25 | * flow controlled if it does not receive ProducerAck commands back from the 26 | * broker. 27 | * 28 | * @openwire:marshaller code="19" version="3" 29 | */ 30 | @OpenWireType(typeCode = 19, version = 3) 31 | public class ProducerAck extends BaseCommand { 32 | 33 | public static final byte DATA_STRUCTURE_TYPE = CommandTypes.PRODUCER_ACK; 34 | 35 | @OpenWireProperty(version = 3, sequence = 1) 36 | protected ProducerId producerId; 37 | 38 | @OpenWireProperty(version = 3, sequence = 2) 39 | protected int size; 40 | 41 | public ProducerAck() { 42 | } 43 | 44 | public ProducerAck(ProducerId producerId, int size) { 45 | this.producerId = producerId; 46 | this.size = size; 47 | } 48 | 49 | public void copy(ProducerAck copy) { 50 | super.copy(copy); 51 | copy.producerId = producerId; 52 | copy.size = size; 53 | } 54 | 55 | @Override 56 | public byte getDataStructureType() { 57 | return DATA_STRUCTURE_TYPE; 58 | } 59 | 60 | @Override 61 | public Response visit(CommandVisitor visitor) throws Exception { 62 | return visitor.processProducerAck(this); 63 | } 64 | 65 | /** 66 | * The producer id that this ack message is destined for. 67 | * 68 | * @openwire:property version=3 69 | */ 70 | public ProducerId getProducerId() { 71 | return producerId; 72 | } 73 | 74 | public void setProducerId(ProducerId producerId) { 75 | this.producerId = producerId; 76 | } 77 | 78 | /** 79 | * The number of bytes that are being acked. 80 | * 81 | * @openwire:property version=3 82 | */ 83 | public int getSize() { 84 | return size; 85 | } 86 | 87 | public void setSize(int size) { 88 | this.size = size; 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /openwire-generator/src/main/java/org/apache/activemq/openwire/generator/AbstractGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.generator; 18 | 19 | import java.io.PrintWriter; 20 | 21 | /** 22 | * Base class that provides useful default implementations if Generator 23 | * related tasks. 24 | */ 25 | public abstract class AbstractGenerator implements Generator { 26 | 27 | private String baseDir; 28 | 29 | /** 30 | * @return the baseDir where the generator should operate. 31 | */ 32 | @Override 33 | public String getBaseDir() { 34 | return baseDir; 35 | } 36 | 37 | /** 38 | * @param baseDir 39 | * the base directory to use as the root of the generation process. 40 | */ 41 | @Override 42 | public void setBaseDir(String baseDir) { 43 | this.baseDir = baseDir; 44 | } 45 | 46 | /** 47 | * Writes the common Apache 2.0 license used in all generated source content. 48 | * 49 | * @param out 50 | * A PrintWriter instance to write the license to. 51 | */ 52 | public static void writeApacheLicense(PrintWriter out) { 53 | out.println("/*"); 54 | out.println(" * Licensed to the Apache Software Foundation (ASF) under one or more"); 55 | out.println(" * contributor license agreements. See the NOTICE file distributed with"); 56 | out.println(" * this work for additional information regarding copyright ownership."); 57 | out.println(" * The ASF licenses this file to You under the Apache License, Version 2.0"); 58 | out.println(" * (the \"License\"); you may not use this file except in compliance with"); 59 | out.println(" * the License. You may obtain a copy of the License at"); 60 | out.println(" *"); 61 | out.println(" * http://www.apache.org/licenses/LICENSE-2.0"); 62 | out.println(" *"); 63 | out.println(" * Unless required by applicable law or agreed to in writing, software"); 64 | out.println(" * distributed under the License is distributed on an \"AS IS\" BASIS,"); 65 | out.println(" * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied."); 66 | out.println(" * See the License for the specific language governing permissions and"); 67 | out.println(" * limitations under the License."); 68 | out.println(" */"); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /openwire-website/src/community/source.page: -------------------------------------------------------------------------------- 1 | --- 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | title: Source 18 | in_menu: true 19 | sort_info: 40 20 | --- name:overview 21 | # ${project_name} 22 | 23 | Get the latest source code 24 | 25 | --- name:content pipeline:jade 26 | 27 | 28 | .left 29 | :markdown 30 | # Git 31 | 32 | .right 33 | :&markdown 34 | 35 | #{project_name} stores its source code in a Git repository at this location: 36 | 37 | * [#{project_git_url}](#{project_git_url}) 38 | 39 | If you are new to Git you might have a look at the 40 | [Version Control with Git](http://git-scm.com/book/en/Getting-Started-About-Version-Control) book. 41 | 42 | .left 43 | :markdown 44 | # Browsing Source 45 | .right 46 | :&markdown 47 | 48 | You can browse the source code online by using any of the following 49 | interfaces web interfaces: 50 | 51 | * [Github](#{github_page}) 52 | 53 | .left 54 | h1 How to Checkout 55 | .right 56 | :&markdown 57 | 58 | You must first install a [Git client](http://subversion.apache.org/packages.html). Then 59 | you check out the project using the following: 60 | 61 | git clone #{project_git_trunk_url} #{project_id} 62 | cd #{project_id} 63 | 64 | Now you probably want to try [build the #{project_name} code](building.html) 65 | 66 | .left 67 | :markdown 68 | # Committer Access 69 | 70 | .right 71 | :&markdown 72 | 73 | Committers should check out the the source code using the Apache Git url. 74 | 75 | * [#{project_git_commiter_url}](#{project_git_commiter_url}) 76 | 77 | Only project developers can commit to the Git tree via this method. 78 | 79 | 80 | .left 81 | :markdown 82 | # Contributing patches 83 | .right 84 | :markdown 85 | If you are not yet a committer but want to contribute some 86 | patch (we love [contributions!](contributing.html)) here's 87 | how you can submit patches 88 | 89 | - include("/community/_creating_patches.ssp.md") 90 | 91 | .left 92 | :markdown 93 | # Next steps 94 | .right 95 | :&markdown 96 | Once you have checked out the code try following 97 | 98 | * [instructions to build #{project_name}](building.html) 99 | * read the [documentation](../documentation/index.html) 100 | * browse the [developer links and maven reports](developers.html) 101 | 102 | -------------------------------------------------------------------------------- /openwire-core/src/test/java/org/apache/activemq/openwire/utils/MarshallingSupport.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.utils; 18 | 19 | import java.io.DataOutput; 20 | import java.io.IOException; 21 | 22 | /** 23 | * Support functions for dealing with data in OpenWire. 24 | */ 25 | public class MarshallingSupport { 26 | 27 | public static void writeUTF8(DataOutput dataOut, String text) throws IOException { 28 | 29 | if (text != null) { 30 | int strlen = text.length(); 31 | int utflen = 0; 32 | char[] charr = new char[strlen]; 33 | int c = 0; 34 | int count = 0; 35 | 36 | text.getChars(0, strlen, charr, 0); 37 | 38 | for (int i = 0; i < strlen; i++) { 39 | c = charr[i]; 40 | if ((c >= 0x0001) && (c <= 0x007F)) { 41 | utflen++; 42 | } else if (c > 0x07FF) { 43 | utflen += 3; 44 | } else { 45 | utflen += 2; 46 | } 47 | } 48 | // TODO diff: Sun code - removed 49 | byte[] bytearr = new byte[utflen + 4]; // TODO diff: Sun code 50 | bytearr[count++] = (byte) ((utflen >>> 24) & 0xFF); // TODO diff: 51 | // Sun code 52 | bytearr[count++] = (byte) ((utflen >>> 16) & 0xFF); // TODO diff: 53 | // Sun code 54 | bytearr[count++] = (byte) ((utflen >>> 8) & 0xFF); 55 | bytearr[count++] = (byte) ((utflen >>> 0) & 0xFF); 56 | for (int i = 0; i < strlen; i++) { 57 | c = charr[i]; 58 | if ((c >= 0x0001) && (c <= 0x007F)) { 59 | bytearr[count++] = (byte) c; 60 | } else if (c > 0x07FF) { 61 | bytearr[count++] = (byte) (0xE0 | ((c >> 12) & 0x0F)); 62 | bytearr[count++] = (byte) (0x80 | ((c >> 6) & 0x3F)); 63 | bytearr[count++] = (byte) (0x80 | ((c >> 0) & 0x3F)); 64 | } else { 65 | bytearr[count++] = (byte) (0xC0 | ((c >> 6) & 0x1F)); 66 | bytearr[count++] = (byte) (0x80 | ((c >> 0) & 0x3F)); 67 | } 68 | } 69 | dataOut.write(bytearr); 70 | 71 | } else { 72 | dataOut.writeInt(-1); 73 | } 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /openwire-website/src/community/contributing.page: -------------------------------------------------------------------------------- 1 | --- 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | title: Contributing 18 | in_menu: false 19 | --- name:overview 20 | 21 | # How to contribute to ${project_name} 22 | We love contributions! 23 | 24 | --- name:content 25 | 26 | We really want you to get involved in the ${project_name} project, to 27 | [join the community](index.html) and help make it a better piece of 28 | software - please do dive in and help! 29 | 30 | Try surf the [documentation](../documentation/index.html) and website in 31 | general - if something is confusing or not clear, [let us 32 | know](index.html) or raise a [support request](support.html). 33 | 34 | [Download](../download.html) the code and try it out and see what you think. 35 | Browse the [source code](source.html). Got an itch to scratch, want to 36 | tune some operation or add some feature? 37 | 38 | Want to do some hacking on the ${project_name} code? Try surfing the our 39 | [Issue Tracker](${project_issue_url}) for open issues or features. If something 40 | tickles your fancy, take ownership of the issue and start working on it! Attach 41 | a patch once you fix it. 42 | 43 | ## Improving the documentation 44 | 45 | Documentation is massively important to help users make the most of 46 | ${project_name} and its probably the area that needs the most help! 47 | 48 | So if you are interested in helping the documentation effort; whether its 49 | just to fix a page here or there, correct a link or even write a tutorial 50 | or improve what documentation is already there please do dive in and 51 | help\! 52 | 53 | All of the documentation is stored in project source repository, see [How 54 | the Site works](site.html) 55 | 56 | ## If you find a bug or problem 57 | 58 | Please raise a new issue in our [Issue Tracker](${project_issue_url}). If 59 | you can create a JUnit test case then your issue is more likely to be 60 | resolved quicker. Then we can add your issue to our [source control 61 | system](source.html) and then we'll know when its really fixed and we can 62 | ensure that the problem stays fixed in future releases. 63 | 64 | ## Working on the code and creating patches 65 | 66 | We gladly accept patches if you can find ways to improve, tune or fix 67 | ${project_name} in some way. 68 | 69 | ${include("/community/_creating_patches.ssp.md")} 70 | 71 | ## Becoming a committer 72 | 73 | Once you have made some good contributions you may be invited to become a 74 | committer by the project team. We'll chat to you offline about it. 75 | -------------------------------------------------------------------------------- /openwire-core/src/main/java/org/apache/activemq/openwire/commands/ConnectionId.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.commands; 18 | 19 | import org.apache.activemq.openwire.annotations.OpenWireType; 20 | import org.apache.activemq.openwire.annotations.OpenWireProperty; 21 | 22 | /** 23 | * @openwire:marshaller code="120" 24 | */ 25 | @OpenWireType(typeCode = 120) 26 | public class ConnectionId implements DataStructure, Comparable { 27 | 28 | public static final byte DATA_STRUCTURE_TYPE = CommandTypes.CONNECTION_ID; 29 | 30 | @OpenWireProperty(version = 1, sequence = 1) 31 | protected String value; 32 | 33 | public ConnectionId() { 34 | } 35 | 36 | public ConnectionId(String connectionId) { 37 | this.value = connectionId; 38 | } 39 | 40 | public ConnectionId(ConnectionId id) { 41 | this.value = id.getValue(); 42 | } 43 | 44 | public ConnectionId(SessionId id) { 45 | this.value = id.getConnectionId(); 46 | } 47 | 48 | public ConnectionId(ProducerId id) { 49 | this.value = id.getConnectionId(); 50 | } 51 | 52 | public ConnectionId(ConsumerId id) { 53 | this.value = id.getConnectionId(); 54 | } 55 | 56 | @Override 57 | public int hashCode() { 58 | return value.hashCode(); 59 | } 60 | 61 | @Override 62 | public boolean equals(Object o) { 63 | if (this == o) { 64 | return true; 65 | } 66 | if (o == null || o.getClass() != ConnectionId.class) { 67 | return false; 68 | } 69 | ConnectionId id = (ConnectionId)o; 70 | return value.equals(id.value); 71 | } 72 | 73 | @Override 74 | public byte getDataStructureType() { 75 | return DATA_STRUCTURE_TYPE; 76 | } 77 | 78 | @Override 79 | public String toString() { 80 | return value; 81 | } 82 | 83 | /** 84 | * @openwire:property version=1 85 | */ 86 | public String getValue() { 87 | return value; 88 | } 89 | 90 | public void setValue(String connectionId) { 91 | this.value = connectionId; 92 | } 93 | 94 | @Override 95 | public boolean isMarshallAware() { 96 | return false; 97 | } 98 | 99 | @Override 100 | public int compareTo(ConnectionId o) { 101 | return value.compareTo(o.value); 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /openwire-core/src/main/java/org/apache/activemq/openwire/commands/MessageDispatch.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.commands; 18 | 19 | import org.apache.activemq.openwire.annotations.OpenWireType; 20 | import org.apache.activemq.openwire.annotations.OpenWireProperty; 21 | 22 | /** 23 | * @openwire:marshaller code="21" 24 | */ 25 | @OpenWireType(typeCode = 21) 26 | public class MessageDispatch extends BaseCommand { 27 | 28 | public static final byte DATA_STRUCTURE_TYPE = CommandTypes.MESSAGE_DISPATCH; 29 | 30 | @OpenWireProperty(version = 1, sequence = 1, cached = true) 31 | protected ConsumerId consumerId; 32 | 33 | @OpenWireProperty(version = 1, sequence = 2, cached = true) 34 | protected OpenWireDestination destination; 35 | 36 | @OpenWireProperty(version = 1, sequence = 3) 37 | protected Message message; 38 | 39 | @OpenWireProperty(version = 1, sequence = 4) 40 | protected int redeliveryCounter; 41 | 42 | @Override 43 | public byte getDataStructureType() { 44 | return DATA_STRUCTURE_TYPE; 45 | } 46 | 47 | @Override 48 | public boolean isMessageDispatch() { 49 | return true; 50 | } 51 | 52 | /** 53 | * @openwire:property version=1 cache=true 54 | */ 55 | public ConsumerId getConsumerId() { 56 | return consumerId; 57 | } 58 | 59 | public void setConsumerId(ConsumerId consumerId) { 60 | this.consumerId = consumerId; 61 | } 62 | 63 | /** 64 | * @openwire:property version=1 cache=true 65 | */ 66 | public OpenWireDestination getDestination() { 67 | return destination; 68 | } 69 | 70 | public void setDestination(OpenWireDestination destination) { 71 | this.destination = destination; 72 | } 73 | 74 | /** 75 | * @openwire:property version=1 76 | */ 77 | public Message getMessage() { 78 | return message; 79 | } 80 | 81 | public void setMessage(Message message) { 82 | this.message = message; 83 | } 84 | 85 | /** 86 | * @openwire:property version=1 87 | */ 88 | public int getRedeliveryCounter() { 89 | return redeliveryCounter; 90 | } 91 | 92 | public void setRedeliveryCounter(int deliveryCounter) { 93 | this.redeliveryCounter = deliveryCounter; 94 | } 95 | 96 | @Override 97 | public Response visit(CommandVisitor visitor) throws Exception { 98 | return visitor.processMessageDispatch(this); 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /openwire-core/src/main/java/org/apache/activemq/openwire/commands/JournalTransaction.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.commands; 18 | 19 | import org.apache.activemq.openwire.annotations.OpenWireType; 20 | import org.apache.activemq.openwire.annotations.OpenWireProperty; 21 | 22 | /** 23 | * @openwire:marshaller code="54" 24 | */ 25 | @OpenWireType(typeCode = 54) 26 | public class JournalTransaction implements DataStructure { 27 | 28 | public static final byte DATA_STRUCTURE_TYPE = CommandTypes.JOURNAL_TRANSACTION; 29 | 30 | public static final byte XA_PREPARE = 1; 31 | public static final byte XA_COMMIT = 2; 32 | public static final byte XA_ROLLBACK = 3; 33 | public static final byte LOCAL_COMMIT = 4; 34 | public static final byte LOCAL_ROLLBACK = 5; 35 | 36 | @OpenWireProperty(version = 1, sequence = 1) 37 | public TransactionId transactionId; 38 | 39 | @OpenWireProperty(version = 1, sequence = 2) 40 | public byte type; 41 | 42 | @OpenWireProperty(version = 1, sequence = 3) 43 | public boolean wasPrepared; 44 | 45 | public JournalTransaction(byte type, TransactionId transactionId, boolean wasPrepared) { 46 | this.type = type; 47 | this.transactionId = transactionId; 48 | this.wasPrepared = wasPrepared; 49 | } 50 | 51 | public JournalTransaction() { 52 | } 53 | 54 | @Override 55 | public byte getDataStructureType() { 56 | return DATA_STRUCTURE_TYPE; 57 | } 58 | 59 | /** 60 | * @openwire:property version=1 61 | */ 62 | public TransactionId getTransactionId() { 63 | return transactionId; 64 | } 65 | 66 | public void setTransactionId(TransactionId transactionId) { 67 | this.transactionId = transactionId; 68 | } 69 | 70 | /** 71 | * @openwire:property version=1 72 | */ 73 | public byte getType() { 74 | return type; 75 | } 76 | 77 | public void setType(byte type) { 78 | this.type = type; 79 | } 80 | 81 | /** 82 | * @openwire:property version=1 83 | */ 84 | public boolean getWasPrepared() { 85 | return wasPrepared; 86 | } 87 | 88 | public void setWasPrepared(boolean wasPrepared) { 89 | this.wasPrepared = wasPrepared; 90 | } 91 | 92 | @Override 93 | public boolean isMarshallAware() { 94 | return false; 95 | } 96 | 97 | @Override 98 | public String toString() { 99 | return getClass().getSimpleName() + " { " + transactionId + " }"; 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /openwire-legacy/src/main/java/org/apache/activemq/openwire/codec/v12/OpenWireTempDestinationMarshaller.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.codec.v12; 18 | 19 | import java.io.DataInput; 20 | import java.io.DataOutput; 21 | import java.io.IOException; 22 | import org.apache.activemq.openwire.codec.BooleanStream; 23 | import org.apache.activemq.openwire.codec.OpenWireFormat; 24 | 25 | public abstract class OpenWireTempDestinationMarshaller extends OpenWireDestinationMarshaller { 26 | 27 | /** 28 | * Un-marshal an object instance from the data input stream 29 | * 30 | * @param o 31 | * the object to un-marshal 32 | * @param dataIn 33 | * the data input stream to build the object from 34 | * @throws IOException 35 | */ 36 | @Override 37 | public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { 38 | super.tightUnmarshal(wireFormat, o, dataIn, bs); 39 | } 40 | 41 | /** 42 | * Write the booleans that this object uses to a BooleanStream 43 | */ 44 | @Override 45 | public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { 46 | int rc = super.tightMarshal1(wireFormat, o, bs); 47 | 48 | return rc + 0; 49 | } 50 | 51 | /** 52 | * Write a object instance to data output stream 53 | * 54 | * @param o 55 | * the instance to be marshaled 56 | * @param dataOut 57 | * the output stream 58 | * @throws IOException 59 | * thrown if an error occurs 60 | */ 61 | @Override 62 | public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException { 63 | super.tightMarshal2(wireFormat, o, dataOut, bs); 64 | } 65 | 66 | /** 67 | * Un-marshal an object instance from the data input stream 68 | * 69 | * @param o 70 | * the object to un-marshal 71 | * @param dataIn 72 | * the data input stream to build the object from 73 | * @throws IOException 74 | */ 75 | @Override 76 | public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException { 77 | super.looseUnmarshal(wireFormat, o, dataIn); 78 | } 79 | 80 | /** 81 | * Write the booleans that this object uses to a BooleanStream 82 | */ 83 | @Override 84 | public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { 85 | super.looseMarshal(wireFormat, o, dataOut); 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /openwire-legacy/src/main/java/org/apache/activemq/openwire/codec/v1/OpenWireTempDestinationMarshaller.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.codec.v1; 18 | 19 | import java.io.DataInput; 20 | import java.io.DataOutput; 21 | import java.io.IOException; 22 | 23 | import org.apache.activemq.openwire.codec.BooleanStream; 24 | import org.apache.activemq.openwire.codec.OpenWireFormat; 25 | 26 | public abstract class OpenWireTempDestinationMarshaller extends OpenWireDestinationMarshaller { 27 | 28 | /** 29 | * Un-marshal an object instance from the data input stream 30 | * 31 | * @param o 32 | * the object to un-marshal 33 | * @param dataIn 34 | * the data input stream to build the object from 35 | * @throws IOException 36 | */ 37 | @Override 38 | public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { 39 | super.tightUnmarshal(wireFormat, o, dataIn, bs); 40 | } 41 | 42 | /** 43 | * Write the booleans that this object uses to a BooleanStream 44 | */ 45 | @Override 46 | public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { 47 | int rc = super.tightMarshal1(wireFormat, o, bs); 48 | return rc + 0; 49 | } 50 | 51 | /** 52 | * Write a object instance to data output stream 53 | * 54 | * @param o 55 | * the instance to be marshaled 56 | * @param dataOut 57 | * the output stream 58 | * @throws IOException 59 | * thrown if an error occurs 60 | */ 61 | @Override 62 | public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException { 63 | super.tightMarshal2(wireFormat, o, dataOut, bs); 64 | } 65 | 66 | /** 67 | * Un-marshal an object instance from the data input stream 68 | * 69 | * @param o 70 | * the object to un-marshal 71 | * @param dataIn 72 | * the data input stream to build the object from 73 | * @throws IOException 74 | */ 75 | @Override 76 | public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException { 77 | super.looseUnmarshal(wireFormat, o, dataIn); 78 | } 79 | 80 | /** 81 | * Write the booleans that this object uses to a BooleanStream 82 | */ 83 | @Override 84 | public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { 85 | super.looseMarshal(wireFormat, o, dataOut); 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /openwire-legacy/src/main/java/org/apache/activemq/openwire/codec/v10/OpenWireTempDestinationMarshaller.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.codec.v10; 18 | 19 | import java.io.DataInput; 20 | import java.io.DataOutput; 21 | import java.io.IOException; 22 | 23 | import org.apache.activemq.openwire.codec.BooleanStream; 24 | import org.apache.activemq.openwire.codec.OpenWireFormat; 25 | 26 | public abstract class OpenWireTempDestinationMarshaller extends OpenWireDestinationMarshaller { 27 | 28 | /** 29 | * Un-marshal an object instance from the data input stream 30 | * 31 | * @param o 32 | * the object to un-marshal 33 | * @param dataIn 34 | * the data input stream to build the object from 35 | * @throws IOException 36 | */ 37 | @Override 38 | public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { 39 | super.tightUnmarshal(wireFormat, o, dataIn, bs); 40 | } 41 | 42 | /** 43 | * Write the booleans that this object uses to a BooleanStream 44 | */ 45 | @Override 46 | public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { 47 | int rc = super.tightMarshal1(wireFormat, o, bs); 48 | 49 | return rc + 0; 50 | } 51 | 52 | /** 53 | * Write a object instance to data output stream 54 | * 55 | * @param o 56 | * the instance to be marshaled 57 | * @param dataOut 58 | * the output stream 59 | * @throws IOException 60 | * thrown if an error occurs 61 | */ 62 | @Override 63 | public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException { 64 | super.tightMarshal2(wireFormat, o, dataOut, bs); 65 | } 66 | 67 | /** 68 | * Un-marshal an object instance from the data input stream 69 | * 70 | * @param o 71 | * the object to un-marshal 72 | * @param dataIn 73 | * the data input stream to build the object from 74 | * @throws IOException 75 | */ 76 | @Override 77 | public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException { 78 | super.looseUnmarshal(wireFormat, o, dataIn); 79 | } 80 | 81 | /** 82 | * Write the booleans that this object uses to a BooleanStream 83 | */ 84 | @Override 85 | public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { 86 | super.looseMarshal(wireFormat, o, dataOut); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /openwire-legacy/src/main/java/org/apache/activemq/openwire/codec/v11/OpenWireTempDestinationMarshaller.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.codec.v11; 18 | 19 | import java.io.DataInput; 20 | import java.io.DataOutput; 21 | import java.io.IOException; 22 | 23 | import org.apache.activemq.openwire.codec.BooleanStream; 24 | import org.apache.activemq.openwire.codec.OpenWireFormat; 25 | 26 | public abstract class OpenWireTempDestinationMarshaller extends OpenWireDestinationMarshaller { 27 | 28 | /** 29 | * Un-marshal an object instance from the data input stream 30 | * 31 | * @param o 32 | * the object to un-marshal 33 | * @param dataIn 34 | * the data input stream to build the object from 35 | * @throws IOException 36 | */ 37 | @Override 38 | public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { 39 | super.tightUnmarshal(wireFormat, o, dataIn, bs); 40 | } 41 | 42 | /** 43 | * Write the booleans that this object uses to a BooleanStream 44 | */ 45 | @Override 46 | public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { 47 | int rc = super.tightMarshal1(wireFormat, o, bs); 48 | 49 | return rc + 0; 50 | } 51 | 52 | /** 53 | * Write a object instance to data output stream 54 | * 55 | * @param o 56 | * the instance to be marshaled 57 | * @param dataOut 58 | * the output stream 59 | * @throws IOException 60 | * thrown if an error occurs 61 | */ 62 | @Override 63 | public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException { 64 | super.tightMarshal2(wireFormat, o, dataOut, bs); 65 | } 66 | 67 | /** 68 | * Un-marshal an object instance from the data input stream 69 | * 70 | * @param o 71 | * the object to un-marshal 72 | * @param dataIn 73 | * the data input stream to build the object from 74 | * @throws IOException 75 | */ 76 | @Override 77 | public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException { 78 | super.looseUnmarshal(wireFormat, o, dataIn); 79 | } 80 | 81 | /** 82 | * Write the booleans that this object uses to a BooleanStream 83 | */ 84 | @Override 85 | public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { 86 | super.looseMarshal(wireFormat, o, dataOut); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /openwire-legacy/src/main/java/org/apache/activemq/openwire/codec/v2/OpenWireTempDestinationMarshaller.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.codec.v2; 18 | 19 | import java.io.DataInput; 20 | import java.io.DataOutput; 21 | import java.io.IOException; 22 | 23 | import org.apache.activemq.openwire.codec.BooleanStream; 24 | import org.apache.activemq.openwire.codec.OpenWireFormat; 25 | 26 | public abstract class OpenWireTempDestinationMarshaller extends OpenWireDestinationMarshaller { 27 | 28 | /** 29 | * Un-marshal an object instance from the data input stream 30 | * 31 | * @param o 32 | * the object to un-marshal 33 | * @param dataIn 34 | * the data input stream to build the object from 35 | * @throws IOException 36 | */ 37 | @Override 38 | public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { 39 | super.tightUnmarshal(wireFormat, o, dataIn, bs); 40 | } 41 | 42 | /** 43 | * Write the booleans that this object uses to a BooleanStream 44 | */ 45 | @Override 46 | public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { 47 | int rc = super.tightMarshal1(wireFormat, o, bs); 48 | 49 | return rc + 0; 50 | } 51 | 52 | /** 53 | * Write a object instance to data output stream 54 | * 55 | * @param o 56 | * the instance to be marshaled 57 | * @param dataOut 58 | * the output stream 59 | * @throws IOException 60 | * thrown if an error occurs 61 | */ 62 | @Override 63 | public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException { 64 | super.tightMarshal2(wireFormat, o, dataOut, bs); 65 | } 66 | 67 | /** 68 | * Un-marshal an object instance from the data input stream 69 | * 70 | * @param o 71 | * the object to un-marshal 72 | * @param dataIn 73 | * the data input stream to build the object from 74 | * @throws IOException 75 | */ 76 | @Override 77 | public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException { 78 | super.looseUnmarshal(wireFormat, o, dataIn); 79 | } 80 | 81 | /** 82 | * Write the booleans that this object uses to a BooleanStream 83 | */ 84 | @Override 85 | public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { 86 | super.looseMarshal(wireFormat, o, dataOut); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /openwire-legacy/src/main/java/org/apache/activemq/openwire/codec/v3/OpenWireTempDestinationMarshaller.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.codec.v3; 18 | 19 | import java.io.DataInput; 20 | import java.io.DataOutput; 21 | import java.io.IOException; 22 | 23 | import org.apache.activemq.openwire.codec.BooleanStream; 24 | import org.apache.activemq.openwire.codec.OpenWireFormat; 25 | 26 | public abstract class OpenWireTempDestinationMarshaller extends OpenWireDestinationMarshaller { 27 | 28 | /** 29 | * Un-marshal an object instance from the data input stream 30 | * 31 | * @param o 32 | * the object to un-marshal 33 | * @param dataIn 34 | * the data input stream to build the object from 35 | * @throws IOException 36 | */ 37 | @Override 38 | public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { 39 | super.tightUnmarshal(wireFormat, o, dataIn, bs); 40 | } 41 | 42 | /** 43 | * Write the booleans that this object uses to a BooleanStream 44 | */ 45 | @Override 46 | public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { 47 | int rc = super.tightMarshal1(wireFormat, o, bs); 48 | 49 | return rc + 0; 50 | } 51 | 52 | /** 53 | * Write a object instance to data output stream 54 | * 55 | * @param o 56 | * the instance to be marshaled 57 | * @param dataOut 58 | * the output stream 59 | * @throws IOException 60 | * thrown if an error occurs 61 | */ 62 | @Override 63 | public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException { 64 | super.tightMarshal2(wireFormat, o, dataOut, bs); 65 | } 66 | 67 | /** 68 | * Un-marshal an object instance from the data input stream 69 | * 70 | * @param o 71 | * the object to un-marshal 72 | * @param dataIn 73 | * the data input stream to build the object from 74 | * @throws IOException 75 | */ 76 | @Override 77 | public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException { 78 | super.looseUnmarshal(wireFormat, o, dataIn); 79 | } 80 | 81 | /** 82 | * Write the booleans that this object uses to a BooleanStream 83 | */ 84 | @Override 85 | public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { 86 | super.looseMarshal(wireFormat, o, dataOut); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /openwire-legacy/src/main/java/org/apache/activemq/openwire/codec/v4/OpenWireTempDestinationMarshaller.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.activemq.openwire.codec.v4; 18 | 19 | import java.io.DataInput; 20 | import java.io.DataOutput; 21 | import java.io.IOException; 22 | 23 | import org.apache.activemq.openwire.codec.BooleanStream; 24 | import org.apache.activemq.openwire.codec.OpenWireFormat; 25 | 26 | public abstract class OpenWireTempDestinationMarshaller extends OpenWireDestinationMarshaller { 27 | 28 | /** 29 | * Un-marshal an object instance from the data input stream 30 | * 31 | * @param o 32 | * the object to un-marshal 33 | * @param dataIn 34 | * the data input stream to build the object from 35 | * @throws IOException 36 | */ 37 | @Override 38 | public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { 39 | super.tightUnmarshal(wireFormat, o, dataIn, bs); 40 | } 41 | 42 | /** 43 | * Write the booleans that this object uses to a BooleanStream 44 | */ 45 | @Override 46 | public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { 47 | int rc = super.tightMarshal1(wireFormat, o, bs); 48 | 49 | return rc + 0; 50 | } 51 | 52 | /** 53 | * Write a object instance to data output stream 54 | * 55 | * @param o 56 | * the instance to be marshaled 57 | * @param dataOut 58 | * the output stream 59 | * @throws IOException 60 | * thrown if an error occurs 61 | */ 62 | @Override 63 | public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException { 64 | super.tightMarshal2(wireFormat, o, dataOut, bs); 65 | } 66 | 67 | /** 68 | * Un-marshal an object instance from the data input stream 69 | * 70 | * @param o 71 | * the object to un-marshal 72 | * @param dataIn 73 | * the data input stream to build the object from 74 | * @throws IOException 75 | */ 76 | @Override 77 | public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException { 78 | super.looseUnmarshal(wireFormat, o, dataIn); 79 | } 80 | 81 | /** 82 | * Write the booleans that this object uses to a BooleanStream 83 | */ 84 | @Override 85 | public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { 86 | super.looseMarshal(wireFormat, o, dataOut); 87 | } 88 | } 89 | --------------------------------------------------------------------------------