From fc4a6497ea6e52c6b455f0121a841e8f249f69aa Mon Sep 17 00:00:00 2001 From: "Timothy A. Bish" Date: Thu, 30 Jun 2011 18:00:38 +0000 Subject: [PATCH] Apply patch for: https://issues.apache.org/jira/browse/AMQ-3383 git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1141641 13f79535-47bb-0310-9956-ffa450edef68 --- .../activemq/command/ConnectionControl.java | 16 ++++++++++++++++ .../openwire/v8/ConnectionControlMarshaller.java | 2 +- .../openwire/v8/ConnectionControlTest.java | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/activemq-core/src/main/java/org/apache/activemq/command/ConnectionControl.java b/activemq-core/src/main/java/org/apache/activemq/command/ConnectionControl.java index 65d01506bf..5b6392d044 100644 --- a/activemq-core/src/main/java/org/apache/activemq/command/ConnectionControl.java +++ b/activemq-core/src/main/java/org/apache/activemq/command/ConnectionControl.java @@ -33,6 +33,7 @@ public class ConnectionControl extends BaseCommand { protected boolean faultTolerant; protected String connectedBrokers=""; protected String reconnectTo = ""; + protected byte[] token; protected boolean rebalanceConnection; public byte getDataStructureType() { @@ -166,4 +167,19 @@ public class ConnectionControl extends BaseCommand { public void setRebalanceConnection(boolean rebalanceConnection) { this.rebalanceConnection = rebalanceConnection; } + + /** + * @openwire:property version=8 + * @return the token + */ + public byte[] getToken() { + return this.token; + } + + /** + * @param token the token to set + */ + public void setToken(byte[] token) { + this.token = token; + } } diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v8/ConnectionControlMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v8/ConnectionControlMarshaller.java index 55ea854543..73c3ad30d4 100644 --- a/activemq-core/src/main/java/org/apache/activemq/openwire/v8/ConnectionControlMarshaller.java +++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v8/ConnectionControlMarshaller.java @@ -1 +1 @@ -/** * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.activemq.openwire.v8; import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; import org.apache.activemq.openwire.*; import org.apache.activemq.command.*; /** * Marshalling code for Open Wire Format for ConnectionControlMarshaller * * * NOTE!: This file is auto generated - do not modify! * if you need to make a change, please see the modify the groovy scripts in the * under src/gram/script and then use maven openwire:generate to regenerate * this file. * * */ public class ConnectionControlMarshaller extends BaseCommandMarshaller { /** * Return the type of Data Structure we marshal * @return short representation of the type data structure */ public byte getDataStructureType() { return ConnectionControl.DATA_STRUCTURE_TYPE; } /** * @return a new object instance */ public DataStructure createObject() { return new ConnectionControl(); } /** * Un-marshal an object instance from the data input stream * * @param o the object to un-marshal * @param dataIn the data input stream to build the object from * @throws IOException */ public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { super.tightUnmarshal(wireFormat, o, dataIn, bs); ConnectionControl info = (ConnectionControl)o; info.setClose(bs.readBoolean()); info.setExit(bs.readBoolean()); info.setFaultTolerant(bs.readBoolean()); info.setResume(bs.readBoolean()); info.setSuspend(bs.readBoolean()); info.setConnectedBrokers(tightUnmarshalString(dataIn, bs)); info.setReconnectTo(tightUnmarshalString(dataIn, bs)); info.setRebalanceConnection(bs.readBoolean()); } /** * Write the booleans that this object uses to a BooleanStream */ public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { ConnectionControl info = (ConnectionControl)o; int rc = super.tightMarshal1(wireFormat, o, bs); bs.writeBoolean(info.isClose()); bs.writeBoolean(info.isExit()); bs.writeBoolean(info.isFaultTolerant()); bs.writeBoolean(info.isResume()); bs.writeBoolean(info.isSuspend()); rc += tightMarshalString1(info.getConnectedBrokers(), bs); rc += tightMarshalString1(info.getReconnectTo(), bs); bs.writeBoolean(info.isRebalanceConnection()); return rc + 0; } /** * Write a object instance to data output stream * * @param o the instance to be marshaled * @param dataOut the output stream * @throws IOException thrown if an error occurs */ public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException { super.tightMarshal2(wireFormat, o, dataOut, bs); ConnectionControl info = (ConnectionControl)o; bs.readBoolean(); bs.readBoolean(); bs.readBoolean(); bs.readBoolean(); bs.readBoolean(); tightMarshalString2(info.getConnectedBrokers(), dataOut, bs); tightMarshalString2(info.getReconnectTo(), dataOut, bs); bs.readBoolean(); } /** * Un-marshal an object instance from the data input stream * * @param o the object to un-marshal * @param dataIn the data input stream to build the object from * @throws IOException */ public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException { super.looseUnmarshal(wireFormat, o, dataIn); ConnectionControl info = (ConnectionControl)o; info.setClose(dataIn.readBoolean()); info.setExit(dataIn.readBoolean()); info.setFaultTolerant(dataIn.readBoolean()); info.setResume(dataIn.readBoolean()); info.setSuspend(dataIn.readBoolean()); info.setConnectedBrokers(looseUnmarshalString(dataIn)); info.setReconnectTo(looseUnmarshalString(dataIn)); info.setRebalanceConnection(dataIn.readBoolean()); } /** * Write the booleans that this object uses to a BooleanStream */ public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { ConnectionControl info = (ConnectionControl)o; super.looseMarshal(wireFormat, o, dataOut); dataOut.writeBoolean(info.isClose()); dataOut.writeBoolean(info.isExit()); dataOut.writeBoolean(info.isFaultTolerant()); dataOut.writeBoolean(info.isResume()); dataOut.writeBoolean(info.isSuspend()); looseMarshalString(info.getConnectedBrokers(), dataOut); looseMarshalString(info.getReconnectTo(), dataOut); dataOut.writeBoolean(info.isRebalanceConnection()); } } \ No newline at end of file +/** * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.activemq.openwire.v8; import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; import org.apache.activemq.openwire.*; import org.apache.activemq.command.*; /** * Marshalling code for Open Wire Format for ConnectionControlMarshaller * * * NOTE!: This file is auto generated - do not modify! * if you need to make a change, please see the modify the groovy scripts in the * under src/gram/script and then use maven openwire:generate to regenerate * this file. * * */ public class ConnectionControlMarshaller extends BaseCommandMarshaller { /** * Return the type of Data Structure we marshal * @return short representation of the type data structure */ public byte getDataStructureType() { return ConnectionControl.DATA_STRUCTURE_TYPE; } /** * @return a new object instance */ public DataStructure createObject() { return new ConnectionControl(); } /** * Un-marshal an object instance from the data input stream * * @param o the object to un-marshal * @param dataIn the data input stream to build the object from * @throws IOException */ public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { super.tightUnmarshal(wireFormat, o, dataIn, bs); ConnectionControl info = (ConnectionControl)o; info.setClose(bs.readBoolean()); info.setExit(bs.readBoolean()); info.setFaultTolerant(bs.readBoolean()); info.setResume(bs.readBoolean()); info.setSuspend(bs.readBoolean()); info.setConnectedBrokers(tightUnmarshalString(dataIn, bs)); info.setReconnectTo(tightUnmarshalString(dataIn, bs)); info.setRebalanceConnection(bs.readBoolean()); info.setToken(tightUnmarshalByteArray(dataIn, bs)); } /** * Write the booleans that this object uses to a BooleanStream */ public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { ConnectionControl info = (ConnectionControl)o; int rc = super.tightMarshal1(wireFormat, o, bs); bs.writeBoolean(info.isClose()); bs.writeBoolean(info.isExit()); bs.writeBoolean(info.isFaultTolerant()); bs.writeBoolean(info.isResume()); bs.writeBoolean(info.isSuspend()); rc += tightMarshalString1(info.getConnectedBrokers(), bs); rc += tightMarshalString1(info.getReconnectTo(), bs); bs.writeBoolean(info.isRebalanceConnection()); rc += tightMarshalByteArray1(info.getToken(), bs); return rc + 0; } /** * Write a object instance to data output stream * * @param o the instance to be marshaled * @param dataOut the output stream * @throws IOException thrown if an error occurs */ public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException { super.tightMarshal2(wireFormat, o, dataOut, bs); ConnectionControl info = (ConnectionControl)o; bs.readBoolean(); bs.readBoolean(); bs.readBoolean(); bs.readBoolean(); bs.readBoolean(); tightMarshalString2(info.getConnectedBrokers(), dataOut, bs); tightMarshalString2(info.getReconnectTo(), dataOut, bs); bs.readBoolean(); tightMarshalByteArray2(info.getToken(), dataOut, bs); } /** * Un-marshal an object instance from the data input stream * * @param o the object to un-marshal * @param dataIn the data input stream to build the object from * @throws IOException */ public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException { super.looseUnmarshal(wireFormat, o, dataIn); ConnectionControl info = (ConnectionControl)o; info.setClose(dataIn.readBoolean()); info.setExit(dataIn.readBoolean()); info.setFaultTolerant(dataIn.readBoolean()); info.setResume(dataIn.readBoolean()); info.setSuspend(dataIn.readBoolean()); info.setConnectedBrokers(looseUnmarshalString(dataIn)); info.setReconnectTo(looseUnmarshalString(dataIn)); info.setRebalanceConnection(dataIn.readBoolean()); info.setToken(looseUnmarshalByteArray(dataIn)); } /** * Write the booleans that this object uses to a BooleanStream */ public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { ConnectionControl info = (ConnectionControl)o; super.looseMarshal(wireFormat, o, dataOut); dataOut.writeBoolean(info.isClose()); dataOut.writeBoolean(info.isExit()); dataOut.writeBoolean(info.isFaultTolerant()); dataOut.writeBoolean(info.isResume()); dataOut.writeBoolean(info.isSuspend()); looseMarshalString(info.getConnectedBrokers(), dataOut); looseMarshalString(info.getReconnectTo(), dataOut); dataOut.writeBoolean(info.isRebalanceConnection()); looseMarshalByteArray(wireFormat, info.getToken(), dataOut); } } \ No newline at end of file diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v8/ConnectionControlTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v8/ConnectionControlTest.java index a00350e5a9..64ef24ddc8 100644 --- a/activemq-core/src/test/java/org/apache/activemq/openwire/v8/ConnectionControlTest.java +++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v8/ConnectionControlTest.java @@ -1 +1 @@ -/** * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.activemq.openwire.v8; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import org.apache.activemq.openwire.*; import org.apache.activemq.command.*; /** * Test case for the OpenWire marshalling for ConnectionControl * * * NOTE!: This file is auto generated - do not modify! * if you need to make a change, please see the modify the groovy scripts in the * under src/gram/script and then use maven openwire:generate to regenerate * this file. * * */ public class ConnectionControlTest extends BaseCommandTestSupport { public static ConnectionControlTest SINGLETON = new ConnectionControlTest(); public Object createObject() throws Exception { ConnectionControl info = new ConnectionControl(); populateObject(info); return info; } protected void populateObject(Object object) throws Exception { super.populateObject(object); ConnectionControl info = (ConnectionControl) object; info.setClose(true); info.setExit(false); info.setFaultTolerant(true); info.setResume(false); info.setSuspend(true); info.setConnectedBrokers("ConnectedBrokers:1"); info.setReconnectTo("ReconnectTo:2"); info.setRebalanceConnection(false); } } \ No newline at end of file +/** * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.activemq.openwire.v8; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import org.apache.activemq.openwire.*; import org.apache.activemq.command.*; /** * Test case for the OpenWire marshalling for ConnectionControl * * * NOTE!: This file is auto generated - do not modify! * if you need to make a change, please see the modify the groovy scripts in the * under src/gram/script and then use maven openwire:generate to regenerate * this file. * * */ public class ConnectionControlTest extends BaseCommandTestSupport { public static ConnectionControlTest SINGLETON = new ConnectionControlTest(); public Object createObject() throws Exception { ConnectionControl info = new ConnectionControl(); populateObject(info); return info; } protected void populateObject(Object object) throws Exception { super.populateObject(object); ConnectionControl info = (ConnectionControl) object; info.setClose(true); info.setExit(false); info.setFaultTolerant(true); info.setResume(false); info.setSuspend(true); info.setConnectedBrokers("ConnectedBrokers:1"); info.setReconnectTo("ReconnectTo:2"); info.setRebalanceConnection(false); info.setToken("Token:3".getBytes()); } } \ No newline at end of file