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 2012/09/06 19:15:08 UTC
svn commit: r1381682 - in /activemq/activemq-apollo/trunk:
apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala
apollo-util/src/main/scala/org/apache/activemq/apollo/util/BaseService.scala
Author: chirino
Date: Thu Sep 6 17:15:07 2012
New Revision: 1381682
URL: http://svn.apache.org/viewvc?rev=1381682&view=rev
Log:
Fixes: APLO-258 - EmbeddedBroker example fails to compile
Modified:
activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala
activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/BaseService.scala
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=1381682&r1=1381681&r2=1381682&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 Thu Sep 6 17:15:07 2012
@@ -336,10 +336,17 @@ class Broker() extends BaseService with
def resource_kind = SecuredResource.BrokerKind
+ // Also provide Runnable based interfaces so that it's easier to use from Java.
+ def update(config: BrokerDTO, on_completed:Runnable):Unit = update(config, new TaskWrapper(on_completed))
+ def start(on_completed:Runnable):Unit = super.start(new TaskWrapper(on_completed))
+ def stop(on_completed:Runnable):Unit = super.stop(new TaskWrapper(on_completed))
+ override def start(on_completed:Task):Unit = super.start(on_completed)
+ override def stop(on_completed:Task):Unit = super.stop(on_completed)
+
/**
* Validates and then applies the configuration.
*/
- def update(config: BrokerDTO, on_completed:Task) = dispatch_queue {
+ def update(config: BrokerDTO, on_completed:Task):Unit = dispatch_queue {
dispatch_queue.assertExecuting()
this.config = config
Modified: activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/BaseService.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/BaseService.scala?rev=1381682&r1=1381681&r2=1381682&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/BaseService.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/BaseService.scala Thu Sep 6 17:15:07 2012
@@ -70,7 +70,7 @@ trait BaseService extends Service with D
private val pending_actions = ListBuffer[Task]()
- final def start(on_completed:Task):Unit = {
+ def start(on_completed:Task):Unit = {
def start_task:Task = ^{
def done = {
pending_actions.foreach(dispatch_queue.execute _)
@@ -118,7 +118,7 @@ trait BaseService extends Service with D
start_task >>: dispatch_queue
}
- final def stop(on_completed:Task):Unit = {
+ def stop(on_completed:Task):Unit = {
def stop_task:Task = ^{
def done = {
val tmp = pending_actions.toArray