index
int64 0
0
| repo_id
stringlengths 9
205
| file_path
stringlengths 31
246
| content
stringlengths 1
12.2M
| __index_level_0__
int64 0
10k
|
---|---|---|---|---|
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/DataStreamMarshaller.java
|
/**
* 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.codec;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.commands.DataStructure;
public interface DataStreamMarshaller {
byte getDataStructureType();
DataStructure createObject();
int tightMarshal1(OpenWireFormat format, Object c, BooleanStream bs) throws IOException;
void tightMarshal2(OpenWireFormat format, Object c, DataOutput ds, BooleanStream bs) throws IOException;
void tightUnmarshal(OpenWireFormat format, Object data, DataInput dis, BooleanStream bs) throws IOException;
void looseMarshal(OpenWireFormat format, Object c, DataOutput ds) throws IOException;
void looseUnmarshal(OpenWireFormat format, Object data, DataInput dis) throws IOException;
}
| 1,400 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/BooleanStream.java
|
/**
* 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.codec;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.nio.ByteBuffer;
public final class BooleanStream {
byte data[] = new byte[48];
short arrayLimit;
short arrayPos;
byte bytePos;
public boolean readBoolean() throws IOException {
assert arrayPos <= arrayLimit;
byte b = data[arrayPos];
boolean rc = ((b >> bytePos) & 0x01) != 0;
bytePos++;
if (bytePos >= 8) {
bytePos = 0;
arrayPos++;
}
return rc;
}
public void writeBoolean(boolean value) throws IOException {
if (bytePos == 0) {
arrayLimit++;
if (arrayLimit >= data.length) {
// re-grow the array.
byte d[] = new byte[data.length * 2];
System.arraycopy(data, 0, d, 0, data.length);
data = d;
}
}
if (value) {
data[arrayPos] |= 0x01 << bytePos;
}
bytePos++;
if (bytePos >= 8) {
bytePos = 0;
arrayPos++;
}
}
public void marshal(DataOutput dataOut) throws IOException {
if (arrayLimit < 64) {
dataOut.writeByte(arrayLimit);
} else if (arrayLimit < 256) { // max value of unsigned byte
dataOut.writeByte(0xC0);
dataOut.writeByte(arrayLimit);
} else {
dataOut.writeByte(0x80);
dataOut.writeShort(arrayLimit);
}
dataOut.write(data, 0, arrayLimit);
clear();
}
public void marshal(ByteBuffer dataOut) {
if (arrayLimit < 64) {
dataOut.put((byte) arrayLimit);
} else if (arrayLimit < 256) { // max value of unsigned byte
dataOut.put((byte) 0xC0);
dataOut.put((byte) arrayLimit);
} else {
dataOut.put((byte) 0x80);
dataOut.putShort(arrayLimit);
}
dataOut.put(data, 0, arrayLimit);
}
public void unmarshal(DataInput dataIn) throws IOException {
arrayLimit = (short) (dataIn.readByte() & 0xFF);
if (arrayLimit == 0xC0) {
arrayLimit = (short) (dataIn.readByte() & 0xFF);
} else if (arrayLimit == 0x80) {
arrayLimit = dataIn.readShort();
}
if (data.length < arrayLimit) {
data = new byte[arrayLimit];
}
dataIn.readFully(data, 0, arrayLimit);
clear();
}
public void clear() {
arrayPos = 0;
bytePos = 0;
}
public int marshalledSize() {
if (arrayLimit < 64) {
return 1 + arrayLimit;
} else if (arrayLimit < 256) {
return 2 + arrayLimit;
} else {
return 3 + arrayLimit;
}
}
}
| 1,401 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/BaseDataStreamMarshaller.java
|
/**
* 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.codec;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.lang.reflect.Constructor;
import org.apache.activemq.openwire.buffer.Buffer;
import org.apache.activemq.openwire.commands.DataStructure;
/**
* Root of all OpenWire marshalers.
*/
public abstract class BaseDataStreamMarshaller implements DataStreamMarshaller {
public static final Constructor<StackTraceElement> STACK_TRACE_ELEMENT_CONSTRUCTOR;
static {
Constructor<StackTraceElement> constructor = null;
try {
constructor = StackTraceElement.class.getConstructor(
new Class[] { String.class, String.class, String.class, int.class });
} catch (Throwable e) {
}
STACK_TRACE_ELEMENT_CONSTRUCTOR = constructor;
}
@Override
public abstract byte getDataStructureType();
@Override
public abstract DataStructure createObject();
@Override
public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
return 0;
}
@Override
public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException {
}
@Override
public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException {
}
public int tightMarshalLong1(OpenWireFormat wireFormat, long o, BooleanStream bs) throws IOException {
if (o == 0) {
bs.writeBoolean(false);
bs.writeBoolean(false);
return 0;
} else if ((o & 0xFFFFFFFFFFFF0000L) == 0) {
bs.writeBoolean(false);
bs.writeBoolean(true);
return 2;
} else if ((o & 0xFFFFFFFF00000000L) == 0) {
bs.writeBoolean(true);
bs.writeBoolean(false);
return 4;
} else {
bs.writeBoolean(true);
bs.writeBoolean(true);
return 8;
}
}
public void tightMarshalLong2(OpenWireFormat wireFormat, long o, DataOutput dataOut, BooleanStream bs) throws IOException {
if (bs.readBoolean()) {
if (bs.readBoolean()) {
dataOut.writeLong(o);
} else {
dataOut.writeInt((int) o);
}
} else {
if (bs.readBoolean()) {
dataOut.writeShort((int) o);
}
}
}
public long tightUnmarshalLong(OpenWireFormat wireFormat, DataInput dataIn, BooleanStream bs) throws IOException {
if (bs.readBoolean()) {
if (bs.readBoolean()) {
return dataIn.readLong();
} else {
return toLong(dataIn.readInt());
}
} else {
if (bs.readBoolean()) {
return toLong(dataIn.readShort());
} else {
return 0;
}
}
}
protected long toLong(short value) {
// lets handle negative values
long answer = value;
return answer & 0xffffL;
}
protected long toLong(int value) {
// lets handle negative values
long answer = value;
return answer & 0xffffffffL;
}
protected DataStructure tightUnmarsalNestedObject(OpenWireFormat wireFormat, DataInput dataIn, BooleanStream bs) throws IOException {
return wireFormat.tightUnmarshalNestedObject(dataIn, bs);
}
protected int tightMarshalNestedObject1(OpenWireFormat wireFormat, DataStructure o, BooleanStream bs) throws IOException {
return wireFormat.tightMarshalNestedObject1(o, bs);
}
protected void tightMarshalNestedObject2(OpenWireFormat wireFormat, DataStructure o, DataOutput dataOut, BooleanStream bs) throws IOException {
wireFormat.tightMarshalNestedObject2(o, dataOut, bs);
}
protected DataStructure tightUnmarsalCachedObject(OpenWireFormat wireFormat, DataInput dataIn, BooleanStream bs) throws IOException {
if (wireFormat.isCacheEnabled()) {
if (bs.readBoolean()) {
short index = dataIn.readShort();
DataStructure object = wireFormat.tightUnmarshalNestedObject(dataIn, bs);
wireFormat.setInUnmarshallCache(index, object);
return object;
} else {
short index = dataIn.readShort();
return wireFormat.getFromUnmarshallCache(index);
}
} else {
return wireFormat.tightUnmarshalNestedObject(dataIn, bs);
}
}
protected int tightMarshalCachedObject1(OpenWireFormat wireFormat, DataStructure o, BooleanStream bs) throws IOException {
if (wireFormat.isCacheEnabled()) {
Short index = wireFormat.getMarshallCacheIndex(o);
bs.writeBoolean(index == null);
if (index == null) {
int rc = wireFormat.tightMarshalNestedObject1(o, bs);
wireFormat.addToMarshallCache(o);
return 2 + rc;
} else {
return 2;
}
} else {
return wireFormat.tightMarshalNestedObject1(o, bs);
}
}
protected void tightMarshalCachedObject2(OpenWireFormat wireFormat, DataStructure o, DataOutput dataOut, BooleanStream bs) throws IOException {
if (wireFormat.isCacheEnabled()) {
Short index = wireFormat.getMarshallCacheIndex(o);
if (bs.readBoolean()) {
dataOut.writeShort(index.shortValue());
wireFormat.tightMarshalNestedObject2(o, dataOut, bs);
} else {
dataOut.writeShort(index.shortValue());
}
} else {
wireFormat.tightMarshalNestedObject2(o, dataOut, bs);
}
}
protected Throwable tightUnmarsalThrowable(OpenWireFormat wireFormat, DataInput dataIn, BooleanStream bs) throws IOException {
if (bs.readBoolean()) {
String clazz = tightUnmarshalString(dataIn, bs);
String message = tightUnmarshalString(dataIn, bs);
Throwable o = createThrowable(clazz, message);
if (wireFormat.isStackTraceEnabled()) {
if (STACK_TRACE_ELEMENT_CONSTRUCTOR != null) {
StackTraceElement ss[] = new StackTraceElement[dataIn.readShort()];
for (int i = 0; i < ss.length; i++) {
try {
ss[i] = STACK_TRACE_ELEMENT_CONSTRUCTOR.newInstance(new Object[] { tightUnmarshalString(dataIn, bs),
tightUnmarshalString(dataIn, bs), tightUnmarshalString(dataIn, bs), Integer.valueOf(dataIn.readInt()) });
} catch (IOException e) {
throw e;
} catch (Throwable e) {
}
}
o.setStackTrace(ss);
} else {
short size = dataIn.readShort();
for (int i = 0; i < size; i++) {
tightUnmarshalString(dataIn, bs);
tightUnmarshalString(dataIn, bs);
tightUnmarshalString(dataIn, bs);
dataIn.readInt();
}
}
o.initCause(tightUnmarsalThrowable(wireFormat, dataIn, bs));
}
return o;
} else {
return null;
}
}
private Throwable createThrowable(String className, String message) {
try {
Class<?> clazz = Class.forName(className, false, BaseDataStreamMarshaller.class.getClassLoader());
Constructor<?> constructor = clazz.getConstructor(new Class[] { String.class });
return (Throwable) constructor.newInstance(new Object[] { message });
} catch (Throwable e) {
return new Throwable(className + ": " + message);
}
}
protected int tightMarshalThrowable1(OpenWireFormat wireFormat, Throwable o, BooleanStream bs) throws IOException {
if (o == null) {
bs.writeBoolean(false);
return 0;
} else {
int rc = 0;
bs.writeBoolean(true);
rc += tightMarshalString1(o.getClass().getName(), bs);
rc += tightMarshalString1(o.getMessage(), bs);
if (wireFormat.isStackTraceEnabled()) {
rc += 2;
StackTraceElement[] stackTrace = o.getStackTrace();
for (int i = 0; i < stackTrace.length; i++) {
StackTraceElement element = stackTrace[i];
rc += tightMarshalString1(element.getClassName(), bs);
rc += tightMarshalString1(element.getMethodName(), bs);
rc += tightMarshalString1(element.getFileName(), bs);
rc += 4;
}
rc += tightMarshalThrowable1(wireFormat, o.getCause(), bs);
}
return rc;
}
}
protected void tightMarshalThrowable2(OpenWireFormat wireFormat, Throwable o, DataOutput dataOut, BooleanStream bs) throws IOException {
if (bs.readBoolean()) {
tightMarshalString2(o.getClass().getName(), dataOut, bs);
tightMarshalString2(o.getMessage(), dataOut, bs);
if (wireFormat.isStackTraceEnabled()) {
StackTraceElement[] stackTrace = o.getStackTrace();
dataOut.writeShort(stackTrace.length);
for (int i = 0; i < stackTrace.length; i++) {
StackTraceElement element = stackTrace[i];
tightMarshalString2(element.getClassName(), dataOut, bs);
tightMarshalString2(element.getMethodName(), dataOut, bs);
tightMarshalString2(element.getFileName(), dataOut, bs);
dataOut.writeInt(element.getLineNumber());
}
tightMarshalThrowable2(wireFormat, o.getCause(), dataOut, bs);
}
}
}
@SuppressWarnings("deprecation")
protected String tightUnmarshalString(DataInput dataIn, BooleanStream bs) throws IOException {
if (bs.readBoolean()) {
if (bs.readBoolean()) {
int size = dataIn.readShort();
byte data[] = new byte[size];
dataIn.readFully(data);
// Yes deprecated, but we know what we are doing.
// This allows us to create a String from a ASCII byte array. (no UTF-8
// decoding)
return new String(data, 0);
} else {
return dataIn.readUTF();
}
} else {
return null;
}
}
protected int tightMarshalString1(String value, BooleanStream bs) throws IOException {
bs.writeBoolean(value != null);
if (value != null) {
int strlen = value.length();
int utflen = 0;
char[] charr = new char[strlen];
int c = 0;
boolean isOnlyAscii = true;
value.getChars(0, strlen, charr, 0);
for (int i = 0; i < strlen; i++) {
c = charr[i];
if ((c >= 0x0001) && (c <= 0x007F)) {
utflen++;
} else if (c > 0x07FF) {
utflen += 3;
isOnlyAscii = false;
} else {
isOnlyAscii = false;
utflen += 2;
}
}
if (utflen >= Short.MAX_VALUE) {
throw new IOException("Encountered a String value that is too long to encode.");
}
bs.writeBoolean(isOnlyAscii);
return utflen + 2;
} else {
return 0;
}
}
protected void tightMarshalString2(String value, DataOutput dataOut, BooleanStream bs) throws IOException {
if (bs.readBoolean()) {
// If we verified it only holds ascii values
if (bs.readBoolean()) {
dataOut.writeShort(value.length());
dataOut.writeBytes(value);
} else {
dataOut.writeUTF(value);
}
}
}
protected int tightMarshalObjectArray1(OpenWireFormat wireFormat, DataStructure[] objects, BooleanStream bs) throws IOException {
if (objects != null) {
int rc = 0;
bs.writeBoolean(true);
rc += 2;
for (int i = 0; i < objects.length; i++) {
rc += tightMarshalNestedObject1(wireFormat, objects[i], bs);
}
return rc;
} else {
bs.writeBoolean(false);
return 0;
}
}
protected void tightMarshalObjectArray2(OpenWireFormat wireFormat, DataStructure[] objects, DataOutput dataOut, BooleanStream bs) throws IOException {
if (bs.readBoolean()) {
dataOut.writeShort(objects.length);
for (int i = 0; i < objects.length; i++) {
tightMarshalNestedObject2(wireFormat, objects[i], dataOut, bs);
}
}
}
protected int tightMarshalConstByteArray1(byte[] data, BooleanStream bs, int i) throws IOException {
return i;
}
protected void tightMarshalConstByteArray2(byte[] data, DataOutput dataOut, BooleanStream bs, int i) throws IOException {
dataOut.write(data, 0, i);
}
protected byte[] tightUnmarshalConstByteArray(DataInput dataIn, BooleanStream bs, int i) throws IOException {
byte data[] = new byte[i];
dataIn.readFully(data);
return data;
}
protected int tightMarshalByteArray1(byte[] data, BooleanStream bs) throws IOException {
bs.writeBoolean(data != null);
if (data != null) {
return data.length + 4;
} else {
return 0;
}
}
protected void tightMarshalByteArray2(byte[] data, DataOutput dataOut, BooleanStream bs) throws IOException {
if (bs.readBoolean()) {
dataOut.writeInt(data.length);
dataOut.write(data);
}
}
protected byte[] tightUnmarshalByteArray(DataInput dataIn, BooleanStream bs) throws IOException {
byte rc[] = null;
if (bs.readBoolean()) {
int size = dataIn.readInt();
rc = new byte[size];
dataIn.readFully(rc);
}
return rc;
}
protected int tightMarshalByteSequence1(Buffer data, BooleanStream bs) throws IOException {
bs.writeBoolean(data != null);
if (data != null) {
return data.getLength() + 4;
} else {
return 0;
}
}
protected void tightMarshalByteSequence2(Buffer data, DataOutput dataOut, BooleanStream bs) throws IOException {
if (bs.readBoolean()) {
dataOut.writeInt(data.getLength());
dataOut.write(data.getData(), data.getOffset(), data.getLength());
}
}
protected Buffer tightUnmarshalByteSequence(DataInput dataIn, BooleanStream bs) throws IOException {
Buffer rc = null;
if (bs.readBoolean()) {
int size = dataIn.readInt();
byte[] t = new byte[size];
dataIn.readFully(t);
return new Buffer(t, 0, size);
}
return rc;
}
//
// The loose marshaling logic
//
@Override
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException {
}
@Override
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException {
}
public void looseMarshalLong(OpenWireFormat wireFormat, long o, DataOutput dataOut) throws IOException {
dataOut.writeLong(o);
}
public long looseUnmarshalLong(OpenWireFormat wireFormat, DataInput dataIn) throws IOException {
return dataIn.readLong();
}
protected DataStructure looseUnmarsalNestedObject(OpenWireFormat wireFormat, DataInput dataIn) throws IOException {
return wireFormat.looseUnmarshalNestedObject(dataIn);
}
protected void looseMarshalNestedObject(OpenWireFormat wireFormat, DataStructure o, DataOutput dataOut) throws IOException {
wireFormat.looseMarshalNestedObject(o, dataOut);
}
protected DataStructure looseUnmarsalCachedObject(OpenWireFormat wireFormat, DataInput dataIn) throws IOException {
if (wireFormat.isCacheEnabled()) {
if (dataIn.readBoolean()) {
short index = dataIn.readShort();
DataStructure object = wireFormat.looseUnmarshalNestedObject(dataIn);
wireFormat.setInUnmarshallCache(index, object);
return object;
} else {
short index = dataIn.readShort();
return wireFormat.getFromUnmarshallCache(index);
}
} else {
return wireFormat.looseUnmarshalNestedObject(dataIn);
}
}
protected void looseMarshalCachedObject(OpenWireFormat wireFormat, DataStructure o, DataOutput dataOut) throws IOException {
if (wireFormat.isCacheEnabled()) {
Short index = wireFormat.getMarshallCacheIndex(o);
dataOut.writeBoolean(index == null);
if (index == null) {
index = wireFormat.addToMarshallCache(o);
dataOut.writeShort(index.shortValue());
wireFormat.looseMarshalNestedObject(o, dataOut);
} else {
dataOut.writeShort(index.shortValue());
}
} else {
wireFormat.looseMarshalNestedObject(o, dataOut);
}
}
protected Throwable looseUnmarsalThrowable(OpenWireFormat wireFormat, DataInput dataIn) throws IOException {
if (dataIn.readBoolean()) {
String clazz = looseUnmarshalString(dataIn);
String message = looseUnmarshalString(dataIn);
Throwable o = createThrowable(clazz, message);
if (wireFormat.isStackTraceEnabled()) {
if (STACK_TRACE_ELEMENT_CONSTRUCTOR != null) {
StackTraceElement ss[] = new StackTraceElement[dataIn.readShort()];
for (int i = 0; i < ss.length; i++) {
try {
ss[i] = STACK_TRACE_ELEMENT_CONSTRUCTOR.newInstance(new Object[] { looseUnmarshalString(dataIn),
looseUnmarshalString(dataIn), looseUnmarshalString(dataIn), Integer.valueOf(dataIn.readInt()) });
} catch (IOException e) {
throw e;
} catch (Throwable e) {
}
}
o.setStackTrace(ss);
} else {
short size = dataIn.readShort();
for (int i = 0; i < size; i++) {
looseUnmarshalString(dataIn);
looseUnmarshalString(dataIn);
looseUnmarshalString(dataIn);
dataIn.readInt();
}
}
o.initCause(looseUnmarsalThrowable(wireFormat, dataIn));
}
return o;
} else {
return null;
}
}
protected void looseMarshalThrowable(OpenWireFormat wireFormat, Throwable o, DataOutput dataOut) throws IOException {
dataOut.writeBoolean(o != null);
if (o != null) {
looseMarshalString(o.getClass().getName(), dataOut);
looseMarshalString(o.getMessage(), dataOut);
if (wireFormat.isStackTraceEnabled()) {
StackTraceElement[] stackTrace = o.getStackTrace();
dataOut.writeShort(stackTrace.length);
for (int i = 0; i < stackTrace.length; i++) {
StackTraceElement element = stackTrace[i];
looseMarshalString(element.getClassName(), dataOut);
looseMarshalString(element.getMethodName(), dataOut);
looseMarshalString(element.getFileName(), dataOut);
dataOut.writeInt(element.getLineNumber());
}
looseMarshalThrowable(wireFormat, o.getCause(), dataOut);
}
}
}
protected String looseUnmarshalString(DataInput dataIn) throws IOException {
if (dataIn.readBoolean()) {
return dataIn.readUTF();
} else {
return null;
}
}
protected void looseMarshalString(String value, DataOutput dataOut) throws IOException {
dataOut.writeBoolean(value != null);
if (value != null) {
dataOut.writeUTF(value);
}
}
protected void looseMarshalObjectArray(OpenWireFormat wireFormat, DataStructure[] objects, DataOutput dataOut) throws IOException {
dataOut.writeBoolean(objects != null);
if (objects != null) {
dataOut.writeShort(objects.length);
for (int i = 0; i < objects.length; i++) {
looseMarshalNestedObject(wireFormat, objects[i], dataOut);
}
}
}
protected void looseMarshalConstByteArray(OpenWireFormat wireFormat, byte[] data, DataOutput dataOut, int i) throws IOException {
dataOut.write(data, 0, i);
}
protected byte[] looseUnmarshalConstByteArray(DataInput dataIn, int i) throws IOException {
byte data[] = new byte[i];
dataIn.readFully(data);
return data;
}
protected void looseMarshalByteArray(OpenWireFormat wireFormat, byte[] data, DataOutput dataOut) throws IOException {
dataOut.writeBoolean(data != null);
if (data != null) {
dataOut.writeInt(data.length);
dataOut.write(data);
}
}
protected byte[] looseUnmarshalByteArray(DataInput dataIn) throws IOException {
byte rc[] = null;
if (dataIn.readBoolean()) {
int size = dataIn.readInt();
rc = new byte[size];
dataIn.readFully(rc);
}
return rc;
}
protected void looseMarshalByteSequence(OpenWireFormat wireFormat, Buffer data, DataOutput dataOut) throws IOException {
dataOut.writeBoolean(data != null);
if (data != null) {
dataOut.writeInt(data.getLength());
dataOut.write(data.getData(), data.getOffset(), data.getLength());
}
}
protected Buffer looseUnmarshalByteSequence(DataInput dataIn) throws IOException {
Buffer rc = null;
if (dataIn.readBoolean()) {
int size = dataIn.readInt();
byte[] t = new byte[size];
dataIn.readFully(t);
rc = new Buffer(t, 0, size);
}
return rc;
}
}
| 1,402 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/OpenWireFormat.java
|
/**
* 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.codec;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
import org.apache.activemq.openwire.buffer.Buffer;
import org.apache.activemq.openwire.buffer.DataByteArrayInputStream;
import org.apache.activemq.openwire.buffer.DataByteArrayOutputStream;
import org.apache.activemq.openwire.commands.CommandTypes;
import org.apache.activemq.openwire.commands.DataStructure;
import org.apache.activemq.openwire.commands.WireFormatInfo;
/**
* The OpenWire Protocol Encoder and Decoder implementation.
*/
public final class OpenWireFormat {
public static final int DEFAULT_STORE_VERSION = CommandTypes.PROTOCOL_STORE_VERSION;
public static final int DEFAULT_WIRE_VERSION = CommandTypes.PROTOCOL_VERSION;
public static final int DEFAULT_LEGACY_VERSION = CommandTypes.PROTOCOL_LEGACY_STORE_VERSION;
public static final long DEFAULT_MAX_FRAME_SIZE = Long.MAX_VALUE;
static final byte NULL_TYPE = CommandTypes.NULL;
private static final int MARSHAL_CACHE_SIZE = Short.MAX_VALUE / 2;
private static final int MARSHAL_CACHE_FREE_SPACE = 100;
private DataStreamMarshaller dataMarshallers[];
private int version;
private boolean stackTraceEnabled;
private boolean tcpNoDelayEnabled;
private boolean cacheEnabled;
private boolean tightEncodingEnabled;
private boolean sizePrefixDisabled;
private long maxFrameSize = DEFAULT_MAX_FRAME_SIZE;
private boolean useLegacyCodecs = false;
// The following fields are used for value caching
private short nextMarshallCacheIndex;
private short nextMarshallCacheEvictionIndex;
private Map<DataStructure, Short> marshallCacheMap = new HashMap<DataStructure, Short>();
private DataStructure marshallCache[] = null;
private DataStructure unmarshallCache[] = null;
private final DataByteArrayOutputStream bytesOut = new DataByteArrayOutputStream();
private final DataByteArrayInputStream bytesIn = new DataByteArrayInputStream();
private WireFormatInfo preferedWireFormatInfo;
public OpenWireFormat() {
this(DEFAULT_STORE_VERSION);
}
public OpenWireFormat(int i) {
setVersion(i);
}
@Override
public int hashCode() {
return version ^ (cacheEnabled ? 0x10000000 : 0x20000000) ^ (stackTraceEnabled ? 0x01000000 : 0x02000000)
^ (tightEncodingEnabled ? 0x00100000 : 0x00200000) ^ (sizePrefixDisabled ? 0x00010000 : 0x00020000);
}
public OpenWireFormat copy() {
OpenWireFormat answer = new OpenWireFormat(version);
answer.stackTraceEnabled = stackTraceEnabled;
answer.tcpNoDelayEnabled = tcpNoDelayEnabled;
answer.cacheEnabled = cacheEnabled;
answer.tightEncodingEnabled = tightEncodingEnabled;
answer.sizePrefixDisabled = sizePrefixDisabled;
answer.preferedWireFormatInfo = preferedWireFormatInfo;
return answer;
}
@Override
public boolean equals(Object object) {
if (object == null) {
return false;
}
OpenWireFormat o = (OpenWireFormat) object;
return o.stackTraceEnabled == stackTraceEnabled && o.cacheEnabled == cacheEnabled && o.version == version
&& o.tightEncodingEnabled == tightEncodingEnabled && o.sizePrefixDisabled == sizePrefixDisabled;
}
@Override
public String toString() {
return "OpenWireFormat{version=" + version + ", cacheEnabled=" + cacheEnabled + ", stackTraceEnabled=" + stackTraceEnabled + ", tightEncodingEnabled="
+ tightEncodingEnabled + ", sizePrefixDisabled=" + sizePrefixDisabled + ", maxFrameSize=" + maxFrameSize + "}";
}
public int getVersion() {
return version;
}
public synchronized Buffer marshal(Object command) throws IOException {
if (cacheEnabled) {
runMarshallCacheEvictionSweep();
}
Buffer sequence = null;
int size = 1;
if (command != null) {
DataStructure c = (DataStructure) command;
byte type = c.getDataStructureType();
DataStreamMarshaller dsm = dataMarshallers[type & 0xFF];
if (dsm == null) {
throw new IOException("Unknown data type: " + type);
}
if (tightEncodingEnabled) {
BooleanStream bs = new BooleanStream();
size += dsm.tightMarshal1(this, c, bs);
size += bs.marshalledSize();
bytesOut.restart(size);
if (!sizePrefixDisabled) {
bytesOut.writeInt(size);
}
bytesOut.writeByte(type);
bs.marshal(bytesOut);
dsm.tightMarshal2(this, c, bytesOut, bs);
sequence = bytesOut.toBuffer();
} else {
bytesOut.restart();
if (!sizePrefixDisabled) {
// we don't know the final size yet but write this here for now.
bytesOut.writeInt(0);
}
bytesOut.writeByte(type);
dsm.looseMarshal(this, c, bytesOut);
if (!sizePrefixDisabled) {
size = bytesOut.size() - 4;
bytesOut.writeInt(0, size);
}
sequence = bytesOut.toBuffer();
}
} else {
bytesOut.restart(5);
bytesOut.writeInt(size);
bytesOut.writeByte(NULL_TYPE);
sequence = bytesOut.toBuffer();
}
return sequence;
}
public synchronized Object unmarshal(Buffer sequence) throws IOException {
bytesIn.restart(sequence);
if (!sizePrefixDisabled) {
int size = bytesIn.readInt();
if (size > maxFrameSize) {
throw new IOException("Frame size of " + (size / (1024 * 1024)) + " MB larger than max allowed " + (maxFrameSize / (1024 * 1024)) + " MB");
}
}
Object command = doUnmarshal(bytesIn);
return command;
}
public synchronized void marshal(Object o, DataOutput dataOut) throws IOException {
if (cacheEnabled) {
runMarshallCacheEvictionSweep();
}
int size = 1;
if (o != null) {
DataStructure c = (DataStructure) o;
byte type = c.getDataStructureType();
DataStreamMarshaller dsm = dataMarshallers[type & 0xFF];
if (dsm == null) {
throw new IOException("Unknown data type: " + type);
}
if (tightEncodingEnabled) {
BooleanStream bs = new BooleanStream();
size += dsm.tightMarshal1(this, c, bs);
size += bs.marshalledSize();
if (!sizePrefixDisabled) {
dataOut.writeInt(size);
}
dataOut.writeByte(type);
bs.marshal(dataOut);
dsm.tightMarshal2(this, c, dataOut, bs);
} else {
DataOutput looseOut = dataOut;
if (!sizePrefixDisabled) {
bytesOut.restart();
looseOut = bytesOut;
}
looseOut.writeByte(type);
dsm.looseMarshal(this, c, looseOut);
if (!sizePrefixDisabled) {
Buffer sequence = bytesOut.toBuffer();
dataOut.writeInt(sequence.getLength());
dataOut.write(sequence.getData(), sequence.getOffset(), sequence.getLength());
}
}
} else {
if (!sizePrefixDisabled) {
dataOut.writeInt(size);
}
dataOut.writeByte(NULL_TYPE);
}
}
public Object unmarshal(DataInput dis) throws IOException {
DataInput dataIn = dis;
if (!sizePrefixDisabled) {
int size = dis.readInt();
if (size > maxFrameSize) {
throw new IOException("Frame size of " + (size / (1024 * 1024)) + " MB larger than max allowed " + (maxFrameSize / (1024 * 1024)) + " MB");
}
}
return doUnmarshal(dataIn);
}
/**
* Used by NIO or AIO transports
*/
public int tightMarshal1(Object o, BooleanStream bs) throws IOException {
int size = 1;
if (o != null) {
DataStructure c = (DataStructure) o;
byte type = c.getDataStructureType();
DataStreamMarshaller dsm = dataMarshallers[type & 0xFF];
if (dsm == null) {
throw new IOException("Unknown data type: " + type);
}
size += dsm.tightMarshal1(this, c, bs);
size += bs.marshalledSize();
}
return size;
}
/**
* Used by NIO or AIO transports; note that the size is not written as part of this method.
*/
public void tightMarshal2(Object o, DataOutput ds, BooleanStream bs) throws IOException {
if (cacheEnabled) {
runMarshallCacheEvictionSweep();
}
if (o != null) {
DataStructure c = (DataStructure) o;
byte type = c.getDataStructureType();
DataStreamMarshaller dsm = dataMarshallers[type & 0xFF];
if (dsm == null) {
throw new IOException("Unknown data type: " + type);
}
ds.writeByte(type);
bs.marshal(ds);
dsm.tightMarshal2(this, c, ds, bs);
}
}
public Object doUnmarshal(DataInput dis) throws IOException {
byte dataType = dis.readByte();
if (dataType != NULL_TYPE) {
DataStreamMarshaller dsm = dataMarshallers[dataType & 0xFF];
if (dsm == null) {
throw new IOException("Unknown data type: " + dataType);
}
Object data = dsm.createObject();
if (this.tightEncodingEnabled) {
BooleanStream bs = new BooleanStream();
bs.unmarshal(dis);
dsm.tightUnmarshal(this, data, dis, bs);
} else {
dsm.looseUnmarshal(this, data, dis);
}
return data;
} else {
return null;
}
}
public int tightMarshalNestedObject1(DataStructure o, BooleanStream bs) throws IOException {
bs.writeBoolean(o != null);
if (o == null) {
return 0;
}
if (o.isMarshallAware()) {
// Legacy code, always writes false
Buffer sequence = null;
bs.writeBoolean(sequence != null);
}
byte type = o.getDataStructureType();
DataStreamMarshaller dsm = dataMarshallers[type & 0xFF];
if (dsm == null) {
throw new IOException("Unknown data type: " + type);
}
return 1 + dsm.tightMarshal1(this, o, bs);
}
public void tightMarshalNestedObject2(DataStructure o, DataOutput ds, BooleanStream bs) throws IOException {
if (!bs.readBoolean()) {
return;
}
byte type = o.getDataStructureType();
ds.writeByte(type);
if (o.isMarshallAware() && bs.readBoolean()) {
// We should not be doing any caching
throw new IOException("Corrupted stream");
} else {
DataStreamMarshaller dsm = dataMarshallers[type & 0xFF];
if (dsm == null) {
throw new IOException("Unknown data type: " + type);
}
dsm.tightMarshal2(this, o, ds, bs);
}
}
public DataStructure tightUnmarshalNestedObject(DataInput dis, BooleanStream bs) throws IOException {
if (bs.readBoolean()) {
byte dataType = dis.readByte();
DataStreamMarshaller dsm = dataMarshallers[dataType & 0xFF];
if (dsm == null) {
throw new IOException("Unknown data type: " + dataType);
}
DataStructure data = dsm.createObject();
if (data.isMarshallAware() && bs.readBoolean()) {
dis.readInt();
dis.readByte();
BooleanStream bs2 = new BooleanStream();
bs2.unmarshal(dis);
dsm.tightUnmarshal(this, data, dis, bs2);
} else {
dsm.tightUnmarshal(this, data, dis, bs);
}
return data;
} else {
return null;
}
}
public DataStructure looseUnmarshalNestedObject(DataInput dis) throws IOException {
if (dis.readBoolean()) {
byte dataType = dis.readByte();
DataStreamMarshaller dsm = dataMarshallers[dataType & 0xFF];
if (dsm == null) {
throw new IOException("Unknown data type: " + dataType);
}
DataStructure data = dsm.createObject();
dsm.looseUnmarshal(this, data, dis);
return data;
} else {
return null;
}
}
public void looseMarshalNestedObject(DataStructure o, DataOutput dataOut) throws IOException {
dataOut.writeBoolean(o != null);
if (o != null) {
byte type = o.getDataStructureType();
dataOut.writeByte(type);
DataStreamMarshaller dsm = dataMarshallers[type & 0xFF];
if (dsm == null) {
throw new IOException("Unknown data type: " + type);
}
dsm.looseMarshal(this, o, dataOut);
}
}
public void runMarshallCacheEvictionSweep() {
// Do we need to start evicting??
while (marshallCacheMap.size() > marshallCache.length - MARSHAL_CACHE_FREE_SPACE) {
marshallCacheMap.remove(marshallCache[nextMarshallCacheEvictionIndex]);
marshallCache[nextMarshallCacheEvictionIndex] = null;
nextMarshallCacheEvictionIndex++;
if (nextMarshallCacheEvictionIndex >= marshallCache.length) {
nextMarshallCacheEvictionIndex = 0;
}
}
}
public Short getMarshallCacheIndex(DataStructure o) {
return marshallCacheMap.get(o);
}
public Short addToMarshallCache(DataStructure o) {
short i = nextMarshallCacheIndex++;
if (nextMarshallCacheIndex >= marshallCache.length) {
nextMarshallCacheIndex = 0;
}
// We can only cache that item if there is space left.
if (marshallCacheMap.size() < marshallCache.length) {
marshallCache[i] = o;
Short index = new Short(i);
marshallCacheMap.put(o, index);
return index;
} else {
// Use -1 to indicate that the value was not cached due to cache being full.
return new Short((short) -1);
}
}
public void setInUnmarshallCache(short index, DataStructure o) {
// There was no space left in the cache, so we can't put this in the cache.
if (index == -1) {
return;
}
unmarshallCache[index] = o;
}
public DataStructure getFromUnmarshallCache(short index) {
return unmarshallCache[index];
}
public void setStackTraceEnabled(boolean b) {
stackTraceEnabled = b;
}
public boolean isStackTraceEnabled() {
return stackTraceEnabled;
}
public boolean isTcpNoDelayEnabled() {
return tcpNoDelayEnabled;
}
public void setTcpNoDelayEnabled(boolean tcpNoDelayEnabled) {
this.tcpNoDelayEnabled = tcpNoDelayEnabled;
}
public boolean isCacheEnabled() {
return cacheEnabled;
}
public void setCacheEnabled(boolean cacheEnabled) {
if (cacheEnabled) {
marshallCache = new DataStructure[MARSHAL_CACHE_SIZE];
unmarshallCache = new DataStructure[MARSHAL_CACHE_SIZE];
}
this.cacheEnabled = cacheEnabled;
}
public boolean isTightEncodingEnabled() {
return tightEncodingEnabled;
}
public void setTightEncodingEnabled(boolean tightEncodingEnabled) {
this.tightEncodingEnabled = tightEncodingEnabled;
}
public boolean isSizePrefixDisabled() {
return sizePrefixDisabled;
}
public void setSizePrefixDisabled(boolean prefixPacketSize) {
this.sizePrefixDisabled = prefixPacketSize;
}
public void setPreferedWireFormatInfo(WireFormatInfo info) {
this.preferedWireFormatInfo = info;
}
public WireFormatInfo getPreferedWireFormatInfo() {
return preferedWireFormatInfo;
}
public long getMaxFrameSize() {
return maxFrameSize;
}
public void setMaxFrameSize(long maxFrameSize) {
this.maxFrameSize = maxFrameSize;
}
/**
* @return the useLegacyCodecs current value.
*/
public boolean isUseLegacyCodecs() {
return useLegacyCodecs;
}
/**
* Sets whether the WireFormat should use the legacy codecs or the universal codec.
*
* @param useLegacyCodecs
* the useLegacyCodecs setting to use.
*/
public void setUseLegacyCodecs(boolean useLegacyCodecs) {
this.useLegacyCodecs = useLegacyCodecs;
}
/**
* Allows you to dynamically switch the version of the openwire protocol being used.
*
* @param version
*/
public void setVersion(int version) {
String mfName = null;
Class<?> mfClass;
if (!useLegacyCodecs) {
mfName = "org.apache.activemq.openwire.codec.universal.MarshallerFactory";
} else {
mfName = "org.apache.activemq.openwire.codec.v" + version + ".MarshallerFactory";
}
try {
mfClass = Class.forName(mfName, false, getClass().getClassLoader());
} catch (ClassNotFoundException e) {
throw new IllegalArgumentException("Invalid version: " + version + ", could not load " + mfName, e);
}
try {
Method method = mfClass.getMethod("createMarshallerMap", new Class[] { OpenWireFormat.class });
dataMarshallers = (DataStreamMarshaller[]) method.invoke(null, new Object[] { this });
} catch (Throwable e) {
throw new IllegalArgumentException("Invalid version: " + version + ", " + mfName
+ " does not properly implement the createMarshallerMap method.", e);
}
this.version = version;
}
public void renegotiateWireFormat(WireFormatInfo info) throws IOException {
if (preferedWireFormatInfo == null) {
throw new IllegalStateException("Wireformat cannot not be renegotiated.");
}
this.setVersion(min(preferedWireFormatInfo.getVersion(), info.getVersion()));
info.setVersion(this.getVersion());
this.setMaxFrameSize(min(preferedWireFormatInfo.getMaxFrameSize(), info.getMaxFrameSize()));
info.setMaxFrameSize(this.getMaxFrameSize());
this.stackTraceEnabled = info.isStackTraceEnabled() && preferedWireFormatInfo.isStackTraceEnabled();
info.setStackTraceEnabled(this.stackTraceEnabled);
this.tcpNoDelayEnabled = info.isTcpNoDelayEnabled() && preferedWireFormatInfo.isTcpNoDelayEnabled();
info.setTcpNoDelayEnabled(this.tcpNoDelayEnabled);
this.cacheEnabled = info.isCacheEnabled() && preferedWireFormatInfo.isCacheEnabled();
info.setCacheEnabled(this.cacheEnabled);
this.tightEncodingEnabled = info.isTightEncodingEnabled() && preferedWireFormatInfo.isTightEncodingEnabled();
info.setTightEncodingEnabled(this.tightEncodingEnabled);
this.sizePrefixDisabled = info.isSizePrefixDisabled() && preferedWireFormatInfo.isSizePrefixDisabled();
info.setSizePrefixDisabled(this.sizePrefixDisabled);
if (cacheEnabled) {
int size = Math.min(preferedWireFormatInfo.getCacheSize(), info.getCacheSize());
info.setCacheSize(size);
if (size == 0) {
size = MARSHAL_CACHE_SIZE;
}
marshallCache = new DataStructure[size];
unmarshallCache = new DataStructure[size];
nextMarshallCacheIndex = 0;
nextMarshallCacheEvictionIndex = 0;
marshallCacheMap = new HashMap<DataStructure, Short>();
} else {
marshallCache = null;
unmarshallCache = null;
nextMarshallCacheIndex = 0;
nextMarshallCacheEvictionIndex = 0;
marshallCacheMap = null;
}
}
protected int min(int version1, int version2) {
if (version1 < version2 && version1 > 0 || version2 <= 0) {
return version1;
}
return version2;
}
protected long min(long version1, long version2) {
if (version1 < version2 && version1 > 0 || version2 <= 0) {
return version1;
}
return version2;
}
}
| 1,403 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/SessionInfoMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for SessionInfo
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class SessionInfoMarshaller extends BaseCommandMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return SessionInfo.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new SessionInfo();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
SessionInfo info = (SessionInfo) target;
info.setSessionId((SessionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
SessionInfo info = (SessionInfo) source;
int rc = super.tightMarshal1(wireFormat, source, bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getSessionId(), bs);
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
SessionInfo info = (SessionInfo) source;
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getSessionId(), dataOut, bs);
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
SessionInfo info = (SessionInfo) source;
super.looseMarshal(wireFormat, source, dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getSessionId(), dataOut);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
SessionInfo info = (SessionInfo) target;
info.setSessionId((SessionId) looseUnmarsalCachedObject(wireFormat, dataIn));
}
}
| 1,404 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/BrokerInfoMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for BrokerInfo
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class BrokerInfoMarshaller extends BaseCommandMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return BrokerInfo.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new BrokerInfo();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
BrokerInfo info = (BrokerInfo) target;
int version = wireFormat.getVersion();
info.setBrokerId((BrokerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setBrokerURL(tightUnmarshalString(dataIn, bs));
if (bs.readBoolean()) {
short size = dataIn.readShort();
BrokerInfo value[] = new BrokerInfo[size];
for (int i = 0; i < size; i++) {
value[i] = (BrokerInfo) tightUnmarsalNestedObject(wireFormat,dataIn, bs);
}
info.setPeerBrokerInfos(value);
} else {
info.setPeerBrokerInfos(null);
}
info.setBrokerName(tightUnmarshalString(dataIn, bs));
info.setSlaveBroker(bs.readBoolean());
info.setMasterBroker(bs.readBoolean());
info.setFaultTolerantConfiguration(bs.readBoolean());
if (version >= 2) {
info.setDuplexConnection(bs.readBoolean());
}
if (version >= 2) {
info.setNetworkConnection(bs.readBoolean());
}
if (version >= 2) {
info.setConnectionId(tightUnmarshalLong(wireFormat, dataIn, bs));
}
if (version >= 3) {
info.setBrokerUploadUrl(tightUnmarshalString(dataIn, bs));
}
if (version >= 3) {
info.setNetworkProperties(tightUnmarshalString(dataIn, bs));
}
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
BrokerInfo info = (BrokerInfo) source;
int version = wireFormat.getVersion();
int rc = super.tightMarshal1(wireFormat, source, bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getBrokerId(), bs);
rc += tightMarshalString1(info.getBrokerURL(), bs);
rc += tightMarshalObjectArray1(wireFormat, info.getPeerBrokerInfos(), bs);
rc += tightMarshalString1(info.getBrokerName(), bs);
bs.writeBoolean(info.isSlaveBroker());
bs.writeBoolean(info.isMasterBroker());
bs.writeBoolean(info.isFaultTolerantConfiguration());
if (version >= 2) {
bs.writeBoolean(info.isDuplexConnection());
}
if (version >= 2) {
bs.writeBoolean(info.isNetworkConnection());
}
if (version >= 2) {
rc += tightMarshalLong1(wireFormat, info.getConnectionId(), bs);
}
if (version >= 3) {
rc += tightMarshalString1(info.getBrokerUploadUrl(), bs);
}
if (version >= 3) {
rc += tightMarshalString1(info.getNetworkProperties(), bs);
}
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
BrokerInfo info = (BrokerInfo) source;
int version = wireFormat.getVersion();
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getBrokerId(), dataOut, bs);
tightMarshalString2(info.getBrokerURL(), dataOut, bs);
tightMarshalObjectArray2(wireFormat, info.getPeerBrokerInfos(), dataOut, bs);
tightMarshalString2(info.getBrokerName(), dataOut, bs);
bs.readBoolean();
bs.readBoolean();
bs.readBoolean();
if (version >= 2) {
bs.readBoolean();
}
if (version >= 2) {
bs.readBoolean();
}
if (version >= 2) {
tightMarshalLong2(wireFormat, info.getConnectionId(), dataOut, bs);
}
if (version >= 3) {
tightMarshalString2(info.getBrokerUploadUrl(), dataOut, bs);
}
if (version >= 3) {
tightMarshalString2(info.getNetworkProperties(), dataOut, bs);
}
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
BrokerInfo info = (BrokerInfo) source;
int version = wireFormat.getVersion();
super.looseMarshal(wireFormat, source, dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getBrokerId(), dataOut);
looseMarshalString(info.getBrokerURL(), dataOut);
looseMarshalObjectArray(wireFormat, info.getPeerBrokerInfos(), dataOut);
looseMarshalString(info.getBrokerName(), dataOut);
dataOut.writeBoolean(info.isSlaveBroker());
dataOut.writeBoolean(info.isMasterBroker());
dataOut.writeBoolean(info.isFaultTolerantConfiguration());
if (version >= 2) {
dataOut.writeBoolean(info.isDuplexConnection());
}
if (version >= 2) {
dataOut.writeBoolean(info.isNetworkConnection());
}
if (version >= 2) {
looseMarshalLong(wireFormat, info.getConnectionId(), dataOut);
}
if (version >= 3) {
looseMarshalString(info.getBrokerUploadUrl(), dataOut);
}
if (version >= 3) {
looseMarshalString(info.getNetworkProperties(), dataOut);
}
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
BrokerInfo info = (BrokerInfo) target;
int version = wireFormat.getVersion();
info.setBrokerId((BrokerId) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setBrokerURL(looseUnmarshalString(dataIn));
if (dataIn.readBoolean()) {
short size = dataIn.readShort();
BrokerInfo value[] = new BrokerInfo[size];
for (int i = 0; i < size; i++) {
value[i] = (BrokerInfo) looseUnmarsalNestedObject(wireFormat,dataIn);
}
info.setPeerBrokerInfos(value);
} else {
info.setPeerBrokerInfos(null);
}
info.setBrokerName(looseUnmarshalString(dataIn));
info.setSlaveBroker(dataIn.readBoolean());
info.setMasterBroker(dataIn.readBoolean());
info.setFaultTolerantConfiguration(dataIn.readBoolean());
if (version >= 2) {
info.setDuplexConnection(dataIn.readBoolean());
}
if (version >= 2) {
info.setNetworkConnection(dataIn.readBoolean());
}
if (version >= 2) {
info.setConnectionId(looseUnmarshalLong(wireFormat, dataIn));
}
if (version >= 3) {
info.setBrokerUploadUrl(looseUnmarshalString(dataIn));
}
if (version >= 3) {
info.setNetworkProperties(looseUnmarshalString(dataIn));
}
}
}
| 1,405 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/OpenWireMapMessageMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for OpenWireMapMessage
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class OpenWireMapMessageMarshaller extends OpenWireMessageMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return OpenWireMapMessage.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new OpenWireMapMessage();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
int rc = super.tightMarshal1(wireFormat, source, bs);
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
super.looseMarshal(wireFormat, source, dataOut);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
}
}
| 1,406 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/MessageAckMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for MessageAck
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class MessageAckMarshaller extends BaseCommandMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return MessageAck.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new MessageAck();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
MessageAck info = (MessageAck) target;
int version = wireFormat.getVersion();
info.setDestination((OpenWireDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setTransactionId((TransactionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setConsumerId((ConsumerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setAckType(dataIn.readByte());
info.setFirstMessageId((MessageId) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
info.setLastMessageId((MessageId) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
info.setMessageCount(dataIn.readInt());
if (version >= 7) {
info.setPoisonCause((Throwable) tightUnmarsalThrowable(wireFormat, dataIn, bs));
}
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
MessageAck info = (MessageAck) source;
int version = wireFormat.getVersion();
int rc = super.tightMarshal1(wireFormat, source, bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getDestination(), bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getTransactionId(), bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConsumerId(), bs);
rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getFirstMessageId(), bs);
rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getLastMessageId(), bs);
if (version >= 7) {
rc += tightMarshalThrowable1(wireFormat, info.getPoisonCause(), bs);
}
return rc + 5;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
MessageAck info = (MessageAck) source;
int version = wireFormat.getVersion();
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getDestination(), dataOut, bs);
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getTransactionId(), dataOut, bs);
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getConsumerId(), dataOut, bs);
dataOut.writeByte(info.getAckType());
tightMarshalNestedObject2(wireFormat, (DataStructure)info.getFirstMessageId(), dataOut, bs);
tightMarshalNestedObject2(wireFormat, (DataStructure)info.getLastMessageId(), dataOut, bs);
dataOut.writeInt(info.getMessageCount());
if (version >= 7) {
tightMarshalThrowable2(wireFormat, info.getPoisonCause(), dataOut, bs);
}
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
MessageAck info = (MessageAck) source;
int version = wireFormat.getVersion();
super.looseMarshal(wireFormat, source, dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getDestination(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getTransactionId(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getConsumerId(), dataOut);
dataOut.writeByte(info.getAckType());
looseMarshalNestedObject(wireFormat, (DataStructure)info.getFirstMessageId(), dataOut);
looseMarshalNestedObject(wireFormat, (DataStructure)info.getLastMessageId(), dataOut);
dataOut.writeInt(info.getMessageCount());
if (version >= 7) {
looseMarshalThrowable(wireFormat, info.getPoisonCause(), dataOut);
}
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
MessageAck info = (MessageAck) target;
int version = wireFormat.getVersion();
info.setDestination((OpenWireDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setTransactionId((TransactionId) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setConsumerId((ConsumerId) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setAckType(dataIn.readByte());
info.setFirstMessageId((MessageId) looseUnmarsalNestedObject(wireFormat, dataIn));
info.setLastMessageId((MessageId) looseUnmarsalNestedObject(wireFormat, dataIn));
info.setMessageCount(dataIn.readInt());
if (version >= 7) {
info.setPoisonCause((Throwable) looseUnmarsalThrowable(wireFormat, dataIn));
}
}
}
| 1,407 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/OpenWireTempQueueMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for OpenWireTempQueue
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class OpenWireTempQueueMarshaller extends OpenWireTempDestinationMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return OpenWireTempQueue.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new OpenWireTempQueue();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
int rc = super.tightMarshal1(wireFormat, source, bs);
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
super.looseMarshal(wireFormat, source, dataOut);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
}
}
| 1,408 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ExceptionResponseMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for ExceptionResponse
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class ExceptionResponseMarshaller extends ResponseMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return ExceptionResponse.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new ExceptionResponse();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
ExceptionResponse info = (ExceptionResponse) target;
info.setException((Throwable) tightUnmarsalThrowable(wireFormat, dataIn, bs));
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
ExceptionResponse info = (ExceptionResponse) source;
int rc = super.tightMarshal1(wireFormat, source, bs);
rc += tightMarshalThrowable1(wireFormat, info.getException(), bs);
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
ExceptionResponse info = (ExceptionResponse) source;
tightMarshalThrowable2(wireFormat, info.getException(), dataOut, bs);
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
ExceptionResponse info = (ExceptionResponse) source;
super.looseMarshal(wireFormat, source, dataOut);
looseMarshalThrowable(wireFormat, info.getException(), dataOut);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
ExceptionResponse info = (ExceptionResponse) target;
info.setException((Throwable) looseUnmarsalThrowable(wireFormat, dataIn));
}
}
| 1,409 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/BrokerIdMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for BrokerId
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class BrokerIdMarshaller extends BaseDataStreamMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return BrokerId.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new BrokerId();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
BrokerId info = (BrokerId) target;
info.setValue(tightUnmarshalString(dataIn, bs));
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
BrokerId info = (BrokerId) source;
int rc = super.tightMarshal1(wireFormat, source, bs);
rc += tightMarshalString1(info.getValue(), bs);
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
BrokerId info = (BrokerId) source;
tightMarshalString2(info.getValue(), dataOut, bs);
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
BrokerId info = (BrokerId) source;
super.looseMarshal(wireFormat, source, dataOut);
looseMarshalString(info.getValue(), dataOut);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
BrokerId info = (BrokerId) target;
info.setValue(looseUnmarshalString(dataIn));
}
}
| 1,410 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/OpenWireObjectMessageMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for OpenWireObjectMessage
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class OpenWireObjectMessageMarshaller extends OpenWireMessageMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return OpenWireObjectMessage.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new OpenWireObjectMessage();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
int rc = super.tightMarshal1(wireFormat, source, bs);
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
super.looseMarshal(wireFormat, source, dataOut);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
}
}
| 1,411 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/KeepAliveInfoMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for KeepAliveInfo
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class KeepAliveInfoMarshaller extends BaseCommandMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return KeepAliveInfo.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new KeepAliveInfo();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
int rc = super.tightMarshal1(wireFormat, source, bs);
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
super.looseMarshal(wireFormat, source, dataOut);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
}
}
| 1,412 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ConnectionInfoMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for ConnectionInfo
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class ConnectionInfoMarshaller extends BaseCommandMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return ConnectionInfo.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new ConnectionInfo();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
ConnectionInfo info = (ConnectionInfo) target;
int version = wireFormat.getVersion();
info.setConnectionId((ConnectionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setClientId(tightUnmarshalString(dataIn, bs));
info.setPassword(tightUnmarshalString(dataIn, bs));
info.setUserName(tightUnmarshalString(dataIn, bs));
if (bs.readBoolean()) {
short size = dataIn.readShort();
BrokerId value[] = new BrokerId[size];
for (int i = 0; i < size; i++) {
value[i] = (BrokerId) tightUnmarsalNestedObject(wireFormat,dataIn, bs);
}
info.setBrokerPath(value);
} else {
info.setBrokerPath(null);
}
info.setBrokerMasterConnector(bs.readBoolean());
info.setManageable(bs.readBoolean());
if (version >= 2) {
info.setClientMaster(bs.readBoolean());
}
if (version >= 6) {
info.setFaultTolerant(bs.readBoolean());
}
if (version >= 6) {
info.setFailoverReconnect(bs.readBoolean());
}
if (version >= 8) {
info.setClientIp(tightUnmarshalString(dataIn, bs));
}
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
ConnectionInfo info = (ConnectionInfo) source;
int version = wireFormat.getVersion();
int rc = super.tightMarshal1(wireFormat, source, bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConnectionId(), bs);
rc += tightMarshalString1(info.getClientId(), bs);
rc += tightMarshalString1(info.getPassword(), bs);
rc += tightMarshalString1(info.getUserName(), bs);
rc += tightMarshalObjectArray1(wireFormat, info.getBrokerPath(), bs);
bs.writeBoolean(info.isBrokerMasterConnector());
bs.writeBoolean(info.isManageable());
if (version >= 2) {
bs.writeBoolean(info.isClientMaster());
}
if (version >= 6) {
bs.writeBoolean(info.isFaultTolerant());
}
if (version >= 6) {
bs.writeBoolean(info.isFailoverReconnect());
}
if (version >= 8) {
rc += tightMarshalString1(info.getClientIp(), bs);
}
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
ConnectionInfo info = (ConnectionInfo) source;
int version = wireFormat.getVersion();
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getConnectionId(), dataOut, bs);
tightMarshalString2(info.getClientId(), dataOut, bs);
tightMarshalString2(info.getPassword(), dataOut, bs);
tightMarshalString2(info.getUserName(), dataOut, bs);
tightMarshalObjectArray2(wireFormat, info.getBrokerPath(), dataOut, bs);
bs.readBoolean();
bs.readBoolean();
if (version >= 2) {
bs.readBoolean();
}
if (version >= 6) {
bs.readBoolean();
}
if (version >= 6) {
bs.readBoolean();
}
if (version >= 8) {
tightMarshalString2(info.getClientIp(), dataOut, bs);
}
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
ConnectionInfo info = (ConnectionInfo) source;
int version = wireFormat.getVersion();
super.looseMarshal(wireFormat, source, dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getConnectionId(), dataOut);
looseMarshalString(info.getClientId(), dataOut);
looseMarshalString(info.getPassword(), dataOut);
looseMarshalString(info.getUserName(), dataOut);
looseMarshalObjectArray(wireFormat, info.getBrokerPath(), dataOut);
dataOut.writeBoolean(info.isBrokerMasterConnector());
dataOut.writeBoolean(info.isManageable());
if (version >= 2) {
dataOut.writeBoolean(info.isClientMaster());
}
if (version >= 6) {
dataOut.writeBoolean(info.isFaultTolerant());
}
if (version >= 6) {
dataOut.writeBoolean(info.isFailoverReconnect());
}
if (version >= 8) {
looseMarshalString(info.getClientIp(), dataOut);
}
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
ConnectionInfo info = (ConnectionInfo) target;
int version = wireFormat.getVersion();
info.setConnectionId((ConnectionId) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setClientId(looseUnmarshalString(dataIn));
info.setPassword(looseUnmarshalString(dataIn));
info.setUserName(looseUnmarshalString(dataIn));
if (dataIn.readBoolean()) {
short size = dataIn.readShort();
BrokerId value[] = new BrokerId[size];
for (int i = 0; i < size; i++) {
value[i] = (BrokerId) looseUnmarsalNestedObject(wireFormat,dataIn);
}
info.setBrokerPath(value);
} else {
info.setBrokerPath(null);
}
info.setBrokerMasterConnector(dataIn.readBoolean());
info.setManageable(dataIn.readBoolean());
if (version >= 2) {
info.setClientMaster(dataIn.readBoolean());
}
if (version >= 6) {
info.setFaultTolerant(dataIn.readBoolean());
}
if (version >= 6) {
info.setFailoverReconnect(dataIn.readBoolean());
}
if (version >= 8) {
info.setClientIp(looseUnmarshalString(dataIn));
}
}
}
| 1,413 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/OpenWireQueueMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for OpenWireQueue
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class OpenWireQueueMarshaller extends OpenWireDestinationMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return OpenWireQueue.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new OpenWireQueue();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
int rc = super.tightMarshal1(wireFormat, source, bs);
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
super.looseMarshal(wireFormat, source, dataOut);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
}
}
| 1,414 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ConnectionErrorMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for ConnectionError
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class ConnectionErrorMarshaller extends BaseCommandMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return ConnectionError.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new ConnectionError();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
ConnectionError info = (ConnectionError) target;
info.setException((Throwable) tightUnmarsalThrowable(wireFormat, dataIn, bs));
info.setConnectionId((ConnectionId) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
ConnectionError info = (ConnectionError) source;
int rc = super.tightMarshal1(wireFormat, source, bs);
rc += tightMarshalThrowable1(wireFormat, info.getException(), bs);
rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getConnectionId(), bs);
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
ConnectionError info = (ConnectionError) source;
tightMarshalThrowable2(wireFormat, info.getException(), dataOut, bs);
tightMarshalNestedObject2(wireFormat, (DataStructure)info.getConnectionId(), dataOut, bs);
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
ConnectionError info = (ConnectionError) source;
super.looseMarshal(wireFormat, source, dataOut);
looseMarshalThrowable(wireFormat, info.getException(), dataOut);
looseMarshalNestedObject(wireFormat, (DataStructure)info.getConnectionId(), dataOut);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
ConnectionError info = (ConnectionError) target;
info.setException((Throwable) looseUnmarsalThrowable(wireFormat, dataIn));
info.setConnectionId((ConnectionId) looseUnmarsalNestedObject(wireFormat, dataIn));
}
}
| 1,415 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/JournalQueueAckMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for JournalQueueAck
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class JournalQueueAckMarshaller extends BaseDataStreamMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return JournalQueueAck.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new JournalQueueAck();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
JournalQueueAck info = (JournalQueueAck) target;
info.setDestination((OpenWireDestination) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
info.setMessageAck((MessageAck) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
JournalQueueAck info = (JournalQueueAck) source;
int rc = super.tightMarshal1(wireFormat, source, bs);
rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getDestination(), bs);
rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getMessageAck(), bs);
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
JournalQueueAck info = (JournalQueueAck) source;
tightMarshalNestedObject2(wireFormat, (DataStructure)info.getDestination(), dataOut, bs);
tightMarshalNestedObject2(wireFormat, (DataStructure)info.getMessageAck(), dataOut, bs);
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
JournalQueueAck info = (JournalQueueAck) source;
super.looseMarshal(wireFormat, source, dataOut);
looseMarshalNestedObject(wireFormat, (DataStructure)info.getDestination(), dataOut);
looseMarshalNestedObject(wireFormat, (DataStructure)info.getMessageAck(), dataOut);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
JournalQueueAck info = (JournalQueueAck) target;
info.setDestination((OpenWireDestination) looseUnmarsalNestedObject(wireFormat, dataIn));
info.setMessageAck((MessageAck) looseUnmarsalNestedObject(wireFormat, dataIn));
}
}
| 1,416 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/OpenWireDestinationMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for OpenWireDestination
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public abstract class OpenWireDestinationMarshaller extends BaseDataStreamMarshaller {
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
OpenWireDestination info = (OpenWireDestination) target;
info.setPhysicalName(tightUnmarshalString(dataIn, bs));
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
OpenWireDestination info = (OpenWireDestination) source;
int rc = super.tightMarshal1(wireFormat, source, bs);
rc += tightMarshalString1(info.getPhysicalName(), bs);
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
OpenWireDestination info = (OpenWireDestination) source;
tightMarshalString2(info.getPhysicalName(), dataOut, bs);
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
OpenWireDestination info = (OpenWireDestination) source;
super.looseMarshal(wireFormat, source, dataOut);
looseMarshalString(info.getPhysicalName(), dataOut);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
OpenWireDestination info = (OpenWireDestination) target;
info.setPhysicalName(looseUnmarshalString(dataIn));
}
}
| 1,417 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/OpenWireBytesMessageMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for OpenWireBytesMessage
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class OpenWireBytesMessageMarshaller extends OpenWireMessageMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return OpenWireBytesMessage.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new OpenWireBytesMessage();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
int rc = super.tightMarshal1(wireFormat, source, bs);
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
super.looseMarshal(wireFormat, source, dataOut);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
}
}
| 1,418 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ShutdownInfoMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for ShutdownInfo
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class ShutdownInfoMarshaller extends BaseCommandMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return ShutdownInfo.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new ShutdownInfo();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
int rc = super.tightMarshal1(wireFormat, source, bs);
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
super.looseMarshal(wireFormat, source, dataOut);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
}
}
| 1,419 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/OpenWireStreamMessageMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for OpenWireStreamMessage
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class OpenWireStreamMessageMarshaller extends OpenWireMessageMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return OpenWireStreamMessage.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new OpenWireStreamMessage();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
int rc = super.tightMarshal1(wireFormat, source, bs);
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
super.looseMarshal(wireFormat, source, dataOut);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
}
}
| 1,420 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/JournalTraceMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for JournalTrace
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class JournalTraceMarshaller extends BaseDataStreamMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return JournalTrace.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new JournalTrace();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
JournalTrace info = (JournalTrace) target;
info.setMessage(tightUnmarshalString(dataIn, bs));
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
JournalTrace info = (JournalTrace) source;
int rc = super.tightMarshal1(wireFormat, source, bs);
rc += tightMarshalString1(info.getMessage(), bs);
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
JournalTrace info = (JournalTrace) source;
tightMarshalString2(info.getMessage(), dataOut, bs);
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
JournalTrace info = (JournalTrace) source;
super.looseMarshal(wireFormat, source, dataOut);
looseMarshalString(info.getMessage(), dataOut);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
JournalTrace info = (JournalTrace) target;
info.setMessage(looseUnmarshalString(dataIn));
}
}
| 1,421 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/WireFormatInfoMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for WireFormatInfo
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class WireFormatInfoMarshaller extends BaseDataStreamMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return WireFormatInfo.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new WireFormatInfo();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
WireFormatInfo info = (WireFormatInfo) target;
info.beforeUnmarshall(wireFormat);
info.setMagic(tightUnmarshalConstByteArray(dataIn, bs, 8));
info.setVersion(dataIn.readInt());
info.setMarshalledProperties(tightUnmarshalByteSequence(dataIn, bs));
info.afterUnmarshall(wireFormat);
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
WireFormatInfo info = (WireFormatInfo) source;
info.beforeMarshall(wireFormat);
int rc = super.tightMarshal1(wireFormat, source, bs);
rc += tightMarshalConstByteArray1(info.getMagic(), bs, 8);
rc += tightMarshalByteSequence1(info.getMarshalledProperties(), bs);
return rc + 4;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
WireFormatInfo info = (WireFormatInfo) source;
tightMarshalConstByteArray2(info.getMagic(), dataOut, bs, 8);
dataOut.writeInt(info.getVersion());
tightMarshalByteSequence2(info.getMarshalledProperties(), dataOut, bs);
info.afterMarshall(wireFormat);
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
WireFormatInfo info = (WireFormatInfo) source;
info.beforeMarshall(wireFormat);
super.looseMarshal(wireFormat, source, dataOut);
looseMarshalConstByteArray(wireFormat, info.getMagic(), dataOut, 8);
dataOut.writeInt(info.getVersion());
looseMarshalByteSequence(wireFormat, info.getMarshalledProperties(), dataOut);
info.afterMarshall(wireFormat);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
WireFormatInfo info = (WireFormatInfo) target;
info.beforeUnmarshall(wireFormat);
info.setMagic(looseUnmarshalConstByteArray(dataIn, 8));
info.setVersion(dataIn.readInt());
info.setMarshalledProperties(looseUnmarshalByteSequence(dataIn));
info.afterUnmarshall(wireFormat);
}
}
| 1,422 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ProducerInfoMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for ProducerInfo
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class ProducerInfoMarshaller extends BaseCommandMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return ProducerInfo.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new ProducerInfo();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
ProducerInfo info = (ProducerInfo) target;
int version = wireFormat.getVersion();
info.setProducerId((ProducerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setDestination((OpenWireDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
if (bs.readBoolean()) {
short size = dataIn.readShort();
BrokerId value[] = new BrokerId[size];
for (int i = 0; i < size; i++) {
value[i] = (BrokerId) tightUnmarsalNestedObject(wireFormat,dataIn, bs);
}
info.setBrokerPath(value);
} else {
info.setBrokerPath(null);
}
if (version >= 2) {
info.setDispatchAsync(bs.readBoolean());
}
if (version >= 3) {
info.setWindowSize(dataIn.readInt());
}
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
ProducerInfo info = (ProducerInfo) source;
int version = wireFormat.getVersion();
int rc = super.tightMarshal1(wireFormat, source, bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getProducerId(), bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getDestination(), bs);
rc += tightMarshalObjectArray1(wireFormat, info.getBrokerPath(), bs);
if (version >= 2) {
bs.writeBoolean(info.isDispatchAsync());
}
if (version >= 3) {
}
return rc + 4;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
ProducerInfo info = (ProducerInfo) source;
int version = wireFormat.getVersion();
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getProducerId(), dataOut, bs);
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getDestination(), dataOut, bs);
tightMarshalObjectArray2(wireFormat, info.getBrokerPath(), dataOut, bs);
if (version >= 2) {
bs.readBoolean();
}
if (version >= 3) {
dataOut.writeInt(info.getWindowSize());
}
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
ProducerInfo info = (ProducerInfo) source;
int version = wireFormat.getVersion();
super.looseMarshal(wireFormat, source, dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getProducerId(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getDestination(), dataOut);
looseMarshalObjectArray(wireFormat, info.getBrokerPath(), dataOut);
if (version >= 2) {
dataOut.writeBoolean(info.isDispatchAsync());
}
if (version >= 3) {
dataOut.writeInt(info.getWindowSize());
}
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
ProducerInfo info = (ProducerInfo) target;
int version = wireFormat.getVersion();
info.setProducerId((ProducerId) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setDestination((OpenWireDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
if (dataIn.readBoolean()) {
short size = dataIn.readShort();
BrokerId value[] = new BrokerId[size];
for (int i = 0; i < size; i++) {
value[i] = (BrokerId) looseUnmarsalNestedObject(wireFormat,dataIn);
}
info.setBrokerPath(value);
} else {
info.setBrokerPath(null);
}
if (version >= 2) {
info.setDispatchAsync(dataIn.readBoolean());
}
if (version >= 3) {
info.setWindowSize(dataIn.readInt());
}
}
}
| 1,423 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/FlushCommandMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for FlushCommand
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class FlushCommandMarshaller extends BaseCommandMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return FlushCommand.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new FlushCommand();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
int rc = super.tightMarshal1(wireFormat, source, bs);
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
super.looseMarshal(wireFormat, source, dataOut);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
}
}
| 1,424 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/RemoveInfoMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for RemoveInfo
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class RemoveInfoMarshaller extends BaseCommandMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return RemoveInfo.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new RemoveInfo();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
RemoveInfo info = (RemoveInfo) target;
int version = wireFormat.getVersion();
info.setObjectId((DataStructure) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
if (version >= 5) {
info.setLastDeliveredSequenceId(tightUnmarshalLong(wireFormat, dataIn, bs));
}
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
RemoveInfo info = (RemoveInfo) source;
int version = wireFormat.getVersion();
int rc = super.tightMarshal1(wireFormat, source, bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getObjectId(), bs);
if (version >= 5) {
rc += tightMarshalLong1(wireFormat, info.getLastDeliveredSequenceId(), bs);
}
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
RemoveInfo info = (RemoveInfo) source;
int version = wireFormat.getVersion();
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getObjectId(), dataOut, bs);
if (version >= 5) {
tightMarshalLong2(wireFormat, info.getLastDeliveredSequenceId(), dataOut, bs);
}
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
RemoveInfo info = (RemoveInfo) source;
int version = wireFormat.getVersion();
super.looseMarshal(wireFormat, source, dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getObjectId(), dataOut);
if (version >= 5) {
looseMarshalLong(wireFormat, info.getLastDeliveredSequenceId(), dataOut);
}
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
RemoveInfo info = (RemoveInfo) target;
int version = wireFormat.getVersion();
info.setObjectId((DataStructure) looseUnmarsalCachedObject(wireFormat, dataIn));
if (version >= 5) {
info.setLastDeliveredSequenceId(looseUnmarshalLong(wireFormat, dataIn));
}
}
}
| 1,425 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ReplayCommandMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for ReplayCommand
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class ReplayCommandMarshaller extends BaseCommandMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return ReplayCommand.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new ReplayCommand();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
ReplayCommand info = (ReplayCommand) target;
info.setFirstNakNumber(dataIn.readInt());
info.setLastNakNumber(dataIn.readInt());
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
ReplayCommand info = (ReplayCommand) source;
int rc = super.tightMarshal1(wireFormat, source, bs);
return rc + 8;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
ReplayCommand info = (ReplayCommand) source;
dataOut.writeInt(info.getFirstNakNumber());
dataOut.writeInt(info.getLastNakNumber());
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
ReplayCommand info = (ReplayCommand) source;
super.looseMarshal(wireFormat, source, dataOut);
dataOut.writeInt(info.getFirstNakNumber());
dataOut.writeInt(info.getLastNakNumber());
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
ReplayCommand info = (ReplayCommand) target;
info.setFirstNakNumber(dataIn.readInt());
info.setLastNakNumber(dataIn.readInt());
}
}
| 1,426 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/OpenWireMessageMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for OpenWireMessage
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class OpenWireMessageMarshaller extends MessageMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return OpenWireMessage.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new OpenWireMessage();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
int rc = super.tightMarshal1(wireFormat, source, bs);
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
super.looseMarshal(wireFormat, source, dataOut);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
}
}
| 1,427 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/OpenWireTempTopicMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for OpenWireTempTopic
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class OpenWireTempTopicMarshaller extends OpenWireTempDestinationMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return OpenWireTempTopic.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new OpenWireTempTopic();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
int rc = super.tightMarshal1(wireFormat, source, bs);
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
super.looseMarshal(wireFormat, source, dataOut);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
}
}
| 1,428 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ConsumerIdMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for ConsumerId
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class ConsumerIdMarshaller extends BaseDataStreamMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return ConsumerId.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new ConsumerId();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
ConsumerId info = (ConsumerId) target;
info.setConnectionId(tightUnmarshalString(dataIn, bs));
info.setSessionId(tightUnmarshalLong(wireFormat, dataIn, bs));
info.setValue(tightUnmarshalLong(wireFormat, dataIn, bs));
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
ConsumerId info = (ConsumerId) source;
int rc = super.tightMarshal1(wireFormat, source, bs);
rc += tightMarshalString1(info.getConnectionId(), bs);
rc += tightMarshalLong1(wireFormat, info.getSessionId(), bs);
rc += tightMarshalLong1(wireFormat, info.getValue(), bs);
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
ConsumerId info = (ConsumerId) source;
tightMarshalString2(info.getConnectionId(), dataOut, bs);
tightMarshalLong2(wireFormat, info.getSessionId(), dataOut, bs);
tightMarshalLong2(wireFormat, info.getValue(), dataOut, bs);
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
ConsumerId info = (ConsumerId) source;
super.looseMarshal(wireFormat, source, dataOut);
looseMarshalString(info.getConnectionId(), dataOut);
looseMarshalLong(wireFormat, info.getSessionId(), dataOut);
looseMarshalLong(wireFormat, info.getValue(), dataOut);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
ConsumerId info = (ConsumerId) target;
info.setConnectionId(looseUnmarshalString(dataIn));
info.setSessionId(looseUnmarshalLong(wireFormat, dataIn));
info.setValue(looseUnmarshalLong(wireFormat, dataIn));
}
}
| 1,429 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/MessageIdMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for MessageId
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class MessageIdMarshaller extends BaseDataStreamMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return MessageId.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new MessageId();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
MessageId info = (MessageId) target;
int version = wireFormat.getVersion();
if (version >= 10) {
info.setTextView(tightUnmarshalString(dataIn, bs));
}
info.setProducerId((ProducerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setProducerSequenceId(tightUnmarshalLong(wireFormat, dataIn, bs));
info.setBrokerSequenceId(tightUnmarshalLong(wireFormat, dataIn, bs));
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
MessageId info = (MessageId) source;
int version = wireFormat.getVersion();
int rc = super.tightMarshal1(wireFormat, source, bs);
if (version >= 10) {
rc += tightMarshalString1(info.getTextView(), bs);
}
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getProducerId(), bs);
rc += tightMarshalLong1(wireFormat, info.getProducerSequenceId(), bs);
rc += tightMarshalLong1(wireFormat, info.getBrokerSequenceId(), bs);
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
MessageId info = (MessageId) source;
int version = wireFormat.getVersion();
if (version >= 10) {
tightMarshalString2(info.getTextView(), dataOut, bs);
}
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getProducerId(), dataOut, bs);
tightMarshalLong2(wireFormat, info.getProducerSequenceId(), dataOut, bs);
tightMarshalLong2(wireFormat, info.getBrokerSequenceId(), dataOut, bs);
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
MessageId info = (MessageId) source;
int version = wireFormat.getVersion();
super.looseMarshal(wireFormat, source, dataOut);
if (version >= 10) {
looseMarshalString(info.getTextView(), dataOut);
}
looseMarshalCachedObject(wireFormat, (DataStructure)info.getProducerId(), dataOut);
looseMarshalLong(wireFormat, info.getProducerSequenceId(), dataOut);
looseMarshalLong(wireFormat, info.getBrokerSequenceId(), dataOut);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
MessageId info = (MessageId) target;
int version = wireFormat.getVersion();
if (version >= 10) {
info.setTextView(looseUnmarshalString(dataIn));
}
info.setProducerId((ProducerId) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setProducerSequenceId(looseUnmarshalLong(wireFormat, dataIn));
info.setBrokerSequenceId(looseUnmarshalLong(wireFormat, dataIn));
}
}
| 1,430 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/XATransactionIdMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for XATransactionId
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class XATransactionIdMarshaller extends TransactionIdMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return XATransactionId.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new XATransactionId();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
XATransactionId info = (XATransactionId) target;
info.setFormatId(dataIn.readInt());
info.setGlobalTransactionId(tightUnmarshalConstByteArray(dataIn, bs, 0));
info.setBranchQualifier(tightUnmarshalConstByteArray(dataIn, bs, 0));
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
XATransactionId info = (XATransactionId) source;
int rc = super.tightMarshal1(wireFormat, source, bs);
rc += tightMarshalByteArray1(info.getGlobalTransactionId(), bs);
rc += tightMarshalByteArray1(info.getBranchQualifier(), bs);
return rc + 4;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
XATransactionId info = (XATransactionId) source;
dataOut.writeInt(info.getFormatId());
tightMarshalByteArray2(info.getGlobalTransactionId(), dataOut, bs);
tightMarshalByteArray2(info.getBranchQualifier(), dataOut, bs);
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
XATransactionId info = (XATransactionId) source;
super.looseMarshal(wireFormat, source, dataOut);
dataOut.writeInt(info.getFormatId());
looseMarshalByteArray(wireFormat, info.getGlobalTransactionId(), dataOut);
looseMarshalByteArray(wireFormat, info.getBranchQualifier(), dataOut);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
XATransactionId info = (XATransactionId) target;
info.setFormatId(dataIn.readInt());
info.setGlobalTransactionId(looseUnmarshalByteArray(dataIn));
info.setBranchQualifier(looseUnmarshalByteArray(dataIn));
}
}
| 1,431 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/SessionIdMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for SessionId
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class SessionIdMarshaller extends BaseDataStreamMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return SessionId.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new SessionId();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
SessionId info = (SessionId) target;
info.setConnectionId(tightUnmarshalString(dataIn, bs));
info.setValue(tightUnmarshalLong(wireFormat, dataIn, bs));
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
SessionId info = (SessionId) source;
int rc = super.tightMarshal1(wireFormat, source, bs);
rc += tightMarshalString1(info.getConnectionId(), bs);
rc += tightMarshalLong1(wireFormat, info.getValue(), bs);
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
SessionId info = (SessionId) source;
tightMarshalString2(info.getConnectionId(), dataOut, bs);
tightMarshalLong2(wireFormat, info.getValue(), dataOut, bs);
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
SessionId info = (SessionId) source;
super.looseMarshal(wireFormat, source, dataOut);
looseMarshalString(info.getConnectionId(), dataOut);
looseMarshalLong(wireFormat, info.getValue(), dataOut);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
SessionId info = (SessionId) target;
info.setConnectionId(looseUnmarshalString(dataIn));
info.setValue(looseUnmarshalLong(wireFormat, dataIn));
}
}
| 1,432 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ProducerIdMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for ProducerId
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class ProducerIdMarshaller extends BaseDataStreamMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return ProducerId.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new ProducerId();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
ProducerId info = (ProducerId) target;
info.setConnectionId(tightUnmarshalString(dataIn, bs));
info.setValue(tightUnmarshalLong(wireFormat, dataIn, bs));
info.setSessionId(tightUnmarshalLong(wireFormat, dataIn, bs));
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
ProducerId info = (ProducerId) source;
int rc = super.tightMarshal1(wireFormat, source, bs);
rc += tightMarshalString1(info.getConnectionId(), bs);
rc += tightMarshalLong1(wireFormat, info.getValue(), bs);
rc += tightMarshalLong1(wireFormat, info.getSessionId(), bs);
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
ProducerId info = (ProducerId) source;
tightMarshalString2(info.getConnectionId(), dataOut, bs);
tightMarshalLong2(wireFormat, info.getValue(), dataOut, bs);
tightMarshalLong2(wireFormat, info.getSessionId(), dataOut, bs);
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
ProducerId info = (ProducerId) source;
super.looseMarshal(wireFormat, source, dataOut);
looseMarshalString(info.getConnectionId(), dataOut);
looseMarshalLong(wireFormat, info.getValue(), dataOut);
looseMarshalLong(wireFormat, info.getSessionId(), dataOut);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
ProducerId info = (ProducerId) target;
info.setConnectionId(looseUnmarshalString(dataIn));
info.setValue(looseUnmarshalLong(wireFormat, dataIn));
info.setSessionId(looseUnmarshalLong(wireFormat, dataIn));
}
}
| 1,433 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ConsumerInfoMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for ConsumerInfo
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class ConsumerInfoMarshaller extends BaseCommandMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return ConsumerInfo.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new ConsumerInfo();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
ConsumerInfo info = (ConsumerInfo) target;
int version = wireFormat.getVersion();
info.setConsumerId((ConsumerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setBrowser(bs.readBoolean());
info.setDestination((OpenWireDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setPrefetchSize(dataIn.readInt());
info.setMaximumPendingMessageLimit(dataIn.readInt());
info.setDispatchAsync(bs.readBoolean());
info.setSelector(tightUnmarshalString(dataIn, bs));
if (version >= 10) {
info.setClientId(tightUnmarshalString(dataIn, bs));
}
info.setSubscriptionName(tightUnmarshalString(dataIn, bs));
info.setNoLocal(bs.readBoolean());
info.setExclusive(bs.readBoolean());
info.setRetroactive(bs.readBoolean());
info.setPriority(dataIn.readByte());
if (bs.readBoolean()) {
short size = dataIn.readShort();
BrokerId value[] = new BrokerId[size];
for (int i = 0; i < size; i++) {
value[i] = (BrokerId) tightUnmarsalNestedObject(wireFormat,dataIn, bs);
}
info.setBrokerPath(value);
} else {
info.setBrokerPath(null);
}
info.setAdditionalPredicate((Object) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
info.setNetworkSubscription(bs.readBoolean());
info.setOptimizedAcknowledge(bs.readBoolean());
info.setNoRangeAcks(bs.readBoolean());
if (version >= 4) {
if (bs.readBoolean()) {
short size = dataIn.readShort();
ConsumerId value[] = new ConsumerId[size];
for (int i = 0; i < size; i++) {
value[i] = (ConsumerId) tightUnmarsalNestedObject(wireFormat,dataIn, bs);
}
info.setNetworkConsumerPath(value);
} else {
info.setNetworkConsumerPath(null);
}
}
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
ConsumerInfo info = (ConsumerInfo) source;
int version = wireFormat.getVersion();
int rc = super.tightMarshal1(wireFormat, source, bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConsumerId(), bs);
bs.writeBoolean(info.isBrowser());
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getDestination(), bs);
bs.writeBoolean(info.isDispatchAsync());
rc += tightMarshalString1(info.getSelector(), bs);
if (version >= 10) {
rc += tightMarshalString1(info.getClientId(), bs);
}
rc += tightMarshalString1(info.getSubscriptionName(), bs);
bs.writeBoolean(info.isNoLocal());
bs.writeBoolean(info.isExclusive());
bs.writeBoolean(info.isRetroactive());
rc += tightMarshalObjectArray1(wireFormat, info.getBrokerPath(), bs);
rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getAdditionalPredicate(), bs);
bs.writeBoolean(info.isNetworkSubscription());
bs.writeBoolean(info.isOptimizedAcknowledge());
bs.writeBoolean(info.isNoRangeAcks());
if (version >= 4) {
rc += tightMarshalObjectArray1(wireFormat, info.getNetworkConsumerPath(), bs);
}
return rc + 9;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
ConsumerInfo info = (ConsumerInfo) source;
int version = wireFormat.getVersion();
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getConsumerId(), dataOut, bs);
bs.readBoolean();
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getDestination(), dataOut, bs);
dataOut.writeInt(info.getPrefetchSize());
dataOut.writeInt(info.getMaximumPendingMessageLimit());
bs.readBoolean();
tightMarshalString2(info.getSelector(), dataOut, bs);
if (version >= 10) {
tightMarshalString2(info.getClientId(), dataOut, bs);
}
tightMarshalString2(info.getSubscriptionName(), dataOut, bs);
bs.readBoolean();
bs.readBoolean();
bs.readBoolean();
dataOut.writeByte(info.getPriority());
tightMarshalObjectArray2(wireFormat, info.getBrokerPath(), dataOut, bs);
tightMarshalNestedObject2(wireFormat, (DataStructure)info.getAdditionalPredicate(), dataOut, bs);
bs.readBoolean();
bs.readBoolean();
bs.readBoolean();
if (version >= 4) {
tightMarshalObjectArray2(wireFormat, info.getNetworkConsumerPath(), dataOut, bs);
}
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
ConsumerInfo info = (ConsumerInfo) source;
int version = wireFormat.getVersion();
super.looseMarshal(wireFormat, source, dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getConsumerId(), dataOut);
dataOut.writeBoolean(info.isBrowser());
looseMarshalCachedObject(wireFormat, (DataStructure)info.getDestination(), dataOut);
dataOut.writeInt(info.getPrefetchSize());
dataOut.writeInt(info.getMaximumPendingMessageLimit());
dataOut.writeBoolean(info.isDispatchAsync());
looseMarshalString(info.getSelector(), dataOut);
if (version >= 10) {
looseMarshalString(info.getClientId(), dataOut);
}
looseMarshalString(info.getSubscriptionName(), dataOut);
dataOut.writeBoolean(info.isNoLocal());
dataOut.writeBoolean(info.isExclusive());
dataOut.writeBoolean(info.isRetroactive());
dataOut.writeByte(info.getPriority());
looseMarshalObjectArray(wireFormat, info.getBrokerPath(), dataOut);
looseMarshalNestedObject(wireFormat, (DataStructure)info.getAdditionalPredicate(), dataOut);
dataOut.writeBoolean(info.isNetworkSubscription());
dataOut.writeBoolean(info.isOptimizedAcknowledge());
dataOut.writeBoolean(info.isNoRangeAcks());
if (version >= 4) {
looseMarshalObjectArray(wireFormat, info.getNetworkConsumerPath(), dataOut);
}
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
ConsumerInfo info = (ConsumerInfo) target;
int version = wireFormat.getVersion();
info.setConsumerId((ConsumerId) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setBrowser(dataIn.readBoolean());
info.setDestination((OpenWireDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setPrefetchSize(dataIn.readInt());
info.setMaximumPendingMessageLimit(dataIn.readInt());
info.setDispatchAsync(dataIn.readBoolean());
info.setSelector(looseUnmarshalString(dataIn));
if (version >= 10) {
info.setClientId(looseUnmarshalString(dataIn));
}
info.setSubscriptionName(looseUnmarshalString(dataIn));
info.setNoLocal(dataIn.readBoolean());
info.setExclusive(dataIn.readBoolean());
info.setRetroactive(dataIn.readBoolean());
info.setPriority(dataIn.readByte());
if (dataIn.readBoolean()) {
short size = dataIn.readShort();
BrokerId value[] = new BrokerId[size];
for (int i = 0; i < size; i++) {
value[i] = (BrokerId) looseUnmarsalNestedObject(wireFormat,dataIn);
}
info.setBrokerPath(value);
} else {
info.setBrokerPath(null);
}
info.setAdditionalPredicate((Object) looseUnmarsalNestedObject(wireFormat, dataIn));
info.setNetworkSubscription(dataIn.readBoolean());
info.setOptimizedAcknowledge(dataIn.readBoolean());
info.setNoRangeAcks(dataIn.readBoolean());
if (version >= 4) {
if (dataIn.readBoolean()) {
short size = dataIn.readShort();
ConsumerId value[] = new ConsumerId[size];
for (int i = 0; i < size; i++) {
value[i] = (ConsumerId) looseUnmarsalNestedObject(wireFormat,dataIn);
}
info.setNetworkConsumerPath(value);
} else {
info.setNetworkConsumerPath(null);
}
}
}
}
| 1,434 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/LocalTransactionIdMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for LocalTransactionId
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class LocalTransactionIdMarshaller extends TransactionIdMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return LocalTransactionId.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new LocalTransactionId();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
LocalTransactionId info = (LocalTransactionId) target;
info.setValue(tightUnmarshalLong(wireFormat, dataIn, bs));
info.setConnectionId((ConnectionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
LocalTransactionId info = (LocalTransactionId) source;
int rc = super.tightMarshal1(wireFormat, source, bs);
rc += tightMarshalLong1(wireFormat, info.getValue(), bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConnectionId(), bs);
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
LocalTransactionId info = (LocalTransactionId) source;
tightMarshalLong2(wireFormat, info.getValue(), dataOut, bs);
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getConnectionId(), dataOut, bs);
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
LocalTransactionId info = (LocalTransactionId) source;
super.looseMarshal(wireFormat, source, dataOut);
looseMarshalLong(wireFormat, info.getValue(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getConnectionId(), dataOut);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
LocalTransactionId info = (LocalTransactionId) target;
info.setValue(looseUnmarshalLong(wireFormat, dataIn));
info.setConnectionId((ConnectionId) looseUnmarsalCachedObject(wireFormat, dataIn));
}
}
| 1,435 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ConnectionControlMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for ConnectionControl
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class ConnectionControlMarshaller extends BaseCommandMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return ConnectionControl.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new ConnectionControl();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
ConnectionControl info = (ConnectionControl) target;
int version = wireFormat.getVersion();
info.setClose(bs.readBoolean());
info.setExit(bs.readBoolean());
info.setFaultTolerant(bs.readBoolean());
info.setResume(bs.readBoolean());
info.setSuspend(bs.readBoolean());
if (version >= 6) {
info.setConnectedBrokers(tightUnmarshalString(dataIn, bs));
}
if (version >= 6) {
info.setReconnectTo(tightUnmarshalString(dataIn, bs));
}
if (version >= 6) {
info.setRebalanceConnection(bs.readBoolean());
}
if (version >= 6) {
info.setToken(tightUnmarshalConstByteArray(dataIn, bs, 0));
}
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
ConnectionControl info = (ConnectionControl) source;
int version = wireFormat.getVersion();
int rc = super.tightMarshal1(wireFormat, source, bs);
bs.writeBoolean(info.isClose());
bs.writeBoolean(info.isExit());
bs.writeBoolean(info.isFaultTolerant());
bs.writeBoolean(info.isResume());
bs.writeBoolean(info.isSuspend());
if (version >= 6) {
rc += tightMarshalString1(info.getConnectedBrokers(), bs);
}
if (version >= 6) {
rc += tightMarshalString1(info.getReconnectTo(), bs);
}
if (version >= 6) {
bs.writeBoolean(info.isRebalanceConnection());
}
if (version >= 6) {
rc += tightMarshalByteArray1(info.getToken(), bs);
}
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
ConnectionControl info = (ConnectionControl) source;
int version = wireFormat.getVersion();
bs.readBoolean();
bs.readBoolean();
bs.readBoolean();
bs.readBoolean();
bs.readBoolean();
if (version >= 6) {
tightMarshalString2(info.getConnectedBrokers(), dataOut, bs);
}
if (version >= 6) {
tightMarshalString2(info.getReconnectTo(), dataOut, bs);
}
if (version >= 6) {
bs.readBoolean();
}
if (version >= 6) {
tightMarshalByteArray2(info.getToken(), dataOut, bs);
}
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
ConnectionControl info = (ConnectionControl) source;
int version = wireFormat.getVersion();
super.looseMarshal(wireFormat, source, dataOut);
dataOut.writeBoolean(info.isClose());
dataOut.writeBoolean(info.isExit());
dataOut.writeBoolean(info.isFaultTolerant());
dataOut.writeBoolean(info.isResume());
dataOut.writeBoolean(info.isSuspend());
if (version >= 6) {
looseMarshalString(info.getConnectedBrokers(), dataOut);
}
if (version >= 6) {
looseMarshalString(info.getReconnectTo(), dataOut);
}
if (version >= 6) {
dataOut.writeBoolean(info.isRebalanceConnection());
}
if (version >= 6) {
looseMarshalByteArray(wireFormat, info.getToken(), dataOut);
}
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
ConnectionControl info = (ConnectionControl) target;
int version = wireFormat.getVersion();
info.setClose(dataIn.readBoolean());
info.setExit(dataIn.readBoolean());
info.setFaultTolerant(dataIn.readBoolean());
info.setResume(dataIn.readBoolean());
info.setSuspend(dataIn.readBoolean());
if (version >= 6) {
info.setConnectedBrokers(looseUnmarshalString(dataIn));
}
if (version >= 6) {
info.setReconnectTo(looseUnmarshalString(dataIn));
}
if (version >= 6) {
info.setRebalanceConnection(dataIn.readBoolean());
}
if (version >= 6) {
info.setToken(looseUnmarshalByteArray(dataIn));
}
}
}
| 1,436 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/OpenWireTopicMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for OpenWireTopic
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class OpenWireTopicMarshaller extends OpenWireDestinationMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return OpenWireTopic.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new OpenWireTopic();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
int rc = super.tightMarshal1(wireFormat, source, bs);
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
super.looseMarshal(wireFormat, source, dataOut);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
}
}
| 1,437 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/IntegerResponseMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for IntegerResponse
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class IntegerResponseMarshaller extends ResponseMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return IntegerResponse.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new IntegerResponse();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
IntegerResponse info = (IntegerResponse) target;
info.setResult(dataIn.readInt());
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
IntegerResponse info = (IntegerResponse) source;
int rc = super.tightMarshal1(wireFormat, source, bs);
return rc + 4;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
IntegerResponse info = (IntegerResponse) source;
dataOut.writeInt(info.getResult());
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
IntegerResponse info = (IntegerResponse) source;
super.looseMarshal(wireFormat, source, dataOut);
dataOut.writeInt(info.getResult());
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
IntegerResponse info = (IntegerResponse) target;
info.setResult(dataIn.readInt());
}
}
| 1,438 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ControlCommandMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for ControlCommand
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class ControlCommandMarshaller extends BaseCommandMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return ControlCommand.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new ControlCommand();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
ControlCommand info = (ControlCommand) target;
info.setCommand(tightUnmarshalString(dataIn, bs));
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
ControlCommand info = (ControlCommand) source;
int rc = super.tightMarshal1(wireFormat, source, bs);
rc += tightMarshalString1(info.getCommand(), bs);
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
ControlCommand info = (ControlCommand) source;
tightMarshalString2(info.getCommand(), dataOut, bs);
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
ControlCommand info = (ControlCommand) source;
super.looseMarshal(wireFormat, source, dataOut);
looseMarshalString(info.getCommand(), dataOut);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
ControlCommand info = (ControlCommand) target;
info.setCommand(looseUnmarshalString(dataIn));
}
}
| 1,439 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/NetworkBridgeFilterMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for NetworkBridgeFilter
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class NetworkBridgeFilterMarshaller extends BaseDataStreamMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return NetworkBridgeFilter.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new NetworkBridgeFilter();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
NetworkBridgeFilter info = (NetworkBridgeFilter) target;
int version = wireFormat.getVersion();
info.setNetworkBrokerId((BrokerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
if (version >= 10) {
info.setMessageTTL(dataIn.readInt());
}
if (version >= 10) {
info.setConsumerTTL(dataIn.readInt());
}
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
NetworkBridgeFilter info = (NetworkBridgeFilter) source;
int version = wireFormat.getVersion();
int rc = super.tightMarshal1(wireFormat, source, bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getNetworkBrokerId(), bs);
if (version >= 10) {
}
if (version >= 10) {
}
return rc + 8;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
NetworkBridgeFilter info = (NetworkBridgeFilter) source;
int version = wireFormat.getVersion();
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getNetworkBrokerId(), dataOut, bs);
if (version >= 10) {
dataOut.writeInt(info.getMessageTTL());
}
if (version >= 10) {
dataOut.writeInt(info.getConsumerTTL());
}
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
NetworkBridgeFilter info = (NetworkBridgeFilter) source;
int version = wireFormat.getVersion();
super.looseMarshal(wireFormat, source, dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getNetworkBrokerId(), dataOut);
if (version >= 10) {
dataOut.writeInt(info.getMessageTTL());
}
if (version >= 10) {
dataOut.writeInt(info.getConsumerTTL());
}
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
NetworkBridgeFilter info = (NetworkBridgeFilter) target;
int version = wireFormat.getVersion();
info.setNetworkBrokerId((BrokerId) looseUnmarsalCachedObject(wireFormat, dataIn));
if (version >= 10) {
info.setMessageTTL(dataIn.readInt());
}
if (version >= 10) {
info.setConsumerTTL(dataIn.readInt());
}
}
}
| 1,440 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/PartialCommandMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for PartialCommand
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class PartialCommandMarshaller extends BaseDataStreamMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return PartialCommand.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new PartialCommand();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
PartialCommand info = (PartialCommand) target;
info.setData(tightUnmarshalConstByteArray(dataIn, bs, 0));
info.setCommandId(dataIn.readInt());
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
PartialCommand info = (PartialCommand) source;
int rc = super.tightMarshal1(wireFormat, source, bs);
rc += tightMarshalByteArray1(info.getData(), bs);
return rc + 4;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
PartialCommand info = (PartialCommand) source;
tightMarshalByteArray2(info.getData(), dataOut, bs);
dataOut.writeInt(info.getCommandId());
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
PartialCommand info = (PartialCommand) source;
super.looseMarshal(wireFormat, source, dataOut);
looseMarshalByteArray(wireFormat, info.getData(), dataOut);
dataOut.writeInt(info.getCommandId());
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
PartialCommand info = (PartialCommand) target;
info.setData(looseUnmarshalByteArray(dataIn));
info.setCommandId(dataIn.readInt());
}
}
| 1,441 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/RemoveSubscriptionInfoMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for RemoveSubscriptionInfo
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class RemoveSubscriptionInfoMarshaller extends BaseCommandMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return RemoveSubscriptionInfo.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new RemoveSubscriptionInfo();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
RemoveSubscriptionInfo info = (RemoveSubscriptionInfo) target;
info.setConnectionId((ConnectionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setSubscriptionName(tightUnmarshalString(dataIn, bs));
info.setClientId(tightUnmarshalString(dataIn, bs));
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
RemoveSubscriptionInfo info = (RemoveSubscriptionInfo) source;
int rc = super.tightMarshal1(wireFormat, source, bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConnectionId(), bs);
rc += tightMarshalString1(info.getSubscriptionName(), bs);
rc += tightMarshalString1(info.getClientId(), bs);
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
RemoveSubscriptionInfo info = (RemoveSubscriptionInfo) source;
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getConnectionId(), dataOut, bs);
tightMarshalString2(info.getSubscriptionName(), dataOut, bs);
tightMarshalString2(info.getClientId(), dataOut, bs);
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
RemoveSubscriptionInfo info = (RemoveSubscriptionInfo) source;
super.looseMarshal(wireFormat, source, dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getConnectionId(), dataOut);
looseMarshalString(info.getSubscriptionName(), dataOut);
looseMarshalString(info.getClientId(), dataOut);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
RemoveSubscriptionInfo info = (RemoveSubscriptionInfo) target;
info.setConnectionId((ConnectionId) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setSubscriptionName(looseUnmarshalString(dataIn));
info.setClientId(looseUnmarshalString(dataIn));
}
}
| 1,442 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/MessagePullMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for MessagePull
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class MessagePullMarshaller extends BaseCommandMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return MessagePull.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new MessagePull();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
MessagePull info = (MessagePull) target;
int version = wireFormat.getVersion();
info.setConsumerId((ConsumerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setDestination((OpenWireDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setTimeout(tightUnmarshalLong(wireFormat, dataIn, bs));
if (version >= 3) {
info.setCorrelationId(tightUnmarshalString(dataIn, bs));
}
if (version >= 4) {
info.setMessageId((MessageId) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
}
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
MessagePull info = (MessagePull) source;
int version = wireFormat.getVersion();
int rc = super.tightMarshal1(wireFormat, source, bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConsumerId(), bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getDestination(), bs);
rc += tightMarshalLong1(wireFormat, info.getTimeout(), bs);
if (version >= 3) {
rc += tightMarshalString1(info.getCorrelationId(), bs);
}
if (version >= 4) {
rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getMessageId(), bs);
}
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
MessagePull info = (MessagePull) source;
int version = wireFormat.getVersion();
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getConsumerId(), dataOut, bs);
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getDestination(), dataOut, bs);
tightMarshalLong2(wireFormat, info.getTimeout(), dataOut, bs);
if (version >= 3) {
tightMarshalString2(info.getCorrelationId(), dataOut, bs);
}
if (version >= 4) {
tightMarshalNestedObject2(wireFormat, (DataStructure)info.getMessageId(), dataOut, bs);
}
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
MessagePull info = (MessagePull) source;
int version = wireFormat.getVersion();
super.looseMarshal(wireFormat, source, dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getConsumerId(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getDestination(), dataOut);
looseMarshalLong(wireFormat, info.getTimeout(), dataOut);
if (version >= 3) {
looseMarshalString(info.getCorrelationId(), dataOut);
}
if (version >= 4) {
looseMarshalNestedObject(wireFormat, (DataStructure)info.getMessageId(), dataOut);
}
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
MessagePull info = (MessagePull) target;
int version = wireFormat.getVersion();
info.setConsumerId((ConsumerId) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setDestination((OpenWireDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setTimeout(looseUnmarshalLong(wireFormat, dataIn));
if (version >= 3) {
info.setCorrelationId(looseUnmarshalString(dataIn));
}
if (version >= 4) {
info.setMessageId((MessageId) looseUnmarsalNestedObject(wireFormat, dataIn));
}
}
}
| 1,443 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/JournalTopicAckMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for JournalTopicAck
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class JournalTopicAckMarshaller extends BaseDataStreamMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return JournalTopicAck.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new JournalTopicAck();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
JournalTopicAck info = (JournalTopicAck) target;
info.setDestination((OpenWireDestination) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
info.setMessageId((MessageId) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
info.setMessageSequenceId(tightUnmarshalLong(wireFormat, dataIn, bs));
info.setSubscritionName(tightUnmarshalString(dataIn, bs));
info.setClientId(tightUnmarshalString(dataIn, bs));
info.setTransactionId((TransactionId) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
JournalTopicAck info = (JournalTopicAck) source;
int rc = super.tightMarshal1(wireFormat, source, bs);
rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getDestination(), bs);
rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getMessageId(), bs);
rc += tightMarshalLong1(wireFormat, info.getMessageSequenceId(), bs);
rc += tightMarshalString1(info.getSubscritionName(), bs);
rc += tightMarshalString1(info.getClientId(), bs);
rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getTransactionId(), bs);
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
JournalTopicAck info = (JournalTopicAck) source;
tightMarshalNestedObject2(wireFormat, (DataStructure)info.getDestination(), dataOut, bs);
tightMarshalNestedObject2(wireFormat, (DataStructure)info.getMessageId(), dataOut, bs);
tightMarshalLong2(wireFormat, info.getMessageSequenceId(), dataOut, bs);
tightMarshalString2(info.getSubscritionName(), dataOut, bs);
tightMarshalString2(info.getClientId(), dataOut, bs);
tightMarshalNestedObject2(wireFormat, (DataStructure)info.getTransactionId(), dataOut, bs);
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
JournalTopicAck info = (JournalTopicAck) source;
super.looseMarshal(wireFormat, source, dataOut);
looseMarshalNestedObject(wireFormat, (DataStructure)info.getDestination(), dataOut);
looseMarshalNestedObject(wireFormat, (DataStructure)info.getMessageId(), dataOut);
looseMarshalLong(wireFormat, info.getMessageSequenceId(), dataOut);
looseMarshalString(info.getSubscritionName(), dataOut);
looseMarshalString(info.getClientId(), dataOut);
looseMarshalNestedObject(wireFormat, (DataStructure)info.getTransactionId(), dataOut);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
JournalTopicAck info = (JournalTopicAck) target;
info.setDestination((OpenWireDestination) looseUnmarsalNestedObject(wireFormat, dataIn));
info.setMessageId((MessageId) looseUnmarsalNestedObject(wireFormat, dataIn));
info.setMessageSequenceId(looseUnmarshalLong(wireFormat, dataIn));
info.setSubscritionName(looseUnmarshalString(dataIn));
info.setClientId(looseUnmarshalString(dataIn));
info.setTransactionId((TransactionId) looseUnmarsalNestedObject(wireFormat, dataIn));
}
}
| 1,444 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/DestinationInfoMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for DestinationInfo
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class DestinationInfoMarshaller extends BaseCommandMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return DestinationInfo.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new DestinationInfo();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
DestinationInfo info = (DestinationInfo) target;
info.setConnectionId((ConnectionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setDestination((OpenWireDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setOperationType(dataIn.readByte());
info.setTimeout(tightUnmarshalLong(wireFormat, dataIn, bs));
if (bs.readBoolean()) {
short size = dataIn.readShort();
BrokerId value[] = new BrokerId[size];
for (int i = 0; i < size; i++) {
value[i] = (BrokerId) tightUnmarsalNestedObject(wireFormat,dataIn, bs);
}
info.setBrokerPath(value);
} else {
info.setBrokerPath(null);
}
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
DestinationInfo info = (DestinationInfo) source;
int rc = super.tightMarshal1(wireFormat, source, bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConnectionId(), bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getDestination(), bs);
rc += tightMarshalLong1(wireFormat, info.getTimeout(), bs);
rc += tightMarshalObjectArray1(wireFormat, info.getBrokerPath(), bs);
return rc + 1;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
DestinationInfo info = (DestinationInfo) source;
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getConnectionId(), dataOut, bs);
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getDestination(), dataOut, bs);
dataOut.writeByte(info.getOperationType());
tightMarshalLong2(wireFormat, info.getTimeout(), dataOut, bs);
tightMarshalObjectArray2(wireFormat, info.getBrokerPath(), dataOut, bs);
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
DestinationInfo info = (DestinationInfo) source;
super.looseMarshal(wireFormat, source, dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getConnectionId(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getDestination(), dataOut);
dataOut.writeByte(info.getOperationType());
looseMarshalLong(wireFormat, info.getTimeout(), dataOut);
looseMarshalObjectArray(wireFormat, info.getBrokerPath(), dataOut);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
DestinationInfo info = (DestinationInfo) target;
info.setConnectionId((ConnectionId) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setDestination((OpenWireDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setOperationType(dataIn.readByte());
info.setTimeout(looseUnmarshalLong(wireFormat, dataIn));
if (dataIn.readBoolean()) {
short size = dataIn.readShort();
BrokerId value[] = new BrokerId[size];
for (int i = 0; i < size; i++) {
value[i] = (BrokerId) looseUnmarsalNestedObject(wireFormat,dataIn);
}
info.setBrokerPath(value);
} else {
info.setBrokerPath(null);
}
}
}
| 1,445 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/OpenWireBlobMessageMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for OpenWireBlobMessage
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class OpenWireBlobMessageMarshaller extends OpenWireMessageMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return OpenWireBlobMessage.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new OpenWireBlobMessage();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
OpenWireBlobMessage info = (OpenWireBlobMessage) target;
int version = wireFormat.getVersion();
if (version >= 3) {
info.setRemoteBlobUrl(tightUnmarshalString(dataIn, bs));
}
if (version >= 3) {
info.setMimeType(tightUnmarshalString(dataIn, bs));
}
if (version >= 3) {
info.setDeletedByBroker(bs.readBoolean());
}
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
OpenWireBlobMessage info = (OpenWireBlobMessage) source;
int version = wireFormat.getVersion();
int rc = super.tightMarshal1(wireFormat, source, bs);
if (version >= 3) {
rc += tightMarshalString1(info.getRemoteBlobUrl(), bs);
}
if (version >= 3) {
rc += tightMarshalString1(info.getMimeType(), bs);
}
if (version >= 3) {
bs.writeBoolean(info.isDeletedByBroker());
}
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
OpenWireBlobMessage info = (OpenWireBlobMessage) source;
int version = wireFormat.getVersion();
if (version >= 3) {
tightMarshalString2(info.getRemoteBlobUrl(), dataOut, bs);
}
if (version >= 3) {
tightMarshalString2(info.getMimeType(), dataOut, bs);
}
if (version >= 3) {
bs.readBoolean();
}
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
OpenWireBlobMessage info = (OpenWireBlobMessage) source;
int version = wireFormat.getVersion();
super.looseMarshal(wireFormat, source, dataOut);
if (version >= 3) {
looseMarshalString(info.getRemoteBlobUrl(), dataOut);
}
if (version >= 3) {
looseMarshalString(info.getMimeType(), dataOut);
}
if (version >= 3) {
dataOut.writeBoolean(info.isDeletedByBroker());
}
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
OpenWireBlobMessage info = (OpenWireBlobMessage) target;
int version = wireFormat.getVersion();
if (version >= 3) {
info.setRemoteBlobUrl(looseUnmarshalString(dataIn));
}
if (version >= 3) {
info.setMimeType(looseUnmarshalString(dataIn));
}
if (version >= 3) {
info.setDeletedByBroker(dataIn.readBoolean());
}
}
}
| 1,446 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/DiscoveryEventMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for DiscoveryEvent
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class DiscoveryEventMarshaller extends BaseDataStreamMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return DiscoveryEvent.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new DiscoveryEvent();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
DiscoveryEvent info = (DiscoveryEvent) target;
info.setServiceName(tightUnmarshalString(dataIn, bs));
info.setBrokerName(tightUnmarshalString(dataIn, bs));
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
DiscoveryEvent info = (DiscoveryEvent) source;
int rc = super.tightMarshal1(wireFormat, source, bs);
rc += tightMarshalString1(info.getServiceName(), bs);
rc += tightMarshalString1(info.getBrokerName(), bs);
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
DiscoveryEvent info = (DiscoveryEvent) source;
tightMarshalString2(info.getServiceName(), dataOut, bs);
tightMarshalString2(info.getBrokerName(), dataOut, bs);
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
DiscoveryEvent info = (DiscoveryEvent) source;
super.looseMarshal(wireFormat, source, dataOut);
looseMarshalString(info.getServiceName(), dataOut);
looseMarshalString(info.getBrokerName(), dataOut);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
DiscoveryEvent info = (DiscoveryEvent) target;
info.setServiceName(looseUnmarshalString(dataIn));
info.setBrokerName(looseUnmarshalString(dataIn));
}
}
| 1,447 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ResponseMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for Response
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class ResponseMarshaller extends BaseCommandMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return Response.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new Response();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
Response info = (Response) target;
info.setCorrelationId(dataIn.readInt());
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
Response info = (Response) source;
int rc = super.tightMarshal1(wireFormat, source, bs);
return rc + 4;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
Response info = (Response) source;
dataOut.writeInt(info.getCorrelationId());
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
Response info = (Response) source;
super.looseMarshal(wireFormat, source, dataOut);
dataOut.writeInt(info.getCorrelationId());
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
Response info = (Response) target;
info.setCorrelationId(dataIn.readInt());
}
}
| 1,448 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/LastPartialCommandMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for LastPartialCommand
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class LastPartialCommandMarshaller extends PartialCommandMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return LastPartialCommand.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new LastPartialCommand();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
int rc = super.tightMarshal1(wireFormat, source, bs);
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
super.looseMarshal(wireFormat, source, dataOut);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
}
}
| 1,449 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/DataArrayResponseMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for DataArrayResponse
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class DataArrayResponseMarshaller extends ResponseMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return DataArrayResponse.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new DataArrayResponse();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
DataArrayResponse info = (DataArrayResponse) target;
if (bs.readBoolean()) {
short size = dataIn.readShort();
DataStructure value[] = new DataStructure[size];
for (int i = 0; i < size; i++) {
value[i] = (DataStructure) tightUnmarsalNestedObject(wireFormat,dataIn, bs);
}
info.setData(value);
} else {
info.setData(null);
}
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
DataArrayResponse info = (DataArrayResponse) source;
int rc = super.tightMarshal1(wireFormat, source, bs);
rc += tightMarshalObjectArray1(wireFormat, info.getData(), bs);
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
DataArrayResponse info = (DataArrayResponse) source;
tightMarshalObjectArray2(wireFormat, info.getData(), dataOut, bs);
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
DataArrayResponse info = (DataArrayResponse) source;
super.looseMarshal(wireFormat, source, dataOut);
looseMarshalObjectArray(wireFormat, info.getData(), dataOut);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
DataArrayResponse info = (DataArrayResponse) target;
if (dataIn.readBoolean()) {
short size = dataIn.readShort();
DataStructure value[] = new DataStructure[size];
for (int i = 0; i < size; i++) {
value[i] = (DataStructure) looseUnmarsalNestedObject(wireFormat,dataIn);
}
info.setData(value);
} else {
info.setData(null);
}
}
}
| 1,450 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/TransactionInfoMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for TransactionInfo
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class TransactionInfoMarshaller extends BaseCommandMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return TransactionInfo.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new TransactionInfo();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
TransactionInfo info = (TransactionInfo) target;
info.setConnectionId((ConnectionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setTransactionId((TransactionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setType(dataIn.readByte());
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
TransactionInfo info = (TransactionInfo) source;
int rc = super.tightMarshal1(wireFormat, source, bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConnectionId(), bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getTransactionId(), bs);
return rc + 1;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
TransactionInfo info = (TransactionInfo) source;
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getConnectionId(), dataOut, bs);
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getTransactionId(), dataOut, bs);
dataOut.writeByte(info.getType());
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
TransactionInfo info = (TransactionInfo) source;
super.looseMarshal(wireFormat, source, dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getConnectionId(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getTransactionId(), dataOut);
dataOut.writeByte(info.getType());
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
TransactionInfo info = (TransactionInfo) target;
info.setConnectionId((ConnectionId) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setTransactionId((TransactionId) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setType(dataIn.readByte());
}
}
| 1,451 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ProducerAckMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for ProducerAck
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class ProducerAckMarshaller extends BaseCommandMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return ProducerAck.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new ProducerAck();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
ProducerAck info = (ProducerAck) target;
int version = wireFormat.getVersion();
if (version >= 3) {
info.setProducerId((ProducerId) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
}
if (version >= 3) {
info.setSize(dataIn.readInt());
}
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
ProducerAck info = (ProducerAck) source;
int version = wireFormat.getVersion();
int rc = super.tightMarshal1(wireFormat, source, bs);
if (version >= 3) {
rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getProducerId(), bs);
}
if (version >= 3) {
}
return rc + 4;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
ProducerAck info = (ProducerAck) source;
int version = wireFormat.getVersion();
if (version >= 3) {
tightMarshalNestedObject2(wireFormat, (DataStructure)info.getProducerId(), dataOut, bs);
}
if (version >= 3) {
dataOut.writeInt(info.getSize());
}
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
ProducerAck info = (ProducerAck) source;
int version = wireFormat.getVersion();
super.looseMarshal(wireFormat, source, dataOut);
if (version >= 3) {
looseMarshalNestedObject(wireFormat, (DataStructure)info.getProducerId(), dataOut);
}
if (version >= 3) {
dataOut.writeInt(info.getSize());
}
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
ProducerAck info = (ProducerAck) target;
int version = wireFormat.getVersion();
if (version >= 3) {
info.setProducerId((ProducerId) looseUnmarsalNestedObject(wireFormat, dataIn));
}
if (version >= 3) {
info.setSize(dataIn.readInt());
}
}
}
| 1,452 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/OpenWireTempDestinationMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for OpenWireTempDestination
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public abstract class OpenWireTempDestinationMarshaller extends OpenWireDestinationMarshaller {
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
int rc = super.tightMarshal1(wireFormat, source, bs);
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
super.looseMarshal(wireFormat, source, dataOut);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
}
}
| 1,453 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ConsumerControlMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for ConsumerControl
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class ConsumerControlMarshaller extends BaseCommandMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return ConsumerControl.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new ConsumerControl();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
ConsumerControl info = (ConsumerControl) target;
int version = wireFormat.getVersion();
if (version >= 6) {
info.setDestination((OpenWireDestination) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
}
info.setClose(bs.readBoolean());
info.setConsumerId((ConsumerId) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
info.setPrefetch(dataIn.readInt());
if (version >= 2) {
info.setFlush(bs.readBoolean());
}
if (version >= 2) {
info.setStart(bs.readBoolean());
}
if (version >= 2) {
info.setStop(bs.readBoolean());
}
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
ConsumerControl info = (ConsumerControl) source;
int version = wireFormat.getVersion();
int rc = super.tightMarshal1(wireFormat, source, bs);
if (version >= 6) {
rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getDestination(), bs);
}
bs.writeBoolean(info.isClose());
rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getConsumerId(), bs);
if (version >= 2) {
bs.writeBoolean(info.isFlush());
}
if (version >= 2) {
bs.writeBoolean(info.isStart());
}
if (version >= 2) {
bs.writeBoolean(info.isStop());
}
return rc + 4;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
ConsumerControl info = (ConsumerControl) source;
int version = wireFormat.getVersion();
if (version >= 6) {
tightMarshalNestedObject2(wireFormat, (DataStructure)info.getDestination(), dataOut, bs);
}
bs.readBoolean();
tightMarshalNestedObject2(wireFormat, (DataStructure)info.getConsumerId(), dataOut, bs);
dataOut.writeInt(info.getPrefetch());
if (version >= 2) {
bs.readBoolean();
}
if (version >= 2) {
bs.readBoolean();
}
if (version >= 2) {
bs.readBoolean();
}
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
ConsumerControl info = (ConsumerControl) source;
int version = wireFormat.getVersion();
super.looseMarshal(wireFormat, source, dataOut);
if (version >= 6) {
looseMarshalNestedObject(wireFormat, (DataStructure)info.getDestination(), dataOut);
}
dataOut.writeBoolean(info.isClose());
looseMarshalNestedObject(wireFormat, (DataStructure)info.getConsumerId(), dataOut);
dataOut.writeInt(info.getPrefetch());
if (version >= 2) {
dataOut.writeBoolean(info.isFlush());
}
if (version >= 2) {
dataOut.writeBoolean(info.isStart());
}
if (version >= 2) {
dataOut.writeBoolean(info.isStop());
}
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
ConsumerControl info = (ConsumerControl) target;
int version = wireFormat.getVersion();
if (version >= 6) {
info.setDestination((OpenWireDestination) looseUnmarsalNestedObject(wireFormat, dataIn));
}
info.setClose(dataIn.readBoolean());
info.setConsumerId((ConsumerId) looseUnmarsalNestedObject(wireFormat, dataIn));
info.setPrefetch(dataIn.readInt());
if (version >= 2) {
info.setFlush(dataIn.readBoolean());
}
if (version >= 2) {
info.setStart(dataIn.readBoolean());
}
if (version >= 2) {
info.setStop(dataIn.readBoolean());
}
}
}
| 1,454 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/OpenWireTextMessageMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for OpenWireTextMessage
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class OpenWireTextMessageMarshaller extends OpenWireMessageMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return OpenWireTextMessage.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new OpenWireTextMessage();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
int rc = super.tightMarshal1(wireFormat, source, bs);
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
super.looseMarshal(wireFormat, source, dataOut);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
}
}
| 1,455 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/BaseCommandMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for BaseCommand
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public abstract class BaseCommandMarshaller extends BaseDataStreamMarshaller {
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
BaseCommand info = (BaseCommand) target;
info.setCommandId(dataIn.readInt());
info.setResponseRequired(bs.readBoolean());
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
BaseCommand info = (BaseCommand) source;
int rc = super.tightMarshal1(wireFormat, source, bs);
bs.writeBoolean(info.isResponseRequired());
return rc + 4;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
BaseCommand info = (BaseCommand) source;
dataOut.writeInt(info.getCommandId());
bs.readBoolean();
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
BaseCommand info = (BaseCommand) source;
super.looseMarshal(wireFormat, source, dataOut);
dataOut.writeInt(info.getCommandId());
dataOut.writeBoolean(info.isResponseRequired());
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
BaseCommand info = (BaseCommand) target;
info.setCommandId(dataIn.readInt());
info.setResponseRequired(dataIn.readBoolean());
}
}
| 1,456 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/MarshallerFactory.java
|
/*
* 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.codec.universal;
import org.apache.activemq.openwire.codec.DataStreamMarshaller;
import org.apache.activemq.openwire.codec.OpenWireFormat;
/**
* Marshalling Factory for the Universal OpenWire Codec package.
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class MarshallerFactory{
/**
* Creates a Map of command type -> Marshallers
*/
static final private DataStreamMarshaller marshaller[] = new DataStreamMarshaller[256];
static {
add(new BrokerIdMarshaller());
add(new BrokerInfoMarshaller());
add(new ConnectionControlMarshaller());
add(new ConnectionErrorMarshaller());
add(new ConnectionIdMarshaller());
add(new ConnectionInfoMarshaller());
add(new ConsumerControlMarshaller());
add(new ConsumerIdMarshaller());
add(new ConsumerInfoMarshaller());
add(new ControlCommandMarshaller());
add(new DataArrayResponseMarshaller());
add(new DataResponseMarshaller());
add(new DestinationInfoMarshaller());
add(new DiscoveryEventMarshaller());
add(new ExceptionResponseMarshaller());
add(new FlushCommandMarshaller());
add(new IntegerResponseMarshaller());
add(new JournalQueueAckMarshaller());
add(new JournalTopicAckMarshaller());
add(new JournalTraceMarshaller());
add(new JournalTransactionMarshaller());
add(new KeepAliveInfoMarshaller());
add(new LastPartialCommandMarshaller());
add(new LocalTransactionIdMarshaller());
add(new MessageAckMarshaller());
add(new MessageDispatchMarshaller());
add(new MessageDispatchNotificationMarshaller());
add(new MessageIdMarshaller());
add(new MessagePullMarshaller());
add(new NetworkBridgeFilterMarshaller());
add(new OpenWireBlobMessageMarshaller());
add(new OpenWireBytesMessageMarshaller());
add(new OpenWireMapMessageMarshaller());
add(new OpenWireMessageMarshaller());
add(new OpenWireObjectMessageMarshaller());
add(new OpenWireQueueMarshaller());
add(new OpenWireStreamMessageMarshaller());
add(new OpenWireTempQueueMarshaller());
add(new OpenWireTempTopicMarshaller());
add(new OpenWireTextMessageMarshaller());
add(new OpenWireTopicMarshaller());
add(new PartialCommandMarshaller());
add(new ProducerAckMarshaller());
add(new ProducerIdMarshaller());
add(new ProducerInfoMarshaller());
add(new RemoveInfoMarshaller());
add(new RemoveSubscriptionInfoMarshaller());
add(new ReplayCommandMarshaller());
add(new ResponseMarshaller());
add(new SessionIdMarshaller());
add(new SessionInfoMarshaller());
add(new ShutdownInfoMarshaller());
add(new SubscriptionInfoMarshaller());
add(new TransactionInfoMarshaller());
add(new WireFormatInfoMarshaller());
add(new XATransactionIdMarshaller());
}
static private void add(DataStreamMarshaller dsm) {
marshaller[dsm.getDataStructureType()] = dsm;
}
static public DataStreamMarshaller[] createMarshallerMap(OpenWireFormat wireFormat) {
return marshaller;
}
}
| 1,457 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/DataResponseMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for DataResponse
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class DataResponseMarshaller extends ResponseMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return DataResponse.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new DataResponse();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
DataResponse info = (DataResponse) target;
info.setData((DataStructure) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
DataResponse info = (DataResponse) source;
int rc = super.tightMarshal1(wireFormat, source, bs);
rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getData(), bs);
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
DataResponse info = (DataResponse) source;
tightMarshalNestedObject2(wireFormat, (DataStructure)info.getData(), dataOut, bs);
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
DataResponse info = (DataResponse) source;
super.looseMarshal(wireFormat, source, dataOut);
looseMarshalNestedObject(wireFormat, (DataStructure)info.getData(), dataOut);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
DataResponse info = (DataResponse) target;
info.setData((DataStructure) looseUnmarsalNestedObject(wireFormat, dataIn));
}
}
| 1,458 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/MessageDispatchNotificationMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for MessageDispatchNotification
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class MessageDispatchNotificationMarshaller extends BaseCommandMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return MessageDispatchNotification.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new MessageDispatchNotification();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
MessageDispatchNotification info = (MessageDispatchNotification) target;
info.setConsumerId((ConsumerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setDestination((OpenWireDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setDeliverySequenceId(tightUnmarshalLong(wireFormat, dataIn, bs));
info.setMessageId((MessageId) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
MessageDispatchNotification info = (MessageDispatchNotification) source;
int rc = super.tightMarshal1(wireFormat, source, bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConsumerId(), bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getDestination(), bs);
rc += tightMarshalLong1(wireFormat, info.getDeliverySequenceId(), bs);
rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getMessageId(), bs);
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
MessageDispatchNotification info = (MessageDispatchNotification) source;
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getConsumerId(), dataOut, bs);
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getDestination(), dataOut, bs);
tightMarshalLong2(wireFormat, info.getDeliverySequenceId(), dataOut, bs);
tightMarshalNestedObject2(wireFormat, (DataStructure)info.getMessageId(), dataOut, bs);
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
MessageDispatchNotification info = (MessageDispatchNotification) source;
super.looseMarshal(wireFormat, source, dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getConsumerId(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getDestination(), dataOut);
looseMarshalLong(wireFormat, info.getDeliverySequenceId(), dataOut);
looseMarshalNestedObject(wireFormat, (DataStructure)info.getMessageId(), dataOut);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
MessageDispatchNotification info = (MessageDispatchNotification) target;
info.setConsumerId((ConsumerId) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setDestination((OpenWireDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setDeliverySequenceId(looseUnmarshalLong(wireFormat, dataIn));
info.setMessageId((MessageId) looseUnmarsalNestedObject(wireFormat, dataIn));
}
}
| 1,459 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/MessageDispatchMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for MessageDispatch
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class MessageDispatchMarshaller extends BaseCommandMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return MessageDispatch.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new MessageDispatch();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
MessageDispatch info = (MessageDispatch) target;
info.setConsumerId((ConsumerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setDestination((OpenWireDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setMessage((Message) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
info.setRedeliveryCounter(dataIn.readInt());
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
MessageDispatch info = (MessageDispatch) source;
int rc = super.tightMarshal1(wireFormat, source, bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConsumerId(), bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getDestination(), bs);
rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getMessage(), bs);
return rc + 4;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
MessageDispatch info = (MessageDispatch) source;
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getConsumerId(), dataOut, bs);
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getDestination(), dataOut, bs);
tightMarshalNestedObject2(wireFormat, (DataStructure)info.getMessage(), dataOut, bs);
dataOut.writeInt(info.getRedeliveryCounter());
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
MessageDispatch info = (MessageDispatch) source;
super.looseMarshal(wireFormat, source, dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getConsumerId(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getDestination(), dataOut);
looseMarshalNestedObject(wireFormat, (DataStructure)info.getMessage(), dataOut);
dataOut.writeInt(info.getRedeliveryCounter());
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
MessageDispatch info = (MessageDispatch) target;
info.setConsumerId((ConsumerId) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setDestination((OpenWireDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setMessage((Message) looseUnmarsalNestedObject(wireFormat, dataIn));
info.setRedeliveryCounter(dataIn.readInt());
}
}
| 1,460 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/MessageMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for Message
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public abstract class MessageMarshaller extends BaseCommandMarshaller {
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
Message info = (Message) target;
int version = wireFormat.getVersion();
info.beforeUnmarshall(wireFormat);
info.setProducerId((ProducerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setDestination((OpenWireDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setTransactionId((TransactionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setOriginalDestination((OpenWireDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setMessageId((MessageId) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
info.setOriginalTransactionId((TransactionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setGroupID(tightUnmarshalString(dataIn, bs));
info.setGroupSequence(dataIn.readInt());
info.setCorrelationId(tightUnmarshalString(dataIn, bs));
info.setPersistent(bs.readBoolean());
info.setExpiration(tightUnmarshalLong(wireFormat, dataIn, bs));
info.setPriority(dataIn.readByte());
info.setReplyTo((OpenWireDestination) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
info.setTimestamp(tightUnmarshalLong(wireFormat, dataIn, bs));
info.setType(tightUnmarshalString(dataIn, bs));
info.setContent(tightUnmarshalByteSequence(dataIn, bs));
info.setMarshalledProperties(tightUnmarshalByteSequence(dataIn, bs));
info.setDataStructure((DataStructure) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
info.setTargetConsumerId((ConsumerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setCompressed(bs.readBoolean());
info.setRedeliveryCounter(dataIn.readInt());
if (bs.readBoolean()) {
short size = dataIn.readShort();
BrokerId value[] = new BrokerId[size];
for (int i = 0; i < size; i++) {
value[i] = (BrokerId) tightUnmarsalNestedObject(wireFormat,dataIn, bs);
}
info.setBrokerPath(value);
} else {
info.setBrokerPath(null);
}
info.setArrival(tightUnmarshalLong(wireFormat, dataIn, bs));
info.setUserId(tightUnmarshalString(dataIn, bs));
info.setRecievedByDFBridge(bs.readBoolean());
if (version >= 2) {
info.setDroppable(bs.readBoolean());
}
if (version >= 3) {
if (bs.readBoolean()) {
short size = dataIn.readShort();
BrokerId value[] = new BrokerId[size];
for (int i = 0; i < size; i++) {
value[i] = (BrokerId) tightUnmarsalNestedObject(wireFormat,dataIn, bs);
}
info.setCluster(value);
} else {
info.setCluster(null);
}
}
if (version >= 3) {
info.setBrokerInTime(tightUnmarshalLong(wireFormat, dataIn, bs));
}
if (version >= 3) {
info.setBrokerOutTime(tightUnmarshalLong(wireFormat, dataIn, bs));
}
if (version >= 10) {
info.setJMSXGroupFirstForConsumer(bs.readBoolean());
}
info.afterUnmarshall(wireFormat);
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
Message info = (Message) source;
int version = wireFormat.getVersion();
info.beforeMarshall(wireFormat);
int rc = super.tightMarshal1(wireFormat, source, bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getProducerId(), bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getDestination(), bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getTransactionId(), bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getOriginalDestination(), bs);
rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getMessageId(), bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getOriginalTransactionId(), bs);
rc += tightMarshalString1(info.getGroupId(), bs);
rc += tightMarshalString1(info.getCorrelationId(), bs);
bs.writeBoolean(info.isPersistent());
rc += tightMarshalLong1(wireFormat, info.getExpiration(), bs);
rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getReplyTo(), bs);
rc += tightMarshalLong1(wireFormat, info.getTimestamp(), bs);
rc += tightMarshalString1(info.getType(), bs);
rc += tightMarshalByteSequence1(info.getContent(), bs);
rc += tightMarshalByteSequence1(info.getMarshalledProperties(), bs);
rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getDataStructure(), bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getTargetConsumerId(), bs);
bs.writeBoolean(info.isCompressed());
rc += tightMarshalObjectArray1(wireFormat, info.getBrokerPath(), bs);
rc += tightMarshalLong1(wireFormat, info.getArrival(), bs);
rc += tightMarshalString1(info.getUserId(), bs);
bs.writeBoolean(info.isRecievedByDFBridge());
if (version >= 2) {
bs.writeBoolean(info.isDroppable());
}
if (version >= 3) {
rc += tightMarshalObjectArray1(wireFormat, info.getCluster(), bs);
}
if (version >= 3) {
rc += tightMarshalLong1(wireFormat, info.getBrokerInTime(), bs);
}
if (version >= 3) {
rc += tightMarshalLong1(wireFormat, info.getBrokerOutTime(), bs);
}
if (version >= 10) {
bs.writeBoolean(info.isJMSXGroupFirstForConsumer());
}
return rc + 9;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
Message info = (Message) source;
int version = wireFormat.getVersion();
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getProducerId(), dataOut, bs);
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getDestination(), dataOut, bs);
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getTransactionId(), dataOut, bs);
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getOriginalDestination(), dataOut, bs);
tightMarshalNestedObject2(wireFormat, (DataStructure)info.getMessageId(), dataOut, bs);
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getOriginalTransactionId(), dataOut, bs);
tightMarshalString2(info.getGroupId(), dataOut, bs);
dataOut.writeInt(info.getGroupSequence());
tightMarshalString2(info.getCorrelationId(), dataOut, bs);
bs.readBoolean();
tightMarshalLong2(wireFormat, info.getExpiration(), dataOut, bs);
dataOut.writeByte(info.getPriority());
tightMarshalNestedObject2(wireFormat, (DataStructure)info.getReplyTo(), dataOut, bs);
tightMarshalLong2(wireFormat, info.getTimestamp(), dataOut, bs);
tightMarshalString2(info.getType(), dataOut, bs);
tightMarshalByteSequence2(info.getContent(), dataOut, bs);
tightMarshalByteSequence2(info.getMarshalledProperties(), dataOut, bs);
tightMarshalNestedObject2(wireFormat, (DataStructure)info.getDataStructure(), dataOut, bs);
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getTargetConsumerId(), dataOut, bs);
bs.readBoolean();
dataOut.writeInt(info.getRedeliveryCounter());
tightMarshalObjectArray2(wireFormat, info.getBrokerPath(), dataOut, bs);
tightMarshalLong2(wireFormat, info.getArrival(), dataOut, bs);
tightMarshalString2(info.getUserId(), dataOut, bs);
bs.readBoolean();
if (version >= 2) {
bs.readBoolean();
}
if (version >= 3) {
tightMarshalObjectArray2(wireFormat, info.getCluster(), dataOut, bs);
}
if (version >= 3) {
tightMarshalLong2(wireFormat, info.getBrokerInTime(), dataOut, bs);
}
if (version >= 3) {
tightMarshalLong2(wireFormat, info.getBrokerOutTime(), dataOut, bs);
}
if (version >= 10) {
bs.readBoolean();
}
info.afterMarshall(wireFormat);
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
Message info = (Message) source;
int version = wireFormat.getVersion();
info.beforeMarshall(wireFormat);
super.looseMarshal(wireFormat, source, dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getProducerId(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getDestination(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getTransactionId(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getOriginalDestination(), dataOut);
looseMarshalNestedObject(wireFormat, (DataStructure)info.getMessageId(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getOriginalTransactionId(), dataOut);
looseMarshalString(info.getGroupId(), dataOut);
dataOut.writeInt(info.getGroupSequence());
looseMarshalString(info.getCorrelationId(), dataOut);
dataOut.writeBoolean(info.isPersistent());
looseMarshalLong(wireFormat, info.getExpiration(), dataOut);
dataOut.writeByte(info.getPriority());
looseMarshalNestedObject(wireFormat, (DataStructure)info.getReplyTo(), dataOut);
looseMarshalLong(wireFormat, info.getTimestamp(), dataOut);
looseMarshalString(info.getType(), dataOut);
looseMarshalByteSequence(wireFormat, info.getContent(), dataOut);
looseMarshalByteSequence(wireFormat, info.getMarshalledProperties(), dataOut);
looseMarshalNestedObject(wireFormat, (DataStructure)info.getDataStructure(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getTargetConsumerId(), dataOut);
dataOut.writeBoolean(info.isCompressed());
dataOut.writeInt(info.getRedeliveryCounter());
looseMarshalObjectArray(wireFormat, info.getBrokerPath(), dataOut);
looseMarshalLong(wireFormat, info.getArrival(), dataOut);
looseMarshalString(info.getUserId(), dataOut);
dataOut.writeBoolean(info.isRecievedByDFBridge());
if (version >= 2) {
dataOut.writeBoolean(info.isDroppable());
}
if (version >= 3) {
looseMarshalObjectArray(wireFormat, info.getCluster(), dataOut);
}
if (version >= 3) {
looseMarshalLong(wireFormat, info.getBrokerInTime(), dataOut);
}
if (version >= 3) {
looseMarshalLong(wireFormat, info.getBrokerOutTime(), dataOut);
}
if (version >= 10) {
dataOut.writeBoolean(info.isJMSXGroupFirstForConsumer());
}
info.afterMarshall(wireFormat);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
Message info = (Message) target;
int version = wireFormat.getVersion();
info.beforeUnmarshall(wireFormat);
info.setProducerId((ProducerId) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setDestination((OpenWireDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setTransactionId((TransactionId) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setOriginalDestination((OpenWireDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setMessageId((MessageId) looseUnmarsalNestedObject(wireFormat, dataIn));
info.setOriginalTransactionId((TransactionId) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setGroupID(looseUnmarshalString(dataIn));
info.setGroupSequence(dataIn.readInt());
info.setCorrelationId(looseUnmarshalString(dataIn));
info.setPersistent(dataIn.readBoolean());
info.setExpiration(looseUnmarshalLong(wireFormat, dataIn));
info.setPriority(dataIn.readByte());
info.setReplyTo((OpenWireDestination) looseUnmarsalNestedObject(wireFormat, dataIn));
info.setTimestamp(looseUnmarshalLong(wireFormat, dataIn));
info.setType(looseUnmarshalString(dataIn));
info.setContent(looseUnmarshalByteSequence(dataIn));
info.setMarshalledProperties(looseUnmarshalByteSequence(dataIn));
info.setDataStructure((DataStructure) looseUnmarsalNestedObject(wireFormat, dataIn));
info.setTargetConsumerId((ConsumerId) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setCompressed(dataIn.readBoolean());
info.setRedeliveryCounter(dataIn.readInt());
if (dataIn.readBoolean()) {
short size = dataIn.readShort();
BrokerId value[] = new BrokerId[size];
for (int i = 0; i < size; i++) {
value[i] = (BrokerId) looseUnmarsalNestedObject(wireFormat,dataIn);
}
info.setBrokerPath(value);
} else {
info.setBrokerPath(null);
}
info.setArrival(looseUnmarshalLong(wireFormat, dataIn));
info.setUserId(looseUnmarshalString(dataIn));
info.setRecievedByDFBridge(dataIn.readBoolean());
if (version >= 2) {
info.setDroppable(dataIn.readBoolean());
}
if (version >= 3) {
if (dataIn.readBoolean()) {
short size = dataIn.readShort();
BrokerId value[] = new BrokerId[size];
for (int i = 0; i < size; i++) {
value[i] = (BrokerId) looseUnmarsalNestedObject(wireFormat,dataIn);
}
info.setCluster(value);
} else {
info.setCluster(null);
}
}
if (version >= 3) {
info.setBrokerInTime(looseUnmarshalLong(wireFormat, dataIn));
}
if (version >= 3) {
info.setBrokerOutTime(looseUnmarshalLong(wireFormat, dataIn));
}
if (version >= 10) {
info.setJMSXGroupFirstForConsumer(dataIn.readBoolean());
}
info.afterUnmarshall(wireFormat);
}
}
| 1,461 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/TransactionIdMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for TransactionId
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public abstract class TransactionIdMarshaller extends BaseDataStreamMarshaller {
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
int rc = super.tightMarshal1(wireFormat, source, bs);
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
super.looseMarshal(wireFormat, source, dataOut);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
}
}
| 1,462 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/SubscriptionInfoMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for SubscriptionInfo
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class SubscriptionInfoMarshaller extends BaseDataStreamMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return SubscriptionInfo.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new SubscriptionInfo();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
SubscriptionInfo info = (SubscriptionInfo) target;
int version = wireFormat.getVersion();
info.setClientId(tightUnmarshalString(dataIn, bs));
info.setDestination((OpenWireDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setSelector(tightUnmarshalString(dataIn, bs));
info.setSubscriptionName(tightUnmarshalString(dataIn, bs));
if (version >= 3) {
info.setSubscribedDestination((OpenWireDestination) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
}
if (version >= 11) {
info.setNoLocal(bs.readBoolean());
}
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
SubscriptionInfo info = (SubscriptionInfo) source;
int version = wireFormat.getVersion();
int rc = super.tightMarshal1(wireFormat, source, bs);
rc += tightMarshalString1(info.getClientId(), bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getDestination(), bs);
rc += tightMarshalString1(info.getSelector(), bs);
rc += tightMarshalString1(info.getSubscriptionName(), bs);
if (version >= 3) {
rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getSubscribedDestination(), bs);
}
if (version >= 11) {
bs.writeBoolean(info.isNoLocal());
}
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
SubscriptionInfo info = (SubscriptionInfo) source;
int version = wireFormat.getVersion();
tightMarshalString2(info.getClientId(), dataOut, bs);
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getDestination(), dataOut, bs);
tightMarshalString2(info.getSelector(), dataOut, bs);
tightMarshalString2(info.getSubscriptionName(), dataOut, bs);
if (version >= 3) {
tightMarshalNestedObject2(wireFormat, (DataStructure)info.getSubscribedDestination(), dataOut, bs);
}
if (version >= 11) {
bs.readBoolean();
}
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
SubscriptionInfo info = (SubscriptionInfo) source;
int version = wireFormat.getVersion();
super.looseMarshal(wireFormat, source, dataOut);
looseMarshalString(info.getClientId(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getDestination(), dataOut);
looseMarshalString(info.getSelector(), dataOut);
looseMarshalString(info.getSubscriptionName(), dataOut);
if (version >= 3) {
looseMarshalNestedObject(wireFormat, (DataStructure)info.getSubscribedDestination(), dataOut);
}
if (version >= 11) {
dataOut.writeBoolean(info.isNoLocal());
}
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
SubscriptionInfo info = (SubscriptionInfo) target;
int version = wireFormat.getVersion();
info.setClientId(looseUnmarshalString(dataIn));
info.setDestination((OpenWireDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setSelector(looseUnmarshalString(dataIn));
info.setSubscriptionName(looseUnmarshalString(dataIn));
if (version >= 3) {
info.setSubscribedDestination((OpenWireDestination) looseUnmarsalNestedObject(wireFormat, dataIn));
}
if (version >= 11) {
info.setNoLocal(dataIn.readBoolean());
}
}
}
| 1,463 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ConnectionIdMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for ConnectionId
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class ConnectionIdMarshaller extends BaseDataStreamMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return ConnectionId.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new ConnectionId();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
ConnectionId info = (ConnectionId) target;
info.setValue(tightUnmarshalString(dataIn, bs));
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
ConnectionId info = (ConnectionId) source;
int rc = super.tightMarshal1(wireFormat, source, bs);
rc += tightMarshalString1(info.getValue(), bs);
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
ConnectionId info = (ConnectionId) source;
tightMarshalString2(info.getValue(), dataOut, bs);
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
ConnectionId info = (ConnectionId) source;
super.looseMarshal(wireFormat, source, dataOut);
looseMarshalString(info.getValue(), dataOut);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
ConnectionId info = (ConnectionId) target;
info.setValue(looseUnmarshalString(dataIn));
}
}
| 1,464 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/JournalTransactionMarshaller.java
|
/*
* 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.codec.universal;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.codec.*;
import org.apache.activemq.openwire.commands.*;
/**
* Marshalling code for Open Wire for JournalTransaction
*
* NOTE!: This file is auto generated - do not modify!
*
*/
public class JournalTransactionMarshaller extends BaseDataStreamMarshaller {
/**
* Return the type of Data Structure handled by this Marshaler
*
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return JournalTransaction.DATA_STRUCTURE_TYPE;
}
/**
* @return a new instance of the managed type.
*/
public DataStructure createObject() {
return new JournalTransaction();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
* @param bs the boolean stream where the type's booleans were marshaled
*
* @throws IOException if an error occurs while reading the data
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, target, dataIn, bs);
JournalTransaction info = (JournalTransaction) target;
info.setTransactionId((TransactionId) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
info.setType(dataIn.readByte());
info.setWasPrepared(bs.readBoolean());
}
/**
* Write the booleans that this object uses to a BooleanStream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException {
JournalTransaction info = (JournalTransaction) source;
int rc = super.tightMarshal1(wireFormat, source, bs);
rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getTransactionId(), bs);
bs.writeBoolean(info.getWasPrepared());
return rc + 1;
}
/**
* Write a object instance to data output stream
*
* @param wireFormat the OpenWireFormat instance to use
* @param source the object to marshal
* @param dataOut the DataOut where the properties are written
* @param bs the boolean stream where the type's booleans are written
*
* @throws IOException if an error occurs while writing the data
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, source, dataOut, bs);
JournalTransaction info = (JournalTransaction) source;
tightMarshalNestedObject2(wireFormat, (DataStructure)info.getTransactionId(), dataOut, bs);
dataOut.writeByte(info.getType());
bs.readBoolean();
}
/**
* Write the object to the output using loose marshaling.
*
* @throws IOException if an error occurs while writing the data
*/
public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException {
JournalTransaction info = (JournalTransaction) source;
super.looseMarshal(wireFormat, source, dataOut);
looseMarshalNestedObject(wireFormat, (DataStructure)info.getTransactionId(), dataOut);
dataOut.writeByte(info.getType());
dataOut.writeBoolean(info.getWasPrepared());
}
/**
* Un-marshal an object instance from the data input stream
*
* @param target the object to un-marshal
* @param dataIn the data input stream to build the object from
*
* @throws IOException if an error occurs while writing the data
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, target, dataIn);
JournalTransaction info = (JournalTransaction) target;
info.setTransactionId((TransactionId) looseUnmarsalNestedObject(wireFormat, dataIn));
info.setType(dataIn.readByte());
info.setWasPrepared(dataIn.readBoolean());
}
}
| 1,465 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/utils/OpenWireConsumer.java
|
/**
* 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.utils;
import org.apache.activemq.openwire.commands.ConsumerId;
import org.apache.activemq.openwire.commands.ConsumerInfo;
import org.apache.activemq.openwire.commands.OpenWireDestination;
import org.apache.activemq.openwire.commands.RemoveInfo;
/**
* Encapsulates an ActiveMQ compatible MessageConsumer ID using an OpenWire
* ConsumerId generated from a parent Session instance.
*/
public class OpenWireConsumer extends ConsumerInfo {
private final OpenWireSession parent;
/**
* Creates a new OpenWireConsumer instance with the assigned consumerId.
*
* @param parent
* the OpenWireSession that created this instance.
* @param consumerId
* the assigned consumer Id for this Consumer.
*/
public OpenWireConsumer(OpenWireSession parent, ConsumerId consumerId) {
super(consumerId);
this.parent = parent;
}
/**
* Creates a new OpenWireConsumer from the given ConsumerInfo instance.
*
* @param parent
* the OpenWireSession that created this instance.
* @param consumerInfo
* the ConsumerInfo instance used to populate this one.
*/
public OpenWireConsumer(OpenWireSession parent, ConsumerInfo consumerInfo) {
this.parent = parent;
consumerInfo.copy(this);
}
/**
* @return the parent OpenWireSessionId instance.
*/
public OpenWireSession getParent() {
return parent;
}
/**
* @return the next logical delivery Id for messages dispatched by the consumer.
*/
public long getNextDeliveryId() {
return parent.getNextDeliveryId();
}
@Override
public String toString() {
return consumerId.toString();
}
/**
* Factory method for creating a ConsumerInfo to wrap this instance's ConsumerId.
*
* @return a new ConsumerInfo instance that can be used to register a remote Consumer.
*/
public ConsumerInfo createConsumerInfo() {
return this.copy();
}
/**
* Factory method for creating a ConsumerInfo to wrap this instance's ConsumerId.
*
* @param destination
* the target destination for this ProducerInfo instance.
*
* @return a new ConsumerInfo instance that can be used to register a remote Consumer.
*/
public ConsumerInfo createConsumerInfo(OpenWireDestination destination) {
this.setDestination(destination);
return this.copy();
}
/**
* Factory method for creating a RemoveInfo command that can be used to remove this
* consumer instance from the Broker.
*
* @return a new RemoveInfo instance that can remove this consumer.
*/
public RemoveInfo createRemoveInfo() {
return new RemoveInfo(getConsumerId());
}
}
| 1,466 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/utils/ObjectMessageInputStream.java
|
/**
* 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.utils;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectStreamClass;
import java.lang.reflect.Proxy;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ObjectMessageInputStream extends ObjectInputStream {
private static final Logger LOG = LoggerFactory.getLogger(ObjectMessageInputStream.class);
private static final ClassLoader FALLBACK_CLASS_LOADER = ObjectMessageInputStream.class.getClassLoader();
private final ClassLoader inLoader;
public ObjectMessageInputStream(InputStream in) throws IOException {
super(in);
inLoader = in.getClass().getClassLoader();
}
@Override
protected Class<?> resolveClass(ObjectStreamClass classDesc) throws IOException, ClassNotFoundException {
ClassLoader cl = Thread.currentThread().getContextClassLoader();
return load(classDesc.getName(), cl, inLoader);
}
@Override
protected Class<?> resolveProxyClass(String[] interfaces) throws IOException, ClassNotFoundException {
ClassLoader cl = Thread.currentThread().getContextClassLoader();
Class<?>[] cinterfaces = new Class[interfaces.length];
for (int i = 0; i < interfaces.length; i++) {
cinterfaces[i] = load(interfaces[i], cl);
}
try {
return Proxy.getProxyClass(cl, cinterfaces);
} catch (IllegalArgumentException e) {
try {
return Proxy.getProxyClass(inLoader, cinterfaces);
} catch (IllegalArgumentException e1) {
// ignore
}
try {
return Proxy.getProxyClass(FALLBACK_CLASS_LOADER, cinterfaces);
} catch (IllegalArgumentException e2) {
// ignore
}
throw new ClassNotFoundException(null, e);
}
}
private Class<?> load(String className, ClassLoader... cl) throws ClassNotFoundException {
// check for simple types first
final Class<?> clazz = loadSimpleType(className);
if (clazz != null) {
LOG.trace("Loaded class: {} as simple type -> ", className, clazz);
return clazz;
}
// try the different class loaders
for (ClassLoader loader : cl) {
LOG.trace("Attempting to load class: {} using classloader: {}", className, cl);
try {
Class<?> answer = Class.forName(className, false, loader);
if (LOG.isTraceEnabled()) {
LOG.trace("Loaded class: {} using classloader: {} -> ", new Object[] { className, cl, answer });
}
return answer;
} catch (ClassNotFoundException e) {
LOG.trace("Class not found: {} using classloader: {}", className, cl);
// ignore
}
}
// and then the fallback class loader
return Class.forName(className, false, FALLBACK_CLASS_LOADER);
}
/**
* Load a simple type
*
* @param name
* the name of the class to load
* @return the class or <tt>null</tt> if it could not be loaded
*/
public static Class<?> loadSimpleType(String name) {
if ("java.lang.byte[]".equals(name) || "byte[]".equals(name)) {
return byte[].class;
} else if ("java.lang.Byte[]".equals(name) || "Byte[]".equals(name)) {
return Byte[].class;
} else if ("java.lang.Object[]".equals(name) || "Object[]".equals(name)) {
return Object[].class;
} else if ("java.lang.String[]".equals(name) || "String[]".equals(name)) {
return String[].class;
// and these is common as well
} else if ("java.lang.String".equals(name) || "String".equals(name)) {
return String.class;
} else if ("java.lang.Boolean".equals(name) || "Boolean".equals(name)) {
return Boolean.class;
} else if ("boolean".equals(name)) {
return boolean.class;
} else if ("java.lang.Integer".equals(name) || "Integer".equals(name)) {
return Integer.class;
} else if ("int".equals(name)) {
return int.class;
} else if ("java.lang.Long".equals(name) || "Long".equals(name)) {
return Long.class;
} else if ("long".equals(name)) {
return long.class;
} else if ("java.lang.Short".equals(name) || "Short".equals(name)) {
return Short.class;
} else if ("short".equals(name)) {
return short.class;
} else if ("java.lang.Byte".equals(name) || "Byte".equals(name)) {
return Byte.class;
} else if ("byte".equals(name)) {
return byte.class;
} else if ("java.lang.Float".equals(name) || "Float".equals(name)) {
return Float.class;
} else if ("float".equals(name)) {
return float.class;
} else if ("java.lang.Double".equals(name) || "Double".equals(name)) {
return Double.class;
} else if ("double".equals(name)) {
return double.class;
}
return null;
}
}
| 1,467 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/utils/OpenWireProducer.java
|
/**
* 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.utils;
import java.util.concurrent.atomic.AtomicLong;
import org.apache.activemq.openwire.commands.MessageId;
import org.apache.activemq.openwire.commands.OpenWireDestination;
import org.apache.activemq.openwire.commands.ProducerId;
import org.apache.activemq.openwire.commands.ProducerInfo;
import org.apache.activemq.openwire.commands.RemoveInfo;
import org.apache.activemq.openwire.commands.SessionId;
/**
* Encapsulates an ActiveMQ compatible OpenWire Producer ID and provides
* functionality used to generate message IDs for the producer.
*/
public class OpenWireProducer extends ProducerInfo {
private final OpenWireSession parent;
private final AtomicLong messageSequence = new AtomicLong(1);
/**
* Creates a new instance with the given parent Session Id and assigned Producer Id
*
* @param parent
* the OpenWireSessionId that is the parent of the new Producer.
* @param producerId
* the ProducerId assigned to this instance.
*/
public OpenWireProducer(OpenWireSession parent, ProducerId producerId) {
super(producerId);
this.parent = parent;
}
/**
* Creates a new instance with the given parent Session Id and copy the given ProducerInfo
*
* @param parent
* the OpenWireSessionId that is the parent of the new Producer.
* @param producerInfo
* the ProducerInfo used to populate this instance.
*/
public OpenWireProducer(OpenWireSession parent, ProducerInfo producerInfo) {
this.parent = parent;
producerInfo.copy(this);
}
/**
* @return the SessionId of this ProducerId instance.
*/
public SessionId getSessionId() {
return this.parent.getSessionId();
}
/**
* @return the parent OpenWireSessionId
*/
public OpenWireSession getParent() {
return parent;
}
/**
* Factory method used to simplify creation of MessageIds from this Producer
*
* @return the next logical MessageId for the producer this instance represents.
*/
public MessageId getNextMessageId() {
return new MessageId(producerId, messageSequence.getAndIncrement());
}
@Override
public String toString() {
return producerId.toString();
}
/**
* Factory method for creating a ProducerInfo to wrap this instance's ProducerId.
*
* @return a new ProducerInfo instance that can be used to register a remote producer.
*/
public ProducerInfo createProducerInfo() {
return this.copy();
}
/**
* Factory method for creating a ProducerInfo to wrap this instance's ProducerId.
*
* @param destination
* the target destination for this ProducerInfo instance.
*
* @return a new ProducerInfo instance that can be used to register a remote producer.
*/
public ProducerInfo createProducerInfo(OpenWireDestination destination) {
this.setDestination(destination);
return this.copy();
}
/**
* Factory method for creating a RemoveInfo command that can be used to remove this
* producer instance from the Broker.
*
* @return a new RemoveInfo instance that can remove this producer.
*/
public RemoveInfo createRemoveInfo() {
return new RemoveInfo(getProducerId());
}
}
| 1,468 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/utils/OpenWireSession.java
|
/**
* 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.utils;
import java.util.concurrent.atomic.AtomicLong;
import org.apache.activemq.openwire.commands.ConnectionId;
import org.apache.activemq.openwire.commands.ConsumerId;
import org.apache.activemq.openwire.commands.ProducerId;
import org.apache.activemq.openwire.commands.RemoveInfo;
import org.apache.activemq.openwire.commands.SessionId;
import org.apache.activemq.openwire.commands.SessionInfo;
/**
* Encapsulates an ActiveMQ compatible OpenWire Session ID and provides methods
* for creating consumer and producer ID objects that are children of this session.
*/
public class OpenWireSession extends SessionInfo {
private final AtomicLong consumerIdGenerator = new AtomicLong(1);
private final AtomicLong producerIdGenerator = new AtomicLong(1);
private final AtomicLong deliveryIdGenerator = new AtomicLong(1);
/**
* Creates a new OpenWireSessionId instance with the given ID.
*
* @param sessionId
* the SessionId assigned to this instance.
*/
public OpenWireSession(SessionId sessionId) {
this.sessionId = sessionId;
}
/**
* Creates a new OpenWireSessionId instance based on the given ConnectionId
* and a session sequence number.
*
* @param connectionId
* the ConnectionId to use for this Session ID.
* @param sequence
* the sequence number that identifies this Session instance.
*/
public OpenWireSession(ConnectionId connectionId, long sequence) {
this(new SessionId(connectionId, sequence));
}
/**
* @return the fixed SessionId of this OpenWireSessionId instance.
*/
@Override
public SessionId getSessionId() {
return sessionId;
}
/**
* @return the next ConsumerId instance for the managed SessionId.
*/
public ConsumerId getNextConsumerId() {
return new ConsumerId(sessionId, consumerIdGenerator.getAndIncrement());
}
/**
* @return the next ProducerId instance for the managed SessionId.
*/
public ProducerId getNextProducerId() {
return new ProducerId(sessionId, producerIdGenerator.getAndIncrement());
}
/**
* @return the next Id to assign incoming message deliveries from the managed session Id.
*/
public long getNextDeliveryId() {
return this.deliveryIdGenerator.getAndIncrement();
}
@Override
public String toString() {
return sessionId.toString();
}
/**
* Factory method used to create OpenWireConsumerId instances from this Session.
*
* @returns an OpenWireConsumerId rooted at this SessionId.
*/
public OpenWireConsumer createOpenWireConsumer() {
return new OpenWireConsumer(this, getNextConsumerId());
}
/**
* Factory method used to create OpenWireProducerId instances from this Session.
*
* @returns an OpenWireProducerId rooted at this SessionId.
*/
public OpenWireProducer createOpenWireProducer() {
return new OpenWireProducer(this, getNextProducerId());
}
/**
* Factory method for creating a SessionInfo to wrap the managed SessionId
*
* @returns a SessionInfo object that wraps the internal SessionId.
*/
public SessionInfo createSessionInfo() {
return new SessionInfo(getSessionId());
}
/**
* Factory method for creating a suitable RemoveInfo for this session instance.
*
* @return a new RemoveInfo instance that can be used to remove this session.
*/
public RemoveInfo createRemoveInfo() {
return new RemoveInfo(getSessionId());
}
}
| 1,469 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/utils/OpenWireConnection.java
|
/**
* 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.utils;
import java.util.concurrent.atomic.AtomicLong;
import org.apache.activemq.openwire.commands.ConnectionId;
import org.apache.activemq.openwire.commands.ConnectionInfo;
import org.apache.activemq.openwire.commands.ConsumerId;
import org.apache.activemq.openwire.commands.LocalTransactionId;
import org.apache.activemq.openwire.commands.RemoveInfo;
import org.apache.activemq.openwire.commands.SessionId;
import org.apache.activemq.openwire.commands.TransactionId;
/**
* Encapsulates an ActiveMQ compatible OpenWire connection Id used to create instance
* of ConnectionId objects and provides methods for creating OpenWireSession instances
* that are children of this Connection.
*/
public class OpenWireConnection extends ConnectionInfo {
private static final OpenWireIdGenerator idGenerator = new OpenWireIdGenerator();
private SessionId connectionSessionId;
private final AtomicLong sessionIdGenerator = new AtomicLong(1);
private final AtomicLong consumerIdGenerator = new AtomicLong(1);
private final AtomicLong tempDestinationIdGenerator = new AtomicLong(1);
private final AtomicLong localTransactionIdGenerator = new AtomicLong(1);
/**
* Creates a fixed OpenWire Connection Id instance.
*/
public OpenWireConnection() {
this(idGenerator.generateId());
}
/**
* Creates a fixed OpenWire Connection Id instance.
*
* @param connectionId
* the set ConnectionId value that this class will use to seed new Session IDs.
*/
public OpenWireConnection(String connectionId) {
this.connectionId = new ConnectionId(connectionId);
}
/**
* Creates a fixed OpenWire Connection Id instance.
*
* @param connectionId
* the set ConnectionId value that this class will use to seed new Session IDs.
*/
public OpenWireConnection(ConnectionId connectionId) {
this.connectionId = connectionId;
}
@Override
public ConnectionId getConnectionId() {
return connectionId;
}
/**
* @return the SessionId used for the internal Connection Session instance.
*/
public SessionId getConnectionSessionId() {
if (this.connectionSessionId == null) {
synchronized (this) {
if (this.connectionSessionId == null) {
this.connectionSessionId = new SessionId(connectionId, -1);
}
}
}
return this.connectionSessionId;
}
/**
* Creates a new SessionId for a Session instance that is rooted by this Connection
*
* @return the next logical SessionId for this ConnectionId instance.
*/
public SessionId getNextSessionId() {
return new SessionId(connectionId, sessionIdGenerator.getAndIncrement());
}
/**
* Creates a new Transaction ID used for local transactions created from this Connection.
*
* @return a new TransactionId instance.
*/
public TransactionId getNextLocalTransactionId() {
return new LocalTransactionId(connectionId, localTransactionIdGenerator.getAndIncrement());
}
/**
* Create a new Consumer Id for ConnectionConsumer instances.
*
* @returns a new ConsumerId valid for use in ConnectionConsumer instances.
*/
public ConsumerId getNextConnectionConsumerId() {
return new ConsumerId(getConnectionSessionId(), consumerIdGenerator.getAndIncrement());
}
/**
* Creates a new Temporary Destination name based on the Connection ID.
*
* @returns a new String destination name used to create temporary destinations.
*/
public String getNextTemporaryDestinationName() {
return connectionId.getValue() + ":" + tempDestinationIdGenerator.getAndIncrement();
}
/**
* Factory method for creating a ConnectionInfo command that contains the connection
* ID from this OpenWireConnection instance.
*
* @return a new ConnectionInfo that contains the proper connection Id.
*/
public ConnectionInfo createConnectionInfo() {
return this.copy();
}
/**
* Factory method for creating a suitable RemoveInfo command that can be used to remove
* this connection from a Broker.
*
* @return a new RemoveInfo that properly references this connection's Id.
*/
public RemoveInfo createRemoveInfo() {
return new RemoveInfo(getConnectionId());
}
/**
* Factory method for OpenWireSession instances
*
* @return a new OpenWireSession with the next logical session ID for this connection.
*/
public OpenWireSession createOpenWireSession() {
return new OpenWireSession(connectionId, sessionIdGenerator.getAndIncrement());
}
}
| 1,470 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/utils/HexSupport.java
|
/*
* 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.utils;
import org.apache.activemq.openwire.buffer.Buffer;
/**
* Used to convert to hex from byte arrays and back.
*/
public final class HexSupport {
private static final String[] HEX_TABLE = new String[]{
"00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c", "0d", "0e", "0f",
"10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f",
"20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2a", "2b", "2c", "2d", "2e", "2f",
"30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3a", "3b", "3c", "3d", "3e", "3f",
"40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4a", "4b", "4c", "4d", "4e", "4f",
"50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "5a", "5b", "5c", "5d", "5e", "5f",
"60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6a", "6b", "6c", "6d", "6e", "6f",
"70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7a", "7b", "7c", "7d", "7e", "7f",
"80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8a", "8b", "8c", "8d", "8e", "8f",
"90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "9a", "9b", "9c", "9d", "9e", "9f",
"a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "aa", "ab", "ac", "ad", "ae", "af",
"b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "ba", "bb", "bc", "bd", "be", "bf",
"c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "ca", "cb", "cc", "cd", "ce", "cf",
"d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8", "d9", "da", "db", "dc", "dd", "de", "df",
"e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9", "ea", "eb", "ec", "ed", "ee", "ef",
"f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "fa", "fb", "fc", "fd", "fe", "ff",
};
private static final int[] INT_OFFSETS = new int[]{
24,16,8,0
};
private HexSupport() {
}
/**
* Create a buffer from a previously encoded HEX String.
*
* @param hex
* the encoded string value of a buffer.
*
* @return a new Buffer instance with the decoded value.
*/
public static Buffer toBufferFromHex(String hex) {
byte rc[] = new byte[hex.length() / 2];
for (int i = 0; i < rc.length; i++) {
String h = hex.substring(i * 2, i * 2 + 2);
int x = Integer.parseInt(h, 16);
rc[i] = (byte) x;
}
return new Buffer(rc);
}
/**
* Return a new String instance that represents the input buffer
* encoded in Hexadecimal form.
*
* @param buffer
* The Buffer to encode.
*
* @return the contents of the Buffer encoded as Hexadecimal String.
*/
public static String toHexFromBuffer(Buffer buffer) {
byte[] data = buffer.data;
StringBuffer rc = new StringBuffer(buffer.length * 2);
int end = buffer.offset + buffer.length;
for (int i = buffer.offset; i < end; i++) {
rc.append(HEX_TABLE[0xFF & data[i]]);
}
return rc.toString();
}
/**
* Convert an Integer value into a string in Hexadecimal form.
*
* @param value
* The integer value to convert.
* @param trim
* True if the leading 0's should be trimmed off.
*
* @return a new String with the input value encoded as Hexadecimal.
*/
public static String toHexFromInt(int value, boolean trim) {
StringBuffer rc = new StringBuffer(INT_OFFSETS.length*2);
for (int i = 0; i < INT_OFFSETS.length; i++) {
int b = 0xFF & (value>>INT_OFFSETS[i]);
if( !(trim && b == 0) ) {
rc.append(HEX_TABLE[b]);
trim=false;
}
}
return rc.toString();
}
}
| 1,471 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/utils/OpenWireIdGenerator.java
|
/**
* 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.utils;
import java.io.IOException;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.UnknownHostException;
import java.util.concurrent.atomic.AtomicLong;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Generator for Globally unique Strings.
*/
public class OpenWireIdGenerator {
private static final Logger LOG = LoggerFactory.getLogger(OpenWireIdGenerator.class);
private static final String UNIQUE_STUB;
private static int instanceCount;
private static String hostName;
private String seed;
private final AtomicLong sequence = new AtomicLong(1);
private int length;
public static final String PROPERTY_IDGENERATOR_PORT = "activemq.idgenerator.port";
static {
String stub = "";
boolean canAccessSystemProps = true;
try {
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPropertiesAccess();
}
} catch (SecurityException se) {
canAccessSystemProps = false;
}
if (canAccessSystemProps) {
int idGeneratorPort = 0;
ServerSocket ss = null;
try {
idGeneratorPort = Integer.parseInt(System.getProperty(PROPERTY_IDGENERATOR_PORT, "0"));
LOG.trace("Using port {}", idGeneratorPort);
hostName = getLocalHostName();
ss = new ServerSocket(idGeneratorPort);
stub = "-" + ss.getLocalPort() + "-" + System.currentTimeMillis() + "-";
Thread.sleep(100);
} catch (Exception e) {
if (LOG.isTraceEnabled()) {
LOG.trace("could not generate unique stub by using DNS and binding to local port", e);
} else {
LOG.warn("could not generate unique stub by using DNS and binding to local port: {} {}", e.getClass().getCanonicalName(), e.getMessage());
}
// Restore interrupted state so higher level code can deal with
// it.
if (e instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
} finally {
if (ss != null) {
try {
ss.close();
} catch (IOException ioe) {
if (LOG.isTraceEnabled()) {
LOG.trace("Closing the server socket failed", ioe);
} else {
LOG.warn("Closing the server socket failed" + " due " + ioe.getMessage());
}
}
}
}
}
if (hostName == null) {
hostName = "localhost";
}
hostName = sanitizeHostName(hostName);
if (stub.length() == 0) {
stub = "-1-" + System.currentTimeMillis() + "-";
}
UNIQUE_STUB = stub;
}
/**
* Construct an IdGenerator
*/
public OpenWireIdGenerator(String prefix) {
synchronized (UNIQUE_STUB) {
this.seed = prefix + UNIQUE_STUB + (instanceCount++) + ":";
this.length = this.seed.length() + ("" + Long.MAX_VALUE).length();
}
}
public OpenWireIdGenerator() {
this("ID:" + hostName);
}
/**
* As we have to find the hostname as a side-affect of generating a unique
* stub, we allow it's easy retrieval here
*
* @return the local host name
*/
public static String getHostName() {
return hostName;
}
/**
* Generate a unique id
*
* @return a unique id
*/
public synchronized String generateId() {
StringBuilder sb = new StringBuilder(length);
sb.append(seed);
sb.append(sequence.getAndIncrement());
return sb.toString();
}
public static String sanitizeHostName(String hostName) {
boolean changed = false;
StringBuilder sb = new StringBuilder();
for (char ch : hostName.toCharArray()) {
// only include ASCII chars
if (ch < 127) {
sb.append(ch);
} else {
changed = true;
}
}
if (changed) {
String newHost = sb.toString();
LOG.info("Sanitized hostname from: {} to: {}", hostName, newHost);
return newHost;
} else {
return hostName;
}
}
/**
* Generate a unique ID - that is friendly for a URL or file system
*
* @return a unique id
*/
public String generateSanitizedId() {
String result = generateId();
result = result.replace(':', '-');
result = result.replace('_', '-');
result = result.replace('.', '-');
return result;
}
/**
* From a generated id - return the seed (i.e. minus the count)
*
* @param id
* the generated identifier
* @return the seed
*/
public static String getSeedFromId(String id) {
String result = id;
if (id != null) {
int index = id.lastIndexOf(':');
if (index > 0 && (index + 1) < id.length()) {
result = id.substring(0, index);
}
}
return result;
}
/**
* From a generated id - return the generator count
*
* @param id
* @return the count
*/
public static long getSequenceFromId(String id) {
long result = -1;
if (id != null) {
int index = id.lastIndexOf(':');
if (index > 0 && (index + 1) < id.length()) {
String numStr = id.substring(index + 1, id.length());
result = Long.parseLong(numStr);
}
}
return result;
}
/**
* Does a proper compare on the IDs
*
* @param id1
* @param id2
*
* @return 0 if equal else a positive if id1 is > id2 ...
*/
public static int compare(String id1, String id2) {
int result = -1;
String seed1 = OpenWireIdGenerator.getSeedFromId(id1);
String seed2 = OpenWireIdGenerator.getSeedFromId(id2);
if (seed1 != null && seed2 != null) {
result = seed1.compareTo(seed2);
if (result == 0) {
long count1 = OpenWireIdGenerator.getSequenceFromId(id1);
long count2 = OpenWireIdGenerator.getSequenceFromId(id2);
result = (int) (count1 - count2);
}
}
return result;
}
private static String getLocalHostName() throws UnknownHostException {
try {
return (InetAddress.getLocalHost()).getHostName();
} catch (UnknownHostException uhe) {
String host = uhe.getMessage(); // host = "hostname: hostname"
if (host != null) {
int colon = host.indexOf(':');
if (colon > 0) {
return host.substring(0, colon);
}
}
throw uhe;
}
}
}
| 1,472 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/utils/OpenWireMarshallingSupport.java
|
/**
* 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.utils;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.io.UTFDataFormatException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import org.apache.activemq.openwire.buffer.DataByteArrayInputStream;
import org.apache.activemq.openwire.buffer.DataByteArrayOutputStream;
import org.apache.activemq.openwire.buffer.UTF8Buffer;
/**
* The fixed version of the UTF8 encoding function. Some older JVM's UTF8
* encoding function breaks when handling large strings.
*/
public final class OpenWireMarshallingSupport {
public static final byte NULL = 0;
public static final byte BOOLEAN_TYPE = 1;
public static final byte BYTE_TYPE = 2;
public static final byte CHAR_TYPE = 3;
public static final byte SHORT_TYPE = 4;
public static final byte INTEGER_TYPE = 5;
public static final byte LONG_TYPE = 6;
public static final byte DOUBLE_TYPE = 7;
public static final byte FLOAT_TYPE = 8;
public static final byte STRING_TYPE = 9;
public static final byte BYTE_ARRAY_TYPE = 10;
public static final byte MAP_TYPE = 11;
public static final byte LIST_TYPE = 12;
public static final byte BIG_STRING_TYPE = 13;
private OpenWireMarshallingSupport() {
}
public static void marshalPrimitiveMap(Map<String, Object> map, DataOutput out) throws IOException {
if (map == null) {
out.writeInt(-1);
} else {
out.writeInt(map.size());
for (String name : map.keySet()) {
out.writeUTF(name);
Object value = map.get(name);
marshalPrimitive(out, value);
}
}
}
public static Map<String, Object> unmarshalPrimitiveMap(DataInput in) throws IOException {
return unmarshalPrimitiveMap(in, Integer.MAX_VALUE);
}
public static Map<String, Object> unmarshalPrimitiveMap(DataInput in, boolean force) throws IOException {
return unmarshalPrimitiveMap(in, Integer.MAX_VALUE, force);
}
public static Map<String, Object> unmarshalPrimitiveMap(DataInput in, int maxPropertySize) throws IOException {
return unmarshalPrimitiveMap(in, maxPropertySize, false);
}
/**
* @param in
* @return
* @throws IOException
* @throws IOException
*/
public static Map<String, Object> unmarshalPrimitiveMap(DataInput in, int maxPropertySize, boolean force) throws IOException {
int size = in.readInt();
if (size > maxPropertySize) {
throw new IOException("Primitive map is larger than the allowed size: " + size);
}
if (size < 0) {
return null;
} else {
Map<String, Object> rc = new HashMap<String, Object>(size);
for (int i = 0; i < size; i++) {
String name = in.readUTF();
rc.put(name, unmarshalPrimitive(in, force));
}
return rc;
}
}
public static void marshalPrimitiveList(List<Object> list, DataOutput out) throws IOException {
out.writeInt(list.size());
for (Object element : list) {
marshalPrimitive(out, element);
}
}
public static List<Object> unmarshalPrimitiveList(DataInput in) throws IOException {
return unmarshalPrimitiveList(in, false);
}
public static List<Object> unmarshalPrimitiveList(DataInput in, boolean force) throws IOException {
int size = in.readInt();
List<Object> answer = new ArrayList<Object>(size);
while (size-- > 0) {
answer.add(unmarshalPrimitive(in, force));
}
return answer;
}
@SuppressWarnings("unchecked")
public static void marshalPrimitive(DataOutput out, Object value) throws IOException {
if (value == null) {
marshalNull(out);
} else if (value.getClass() == Boolean.class) {
marshalBoolean(out, ((Boolean) value).booleanValue());
} else if (value.getClass() == Byte.class) {
marshalByte(out, ((Byte) value).byteValue());
} else if (value.getClass() == Character.class) {
marshalChar(out, ((Character) value).charValue());
} else if (value.getClass() == Short.class) {
marshalShort(out, ((Short) value).shortValue());
} else if (value.getClass() == Integer.class) {
marshalInt(out, ((Integer) value).intValue());
} else if (value.getClass() == Long.class) {
marshalLong(out, ((Long) value).longValue());
} else if (value.getClass() == Float.class) {
marshalFloat(out, ((Float) value).floatValue());
} else if (value.getClass() == Double.class) {
marshalDouble(out, ((Double) value).doubleValue());
} else if (value.getClass() == byte[].class) {
marshalByteArray(out, (byte[]) value);
} else if (value.getClass() == String.class) {
marshalString(out, (String) value);
} else if (value.getClass() == UTF8Buffer.class) {
marshalString(out, value.toString());
} else if (value instanceof Map) {
out.writeByte(MAP_TYPE);
marshalPrimitiveMap((Map<String, Object>) value, out);
} else if (value instanceof List) {
out.writeByte(LIST_TYPE);
marshalPrimitiveList((List<Object>) value, out);
} else {
throw new IOException("Object is not a primitive: " + value);
}
}
public static Object unmarshalPrimitive(DataInput in) throws IOException {
return unmarshalPrimitive(in, false);
}
public static Object unmarshalPrimitive(DataInput in, boolean force) throws IOException {
Object value = null;
byte type = in.readByte();
switch (type) {
case BYTE_TYPE:
value = Byte.valueOf(in.readByte());
break;
case BOOLEAN_TYPE:
value = in.readBoolean() ? Boolean.TRUE : Boolean.FALSE;
break;
case CHAR_TYPE:
value = Character.valueOf(in.readChar());
break;
case SHORT_TYPE:
value = Short.valueOf(in.readShort());
break;
case INTEGER_TYPE:
value = Integer.valueOf(in.readInt());
break;
case LONG_TYPE:
value = Long.valueOf(in.readLong());
break;
case FLOAT_TYPE:
value = new Float(in.readFloat());
break;
case DOUBLE_TYPE:
value = new Double(in.readDouble());
break;
case BYTE_ARRAY_TYPE:
value = new byte[in.readInt()];
in.readFully((byte[]) value);
break;
case STRING_TYPE:
if (force) {
value = in.readUTF();
} else {
value = readUTF(in, in.readUnsignedShort());
}
break;
case BIG_STRING_TYPE: {
if (force) {
value = readUTF8(in);
} else {
value = readUTF(in, in.readInt());
}
break;
}
case MAP_TYPE:
value = unmarshalPrimitiveMap(in, true);
break;
case LIST_TYPE:
value = unmarshalPrimitiveList(in, true);
break;
case NULL:
value = null;
break;
default:
throw new IOException("Unknown primitive type: " + type);
}
return value;
}
public static UTF8Buffer readUTF(DataInput in, int length) throws IOException {
byte data[] = new byte[length];
in.readFully(data);
return new UTF8Buffer(data);
}
public static void marshalNull(DataOutput out) throws IOException {
out.writeByte(NULL);
}
public static void marshalBoolean(DataOutput out, boolean value) throws IOException {
out.writeByte(BOOLEAN_TYPE);
out.writeBoolean(value);
}
public static void marshalByte(DataOutput out, byte value) throws IOException {
out.writeByte(BYTE_TYPE);
out.writeByte(value);
}
public static void marshalChar(DataOutput out, char value) throws IOException {
out.writeByte(CHAR_TYPE);
out.writeChar(value);
}
public static void marshalShort(DataOutput out, short value) throws IOException {
out.writeByte(SHORT_TYPE);
out.writeShort(value);
}
public static void marshalInt(DataOutput out, int value) throws IOException {
out.writeByte(INTEGER_TYPE);
out.writeInt(value);
}
public static void marshalLong(DataOutput out, long value) throws IOException {
out.writeByte(LONG_TYPE);
out.writeLong(value);
}
public static void marshalFloat(DataOutput out, float value) throws IOException {
out.writeByte(FLOAT_TYPE);
out.writeFloat(value);
}
public static void marshalDouble(DataOutput out, double value) throws IOException {
out.writeByte(DOUBLE_TYPE);
out.writeDouble(value);
}
public static void marshalByteArray(DataOutput out, byte[] value) throws IOException {
marshalByteArray(out, value, 0, value.length);
}
public static void marshalByteArray(DataOutput out, byte[] value, int offset, int length) throws IOException {
out.writeByte(BYTE_ARRAY_TYPE);
out.writeInt(length);
out.write(value, offset, length);
}
public static void marshalString(DataOutput out, String s) throws IOException {
// If it's too big, out.writeUTF may not able able to write it out.
if (s.length() < Short.MAX_VALUE / 4) {
out.writeByte(STRING_TYPE);
out.writeUTF(s);
} else {
out.writeByte(BIG_STRING_TYPE);
writeUTF8(out, s);
}
}
public static void writeUTF8(DataOutput dataOut, String text) throws IOException {
if (text != null) {
int strlen = text.length();
int utflen = 0;
char[] charr = new char[strlen];
int c = 0;
int count = 0;
text.getChars(0, strlen, charr, 0);
for (int i = 0; i < strlen; i++) {
c = charr[i];
if ((c >= 0x0001) && (c <= 0x007F)) {
utflen++;
} else if (c > 0x07FF) {
utflen += 3;
} else {
utflen += 2;
}
}
// TODO diff: Sun code - removed
byte[] bytearr = new byte[utflen + 4]; // TODO diff: Sun code
bytearr[count++] = (byte) ((utflen >>> 24) & 0xFF); // TODO diff:
// Sun code
bytearr[count++] = (byte) ((utflen >>> 16) & 0xFF); // TODO diff:
// Sun code
bytearr[count++] = (byte) ((utflen >>> 8) & 0xFF);
bytearr[count++] = (byte) ((utflen >>> 0) & 0xFF);
for (int i = 0; i < strlen; i++) {
c = charr[i];
if ((c >= 0x0001) && (c <= 0x007F)) {
bytearr[count++] = (byte) c;
} else if (c > 0x07FF) {
bytearr[count++] = (byte) (0xE0 | ((c >> 12) & 0x0F));
bytearr[count++] = (byte) (0x80 | ((c >> 6) & 0x3F));
bytearr[count++] = (byte) (0x80 | ((c >> 0) & 0x3F));
} else {
bytearr[count++] = (byte) (0xC0 | ((c >> 6) & 0x1F));
bytearr[count++] = (byte) (0x80 | ((c >> 0) & 0x3F));
}
}
dataOut.write(bytearr);
} else {
dataOut.writeInt(-1);
}
}
public static String readUTF8(DataInput dataIn) throws IOException {
int utflen = dataIn.readInt(); // TODO diff: Sun code
if (utflen > -1) {
StringBuffer str = new StringBuffer(utflen);
byte bytearr[] = new byte[utflen];
int c;
int char2;
int char3;
int count = 0;
dataIn.readFully(bytearr, 0, utflen);
while (count < utflen) {
c = bytearr[count] & 0xff;
switch (c >> 4) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
/* 0xxxxxxx */
count++;
str.append((char) c);
break;
case 12:
case 13:
/* 110x xxxx 10xx xxxx */
count += 2;
if (count > utflen) {
throw new UTFDataFormatException();
}
char2 = bytearr[count - 1];
if ((char2 & 0xC0) != 0x80) {
throw new UTFDataFormatException();
}
str.append((char) (((c & 0x1F) << 6) | (char2 & 0x3F)));
break;
case 14:
/* 1110 xxxx 10xx xxxx 10xx xxxx */
count += 3;
if (count > utflen) {
throw new UTFDataFormatException();
}
char2 = bytearr[count - 2]; // TODO diff: Sun code
char3 = bytearr[count - 1]; // TODO diff: Sun code
if (((char2 & 0xC0) != 0x80) || ((char3 & 0xC0) != 0x80)) {
throw new UTFDataFormatException();
}
str.append((char) (((c & 0x0F) << 12) | ((char2 & 0x3F) << 6) | ((char3 & 0x3F) << 0)));
break;
default:
/* 10xx xxxx, 1111 xxxx */
throw new UTFDataFormatException();
}
}
// The number of chars produced may be less than utflen
return new String(str);
} else {
return null;
}
}
public static String propertiesToString(Properties props) throws IOException {
String result = "";
if (props != null) {
DataByteArrayOutputStream dataOut = new DataByteArrayOutputStream();
props.store(dataOut, "");
result = new String(dataOut.getData(), 0, dataOut.size());
dataOut.close();
}
return result;
}
public static Properties stringToProperties(String str) throws IOException {
Properties result = new Properties();
if (str != null && str.length() > 0) {
DataByteArrayInputStream dataIn = new DataByteArrayInputStream(str.getBytes());
result.load(dataIn);
dataIn.close();
}
return result;
}
public static String truncate64(String text) {
if (text.length() > 63) {
text = text.substring(0, 45) + "..." + text.substring(text.length() - 12);
}
return text;
}
}
| 1,473 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/utils/IOExceptionSupport.java
|
/**
* 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.utils;
import java.io.IOException;
/**
* Exception support class.
*
* Factory class for creating IOException instances based on String messages or by
* wrapping other causal exceptions.
*
* @since 1.0
*/
public final class IOExceptionSupport {
private IOExceptionSupport() {}
public static IOException create(String msg, Throwable cause) {
IOException exception = new IOException(msg);
exception.initCause(cause);
return exception;
}
public static IOException create(Throwable cause) {
if (cause instanceof IOException) {
return (IOException) cause;
}
if (cause.getCause() instanceof IOException) {
return (IOException) cause.getCause();
}
String msg = cause.getMessage();
if (msg == null || msg.length() == 0) {
msg = cause.toString();
}
IOException exception = new IOException(msg);
exception.initCause(cause);
return exception;
}
}
| 1,474 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/commands/ConnectionId.java
|
/**
* 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.commands;
import org.apache.activemq.openwire.annotations.OpenWireType;
import org.apache.activemq.openwire.annotations.OpenWireProperty;
/**
* @openwire:marshaller code="120"
*/
@OpenWireType(typeCode = 120)
public class ConnectionId implements DataStructure, Comparable<ConnectionId> {
public static final byte DATA_STRUCTURE_TYPE = CommandTypes.CONNECTION_ID;
@OpenWireProperty(version = 1, sequence = 1)
protected String value;
public ConnectionId() {
}
public ConnectionId(String connectionId) {
this.value = connectionId;
}
public ConnectionId(ConnectionId id) {
this.value = id.getValue();
}
public ConnectionId(SessionId id) {
this.value = id.getConnectionId();
}
public ConnectionId(ProducerId id) {
this.value = id.getConnectionId();
}
public ConnectionId(ConsumerId id) {
this.value = id.getConnectionId();
}
@Override
public int hashCode() {
return value.hashCode();
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || o.getClass() != ConnectionId.class) {
return false;
}
ConnectionId id = (ConnectionId)o;
return value.equals(id.value);
}
@Override
public byte getDataStructureType() {
return DATA_STRUCTURE_TYPE;
}
@Override
public String toString() {
return value;
}
/**
* @openwire:property version=1
*/
public String getValue() {
return value;
}
public void setValue(String connectionId) {
this.value = connectionId;
}
@Override
public boolean isMarshallAware() {
return false;
}
@Override
public int compareTo(ConnectionId o) {
return value.compareTo(o.value);
}
}
| 1,475 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/commands/MessageDispatch.java
|
/**
* 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.commands;
import org.apache.activemq.openwire.annotations.OpenWireType;
import org.apache.activemq.openwire.annotations.OpenWireProperty;
/**
* @openwire:marshaller code="21"
*/
@OpenWireType(typeCode = 21)
public class MessageDispatch extends BaseCommand {
public static final byte DATA_STRUCTURE_TYPE = CommandTypes.MESSAGE_DISPATCH;
@OpenWireProperty(version = 1, sequence = 1, cached = true)
protected ConsumerId consumerId;
@OpenWireProperty(version = 1, sequence = 2, cached = true)
protected OpenWireDestination destination;
@OpenWireProperty(version = 1, sequence = 3)
protected Message message;
@OpenWireProperty(version = 1, sequence = 4)
protected int redeliveryCounter;
@Override
public byte getDataStructureType() {
return DATA_STRUCTURE_TYPE;
}
@Override
public boolean isMessageDispatch() {
return true;
}
/**
* @openwire:property version=1 cache=true
*/
public ConsumerId getConsumerId() {
return consumerId;
}
public void setConsumerId(ConsumerId consumerId) {
this.consumerId = consumerId;
}
/**
* @openwire:property version=1 cache=true
*/
public OpenWireDestination getDestination() {
return destination;
}
public void setDestination(OpenWireDestination destination) {
this.destination = destination;
}
/**
* @openwire:property version=1
*/
public Message getMessage() {
return message;
}
public void setMessage(Message message) {
this.message = message;
}
/**
* @openwire:property version=1
*/
public int getRedeliveryCounter() {
return redeliveryCounter;
}
public void setRedeliveryCounter(int deliveryCounter) {
this.redeliveryCounter = deliveryCounter;
}
@Override
public Response visit(CommandVisitor visitor) throws Exception {
return visitor.processMessageDispatch(this);
}
}
| 1,476 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/commands/FlushCommand.java
|
/**
* 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.commands;
import org.apache.activemq.openwire.annotations.OpenWireType;
/**
* An indication to the transport layer that a flush is required.
*
* @openwire:marshaller code="15"
*/
@OpenWireType(typeCode = 15)
public class FlushCommand extends BaseCommand {
public static final byte DATA_STRUCTURE_TYPE = CommandTypes.FLUSH_COMMAND;
public static final Command COMMAND = new FlushCommand();
@Override
public byte getDataStructureType() {
return DATA_STRUCTURE_TYPE;
}
@Override
public Response visit(CommandVisitor visitor) throws Exception {
return visitor.processFlush(this);
}
}
| 1,477 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/commands/Message.java
|
/**
* 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.commands;
import static org.apache.activemq.openwire.codec.OpenWireConstants.ADIVSORY_MESSAGE_TYPE;
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.zip.DeflaterOutputStream;
import java.util.zip.InflaterInputStream;
import org.apache.activemq.openwire.annotations.OpenWireExtension;
import org.apache.activemq.openwire.annotations.OpenWireProperty;
import org.apache.activemq.openwire.annotations.OpenWireType;
import org.apache.activemq.openwire.buffer.Buffer;
import org.apache.activemq.openwire.buffer.DataByteArrayInputStream;
import org.apache.activemq.openwire.buffer.DataByteArrayOutputStream;
import org.apache.activemq.openwire.buffer.UTF8Buffer;
import org.apache.activemq.openwire.codec.OpenWireFormat;
import org.apache.activemq.openwire.utils.IOExceptionSupport;
import org.apache.activemq.openwire.utils.OpenWireMarshallingSupport;
/**
* Represents an ActiveMQ message
*/
@OpenWireType(typeCode = 0, marshalAware = true)
public abstract class Message extends BaseCommand implements MarshallAware {
public static final String ORIGINAL_EXPIRATION = "originalExpiration";
/**
* The default minimum amount of memory a message is assumed to use
*/
public static final int DEFAULT_MINIMUM_MESSAGE_SIZE = 1024;
@OpenWireProperty(version = 1, sequence = 1, cached = true)
protected ProducerId producerId;
@OpenWireProperty(version = 1, sequence = 2, cached = true)
protected OpenWireDestination destination;
@OpenWireProperty(version = 1, sequence = 3, cached = true)
protected TransactionId transactionId;
@OpenWireProperty(version = 1, sequence = 4, cached = true)
protected OpenWireDestination originalDestination;
@OpenWireProperty(version = 1, sequence = 5)
protected MessageId messageId;
@OpenWireProperty(version = 1, sequence = 6, cached = true)
protected TransactionId originalTransactionId;
@OpenWireProperty(version = 1, sequence = 7)
protected String groupId;
@OpenWireProperty(version = 1, sequence = 8)
protected int groupSequence;
@OpenWireProperty(version = 1, sequence = 9)
protected String correlationId;
@OpenWireProperty(version = 1, sequence = 10)
protected boolean persistent;
@OpenWireProperty(version = 1, sequence = 11)
protected long expiration;
@OpenWireProperty(version = 1, sequence = 12)
protected byte priority;
@OpenWireProperty(version = 1, sequence = 13)
protected OpenWireDestination replyTo;
@OpenWireProperty(version = 1, sequence = 14)
protected long timestamp;
@OpenWireProperty(version = 1, sequence = 15)
protected String type;
@OpenWireProperty(version = 1, sequence = 16)
protected Buffer content;
@OpenWireProperty(version = 1, sequence = 17)
protected Buffer marshalledProperties;
@OpenWireProperty(version = 1, sequence = 18)
protected DataStructure dataStructure;
@OpenWireProperty(version = 1, sequence = 19, cached = true)
protected ConsumerId targetConsumerId;
@OpenWireProperty(version = 1, sequence = 20)
protected boolean compressed;
@OpenWireProperty(version = 1, sequence = 21)
protected int redeliveryCounter;
@OpenWireProperty(version = 1, sequence = 22, cached = true)
private BrokerId[] brokerPath;
@OpenWireProperty(version = 1, sequence = 23)
protected long arrival;
@OpenWireProperty(version = 1, sequence = 24)
protected String userId;
@OpenWireProperty(version = 1, sequence = 25, serialized = false)
protected transient boolean recievedByDFBridge;
@OpenWireProperty(version = 2, sequence = 26, cached = true)
protected boolean droppable;
@OpenWireProperty(version = 3, sequence = 27, cached = true)
private BrokerId[] cluster;
@OpenWireProperty(version = 3, sequence = 28)
protected long brokerInTime;
@OpenWireProperty(version = 3, sequence = 29)
protected long brokerOutTime;
@OpenWireProperty(version = 10, sequence = 30)
protected boolean jmsXGroupFirstForConsumer;
@OpenWireExtension(serialized = true)
protected int size;
@OpenWireExtension(serialized = true)
protected Map<String, Object> properties;
public abstract Message copy();
public abstract void clearBody() throws IOException;
public abstract void storeContent();
public abstract void storeContentAndClear();
// useful to reduce the memory footprint of a persisted message
public void clearMarshalledState() throws IOException {
properties = null;
}
protected void copy(Message copy) {
super.copy(copy);
copy.producerId = producerId;
copy.transactionId = transactionId;
copy.destination = destination;
copy.messageId = messageId != null ? messageId.copy() : null;
copy.originalDestination = originalDestination;
copy.originalTransactionId = originalTransactionId;
copy.expiration = expiration;
copy.timestamp = timestamp;
copy.correlationId = correlationId;
copy.replyTo = replyTo;
copy.persistent = persistent;
copy.redeliveryCounter = redeliveryCounter;
copy.type = type;
copy.priority = priority;
copy.size = size;
copy.groupId = groupId;
copy.userId = userId;
copy.groupSequence = groupSequence;
if (properties != null) {
copy.properties = new HashMap<String, Object>(properties);
// The new message hasn't expired, so remove this feild.
copy.properties.remove(ORIGINAL_EXPIRATION);
} else {
copy.properties = properties;
}
copy.content = content;
copy.marshalledProperties = marshalledProperties;
copy.dataStructure = dataStructure;
copy.compressed = compressed;
copy.recievedByDFBridge = recievedByDFBridge;
copy.arrival = arrival;
copy.brokerInTime = brokerInTime;
copy.brokerOutTime = brokerOutTime;
copy.brokerPath = brokerPath;
copy.jmsXGroupFirstForConsumer = jmsXGroupFirstForConsumer;
}
@SuppressWarnings("unchecked")
public Map<String, Object> getProperties() throws IOException {
if (properties == null) {
if (marshalledProperties == null) {
return Collections.EMPTY_MAP;
}
properties = unmarsallProperties(marshalledProperties);
}
return Collections.unmodifiableMap(properties);
}
public void clearProperties() throws IOException {
marshalledProperties = null;
properties = null;
}
public Object getProperty(String name) throws IOException {
if (properties == null) {
if (marshalledProperties == null) {
return null;
}
try {
properties = unmarsallProperties(marshalledProperties);
} catch (Exception e) {
throw IOExceptionSupport.create("Error during properties unmarshal, reason: " + e.getMessage(), e);
}
}
Object result = properties.get(name);
if (result instanceof UTF8Buffer) {
result = result.toString();
}
return result;
}
public void setProperty(String name, Object value) throws IOException {
lazyCreateProperties();
properties.put(name, value);
}
public void removeProperty(String name) throws IOException {
lazyCreateProperties();
properties.remove(name);
}
protected void lazyCreateProperties() throws IOException {
if (properties == null) {
if (marshalledProperties == null) {
properties = new HashMap<String, Object>();
} else {
try {
properties = unmarsallProperties(marshalledProperties);
} catch (Exception e) {
throw IOExceptionSupport.create(
"Error during properties unmarshal, reason: " + e.getMessage(), e);
}
marshalledProperties = null;
}
} else {
marshalledProperties = null;
}
}
private Map<String, Object> unmarsallProperties(Buffer marshalledProperties) throws IOException {
return OpenWireMarshallingSupport.unmarshalPrimitiveMap(new DataInputStream(new DataByteArrayInputStream(marshalledProperties)));
}
@Override
public void beforeMarshall(OpenWireFormat wireFormat) throws IOException {
// Need to marshal the properties.
if (marshalledProperties == null && properties != null) {
DataByteArrayOutputStream baos = new DataByteArrayOutputStream();
DataOutputStream os = new DataOutputStream(baos);
OpenWireMarshallingSupport.marshalPrimitiveMap(properties, os);
os.close();
marshalledProperties = baos.toBuffer();
}
}
@Override
public void afterMarshall(OpenWireFormat wireFormat) throws IOException {
}
@Override
public void beforeUnmarshall(OpenWireFormat wireFormat) throws IOException {
}
@Override
public void afterUnmarshall(OpenWireFormat wireFormat) throws IOException {
}
/**
* @openwire:property version=1 cache=true
*/
public ProducerId getProducerId() {
return producerId;
}
public void setProducerId(ProducerId producerId) {
this.producerId = producerId;
}
/**
* @openwire:property version=1 cache=true
*/
public OpenWireDestination getDestination() {
return destination;
}
public void setDestination(OpenWireDestination destination) {
this.destination = destination;
}
/**
* @openwire:property version=1 cache=true
*/
public TransactionId getTransactionId() {
return transactionId;
}
public void setTransactionId(TransactionId transactionId) {
this.transactionId = transactionId;
}
public boolean isInTransaction() {
return transactionId != null;
}
/**
* @openwire:property version=1 cache=true
*/
public OpenWireDestination getOriginalDestination() {
return originalDestination;
}
public void setOriginalDestination(OpenWireDestination destination) {
this.originalDestination = destination;
}
/**
* @openwire:property version=1
*/
public MessageId getMessageId() {
return messageId;
}
public void setMessageId(MessageId messageId) {
this.messageId = messageId;
}
/**
* @openwire:property version=1 cache=true
*/
public TransactionId getOriginalTransactionId() {
return originalTransactionId;
}
public void setOriginalTransactionId(TransactionId transactionId) {
this.originalTransactionId = transactionId;
}
/**
* @openwire:property version=1
*/
public String getGroupId() {
return groupId;
}
public void setGroupID(String groupId) {
this.groupId = groupId;
}
/**
* @openwire:property version=1
*/
public int getGroupSequence() {
return groupSequence;
}
public void setGroupSequence(int groupSequence) {
this.groupSequence = groupSequence;
}
/**
* @openwire:property version=1
*/
public String getCorrelationId() {
return correlationId;
}
public void setCorrelationId(String correlationId) {
this.correlationId = correlationId;
}
/**
* @openwire:property version=1
*/
public boolean isPersistent() {
return persistent;
}
public void setPersistent(boolean deliveryMode) {
this.persistent = deliveryMode;
}
/**
* @openwire:property version=1
*/
public long getExpiration() {
return expiration;
}
public void setExpiration(long expiration) {
this.expiration = expiration;
}
/**
* @openwire:property version=1
*/
public byte getPriority() {
return priority;
}
public void setPriority(byte priority) {
if (priority < 0) {
this.priority = 0;
} else if (priority > 9) {
this.priority = 9;
} else {
this.priority = priority;
}
}
/**
* @openwire:property version=1
*/
public OpenWireDestination getReplyTo() {
return replyTo;
}
public void setReplyTo(OpenWireDestination replyTo) {
this.replyTo = replyTo;
}
/**
* @openwire:property version=1
*/
public long getTimestamp() {
return timestamp;
}
public void setTimestamp(long timestamp) {
this.timestamp = timestamp;
}
/**
* @openwire:property version=1
*/
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
/**
* @openwire:property version=1
*/
public Buffer getContent() {
return content;
}
public void setContent(Buffer content) {
this.content = content;
if (content == null) {
compressed = false;
}
}
/**
* @openwire:property version=1
*/
public Buffer getMarshalledProperties() {
return marshalledProperties;
}
public void setMarshalledProperties(Buffer marshalledProperties) {
this.marshalledProperties = marshalledProperties;
}
/**
* @openwire:property version=1
*/
public DataStructure getDataStructure() {
return dataStructure;
}
public void setDataStructure(DataStructure data) {
this.dataStructure = data;
}
/**
* Can be used to route the message to a specific consumer. Should be null
* to allow the broker use normal JMS routing semantics. If the target
* consumer id is an active consumer on the broker, the message is dropped.
* Used by the AdvisoryBroker to replay advisory messages to a specific
* consumer.
*
* @openwire:property version=1 cache=true
*/
public ConsumerId getTargetConsumerId() {
return targetConsumerId;
}
public void setTargetConsumerId(ConsumerId targetConsumerId) {
this.targetConsumerId = targetConsumerId;
}
public boolean isExpired() {
long expireTime = getExpiration();
return expireTime > 0 && System.currentTimeMillis() > expireTime;
}
public boolean isAdvisory() {
return type != null && type.equals(ADIVSORY_MESSAGE_TYPE);
}
/**
* @openwire:property version=1
*/
public boolean isCompressed() {
return compressed;
}
public void setCompressed(boolean compressed) {
this.compressed = compressed;
}
public boolean isRedelivered() {
return redeliveryCounter > 0;
}
public void setRedelivered(boolean redelivered) {
if (redelivered) {
if (!isRedelivered()) {
setRedeliveryCounter(1);
}
} else {
if (isRedelivered()) {
setRedeliveryCounter(0);
}
}
}
/**
* @openwire:property version=1
*/
public int getRedeliveryCounter() {
return redeliveryCounter;
}
public void setRedeliveryCounter(int deliveryCounter) {
this.redeliveryCounter = deliveryCounter;
}
/**
* The route of brokers the command has moved through.
*
* @openwire:property version=1 cache=true
*/
public BrokerId[] getBrokerPath() {
return brokerPath;
}
public void setBrokerPath(BrokerId[] brokerPath) {
this.brokerPath = brokerPath;
}
/**
* Used to schedule the arrival time of a message to a broker. The broker
* will not dispatch a message to a consumer until it's arrival time has
* elapsed.
*
* @openwire:property version=1
*/
public long getArrival() {
return arrival;
}
public void setArrival(long arrival) {
this.arrival = arrival;
}
/**
* Only set by the broker and defines the userID of the producer connection
* who sent this message. This is an optional field, it needs to be enabled
* on the broker to have this field populated.
*
* @openwire:property version=1
*/
public String getUserId() {
return userId;
}
public void setUserId(String jmsxUserId) {
this.userId = jmsxUserId;
}
@Override
public boolean isMarshallAware() {
return true;
}
public int getSize() {
int minimumMessageSize = DEFAULT_MINIMUM_MESSAGE_SIZE;
if (size < minimumMessageSize || size == 0) {
size = minimumMessageSize;
if (marshalledProperties != null) {
size += marshalledProperties.getLength();
}
if (content != null) {
size += content.getLength();
}
}
return size;
}
/**
* @openwire:property version=1
* @return Returns the recievedByDFBridge.
*/
public boolean isRecievedByDFBridge() {
return recievedByDFBridge;
}
/**
* @param recievedByDFBridge The recievedByDFBridge to set.
*/
public void setRecievedByDFBridge(boolean recievedByDFBridge) {
this.recievedByDFBridge = recievedByDFBridge;
}
/**
* @openwire:property version=2 cache=true
*/
public boolean isDroppable() {
return droppable;
}
public void setDroppable(boolean droppable) {
this.droppable = droppable;
}
/**
* If a message is stored in multiple nodes on a cluster, all the cluster
* members will be listed here. Otherwise, it will be null.
*
* @openwire:property version=3 cache=true
*/
public BrokerId[] getCluster() {
return cluster;
}
public void setCluster(BrokerId[] cluster) {
this.cluster = cluster;
}
@Override
public boolean isMessage() {
return true;
}
/**
* @openwire:property version=3
*/
public long getBrokerInTime() {
return this.brokerInTime;
}
public void setBrokerInTime(long brokerInTime) {
this.brokerInTime = brokerInTime;
}
/**
* @openwire:property version=3
*/
public long getBrokerOutTime() {
return this.brokerOutTime;
}
public void setBrokerOutTime(long brokerOutTime) {
this.brokerOutTime = brokerOutTime;
}
/**
* @openwire:property version=10
*/
public boolean isJMSXGroupFirstForConsumer() {
return jmsXGroupFirstForConsumer;
}
public void setJMSXGroupFirstForConsumer(boolean val) {
jmsXGroupFirstForConsumer = val;
}
/**
* For a Message that is not currently using compression in its message body this
* method will initiate a store of current content and then compress the data in
* the message body.
*
* @throws IOException if an error occurs during the compression process.
*/
public void compress() throws IOException {
if (!isCompressed()) {
storeContent();
if (!isCompressed() && getContent() != null) {
doCompress();
}
}
}
/**
* For a message whose body is compressed this method will perform a full decompression
* of the contents and return the resulting uncompressed buffer, if the contents are not
* compressed then they are returned unchanged.
*
* @return a Buffer instance that contains the message contents, uncompressed if needed.
*
* @throws IOException if an error occurs during decompression of the message contents.
*/
public Buffer decompress() throws IOException {
if (isCompressed()) {
return doDecompress();
} else {
return content;
}
}
protected Buffer doDecompress() throws IOException {
// TODO
ByteArrayInputStream input = new ByteArrayInputStream(this.content.getData(), this.content.getOffset(), this.content.getLength());
InflaterInputStream inflater = new InflaterInputStream(input);
DataByteArrayOutputStream output = new DataByteArrayOutputStream();
try {
byte[] buffer = new byte[8*1024];
int read = 0;
while ((read = inflater.read(buffer)) != -1) {
output.write(buffer, 0, read);
}
} finally {
inflater.close();
output.close();
}
return output.toBuffer();
}
protected void doCompress() throws IOException {
compressed = true;
Buffer bytes = getContent();
DataByteArrayOutputStream bytesOut = new DataByteArrayOutputStream();
OutputStream os = new DeflaterOutputStream(bytesOut);
os.write(bytes.data, bytes.offset, bytes.length);
os.close();
setContent(bytesOut.toBuffer());
}
@Override
public String toString() {
return getClass().getSimpleName() + " { " + messageId + " }";
}
}
| 1,478 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/commands/RemoveInfo.java
|
/**
* 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.commands;
import java.io.IOException;
import org.apache.activemq.openwire.annotations.OpenWireType;
import org.apache.activemq.openwire.annotations.OpenWireProperty;
/**
* Removes a consumer, producer, session or connection.
*
* @openwire:marshaller code="12"
*/
@OpenWireType(typeCode = 12)
public class RemoveInfo extends BaseCommand {
public static final byte DATA_STRUCTURE_TYPE = CommandTypes.REMOVE_INFO;
@OpenWireProperty(version = 1, sequence = 1, cached = true)
protected DataStructure objectId;
@OpenWireProperty(version = 5, sequence = 2)
protected long lastDeliveredSequenceId;
public RemoveInfo() {
}
public RemoveInfo(DataStructure objectId) {
this.objectId = objectId;
}
@Override
public byte getDataStructureType() {
return DATA_STRUCTURE_TYPE;
}
/**
* @openwire:property version=1 cache=true
*/
public DataStructure getObjectId() {
return objectId;
}
public void setObjectId(DataStructure objectId) {
this.objectId = objectId;
}
/**
* @openwire:property version=5 cache=false
*/
public long getLastDeliveredSequenceId() {
return lastDeliveredSequenceId;
}
public void setLastDeliveredSequenceId(long lastDeliveredSequenceId) {
this.lastDeliveredSequenceId = lastDeliveredSequenceId;
}
@Override
public Response visit(CommandVisitor visitor) throws Exception {
switch (objectId.getDataStructureType()) {
case ConnectionId.DATA_STRUCTURE_TYPE:
return visitor.processRemoveConnection((ConnectionId)objectId, lastDeliveredSequenceId);
case SessionId.DATA_STRUCTURE_TYPE:
return visitor.processRemoveSession((SessionId)objectId, lastDeliveredSequenceId);
case ConsumerId.DATA_STRUCTURE_TYPE:
return visitor.processRemoveConsumer((ConsumerId)objectId, lastDeliveredSequenceId);
case ProducerId.DATA_STRUCTURE_TYPE:
return visitor.processRemoveProducer((ProducerId)objectId);
default:
throw new IOException("Unknown remove command type: " + objectId.getDataStructureType());
}
}
/**
* Returns true if this event is for a removed connection
*/
public boolean isConnectionRemove() {
return objectId.getDataStructureType() == ConnectionId.DATA_STRUCTURE_TYPE;
}
/**
* Returns true if this event is for a removed session
*/
public boolean isSessionRemove() {
return objectId.getDataStructureType() == SessionId.DATA_STRUCTURE_TYPE;
}
/**
* Returns true if this event is for a removed consumer
*/
public boolean isConsumerRemove() {
return objectId.getDataStructureType() == ConsumerId.DATA_STRUCTURE_TYPE;
}
/**
* Returns true if this event is for a removed producer
*/
public boolean isProducerRemove() {
return objectId.getDataStructureType() == ProducerId.DATA_STRUCTURE_TYPE;
}
}
| 1,479 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/commands/DiscoveryEvent.java
|
/**
* 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.commands;
import org.apache.activemq.openwire.annotations.OpenWireType;
import org.apache.activemq.openwire.annotations.OpenWireProperty;
/**
* Represents a discovery event containing the details of the service
*
* @openwire:marshaller code="40"
*/
@OpenWireType(typeCode = 40)
public class DiscoveryEvent implements DataStructure {
public static final byte DATA_STRUCTURE_TYPE = CommandTypes.DISCOVERY_EVENT;
@OpenWireProperty(version = 1, sequence = 1)
protected String serviceName;
@OpenWireProperty(version = 1, sequence = 2)
protected String brokerName;
public DiscoveryEvent() {
}
public DiscoveryEvent(String serviceName) {
this.serviceName = serviceName;
}
protected DiscoveryEvent(DiscoveryEvent copy) {
serviceName = copy.serviceName;
brokerName = copy.brokerName;
}
@Override
public byte getDataStructureType() {
return DATA_STRUCTURE_TYPE;
}
/**
* @openwire:property version=1
*/
public String getServiceName() {
return serviceName;
}
public void setServiceName(String serviceName) {
this.serviceName = serviceName;
}
/**
* @openwire:property version=1
*/
public String getBrokerName() {
return brokerName;
}
public void setBrokerName(String name) {
this.brokerName = name;
}
@Override
public boolean isMarshallAware() {
return false;
}
}
| 1,480 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/commands/RemoveSubscriptionInfo.java
|
/**
* 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.commands;
import org.apache.activemq.openwire.annotations.OpenWireType;
import org.apache.activemq.openwire.annotations.OpenWireProperty;
/**
* @openwire:marshaller code="9"
*/
@OpenWireType(typeCode = 9)
public class RemoveSubscriptionInfo extends BaseCommand {
public static final byte DATA_STRUCTURE_TYPE = CommandTypes.REMOVE_SUBSCRIPTION_INFO;
@OpenWireProperty(version = 1, sequence = 1, cached = true)
protected ConnectionId connectionId;
@OpenWireProperty(version = 1, sequence = 2)
protected String subscriptionName;
@OpenWireProperty(version = 1, sequence = 3)
protected String clientId;
@Override
public byte getDataStructureType() {
return DATA_STRUCTURE_TYPE;
}
/**
* @openwire:property version=1 cache=true
*/
public ConnectionId getConnectionId() {
return connectionId;
}
public void setConnectionId(ConnectionId connectionId) {
this.connectionId = connectionId;
}
/**
* @openwire:property version=1
*/
public String getSubcriptionName() {
return subscriptionName;
}
/**
*/
public void setSubcriptionName(String subscriptionName) {
this.subscriptionName = subscriptionName;
}
public String getSubscriptionName() {
return subscriptionName;
}
public void setSubscriptionName(String subscriptionName) {
this.subscriptionName = subscriptionName;
}
/**
* @openwire:property version=1
*/
public String getClientId() {
return clientId;
}
public void setClientId(String clientId) {
this.clientId = clientId;
}
@Override
public Response visit(CommandVisitor visitor) throws Exception {
return visitor.processRemoveSubscription(this);
}
}
| 1,481 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/commands/SessionId.java
|
/**
* 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.commands;
import org.apache.activemq.openwire.annotations.OpenWireType;
import org.apache.activemq.openwire.annotations.OpenWireExtension;
import org.apache.activemq.openwire.annotations.OpenWireProperty;
/**
* @openwire:marshaller code="121"
*/
@OpenWireType(typeCode = 121)
public class SessionId implements DataStructure {
public static final byte DATA_STRUCTURE_TYPE = CommandTypes.SESSION_ID;
@OpenWireProperty(version = 1, sequence = 1, cached = true)
protected String connectionId;
@OpenWireProperty(version = 1, sequence = 2)
protected long value;
@OpenWireExtension
protected transient int hashCode;
@OpenWireExtension
protected transient String key;
@OpenWireExtension
protected transient ConnectionId parentId;
public SessionId() {
}
public SessionId(ConnectionId connectionId, long sessionId) {
this.connectionId = connectionId.getValue();
this.value = sessionId;
}
public SessionId(SessionId id) {
this.connectionId = id.getConnectionId();
this.value = id.getValue();
}
public SessionId(ProducerId id) {
this.connectionId = id.getConnectionId();
this.value = id.getSessionId();
}
public SessionId(ConsumerId id) {
this.connectionId = id.getConnectionId();
this.value = id.getSessionId();
}
public ConnectionId getParentId() {
if (parentId == null) {
parentId = new ConnectionId(this);
}
return parentId;
}
@Override
public int hashCode() {
if (hashCode == 0) {
hashCode = connectionId.hashCode() ^ (int)value;
}
return hashCode;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || o.getClass() != SessionId.class) {
return false;
}
SessionId id = (SessionId)o;
return value == id.value && connectionId.equals(id.connectionId);
}
@Override
public byte getDataStructureType() {
return DATA_STRUCTURE_TYPE;
}
/**
* @openwire:property version=1 cache=true
*/
public String getConnectionId() {
return connectionId;
}
public void setConnectionId(String connectionId) {
this.connectionId = connectionId;
}
/**
* @openwire:property version=1
*/
public long getValue() {
return value;
}
public void setValue(long sessionId) {
this.value = sessionId;
}
@Override
public String toString() {
if (key == null) {
key = connectionId + ":" + value;
}
return key;
}
@Override
public boolean isMarshallAware() {
return false;
}
}
| 1,482 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/commands/MessageAck.java
|
/**
* 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.commands;
import org.apache.activemq.openwire.annotations.OpenWireType;
import org.apache.activemq.openwire.annotations.OpenWireExtension;
import org.apache.activemq.openwire.annotations.OpenWireProperty;
/**
* @openwire:marshaller code="22"
*/
@OpenWireType(typeCode = 22)
public class MessageAck extends BaseCommand {
public static final byte DATA_STRUCTURE_TYPE = CommandTypes.MESSAGE_ACK;
/**
* Used to let the broker know that the message has been delivered to the client. Message
* will still be retained until an standard ack is received. This is used get the broker to
* send more messages past prefetch limits when an standard ack has not been sent.
*/
public static final byte DELIVERED_ACK_TYPE = 0;
/**
* The standard ack case where a client wants the message to be discarded.
*/
public static final byte STANDARD_ACK_TYPE = 2;
/**
* In case the client want's to explicitly let the broker know that a message was not
* processed and the message was considered a poison message.
*/
public static final byte POSION_ACK_TYPE = 1;
/**
* In case the client want's to explicitly let the broker know that a message was not
* processed and it was re-delivered to the consumer but it was not yet considered to be a
* poison message. The messageCount field will hold the number of times the message was
* re-delivered.
*/
public static final byte REDELIVERED_ACK_TYPE = 3;
/**
* The ack case where a client wants only an individual message to be discarded.
*/
public static final byte INDIVIDUAL_ACK_TYPE = 4;
/**
* The ack case where a durable topic subscription does not match a selector.
*/
public static final byte UNMATCHED_ACK_TYPE = 5;
/**
* the case where a consumer does not dispatch because message has expired inflight
*/
public static final byte EXPIRED_ACK_TYPE = 6;
@OpenWireProperty(version = 1, sequence = 1, cached = true)
protected OpenWireDestination destination;
@OpenWireProperty(version = 1, sequence = 2, cached = true)
protected TransactionId transactionId;
@OpenWireProperty(version = 1, sequence = 3, cached = true)
protected ConsumerId consumerId;
@OpenWireProperty(version = 1, sequence = 4)
protected byte ackType;
@OpenWireProperty(version = 1, sequence = 5)
protected MessageId firstMessageId;
@OpenWireProperty(version = 1, sequence = 6)
protected MessageId lastMessageId;
@OpenWireProperty(version = 1, sequence = 7)
protected int messageCount;
@OpenWireProperty(version = 7, sequence = 8)
protected Throwable poisonCause;
@OpenWireExtension
protected transient String consumerKey;
public MessageAck() {
}
public MessageAck(MessageDispatch md, byte ackType, int messageCount) {
this.ackType = ackType;
this.consumerId = md.getConsumerId();
this.destination = md.getDestination();
this.lastMessageId = md.getMessage().getMessageId();
this.messageCount = messageCount;
}
public MessageAck(Message message, byte ackType, int messageCount) {
this.ackType = ackType;
this.destination = message.getDestination();
this.lastMessageId = message.getMessageId();
this.messageCount = messageCount;
}
public void copy(MessageAck copy) {
super.copy(copy);
copy.firstMessageId = firstMessageId;
copy.lastMessageId = lastMessageId;
copy.destination = destination;
copy.transactionId = transactionId;
copy.ackType = ackType;
copy.consumerId = consumerId;
}
@Override
public byte getDataStructureType() {
return DATA_STRUCTURE_TYPE;
}
@Override
public boolean isMessageAck() {
return true;
}
public boolean isPoisonAck() {
return ackType == POSION_ACK_TYPE;
}
public boolean isStandardAck() {
return ackType == STANDARD_ACK_TYPE;
}
public boolean isDeliveredAck() {
return ackType == DELIVERED_ACK_TYPE;
}
public boolean isRedeliveredAck() {
return ackType == REDELIVERED_ACK_TYPE;
}
public boolean isIndividualAck() {
return ackType == INDIVIDUAL_ACK_TYPE;
}
public boolean isUnmatchedAck() {
return ackType == UNMATCHED_ACK_TYPE;
}
public boolean isExpiredAck() {
return ackType == EXPIRED_ACK_TYPE;
}
/**
* @openwire:property version=1 cache=true
*/
public OpenWireDestination getDestination() {
return destination;
}
public void setDestination(OpenWireDestination destination) {
this.destination = destination;
}
/**
* @openwire:property version=1 cache=true
*/
public TransactionId getTransactionId() {
return transactionId;
}
public void setTransactionId(TransactionId transactionId) {
this.transactionId = transactionId;
}
public boolean isInTransaction() {
return transactionId != null;
}
/**
* @openwire:property version=1 cache=true
*/
public ConsumerId getConsumerId() {
return consumerId;
}
public void setConsumerId(ConsumerId consumerId) {
this.consumerId = consumerId;
}
/**
* @openwire:property version=1
*/
public byte getAckType() {
return ackType;
}
public void setAckType(byte ackType) {
this.ackType = ackType;
}
/**
* @openwire:property version=1
*/
public MessageId getFirstMessageId() {
return firstMessageId;
}
public void setFirstMessageId(MessageId firstMessageId) {
this.firstMessageId = firstMessageId;
}
/**
* @openwire:property version=1
*/
public MessageId getLastMessageId() {
return lastMessageId;
}
public void setLastMessageId(MessageId lastMessageId) {
this.lastMessageId = lastMessageId;
}
/**
* The number of messages being acknowledged in the range.
*
* @openwire:property version=1
*/
public int getMessageCount() {
return messageCount;
}
public void setMessageCount(int messageCount) {
this.messageCount = messageCount;
}
/**
* The cause of a poison ack, if a message listener throws an exception it will be recorded
* here
*
* @openwire:property version=7
*/
public Throwable getPoisonCause() {
return poisonCause;
}
public void setPoisonCause(Throwable poisonCause) {
this.poisonCause = poisonCause;
}
@Override
public Response visit(CommandVisitor visitor) throws Exception {
return visitor.processMessageAck(this);
}
/**
* A helper method to allow a single message ID to be acknowledged
*/
public void setMessageID(MessageId messageID) {
setFirstMessageId(messageID);
setLastMessageId(messageID);
setMessageCount(1);
}
}
| 1,483 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/commands/DataResponse.java
|
/**
* 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.commands;
import org.apache.activemq.openwire.annotations.OpenWireType;
import org.apache.activemq.openwire.annotations.OpenWireProperty;
/**
* @openwire:marshaller code="32"
*/
@OpenWireType(typeCode = 32)
public class DataResponse extends Response {
public static final byte DATA_STRUCTURE_TYPE = CommandTypes.DATA_RESPONSE;
@OpenWireProperty(version = 1, sequence = 1)
DataStructure data;
public DataResponse() {
}
public DataResponse(DataStructure data) {
this.data = data;
}
@Override
public byte getDataStructureType() {
return DATA_STRUCTURE_TYPE;
}
/**
* @openwire:property version=1
*/
public DataStructure getData() {
return data;
}
public void setData(DataStructure data) {
this.data = data;
}
}
| 1,484 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/commands/JournalQueueAck.java
|
/**
* 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.commands;
import org.apache.activemq.openwire.annotations.OpenWireType;
import org.apache.activemq.openwire.annotations.OpenWireProperty;
/**
* @openwire:marshaller code="52"
*/
@OpenWireType(typeCode = 52)
public class JournalQueueAck implements DataStructure {
public static final byte DATA_STRUCTURE_TYPE = CommandTypes.JOURNAL_REMOVE;
@OpenWireProperty(version = 1, sequence = 1)
OpenWireDestination destination;
@OpenWireProperty(version = 1, sequence = 2)
MessageAck messageAck;
@Override
public byte getDataStructureType() {
return DATA_STRUCTURE_TYPE;
}
/**
* @openwire:property version=1
*/
public OpenWireDestination getDestination() {
return destination;
}
public void setDestination(OpenWireDestination destination) {
this.destination = destination;
}
/**
* @openwire:property version=1
*/
public MessageAck getMessageAck() {
return messageAck;
}
public void setMessageAck(MessageAck messageAck) {
this.messageAck = messageAck;
}
@Override
public boolean isMarshallAware() {
return false;
}
@Override
public String toString() {
return getClass().getSimpleName() + "{ " + destination + " }";
}
}
| 1,485 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/commands/TransactionId.java
|
/**
* 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.commands;
import org.apache.activemq.openwire.annotations.OpenWireType;
/**
* @openwire:marshaller
*/
@OpenWireType(typeCode = 0)
public abstract class TransactionId implements DataStructure {
public abstract boolean isXATransaction();
public abstract boolean isLocalTransaction();
public abstract String getTransactionKey();
@Override
public boolean isMarshallAware() {
return false;
}
}
| 1,486 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/commands/KeepAliveInfo.java
|
/**
* 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.commands;
import org.apache.activemq.openwire.annotations.OpenWireType;
/**
* @openwire:marshaller code="10"
*/
@OpenWireType(typeCode = 10)
public class KeepAliveInfo extends BaseCommand {
public static final byte DATA_STRUCTURE_TYPE = CommandTypes.KEEP_ALIVE_INFO;
@Override
public byte getDataStructureType() {
return DATA_STRUCTURE_TYPE;
}
@Override
public boolean isResponse() {
return false;
}
@Override
public boolean isMessageDispatch() {
return false;
}
@Override
public boolean isMessage() {
return false;
}
@Override
public boolean isMessageAck() {
return false;
}
@Override
public boolean isBrokerInfo() {
return false;
}
@Override
public boolean isWireFormatInfo() {
return false;
}
@Override
public Response visit(CommandVisitor visitor) throws Exception {
return visitor.processKeepAlive(this);
}
@Override
public boolean isMarshallAware() {
return false;
}
@Override
public boolean isMessageDispatchNotification() {
return false;
}
@Override
public boolean isShutdownInfo() {
return false;
}
@Override
public String toString() {
return this.getClass().getSimpleName();
}
}
| 1,487 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/commands/ReplayCommand.java
|
/**
* 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.commands;
import org.apache.activemq.openwire.annotations.OpenWireType;
import org.apache.activemq.openwire.annotations.OpenWireExtension;
import org.apache.activemq.openwire.annotations.OpenWireProperty;
/**
* A general purpose replay command for some kind of producer where ranges of
* messages are asked to be replayed. This command is typically used over a
* non-reliable transport such as UDP or multicast but could also be used on
* TCP/IP if a socket has been re-established.
*
* @openwire:marshaller code="65"
*/
@OpenWireType(typeCode = 65)
public class ReplayCommand extends BaseCommand {
public static final byte DATA_STRUCTURE_TYPE = CommandTypes.REPLAY;
@OpenWireProperty(version = 1, sequence = 1)
private int firstNakNumber;
@OpenWireProperty(version = 1, sequence = 2)
private int lastNakNumber;
@OpenWireExtension(serialized = true)
private String producerId;
@OpenWireExtension(serialized = true)
private int firstAckNumber;
@OpenWireExtension(serialized = true)
private int lastAckNumber;
public ReplayCommand() {
}
@Override
public byte getDataStructureType() {
return DATA_STRUCTURE_TYPE;
}
public String getProducerId() {
return producerId;
}
/**
* Is used to uniquely identify the producer of the sequence
*/
public void setProducerId(String producerId) {
this.producerId = producerId;
}
public int getFirstAckNumber() {
return firstAckNumber;
}
/**
* Is used to specify the first sequence number being acknowledged as delivered on the transport
* so that it can be removed from cache
*/
public void setFirstAckNumber(int firstSequenceNumber) {
this.firstAckNumber = firstSequenceNumber;
}
public int getLastAckNumber() {
return lastAckNumber;
}
/**
* Is used to specify the last sequence number being acknowledged as delivered on the transport
* so that it can be removed from cache
*/
public void setLastAckNumber(int lastSequenceNumber) {
this.lastAckNumber = lastSequenceNumber;
}
@Override
public Response visit(CommandVisitor visitor) throws Exception {
return null;
}
/**
* Is used to specify the first sequence number to be replayed
*
* @openwire:property version=1
*/
public int getFirstNakNumber() {
return firstNakNumber;
}
public void setFirstNakNumber(int firstNakNumber) {
this.firstNakNumber = firstNakNumber;
}
/**
* Is used to specify the last sequence number to be replayed
*
* @openwire:property version=1
*/
public int getLastNakNumber() {
return lastNakNumber;
}
public void setLastNakNumber(int lastNakNumber) {
this.lastNakNumber = lastNakNumber;
}
@Override
public String toString() {
return "ReplayCommand {commandId = " + getCommandId() + ", firstNakNumber = " + getFirstNakNumber() + ", lastNakNumber = " + getLastNakNumber() + "}";
}
}
| 1,488 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/commands/Response.java
|
/**
* 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.commands;
import org.apache.activemq.openwire.annotations.OpenWireType;
import org.apache.activemq.openwire.annotations.OpenWireProperty;
/**
* @openwire:marshaller code="30"
*/
@OpenWireType(typeCode = 30)
public class Response extends BaseCommand {
public static final byte DATA_STRUCTURE_TYPE = CommandTypes.RESPONSE;
@OpenWireProperty(version = 1, sequence = 1)
int correlationId;
@Override
public byte getDataStructureType() {
return DATA_STRUCTURE_TYPE;
}
/**
* @openwire:property version=1
*/
public int getCorrelationId() {
return correlationId;
}
public void setCorrelationId(int responseId) {
this.correlationId = responseId;
}
@Override
public boolean isResponse() {
return true;
}
public boolean isException() {
return false;
}
@Override
public Response visit(CommandVisitor visitor) throws Exception {
return null;
}
}
| 1,489 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/commands/ConnectionInfo.java
|
/**
* 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.commands;
import org.apache.activemq.openwire.annotations.OpenWireType;
import org.apache.activemq.openwire.annotations.OpenWireProperty;
/**
* @openwire:marshaller code="3"
*/
@OpenWireType(typeCode = 3)
public class ConnectionInfo extends BaseCommand {
public static final byte DATA_STRUCTURE_TYPE = CommandTypes.CONNECTION_INFO;
@OpenWireProperty(version = 1, sequence = 1, cached = true)
protected ConnectionId connectionId;
@OpenWireProperty(version = 1, sequence = 2)
protected String clientId;
@OpenWireProperty(version = 1, sequence = 3)
protected String password;
@OpenWireProperty(version = 1, sequence = 4)
protected String userName;
@OpenWireProperty(version = 1, sequence = 5, cached = true)
protected BrokerId[] brokerPath;
@OpenWireProperty(version = 1, sequence = 6)
protected boolean brokerMasterConnector;
@OpenWireProperty(version = 1, sequence = 7)
protected boolean manageable;
@OpenWireProperty(version = 2, sequence = 8)
protected boolean clientMaster = true;
@OpenWireProperty(version = 6, sequence = 9)
protected boolean faultTolerant = false;
@OpenWireProperty(version = 6, sequence = 10)
protected boolean failoverReconnect;
@OpenWireProperty(version = 8, sequence = 11)
protected String clientIp;
public ConnectionInfo() {
}
public ConnectionInfo(ConnectionId connectionId) {
this.connectionId = connectionId;
}
@Override
public byte getDataStructureType() {
return DATA_STRUCTURE_TYPE;
}
public ConnectionInfo copy() {
ConnectionInfo copy = new ConnectionInfo();
copy(copy);
return copy;
}
private void copy(ConnectionInfo copy) {
super.copy(copy);
copy.connectionId = connectionId;
copy.clientId = clientId;
copy.userName = userName;
copy.password = password;
copy.brokerPath = brokerPath;
copy.brokerMasterConnector = brokerMasterConnector;
copy.manageable = manageable;
copy.clientMaster = clientMaster;
copy.faultTolerant= faultTolerant;
copy.clientIp = clientIp;
}
/**
* @openwire:property version=1 cache=true
*/
public ConnectionId getConnectionId() {
return connectionId;
}
public void setConnectionId(ConnectionId connectionId) {
this.connectionId = connectionId;
}
/**
* @openwire:property version=1
*/
public String getClientId() {
return clientId;
}
public void setClientId(String clientId) {
this.clientId = clientId;
}
public RemoveInfo createRemoveCommand() {
RemoveInfo command = new RemoveInfo(getConnectionId());
command.setResponseRequired(isResponseRequired());
return command;
}
/**
* @openwire:property version=1
*/
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
/**
* @openwire:property version=1
*/
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
/**
* The route of brokers the command has moved through.
*
* @openwire:property version=1 cache=true
*/
public BrokerId[] getBrokerPath() {
return brokerPath;
}
public void setBrokerPath(BrokerId[] brokerPath) {
this.brokerPath = brokerPath;
}
@Override
public Response visit(CommandVisitor visitor) throws Exception {
return visitor.processAddConnection(this);
}
/**
* @openwire:property version=1
*/
public boolean isBrokerMasterConnector() {
return brokerMasterConnector;
}
/**
* @param slaveBroker The brokerMasterConnector to set.
*/
public void setBrokerMasterConnector(boolean slaveBroker) {
this.brokerMasterConnector = slaveBroker;
}
/**
* @openwire:property version=1
*/
public boolean isManageable() {
return manageable;
}
/**
* @param manageable The manageable to set.
*/
public void setManageable(boolean manageable) {
this.manageable = manageable;
}
/**
* @openwire:property version=2
* @return the clientMaster
*/
public boolean isClientMaster() {
return this.clientMaster;
}
/**
* @param clientMaster the clientMaster to set
*/
public void setClientMaster(boolean clientMaster) {
this.clientMaster = clientMaster;
}
/**
* @openwire:property version=6 cache=false
* @return the faultTolerant
*/
public boolean isFaultTolerant() {
return this.faultTolerant;
}
/**
* @param faultTolerant the faultTolerant to set
*/
public void setFaultTolerant(boolean faultTolerant) {
this.faultTolerant = faultTolerant;
}
/**
* @openwire:property version=6 cache=false
* @return failoverReconnect true if this is a reconnect
*/
public boolean isFailoverReconnect() {
return this.failoverReconnect;
}
public void setFailoverReconnect(boolean failoverReconnect) {
this.failoverReconnect = failoverReconnect;
}
/**
* @openwire:property version=8
*/
public String getClientIp() {
return clientIp;
}
public void setClientIp(String clientIp) {
this.clientIp = clientIp;
}
@Override
public String toString() {
return "ConnectionInfo: { " + getConnectionId() + " }";
}
@Override
public boolean isConnectionInfo() {
return true;
}
}
| 1,490 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/commands/CommandTypes.java
|
/**
* 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.commands;
/**
* Holds the command id constants used by the command objects.
*/
public interface CommandTypes {
// What is the latest version of the openwire protocol
byte PROTOCOL_VERSION = 11;
// What is the latest version of the openwire protocol used in the stores
byte PROTOCOL_STORE_VERSION = 11;
// What is the legacy version that old KahaDB store's most commonly used
byte PROTOCOL_LEGACY_STORE_VERSION = 6;
// A marshaling layer can use this type to specify a null object.
byte NULL = 0;
////////////////////////////////////////////////////////////////////////////
// Info objects sent back and forth client/server when setting up a
// client connection, session, producer, consumer, transaction, etc...
////////////////////////////////////////////////////////////////////////////
byte WIREFORMAT_INFO = 1;
byte BROKER_INFO = 2;
byte CONNECTION_INFO = 3;
byte SESSION_INFO = 4;
byte CONSUMER_INFO = 5;
byte PRODUCER_INFO = 6;
byte TRANSACTION_INFO = 7;
byte DESTINATION_INFO = 8;
byte REMOVE_SUBSCRIPTION_INFO = 9;
byte KEEP_ALIVE_INFO = 10;
byte SHUTDOWN_INFO = 11;
byte REMOVE_INFO = 12;
byte CONTROL_COMMAND = 14;
byte FLUSH_COMMAND = 15;
byte CONNECTION_ERROR = 16;
byte CONSUMER_CONTROL = 17;
byte CONNECTION_CONTROL = 18;
////////////////////////////////////////////////////////////////////////////
// Messages that go back and forth between the client and the server.
////////////////////////////////////////////////////////////////////////////
byte PRODUCER_ACK = 19;
byte MESSAGE_PULL = 20;
byte MESSAGE_DISPATCH = 21;
byte MESSAGE_ACK = 22;
byte OPENWIRE_MESSAGE = 23;
byte OPENWIRE_BYTES_MESSAGE = 24;
byte OPENWIRE_MAP_MESSAGE = 25;
byte OPENWIRE_OBJECT_MESSAGE = 26;
byte OPENWIRE_STREAM_MESSAGE = 27;
byte OPENWIRE_TEXT_MESSAGE = 28;
byte OPENWIRE_BLOB_MESSAGE = 29;
////////////////////////////////////////////////////////////////////////////
// Command Response messages
////////////////////////////////////////////////////////////////////////////
byte RESPONSE = 30;
byte EXCEPTION_RESPONSE = 31;
byte DATA_RESPONSE = 32;
byte DATA_ARRAY_RESPONSE = 33;
byte INTEGER_RESPONSE = 34;
////////////////////////////////////////////////////////////////////////////
// Used by discovery
////////////////////////////////////////////////////////////////////////////
byte DISCOVERY_EVENT = 40;
////////////////////////////////////////////////////////////////////////////
// Command object used by the Journal
////////////////////////////////////////////////////////////////////////////
byte JOURNAL_ACK = 50;
byte JOURNAL_REMOVE = 52;
byte JOURNAL_TRACE = 53;
byte JOURNAL_TRANSACTION = 54;
byte DURABLE_SUBSCRIPTION_INFO = 55;
////////////////////////////////////////////////////////////////////////////
// Reliability and fragmentation
////////////////////////////////////////////////////////////////////////////
byte PARTIAL_COMMAND = 60;
byte PARTIAL_LAST_COMMAND = 61;
byte REPLAY = 65;
////////////////////////////////////////////////////////////////////////////
// Types used represent basic Java types.
////////////////////////////////////////////////////////////////////////////
byte BYTE_TYPE = 70;
byte CHAR_TYPE = 71;
byte SHORT_TYPE = 72;
byte INTEGER_TYPE = 73;
byte LONG_TYPE = 74;
byte DOUBLE_TYPE = 75;
byte FLOAT_TYPE = 76;
byte STRING_TYPE = 77;
byte BOOLEAN_TYPE = 78;
byte BYTE_ARRAY_TYPE = 79;
////////////////////////////////////////////////////////////////////////////
// Broker to Broker command objects
////////////////////////////////////////////////////////////////////////////
byte MESSAGE_DISPATCH_NOTIFICATION = 90;
byte NETWORK_BRIDGE_FILTER = 91;
////////////////////////////////////////////////////////////////////////////
// Data structures contained in the command objects.
////////////////////////////////////////////////////////////////////////////
byte OPENWIRE_QUEUE = 100;
byte OPENWIRE_TOPIC = 101;
byte OPENWIRE_TEMP_QUEUE = 102;
byte OPENWIRE_TEMP_TOPIC = 103;
byte MESSAGE_ID = 110;
byte OPENWIRE_LOCAL_TRANSACTION_ID = 111;
byte OPENWIRE_XA_TRANSACTION_ID = 112;
byte CONNECTION_ID = 120;
byte SESSION_ID = 121;
byte CONSUMER_ID = 122;
byte PRODUCER_ID = 123;
byte BROKER_ID = 124;
}
| 1,491 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/commands/DataArrayResponse.java
|
/**
* 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.commands;
import org.apache.activemq.openwire.annotations.OpenWireType;
import org.apache.activemq.openwire.annotations.OpenWireProperty;
/**
* @openwire:marshaller code="33"
*/
@OpenWireType(typeCode = 33)
public class DataArrayResponse extends Response {
public static final byte DATA_STRUCTURE_TYPE = CommandTypes.DATA_ARRAY_RESPONSE;
@OpenWireProperty(version = 1, sequence = 1)
DataStructure data[];
public DataArrayResponse() {
}
public DataArrayResponse(DataStructure data[]) {
this.data = data;
}
@Override
public byte getDataStructureType() {
return DATA_STRUCTURE_TYPE;
}
/**
* @openwire:property version=1
*/
public DataStructure[] getData() {
return data;
}
public void setData(DataStructure[] data) {
this.data = data;
}
}
| 1,492 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/commands/MessageDispatchNotification.java
|
/**
* 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.commands;
import org.apache.activemq.openwire.annotations.OpenWireType;
import org.apache.activemq.openwire.annotations.OpenWireProperty;
/**
* @openwire:marshaller code="90"
*/
@OpenWireType(typeCode = 90)
public class MessageDispatchNotification extends BaseCommand {
public static final byte DATA_STRUCTURE_TYPE = CommandTypes.MESSAGE_DISPATCH_NOTIFICATION;
@OpenWireProperty(version = 1, sequence = 1, cached = true)
protected ConsumerId consumerId;
@OpenWireProperty(version = 1, sequence = 2, cached = true)
protected OpenWireDestination destination;
@OpenWireProperty(version = 1, sequence = 3)
protected long deliverySequenceId;
@OpenWireProperty(version = 1, sequence = 4)
protected MessageId messageId;
@Override
public byte getDataStructureType() {
return DATA_STRUCTURE_TYPE;
}
@Override
public boolean isMessageDispatchNotification() {
return true;
}
/**
* @openwire:property version=1 cache=true
*/
public ConsumerId getConsumerId() {
return consumerId;
}
public void setConsumerId(ConsumerId consumerId) {
this.consumerId = consumerId;
}
/**
* @openwire:property version=1 cache=true
*/
public OpenWireDestination getDestination() {
return destination;
}
public void setDestination(OpenWireDestination destination) {
this.destination = destination;
}
/**
* @openwire:property version=1
*/
public long getDeliverySequenceId() {
return deliverySequenceId;
}
public void setDeliverySequenceId(long deliverySequenceId) {
this.deliverySequenceId = deliverySequenceId;
}
/**
* @openwire:property version=1
*/
public MessageId getMessageId() {
return messageId;
}
public void setMessageId(MessageId messageId) {
this.messageId = messageId;
}
@Override
public Response visit(CommandVisitor visitor) throws Exception {
return visitor.processMessageDispatchNotification(this);
}
}
| 1,493 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/commands/ExceptionResponse.java
|
/**
* 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.commands;
import org.apache.activemq.openwire.annotations.OpenWireType;
import org.apache.activemq.openwire.annotations.OpenWireProperty;
/**
* @openwire:marshaller code="31"
*/
@OpenWireType(typeCode = 31)
public class ExceptionResponse extends Response {
public static final byte DATA_STRUCTURE_TYPE = CommandTypes.EXCEPTION_RESPONSE;
@OpenWireProperty(version = 1, sequence = 1)
Throwable exception;
public ExceptionResponse() {
}
public ExceptionResponse(Throwable e) {
setException(e);
}
@Override
public byte getDataStructureType() {
return DATA_STRUCTURE_TYPE;
}
/**
* @openwire:property version=1
*/
public Throwable getException() {
return exception;
}
public void setException(Throwable exception) {
this.exception = exception;
}
@Override
public boolean isException() {
return true;
}
}
| 1,494 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/commands/Command.java
|
/**
* 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.commands;
/**
* The Command Pattern so that we can send and receive commands on the different
* transports.
*/
public interface Command extends DataStructure {
void setCommandId(int value);
/**
* @return the unique ID of this request used to map responses to requests
*/
int getCommandId();
void setResponseRequired(boolean responseRequired);
boolean isResponseRequired();
boolean isResponse();
boolean isMessageDispatch();
boolean isBrokerInfo();
boolean isWireFormatInfo();
boolean isMessage();
boolean isMessageAck();
boolean isMessageDispatchNotification();
boolean isShutdownInfo();
boolean isConnectionControl();
boolean isConnectionInfo();
boolean isSessionInfo();
boolean isProducerInfo();
boolean isConsumerInfo();
Response visit(CommandVisitor visitor) throws Exception;
}
| 1,495 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/commands/DataStructure.java
|
/**
* 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.commands;
/**
* Base class for all the OpenWire commands and resource objects.
*/
public interface DataStructure {
/**
* @return The type of the data structure
*/
byte getDataStructureType();
/**
* Returns true when a Data Structure instance want to be made aware of the
* marshaling events associated with send and receive of the command.
*
* Any instance that is marshal aware will implement the MarshalAware interface
* however this method provides a shortcut that can be faster than a direct
* instance of check on each marshaled object.
*
* @return if the data structure is marshal aware.
*/
boolean isMarshallAware();
}
| 1,496 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/commands/OpenWireTempQueue.java
|
/**
* 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.commands;
import org.apache.activemq.openwire.annotations.OpenWireType;
/**
* Represents an OpenWire Temporary Queue.
*/
@OpenWireType(typeCode = 102)
public class OpenWireTempQueue extends OpenWireTempDestination {
public static final byte DATA_STRUCTURE_TYPE = CommandTypes.OPENWIRE_TEMP_QUEUE;
public OpenWireTempQueue() {
}
public OpenWireTempQueue(String name) {
super(name);
}
public OpenWireTempQueue(ConnectionId connectionId, long sequenceId) {
super(connectionId.getValue(), sequenceId);
}
@Override
public byte getDataStructureType() {
return DATA_STRUCTURE_TYPE;
}
@Override
public boolean isQueue() {
return true;
}
@Override
public byte getDestinationType() {
return TEMP_QUEUE_TYPE;
}
@Override
protected String getQualifiedPrefix() {
return TEMP_QUEUE_QUALIFED_PREFIX;
}
public String getQueueName() {
return getPhysicalName();
}
}
| 1,497 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/commands/ConsumerControl.java
|
/**
* 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.commands;
import org.apache.activemq.openwire.annotations.OpenWireType;
import org.apache.activemq.openwire.annotations.OpenWireProperty;
/**
* Used by the Broker to control various aspects of a consumer instance.
*
* @openwire:marshaller code="17"
*/
@OpenWireType(typeCode = 17)
public class ConsumerControl extends BaseCommand {
public static final byte DATA_STRUCTURE_TYPE = CommandTypes.CONSUMER_CONTROL;
@OpenWireProperty(version = 6, sequence = 1)
protected OpenWireDestination destination;
@OpenWireProperty(version = 1, sequence = 2)
protected boolean close;
@OpenWireProperty(version = 1, sequence = 3)
protected ConsumerId consumerId;
@OpenWireProperty(version = 1, sequence = 4)
protected int prefetch;
@OpenWireProperty(version = 2, sequence = 5)
protected boolean flush;
@OpenWireProperty(version = 2, sequence = 6)
protected boolean start;
@OpenWireProperty(version = 2, sequence = 7)
protected boolean stop;
/**
* @openwire:property version=6
* @return Returns the destination.
*/
public OpenWireDestination getDestination() {
return destination;
}
public void setDestination(OpenWireDestination destination) {
this.destination = destination;
}
@Override
public byte getDataStructureType() {
return DATA_STRUCTURE_TYPE;
}
@Override
public Response visit(CommandVisitor visitor) throws Exception {
return visitor.processConsumerControl(this);
}
/**
* @openwire:property version=1
* @return Returns the close.
*/
public boolean isClose() {
return close;
}
/**
* @param close The close to set.
*/
public void setClose(boolean close) {
this.close = close;
}
/**
* @openwire:property version=1
* @return Returns the consumerId.
*/
public ConsumerId getConsumerId() {
return consumerId;
}
/**
* @param consumerId The consumerId to set.
*/
public void setConsumerId(ConsumerId consumerId) {
this.consumerId = consumerId;
}
/**
* @openwire:property version=1
* @return Returns the prefetch.
*/
public int getPrefetch() {
return prefetch;
}
/**
* @param prefetch The prefetch to set.
*/
public void setPrefetch(int prefetch) {
this.prefetch = prefetch;
}
/**
* @openwire:property version=2
* @return the flush
*/
public boolean isFlush() {
return this.flush;
}
/**
* @param flush the flush to set
*/
public void setFlush(boolean flush) {
this.flush = flush;
}
/**
* @openwire:property version=2
* @return the start
*/
public boolean isStart() {
return this.start;
}
/**
* @param start the start to set
*/
public void setStart(boolean start) {
this.start = start;
}
/**
* @openwire:property version=2
* @return the stop
*/
public boolean isStop() {
return this.stop;
}
/**
* @param stop the stop to set
*/
public void setStop(boolean stop) {
this.stop = stop;
}
}
| 1,498 |
0 |
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire
|
Create_ds/activemq-openwire/openwire-core/src/main/java/org/apache/activemq/openwire/commands/OpenWireQueue.java
|
/**
* 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.commands;
import org.apache.activemq.openwire.annotations.OpenWireType;
@OpenWireType(typeCode = 100)
public class OpenWireQueue extends OpenWireDestination {
public static final byte DATA_STRUCTURE_TYPE = CommandTypes.OPENWIRE_QUEUE;
public OpenWireQueue() {
}
public OpenWireQueue(String name) {
super(name);
}
@Override
public byte getDataStructureType() {
return DATA_STRUCTURE_TYPE;
}
@Override
public boolean isQueue() {
return true;
}
@Override
public byte getDestinationType() {
return QUEUE_TYPE;
}
@Override
protected String getQualifiedPrefix() {
return QUEUE_QUALIFIED_PREFIX;
}
public String getQueueName() {
return getPhysicalName();
}
}
| 1,499 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.