You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2011/06/11 00:25:39 UTC

svn commit: r1134466 - in /activemq/activemq-apollo/trunk: apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/dto/ apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/ apollo-broker/src/main/scala/org/apache/activemq/apoll...

Author: chirino
Date: Fri Jun 10 22:25:39 2011
New Revision: 1134466

URL: http://svn.apache.org/viewvc?rev=1134466&view=rev
Log:
Further work to support https://issues.apache.org/jira/browse/APLO-39 : we now handle web admin updates, store updates, and connector updates.

Modified:
    activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/dto/BDBStoreDTO.java
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Connector.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Router.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/VirtualHost.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jetty/JettyWebServer.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/web/WebServerFactory.scala
    activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/AddUserHeaderDTO.java
    activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ConnectorAclDTO.java
    activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ConnectorDTO.java
    activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/NullStoreDTO.java
    activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ProtocolDTO.java
    activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/StoreDTO.java
    activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/WebAdminDTO.java
    activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/scala/org/apache/activemq/apollo/broker/store/hawtdb/dto/HawtDBStoreDTO.java
    activemq/activemq-apollo/trunk/apollo-jdbm2/src/main/scala/org/apache/activemq/apollo/broker/store/jdbm2/dto/JDBM2StoreDTO.java
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/dto/StompDTO.java
    activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/osgi/OsgiWebServerFactory.scala

Modified: activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/dto/BDBStoreDTO.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/dto/BDBStoreDTO.java?rev=1134466&r1=1134465&r2=1134466&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/dto/BDBStoreDTO.java (original)
+++ activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/dto/BDBStoreDTO.java Fri Jun 10 22:25:39 2011
@@ -40,5 +40,27 @@ public class BDBStoreDTO extends StoreDT
     @XmlAttribute(name="zero_copy")
     public Boolean zero_copy;
 
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+        if (!super.equals(o)) return false;
 
+        BDBStoreDTO that = (BDBStoreDTO) o;
+
+        if (directory != null ? !directory.equals(that.directory) : that.directory != null) return false;
+        if (read_threads != null ? !read_threads.equals(that.read_threads) : that.read_threads != null) return false;
+        if (zero_copy != null ? !zero_copy.equals(that.zero_copy) : that.zero_copy != null) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = super.hashCode();
+        result = 31 * result + (directory != null ? directory.hashCode() : 0);
+        result = 31 * result + (read_threads != null ? read_threads.hashCode() : 0);
+        result = 31 * result + (zero_copy != null ? zero_copy.hashCode() : 0);
+        return result;
+    }
 }

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala?rev=1134466&r1=1134465&r2=1134466&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala Fri Jun 10 22:25:39 2011
@@ -422,10 +422,7 @@ class Broker() extends BaseService {
 
     if( !config.web_admins.isEmpty ) {
       if ( web_server!=null ) {
-        val task = tracker.task("restart: "+web_server)
-        web_server.stop(^{
-          web_server.start(task)
-        })
+        web_server.update(tracker.task("update: "+web_server))
       } else {
         web_server = WebServerFactory.create(this)
         if (web_server==null) {

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Connector.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Connector.scala?rev=1134466&r1=1134465&r2=1134466&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Connector.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Connector.scala Fri Jun 10 22:25:39 2011
@@ -111,18 +111,26 @@ class AcceptingConnector(val broker:Brok
 
   /**
    */
-  def update(config: ConnectorDTO, on_completed:Runnable) = {
-    dispatch_queue.assertExecuting()
-    this.config = config
-    if( service_state.is_started ) {
-
+  def update(config: ConnectorDTO, on_completed:Runnable) = dispatch_queue {
+    if ( !service_state.is_started || this.config == config ) {
+      this.config = config
+      on_completed.run
+    } else {
+      // if the connector config is updated.. lets stop, apply config, then restart
+      // the connector.
+      stop(^{
+        this.config = config
+        start(on_completed)
+      })
     }
-    on_completed.run
   }
 
 
   override def _start(on_completed:Runnable) = {
     assert(config!=null, "Connector must be configured before it is started.")
+
+    accepted.set(0)
+    connected.set(0)
     protocol = ProtocolFactory.get(config.protocol.getOrElse("any")).get
     transport_server = TransportFactory.bind( config.bind )
     transport_server.setDispatchQueue(dispatch_queue)
@@ -146,6 +154,8 @@ class AcceptingConnector(val broker:Brok
   override def _stop(on_completed:Runnable): Unit = {
     transport_server.stop(^{
       broker.console_log.info("Stopped connector at: "+config.bind)
+      transport_server = null
+      protocol = null
       on_completed.run
     })
   }

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala?rev=1134466&r1=1134465&r2=1134466&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala Fri Jun 10 22:25:39 2011
@@ -914,4 +914,8 @@ class LocalRouter(val virtual_host:Virtu
     })
   }
 
+  def apply_update(on_completed:Runnable) = {
+    // TODO: check to see if any of the destination configs need updating.
+    on_completed.run()
+  }
 }
\ No newline at end of file

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Router.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Router.scala?rev=1134466&r1=1134465&r2=1134466&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Router.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Router.scala Fri Jun 10 22:25:39 2011
@@ -42,6 +42,7 @@ trait Router extends Service {
 
   def disconnect(destinations:Array[DestinationDTO], producer:BindableDeliveryProducer)
 
+  def apply_update(on_completed:Runnable):Unit
 }
 
 /**

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=1134466&r1=1134465&r2=1134466&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 Fri Jun 10 22:25:39 2011
@@ -70,15 +70,27 @@ class VirtualHost(val broker: Broker, va
   /**
    * Validates and then applies the configuration.
    */
-  def update(config: VirtualHostDTO, on_completed:Runnable) = dispatch_queue{
-    this.config = config
+  def update(config: VirtualHostDTO, on_completed:Runnable) = dispatch_queue {
+    if ( !service_state.is_started ) {
+      this.config = config
+      on_completed.run
+    } else {
 
-    if( service_state.is_started ) {
+      // in some cases we have to restart the virtual host..
+      if( config.store != this.config.store || config.router != this.config.router) {
+        stop(^{
+          this.config = config
+          start(on_completed)
+        })
+      } else {
+        this.config = config
+        apply_update
+        this.router.apply_update(on_completed)
+      }
     }
   }
 
-  override protected def _start(on_completed:Runnable):Unit = {
-
+  def apply_update:Unit = {
     // Configure the logging categories...
     val log_category = config.log_category.getOrElse(new LogCategoryDTO)
     security_log = Option(log_category.security).map(Log(_)).getOrElse(broker.security_log)
@@ -86,10 +98,8 @@ class VirtualHost(val broker: Broker, va
     connection_log = Option(log_category.connection).map(Log(_)).getOrElse(broker.connection_log)
     console_log = Option(log_category.console).map(Log(_)).getOrElse(broker.console_log)
 
-    val tracker = new LoggingTracker("virtual host startup", console_log, dispatch_queue)
-
-    if( config.authentication != null ) {
-      if( config.authentication.enabled.getOrElse(true) ) {
+    if (config.authentication != null) {
+      if (config.authentication.enabled.getOrElse(true)) {
         // Virtual host has it's own settings.
         authenticator = new JaasAuthenticator(config.authentication, security_log)
         authorizer = new AclAuthorizer(config.authentication.acl_principal_kinds().toList, security_log)
@@ -104,9 +114,16 @@ class VirtualHost(val broker: Broker, va
       authorizer = broker.authorizer
     }
 
+  }
+
+  override protected def _start(on_completed:Runnable):Unit = {
+
+    apply_update
+
     router = RouterFactory.create(this)
     store = StoreFactory.create(config.store)
 
+    val tracker = new LoggingTracker("virtual host startup", console_log, dispatch_queue)
     if( store!=null ) {
       val task = tracker.task("store startup")
       console_log.info("Starting store: "+store)

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jetty/JettyWebServer.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jetty/JettyWebServer.scala?rev=1134466&r1=1134465&r2=1134466&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jetty/JettyWebServer.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jetty/JettyWebServer.scala Fri Jun 10 22:25:39 2011
@@ -31,6 +31,7 @@ import collection.mutable.HashMap
 import org.eclipse.jetty.server.ssl.SslSelectChannelConnector
 import javax.net.ssl.SSLContext
 import org.eclipse.jetty.util.thread.ExecutorThreadPool
+import org.apache.activemq.apollo.dto.WebAdminDTO
 
 /**
  * <p>
@@ -133,6 +134,7 @@ class JettyWebServer(val broker:Broker) 
   override def toString: String = "jetty webserver"
 
   val dispatch_queue = createQueue()
+  var web_admins = List[WebAdminDTO]()
 
   protected def _start(on_completed: Runnable) = Broker.BLOCKABLE_THREAD_POOL {
     this.synchronized {
@@ -152,7 +154,8 @@ class JettyWebServer(val broker:Broker) 
       val contexts = HashMap[String, Handler]()
       val connectors = HashMap[String, Connector]()
 
-      config.web_admins.foreach { web_admin =>
+      web_admins = config.web_admins.toList
+      web_admins.foreach { web_admin =>
 
         val bind = web_admin.bind.getOrElse("http://127.0.0.1:61680")
         val bind_uri = new URI(bind)
@@ -245,4 +248,16 @@ class JettyWebServer(val broker:Broker) 
     }
   }
 
+  def update(on_complete: Runnable) = dispatch_queue {
+    import collection.JavaConversions._
+    val new_list = broker.config.web_admins.toList
+    if( new_list != web_admins ) {
+      // restart to pickup the changes.
+      stop(^{
+        start(on_complete)
+      })
+    } else {
+      on_complete.run()
+    }
+  }
 }
\ No newline at end of file

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/web/WebServerFactory.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/web/WebServerFactory.scala?rev=1134466&r1=1134465&r2=1134466&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/web/WebServerFactory.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/web/WebServerFactory.scala Fri Jun 10 22:25:39 2011
@@ -25,7 +25,9 @@ import org.apache.activemq.apollo.broker
  *
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
-trait WebServer extends Service
+trait WebServer extends Service {
+  def update(on_complete:Runnable):Unit
+}
 
 /**
  * <p>

Modified: activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/AddUserHeaderDTO.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/AddUserHeaderDTO.java?rev=1134466&r1=1134465&r2=1134466&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/AddUserHeaderDTO.java (original)
+++ activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/AddUserHeaderDTO.java Fri Jun 10 22:25:39 2011
@@ -54,4 +54,25 @@ public class AddUserHeaderDTO {
     @XmlAttribute(name="kind")
     public String kind;
 
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (!(o instanceof AddUserHeaderDTO)) return false;
+
+        AddUserHeaderDTO that = (AddUserHeaderDTO) o;
+
+        if (kind != null ? !kind.equals(that.kind) : that.kind != null) return false;
+        if (name != null ? !name.equals(that.name) : that.name != null) return false;
+        if (separator != null ? !separator.equals(that.separator) : that.separator != null) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = name != null ? name.hashCode() : 0;
+        result = 31 * result + (separator != null ? separator.hashCode() : 0);
+        result = 31 * result + (kind != null ? kind.hashCode() : 0);
+        return result;
+    }
 }

Modified: activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ConnectorAclDTO.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ConnectorAclDTO.java?rev=1134466&r1=1134465&r2=1134466&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ConnectorAclDTO.java (original)
+++ activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ConnectorAclDTO.java Fri Jun 10 22:25:39 2011
@@ -36,4 +36,20 @@ public class ConnectorAclDTO {
     @XmlElement(name="connect")
     public List<PrincipalDTO> connects = new ArrayList<PrincipalDTO>();
 
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (!(o instanceof ConnectorAclDTO)) return false;
+
+        ConnectorAclDTO that = (ConnectorAclDTO) o;
+
+        if (connects != null ? !connects.equals(that.connects) : that.connects != null) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        return connects != null ? connects.hashCode() : 0;
+    }
 }

Modified: activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ConnectorDTO.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ConnectorDTO.java?rev=1134466&r1=1134465&r2=1134466&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ConnectorDTO.java (original)
+++ activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ConnectorDTO.java Fri Jun 10 22:25:39 2011
@@ -54,4 +54,30 @@ public class ConnectorDTO extends Servic
     @XmlElement(name="acl")
     public ConnectorAclDTO acl;
 
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (!(o instanceof ConnectorDTO)) return false;
+
+        ConnectorDTO that = (ConnectorDTO) o;
+
+        if (acl != null ? !acl.equals(that.acl) : that.acl != null) return false;
+        if (bind != null ? !bind.equals(that.bind) : that.bind != null) return false;
+        if (connection_limit != null ? !connection_limit.equals(that.connection_limit) : that.connection_limit != null)
+            return false;
+        if (protocol != null ? !protocol.equals(that.protocol) : that.protocol != null) return false;
+        if (protocols != null ? !protocols.equals(that.protocols) : that.protocols != null) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = bind != null ? bind.hashCode() : 0;
+        result = 31 * result + (protocol != null ? protocol.hashCode() : 0);
+        result = 31 * result + (connection_limit != null ? connection_limit.hashCode() : 0);
+        result = 31 * result + (protocols != null ? protocols.hashCode() : 0);
+        result = 31 * result + (acl != null ? acl.hashCode() : 0);
+        return result;
+    }
 }
\ No newline at end of file

Modified: activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/NullStoreDTO.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/NullStoreDTO.java?rev=1134466&r1=1134465&r2=1134466&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/NullStoreDTO.java (original)
+++ activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/NullStoreDTO.java Fri Jun 10 22:25:39 2011
@@ -29,5 +29,19 @@ import javax.xml.bind.annotation.XmlRoot
  */
 @XmlRootElement(name="null_store")
 @XmlAccessorType(XmlAccessType.FIELD)
+
 public class NullStoreDTO extends StoreDTO {
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (!(o instanceof NullStoreDTO)) return false;
+        if (!super.equals(o)) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        return 32;
+    }
 }

Modified: activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ProtocolDTO.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ProtocolDTO.java?rev=1134466&r1=1134465&r2=1134466&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ProtocolDTO.java (original)
+++ activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ProtocolDTO.java Fri Jun 10 22:25:39 2011
@@ -28,4 +28,16 @@ import javax.xml.bind.annotation.*;
 @XmlRootElement(name="protocol")
 @XmlAccessorType(XmlAccessType.FIELD)
 public class ProtocolDTO {
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (!(o instanceof ProtocolDTO)) return false;
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        return 31;
+    }
 }

Modified: activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/StoreDTO.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/StoreDTO.java?rev=1134466&r1=1134465&r2=1134466&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/StoreDTO.java (original)
+++ activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/StoreDTO.java Fri Jun 10 22:25:39 2011
@@ -38,5 +38,21 @@ public abstract class StoreDTO {
     @XmlAttribute(name="flush_delay", required=false)
     public Long flush_delay;
 
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (!(o instanceof StoreDTO)) return false;
 
+        StoreDTO storeDTO = (StoreDTO) o;
+
+        if (flush_delay != null ? !flush_delay.equals(storeDTO.flush_delay) : storeDTO.flush_delay != null)
+            return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        return flush_delay != null ? flush_delay.hashCode() : 0;
+    }
 }

Modified: activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/WebAdminDTO.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/WebAdminDTO.java?rev=1134466&r1=1134465&r2=1134466&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/WebAdminDTO.java (original)
+++ activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/WebAdminDTO.java Fri Jun 10 22:25:39 2011
@@ -35,4 +35,20 @@ public class WebAdminDTO {
     @XmlAttribute
     public String bind;
 
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (!(o instanceof WebAdminDTO)) return false;
+
+        WebAdminDTO that = (WebAdminDTO) o;
+
+        if (bind != null ? !bind.equals(that.bind) : that.bind != null) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        return bind != null ? bind.hashCode() : 0;
+    }
 }

Modified: activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/scala/org/apache/activemq/apollo/broker/store/hawtdb/dto/HawtDBStoreDTO.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/scala/org/apache/activemq/apollo/broker/store/hawtdb/dto/HawtDBStoreDTO.java?rev=1134466&r1=1134465&r2=1134466&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/scala/org/apache/activemq/apollo/broker/store/hawtdb/dto/HawtDBStoreDTO.java (original)
+++ activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/scala/org/apache/activemq/apollo/broker/store/hawtdb/dto/HawtDBStoreDTO.java Fri Jun 10 22:25:39 2011
@@ -58,5 +58,47 @@ public class HawtDBStoreDTO extends Stor
     @XmlAttribute(name="fail_if_locked")
     public Boolean fail_if_locked;
 
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+        if (!super.equals(o)) return false;
 
+        HawtDBStoreDTO that = (HawtDBStoreDTO) o;
+
+        if (archive_directory != null ? !archive_directory.equals(that.archive_directory) : that.archive_directory != null)
+            return false;
+        if (cleanup_interval != null ? !cleanup_interval.equals(that.cleanup_interval) : that.cleanup_interval != null)
+            return false;
+        if (directory != null ? !directory.equals(that.directory) : that.directory != null) return false;
+        if (fail_if_locked != null ? !fail_if_locked.equals(that.fail_if_locked) : that.fail_if_locked != null)
+            return false;
+        if (index_cache_size != null ? !index_cache_size.equals(that.index_cache_size) : that.index_cache_size != null)
+            return false;
+        if (index_flush_interval != null ? !index_flush_interval.equals(that.index_flush_interval) : that.index_flush_interval != null)
+            return false;
+        if (index_page_size != null ? !index_page_size.equals(that.index_page_size) : that.index_page_size != null)
+            return false;
+        if (journal_batch_size != null ? !journal_batch_size.equals(that.journal_batch_size) : that.journal_batch_size != null)
+            return false;
+        if (journal_log_size != null ? !journal_log_size.equals(that.journal_log_size) : that.journal_log_size != null)
+            return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = super.hashCode();
+        result = 31 * result + (directory != null ? directory.hashCode() : 0);
+        result = 31 * result + (archive_directory != null ? archive_directory.hashCode() : 0);
+        result = 31 * result + (index_flush_interval != null ? index_flush_interval.hashCode() : 0);
+        result = 31 * result + (cleanup_interval != null ? cleanup_interval.hashCode() : 0);
+        result = 31 * result + (journal_log_size != null ? journal_log_size.hashCode() : 0);
+        result = 31 * result + (journal_batch_size != null ? journal_batch_size.hashCode() : 0);
+        result = 31 * result + (index_cache_size != null ? index_cache_size.hashCode() : 0);
+        result = 31 * result + (index_page_size != null ? index_page_size.hashCode() : 0);
+        result = 31 * result + (fail_if_locked != null ? fail_if_locked.hashCode() : 0);
+        return result;
+    }
 }

Modified: activemq/activemq-apollo/trunk/apollo-jdbm2/src/main/scala/org/apache/activemq/apollo/broker/store/jdbm2/dto/JDBM2StoreDTO.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-jdbm2/src/main/scala/org/apache/activemq/apollo/broker/store/jdbm2/dto/JDBM2StoreDTO.java?rev=1134466&r1=1134465&r2=1134466&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-jdbm2/src/main/scala/org/apache/activemq/apollo/broker/store/jdbm2/dto/JDBM2StoreDTO.java (original)
+++ activemq/activemq-apollo/trunk/apollo-jdbm2/src/main/scala/org/apache/activemq/apollo/broker/store/jdbm2/dto/JDBM2StoreDTO.java Fri Jun 10 22:25:39 2011
@@ -39,4 +39,29 @@ public class JDBM2StoreDTO extends Store
 
     @XmlAttribute(name="zero_copy")
     public Boolean zero_copy;
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+        if (!super.equals(o)) return false;
+
+        JDBM2StoreDTO that = (JDBM2StoreDTO) o;
+
+        if (compact_interval != null ? !compact_interval.equals(that.compact_interval) : that.compact_interval != null)
+            return false;
+        if (directory != null ? !directory.equals(that.directory) : that.directory != null) return false;
+        if (zero_copy != null ? !zero_copy.equals(that.zero_copy) : that.zero_copy != null) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = super.hashCode();
+        result = 31 * result + (directory != null ? directory.hashCode() : 0);
+        result = 31 * result + (compact_interval != null ? compact_interval.hashCode() : 0);
+        result = 31 * result + (zero_copy != null ? zero_copy.hashCode() : 0);
+        return result;
+    }
 }

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=1134466&r1=1134465&r2=1134466&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 Fri Jun 10 22:25:39 2011
@@ -74,4 +74,56 @@ public class StompDTO extends ProtocolDT
     @XmlAttribute(name="any_descendant_wildcard")
     public String any_descendant_wildcard;
 
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (!(o instanceof StompDTO)) return false;
+
+        StompDTO stompDTO = (StompDTO) o;
+
+        if (add_user_header != null ? !add_user_header.equals(stompDTO.add_user_header) : stompDTO.add_user_header != null)
+            return false;
+        if (add_user_headers != null ? !add_user_headers.equals(stompDTO.add_user_headers) : stompDTO.add_user_headers != null)
+            return false;
+        if (any_child_wildcard != null ? !any_child_wildcard.equals(stompDTO.any_child_wildcard) : stompDTO.any_child_wildcard != null)
+            return false;
+        if (any_descendant_wildcard != null ? !any_descendant_wildcard.equals(stompDTO.any_descendant_wildcard) : stompDTO.any_descendant_wildcard != null)
+            return false;
+        if (destination_separator != null ? !destination_separator.equals(stompDTO.destination_separator) : stompDTO.destination_separator != null)
+            return false;
+        if (max_data_length != null ? !max_data_length.equals(stompDTO.max_data_length) : stompDTO.max_data_length != null)
+            return false;
+        if (max_header_length != null ? !max_header_length.equals(stompDTO.max_header_length) : stompDTO.max_header_length != null)
+            return false;
+        if (max_headers != null ? !max_headers.equals(stompDTO.max_headers) : stompDTO.max_headers != null)
+            return false;
+        if (path_separator != null ? !path_separator.equals(stompDTO.path_separator) : stompDTO.path_separator != null)
+            return false;
+        if (protocol_filters != null ? !protocol_filters.equals(stompDTO.protocol_filters) : stompDTO.protocol_filters != null)
+            return false;
+        if (queue_prefix != null ? !queue_prefix.equals(stompDTO.queue_prefix) : stompDTO.queue_prefix != null)
+            return false;
+        if (topic_prefix != null ? !topic_prefix.equals(stompDTO.topic_prefix) : stompDTO.topic_prefix != null)
+            return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = add_user_header != null ? add_user_header.hashCode() : 0;
+        result = 31 * result + (add_user_headers != null ? add_user_headers.hashCode() : 0);
+        result = 31 * result + (max_header_length != null ? max_header_length.hashCode() : 0);
+        result = 31 * result + (max_headers != null ? max_headers.hashCode() : 0);
+        result = 31 * result + (max_data_length != null ? max_data_length.hashCode() : 0);
+        result = 31 * result + (protocol_filters != null ? protocol_filters.hashCode() : 0);
+        result = 31 * result + (queue_prefix != null ? queue_prefix.hashCode() : 0);
+        result = 31 * result + (topic_prefix != null ? topic_prefix.hashCode() : 0);
+        result = 31 * result + (destination_separator != null ? destination_separator.hashCode() : 0);
+        result = 31 * result + (path_separator != null ? path_separator.hashCode() : 0);
+        result = 31 * result + (any_child_wildcard != null ? any_child_wildcard.hashCode() : 0);
+        result = 31 * result + (any_descendant_wildcard != null ? any_descendant_wildcard.hashCode() : 0);
+        return result;
+    }
 }

Modified: activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/osgi/OsgiWebServerFactory.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/osgi/OsgiWebServerFactory.scala?rev=1134466&r1=1134465&r2=1134466&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/osgi/OsgiWebServerFactory.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/osgi/OsgiWebServerFactory.scala Fri Jun 10 22:25:39 2011
@@ -53,6 +53,10 @@ class OsgiWebServerFactory  extends WebS
         onComplete.run
       }
 
+      def update(on_complete: Runnable) = {
+        on_complete.run()
+      }
+
     }
   }
 }
\ No newline at end of file