Added some fields for future use to the BrokerInfo and ProducerInfo classes.

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@472165 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2006-11-07 16:56:12 +00:00
parent da7478d9d5
commit 3daf923b51
6 changed files with 44 additions and 0 deletions

View File

@ -37,6 +37,7 @@ public class BrokerInfo extends BaseCommand{
boolean duplexConnection;
BrokerInfo peerBrokerInfos[];
String brokerName;
long connectionId;
public boolean isBrokerInfo(){
return true;
@ -169,4 +170,19 @@ public class BrokerInfo extends BaseCommand{
public void setNetworkConnection(boolean networkConnection){
this.networkConnection=networkConnection;
}
/**
* The broker assigns a each connection it accepts a connection id.
*
* @openwire:property version=2
*/
public long getConnectionId() {
return connectionId;
}
public void setConnectionId(long connectionId) {
this.connectionId = connectionId;
}
}

View File

@ -31,6 +31,7 @@ public class ProducerInfo extends BaseCommand {
protected ProducerId producerId;
protected ActiveMQDestination destination;
protected BrokerId[] brokerPath;
protected boolean dispatchAsync;
public ProducerInfo() {
}
@ -101,4 +102,19 @@ public class ProducerInfo extends BaseCommand {
return visitor.processAddProducer( this );
}
/**
* If the broker should dispatch messages from this producer async. Since sync
* dispatch could potentally block the producer thread, this could be an important
* setting for the producer.
*
* @openwire:property version=2
*/
public boolean isDispatchAsync() {
return dispatchAsync;
}
public void setDispatchAsync(boolean dispatchAsync) {
this.dispatchAsync = dispatchAsync;
}
}

View File

@ -86,6 +86,7 @@ public class BrokerInfoMarshaller extends BaseCommandMarshaller {
info.setFaultTolerantConfiguration(bs.readBoolean());
info.setDuplexConnection(bs.readBoolean());
info.setNetworkConnection(bs.readBoolean());
info.setConnectionId(tightUnmarshalLong(wireFormat, dataIn, bs));
}
@ -107,6 +108,7 @@ public class BrokerInfoMarshaller extends BaseCommandMarshaller {
bs.writeBoolean(info.isFaultTolerantConfiguration());
bs.writeBoolean(info.isDuplexConnection());
bs.writeBoolean(info.isNetworkConnection());
rc+=tightMarshalLong1(wireFormat, info.getConnectionId(), bs);
return rc + 0;
}
@ -131,6 +133,7 @@ public class BrokerInfoMarshaller extends BaseCommandMarshaller {
bs.readBoolean();
bs.readBoolean();
bs.readBoolean();
tightMarshalLong2(wireFormat, info.getConnectionId(), dataOut, bs);
}
@ -165,6 +168,7 @@ public class BrokerInfoMarshaller extends BaseCommandMarshaller {
info.setFaultTolerantConfiguration(dataIn.readBoolean());
info.setDuplexConnection(dataIn.readBoolean());
info.setNetworkConnection(dataIn.readBoolean());
info.setConnectionId(looseUnmarshalLong(wireFormat, dataIn));
}
@ -186,6 +190,7 @@ public class BrokerInfoMarshaller extends BaseCommandMarshaller {
dataOut.writeBoolean(info.isFaultTolerantConfiguration());
dataOut.writeBoolean(info.isDuplexConnection());
dataOut.writeBoolean(info.isNetworkConnection());
looseMarshalLong(wireFormat, info.getConnectionId(), dataOut);
}
}

View File

@ -80,6 +80,7 @@ public class ProducerInfoMarshaller extends BaseCommandMarshaller {
else {
info.setBrokerPath(null);
}
info.setDispatchAsync(bs.readBoolean());
}
@ -95,6 +96,7 @@ public class ProducerInfoMarshaller extends BaseCommandMarshaller {
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getProducerId(), bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getDestination(), bs);
rc += tightMarshalObjectArray1(wireFormat, info.getBrokerPath(), bs);
bs.writeBoolean(info.isDispatchAsync());
return rc + 0;
}
@ -113,6 +115,7 @@ public class ProducerInfoMarshaller extends BaseCommandMarshaller {
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getProducerId(), dataOut, bs);
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getDestination(), dataOut, bs);
tightMarshalObjectArray2(wireFormat, info.getBrokerPath(), dataOut, bs);
bs.readBoolean();
}
@ -141,6 +144,7 @@ public class ProducerInfoMarshaller extends BaseCommandMarshaller {
else {
info.setBrokerPath(null);
}
info.setDispatchAsync(dataIn.readBoolean());
}
@ -156,6 +160,7 @@ public class ProducerInfoMarshaller extends BaseCommandMarshaller {
looseMarshalCachedObject(wireFormat, (DataStructure)info.getProducerId(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getDestination(), dataOut);
looseMarshalObjectArray(wireFormat, info.getBrokerPath(), dataOut);
dataOut.writeBoolean(info.isDispatchAsync());
}
}

View File

@ -66,5 +66,6 @@ public class BrokerInfoTest extends BaseCommandTestSupport {
info.setFaultTolerantConfiguration(true);
info.setDuplexConnection(false);
info.setNetworkConnection(true);
info.setConnectionId(1);
}
}

View File

@ -60,5 +60,6 @@ public class ProducerInfoTest extends BaseCommandTestSupport {
}
info.setBrokerPath(value);
}
info.setDispatchAsync(true);
}
}