Author: chirino
Date: Tue Feb 21 02:08:38 2012
New Revision: 1291554
URL: http://svn.apache.org/viewvc?rev=1291554&view=rev
Log:
Better openwire config field names.
Modified:
activemq/activemq-apollo/trunk/apollo-broker/src/test/resources/log4j.properties
activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/OpenwireProtocolHandler.scala
activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/dto/OpenwireDTO.java
Modified:
activemq/activemq-apollo/trunk/apollo-broker/src/test/resources/log4j.properties
URL:
http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/test/resources/log4j.properties?rev=1291554&r1=1291553&r2=1291554&view=diff
==============================================================================
---
activemq/activemq-apollo/trunk/apollo-broker/src/test/resources/log4j.properties
(original)
+++
activemq/activemq-apollo/trunk/apollo-broker/src/test/resources/log4j.properties
Tue Feb 21 02:08:38 2012
@@ -19,7 +19,8 @@
# The logging properties used during tests..
#
log4j.rootLogger=WARN, console, file
-log4j.logger.org.apache.activemq=TRACE
+log4j.logger.org.apache.activemq=INFO
+# log4j.logger.org.apache.activemq=TRACE
# Console will only display warnnings
log4j.appender.console=org.apache.log4j.ConsoleAppender
Modified:
activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/OpenwireProtocolHandler.scala
URL:
http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/OpenwireProtocolHandler.scala?rev=1291554&r1=1291553&r2=1291554&view=diff
==============================================================================
---
activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/OpenwireProtocolHandler.scala
(original)
+++
activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/OpenwireProtocolHandler.scala
Tue Feb 21 02:08:38 2012
@@ -133,6 +133,10 @@ class OpenwireProtocolHandler extends Pr
rc
}
+ def buffer_size = {
+
MemoryPropertyEditor.parse(Option(config.buffer_size).getOrElse("640k")).toInt
+ }
+
override def set_connection(connection: BrokerConnection) = {
super.set_connection(connection)
import collection.JavaConversions._
@@ -145,15 +149,16 @@ class OpenwireProtocolHandler extends Pr
import OptionSupport._
preferred_wireformat_settings.setSizePrefixDisabled(false)
-
preferred_wireformat_settings.setCacheEnabled(config.cache_enabled.getOrElse(DEFAULT_WIREFORMAT_SETTINGS.isCacheEnabled))
+
preferred_wireformat_settings.setCacheEnabled(config.cache.getOrElse(DEFAULT_WIREFORMAT_SETTINGS.isCacheEnabled))
preferred_wireformat_settings.setVersion(config.version.getOrElse(DEFAULT_WIREFORMAT_SETTINGS.getVersion))
-
preferred_wireformat_settings.setStackTraceEnabled(config.stack_trace_enabled.getOrElse(DEFAULT_WIREFORMAT_SETTINGS.isStackTraceEnabled))
-
preferred_wireformat_settings.setCacheEnabled(config.cache_enabled.getOrElse(DEFAULT_WIREFORMAT_SETTINGS.isCacheEnabled))
-
preferred_wireformat_settings.setTightEncodingEnabled(config.tight_encoding_enabled.getOrElse(DEFAULT_WIREFORMAT_SETTINGS.isTightEncodingEnabled))
+
preferred_wireformat_settings.setStackTraceEnabled(config.stack_trace.getOrElse(DEFAULT_WIREFORMAT_SETTINGS.isStackTraceEnabled))
+
preferred_wireformat_settings.setCacheEnabled(config.cache.getOrElse(DEFAULT_WIREFORMAT_SETTINGS.isCacheEnabled))
+
preferred_wireformat_settings.setTightEncodingEnabled(config.tight_encoding.getOrElse(DEFAULT_WIREFORMAT_SETTINGS.isTightEncodingEnabled))
preferred_wireformat_settings.setMaxInactivityDuration(config.max_inactivity_duration.getOrElse(DEFAULT_WIREFORMAT_SETTINGS.getMaxInactivityDuration))
preferred_wireformat_settings.setMaxInactivityDurationInitalDelay(config.max_inactivity_duration_initial_delay.getOrElse(DEFAULT_WIREFORMAT_SETTINGS.getMaxInactivityDurationInitalDelay))
preferred_wireformat_settings.setCacheSize(config.cache_size.getOrElse(DEFAULT_WIREFORMAT_SETTINGS.getCacheSize))
preferred_wireformat_settings.setMaxFrameSize(config.max_frame_size.getOrElse(DEFAULT_WIREFORMAT_SETTINGS.getMaxFrameSize))
+
preferred_wireformat_settings.setTcpNoDelayEnabled(config.tcp_no_delay.getOrElse(DEFAULT_WIREFORMAT_SETTINGS.isTcpNoDelayEnabled))
}
@@ -615,7 +620,7 @@ class OpenwireProtocolHandler extends Pr
case class OpenwireDeliveryProducerRoute(addresses:Array[SimpleAddress])
extends DeliveryProducerRoute(host.router) {
- override def send_buffer_size = codec.getReadBufferSize
+ override def send_buffer_size = buffer_size
override def connection = Some(OpenwireProtocolHandler.this.connection)
override def dispatch_queue = queue
@@ -917,7 +922,7 @@ class OpenwireProtocolHandler extends Pr
override def connection = Some(OpenwireProtocolHandler.this.connection)
def is_persistent = false
- override def receive_buffer_size = codec.getWriteBufferSize*4
+ override def receive_buffer_size = buffer_size
def matches(delivery:Delivery) = {
if( delivery.message.protocol eq OpenwireProtocol ) {
@@ -935,7 +940,7 @@ class OpenwireProtocolHandler extends Pr
producer.dispatch_queue.assertExecuting()
retain
- val downstream = session_manager.open(producer.dispatch_queue,
receive_buffer_size)
+ val downstream = session_manager.open(producer.dispatch_queue,
buffer_size)
var closed = false
def consumer = ConsumerContext.this
Modified:
activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/dto/OpenwireDTO.java
URL:
http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/dto/OpenwireDTO.java?rev=1291554&r1=1291553&r2=1291554&view=diff
==============================================================================
---
activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/dto/OpenwireDTO.java
(original)
+++
activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/dto/OpenwireDTO.java
Tue Feb 21 02:08:38 2012
@@ -27,26 +27,26 @@ import javax.xml.bind.annotation.*;
@XmlAccessorType(XmlAccessType.FIELD)
public class OpenwireDTO extends ProtocolDTO {
- @XmlAttribute(name="max_data_length")
- public String max_data_length;
-
public Integer version;
- @XmlAttribute(name="stack_trace_enabled")
- public Boolean stack_trace_enabled;
- @XmlAttribute(name="cache_enabled")
- public Boolean cache_enabled;
+ @XmlAttribute(name="stack_trace")
+ public Boolean stack_trace;
+ @XmlAttribute(name="cache")
+ public Boolean cache;
@XmlAttribute(name="cache_size")
public Integer cache_size;
- @XmlAttribute(name="tight_encoding_enabled")
- public Boolean tight_encoding_enabled;
- @XmlAttribute(name="size_prefix_disabled")
- public Boolean size_prefix_disabled;
+ @XmlAttribute(name="tight_encoding")
+ public Boolean tight_encoding;
+ @XmlAttribute(name="tcp_no_delay")
+ public Boolean tcp_no_delay;
@XmlAttribute(name="max_inactivity_duration")
public Long max_inactivity_duration;
@XmlAttribute(name="max_inactivity_duration_initial_delay")
public Long max_inactivity_duration_initial_delay;
@XmlAttribute(name="max_frame_size")
public Long max_frame_size;
+ @XmlAttribute(name="buffer_size")
+ public String buffer_size;
+
@Override
public boolean equals(Object o) {
@@ -56,22 +56,22 @@ public class OpenwireDTO extends Protoco
OpenwireDTO that = (OpenwireDTO) o;
- if (cache_enabled != null ? !cache_enabled.equals(that.cache_enabled)
: that.cache_enabled != null)
+ if (cache != null ? !cache.equals(that.cache) : that.cache != null)
return false;
if (cache_size != null ? !cache_size.equals(that.cache_size) :
that.cache_size != null) return false;
- if (max_data_length != null ?
!max_data_length.equals(that.max_data_length) : that.max_data_length != null)
- return false;
if (max_frame_size != null ?
!max_frame_size.equals(that.max_frame_size) : that.max_frame_size != null)
return false;
if (max_inactivity_duration != null ?
!max_inactivity_duration.equals(that.max_inactivity_duration) :
that.max_inactivity_duration != null)
return false;
if (max_inactivity_duration_initial_delay != null ?
!max_inactivity_duration_initial_delay.equals(that.max_inactivity_duration_initial_delay)
: that.max_inactivity_duration_initial_delay != null)
return false;
- if (size_prefix_disabled != null ?
!size_prefix_disabled.equals(that.size_prefix_disabled) :
that.size_prefix_disabled != null)
+ if (tcp_no_delay != null ? !tcp_no_delay.equals(that.tcp_no_delay) :
that.tcp_no_delay != null)
+ return false;
+ if (stack_trace != null ? !stack_trace.equals(that.stack_trace) :
that.stack_trace != null)
return false;
- if (stack_trace_enabled != null ?
!stack_trace_enabled.equals(that.stack_trace_enabled) :
that.stack_trace_enabled != null)
+ if (tight_encoding != null ?
!tight_encoding.equals(that.tight_encoding) : that.tight_encoding != null)
return false;
- if (tight_encoding_enabled != null ?
!tight_encoding_enabled.equals(that.tight_encoding_enabled) :
that.tight_encoding_enabled != null)
+ if (buffer_size != null ? !buffer_size.equals(that.buffer_size) :
that.buffer_size != null)
return false;
if (version != null ? !version.equals(that.version) : that.version !=
null) return false;
@@ -81,16 +81,16 @@ public class OpenwireDTO extends Protoco
@Override
public int hashCode() {
int result = super.hashCode();
- result = 31 * result + (max_data_length != null ?
max_data_length.hashCode() : 0);
result = 31 * result + (version != null ? version.hashCode() : 0);
- result = 31 * result + (stack_trace_enabled != null ?
stack_trace_enabled.hashCode() : 0);
- result = 31 * result + (cache_enabled != null ?
cache_enabled.hashCode() : 0);
+ result = 31 * result + (stack_trace != null ? stack_trace.hashCode() :
0);
+ result = 31 * result + (cache != null ? cache.hashCode() : 0);
result = 31 * result + (cache_size != null ? cache_size.hashCode() :
0);
- result = 31 * result + (tight_encoding_enabled != null ?
tight_encoding_enabled.hashCode() : 0);
- result = 31 * result + (size_prefix_disabled != null ?
size_prefix_disabled.hashCode() : 0);
+ result = 31 * result + (tight_encoding != null ?
tight_encoding.hashCode() : 0);
+ result = 31 * result + (tcp_no_delay != null ? tcp_no_delay.hashCode()
: 0);
result = 31 * result + (max_inactivity_duration != null ?
max_inactivity_duration.hashCode() : 0);
result = 31 * result + (max_inactivity_duration_initial_delay != null
? max_inactivity_duration_initial_delay.hashCode() : 0);
result = 31 * result + (max_frame_size != null ?
max_frame_size.hashCode() : 0);
+ result = 31 * result + (buffer_size != null ? buffer_size.hashCode() :
0);
return result;
}
}