Author: chirino
Date: Tue Jan 17 20:36:54 2012
New Revision: 1232563
URL: http://svn.apache.org/viewvc?rev=1232563&view=rev
Log:
Finish up APLO-118: All configuration attributes which configure memory/disk
usage sizes should support values like "1k" "2G" etc.
Modified:
activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/VirtualHost.scala
activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/VirtualHostDTO.java
activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/dto/OpenwireDTO.java
activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala
activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/dto/StompDTO.java
Modified:
activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/VirtualHost.scala
URL:
http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/VirtualHost.scala?rev=1232563&r1=1232562&r2=1232563&view=diff
==============================================================================
---
activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/VirtualHost.scala
(original)
+++
activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/VirtualHost.scala
Tue Jan 17 20:36:54 2012
@@ -171,7 +171,7 @@ class VirtualHost(val broker: Broker, va
override protected def _start(on_completed:Runnable):Unit = {
apply_update
- if ( config.heap_bypass.getOrElse(0) > 0 ) {
+ if (
Option(config.heap_bypass).map(MemoryPropertyEditor.parse(_).toInt).getOrElse(0)
> 0 ) {
import org.apache.activemq.apollo.util.FileSupport._
val tmp_dir = broker.tmp / "heapbypass" / id
tmp_dir.recursive_delete
Modified:
activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/VirtualHostDTO.java
URL:
http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/VirtualHostDTO.java?rev=1232563&r1=1232562&r2=1232563&view=diff
==============================================================================
---
activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/VirtualHostDTO.java
(original)
+++
activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/VirtualHostDTO.java
Tue Jan 17 20:36:54 2012
@@ -88,7 +88,7 @@ public class VirtualHostDTO extends Serv
* setting on the JVM heap. They will be held in temp files until
consumed or persisted
*/
@XmlElement(name="heap_bypass")
- public Integer heap_bypass;
+ public String heap_bypass;
/**
* To hold any other non-matching XML elements
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=1232563&r1=1232562&r2=1232563&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 Jan 17 20:36:54 2012
@@ -28,7 +28,7 @@ import javax.xml.bind.annotation.*;
public class OpenwireDTO extends ProtocolDTO {
@XmlAttribute(name="max_data_length")
- public Integer max_data_length;
+ public String max_data_length;
@XmlAttribute(name="destination_separator")
public String destination_separator;
Modified:
activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala
URL:
http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala?rev=1232563&r1=1232562&r2=1232563&view=diff
==============================================================================
---
activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala
(original)
+++
activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala
Tue Jan 17 20:36:54 2012
@@ -593,8 +593,8 @@ class StompProtocolHandler extends Proto
protocol_filters =
ProtocolFilter.create_filters(config.protocol_filters.toList, this)
import OptionSupport._
- config.max_data_length.foreach( codec.max_data_length = _ )
- config.max_header_length.foreach( codec.max_header_length = _ )
+ Option(config.max_data_length).map(MemoryPropertyEditor.parse(_)).foreach(
codec.max_data_length = _ )
+
Option(config.max_header_length).map(MemoryPropertyEditor.parse(_)).foreach(
codec.max_header_length = _ )
config.max_headers.foreach( codec.max_headers = _ )
if( config.queue_prefix!=null ||
Modified:
activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/dto/StompDTO.java
URL:
http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/dto/StompDTO.java?rev=1232563&r1=1232562&r2=1232563&view=diff
==============================================================================
---
activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/dto/StompDTO.java
(original)
+++
activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/dto/StompDTO.java
Tue Jan 17 20:36:54 2012
@@ -57,13 +57,13 @@ public class StompDTO extends ProtocolDT
public String add_redeliveries_header;
@XmlAttribute(name="max_header_length")
- public Integer max_header_length;
+ public String max_header_length;
@XmlAttribute(name="max_headers")
public Integer max_headers;
@XmlAttribute(name="max_data_length")
- public Integer max_data_length;
+ public String max_data_length;
/**
* A broker accepts connections via it's configured connectors.