diff --git a/akka-amqp/src/main/scala/AMQP.scala b/akka-amqp/src/main/scala/AMQP.scala index 4ac0be82d9..3dcef18a44 100644 --- a/akka-amqp/src/main/scala/AMQP.scala +++ b/akka-amqp/src/main/scala/AMQP.scala @@ -80,7 +80,7 @@ object AMQP { class AMQPSupervisor extends Actor with Logging { import scala.collection.JavaConversions._ import self._ - + private val connections = new ConcurrentHashMap[ActorRef, ActorRef] self.faultHandler = Some(OneForOneStrategy(5, 5000)) @@ -364,7 +364,7 @@ object AMQP { import scala.collection.JavaConversions._ import self._ - + faultHandler = Some(OneForOneStrategy(5, 5000)) trapExit = List(classOf[Throwable]) diff --git a/akka-amqp/src/main/scala/ExampleSession.scala b/akka-amqp/src/main/scala/ExampleSession.scala index 119ae07a07..d2fffd2ae1 100644 --- a/akka-amqp/src/main/scala/ExampleSession.scala +++ b/akka-amqp/src/main/scala/ExampleSession.scala @@ -22,7 +22,7 @@ object ExampleSession { direct Thread.sleep(1000) - + println("==== FANOUT ===") fanout } @@ -47,4 +47,4 @@ object ExampleSession { val producer = AMQP.newProducer(CONFIG, HOSTNAME, PORT, CHAT, None, None, 100) producer ! Message("@jonas_boner: I'm going surfing".getBytes, "") } -} \ No newline at end of file +} diff --git a/akka-camel/src/main/scala/CamelContextLifecycle.scala b/akka-camel/src/main/scala/CamelContextLifecycle.scala index 95304b1a6f..9aee8f5a1d 100644 --- a/akka-camel/src/main/scala/CamelContextLifecycle.scala +++ b/akka-camel/src/main/scala/CamelContextLifecycle.scala @@ -11,7 +11,7 @@ import se.scalablesolutions.akka.util.Logging /** * Defines the lifecycle of a CamelContext. Allowed state transitions are - * init -> start -> stop -> init -> ... etc. + * init -> start -> stop -> init -> ... etc. * * @author Martin Krasser */ @@ -95,4 +95,4 @@ trait CamelContextLifecycle extends Logging { object CamelContextManager extends CamelContextLifecycle { override def context: CamelContext = super.context override def template: ProducerTemplate = super.template -} \ No newline at end of file +} diff --git a/akka-camel/src/main/scala/Consumer.scala b/akka-camel/src/main/scala/Consumer.scala index 27ec98b25d..caafca4628 100644 --- a/akka-camel/src/main/scala/Consumer.scala +++ b/akka-camel/src/main/scala/Consumer.scala @@ -17,4 +17,4 @@ trait Consumer { self: Actor => * Returns the Camel endpoint URI to consume messages from. */ def endpointUri: String -} \ No newline at end of file +} diff --git a/akka-camel/src/main/scala/Message.scala b/akka-camel/src/main/scala/Message.scala index a4231978ec..ec382df0c9 100644 --- a/akka-camel/src/main/scala/Message.scala +++ b/akka-camel/src/main/scala/Message.scala @@ -23,7 +23,7 @@ case class Message(val body: Any, val headers: Map[String, Any] = Map.empty) { * * @see CamelContextManager. */ - @deprecated("use bodyAs[T](implicit m: Manifest[T]): T instead") + @deprecated("use bodyAs[T](implicit m: Manifest[T]): T instead") def bodyAs[T](clazz: Class[T]): T = CamelContextManager.context.getTypeConverter.mandatoryConvertTo[T](clazz, body) @@ -53,7 +53,7 @@ case class Message(val body: Any, val headers: Map[String, Any] = Map.empty) { * * @see Message#bodyAs(Class) */ - @deprecated("use setBodyAs[T](implicit m: Manifest[T]): Message instead") + @deprecated("use setBodyAs[T](implicit m: Manifest[T]): Message instead") def setBodyAs[T](clazz: Class[T]): Message = setBody(bodyAs(clazz)) /** @@ -200,7 +200,7 @@ class CamelExchangeAdapter(exchange: Exchange) { * * @see Failure */ - def toFailureMessage(headers: Map[String, Any]): Failure = + def toFailureMessage(headers: Map[String, Any]): Failure = Failure(exchange.getException, headers ++ responseMessage.toMessage.headers) private def requestMessage = exchange.getIn @@ -246,19 +246,19 @@ class CamelMessageAdapter(val cm: CamelMessage) { /** * Defines conversion methods to CamelExchangeAdapter and CamelMessageAdapter. * Imported by applications - * that implicitly want to use conversion methods of CamelExchangeAdapter and CamelMessageAdapter. + * that implicitly want to use conversion methods of CamelExchangeAdapter and CamelMessageAdapter. */ object CamelMessageConversion { - + /** * Creates an CamelExchangeAdapter for the given Camel exchange. */ - implicit def toExchangeAdapter(ce: Exchange): CamelExchangeAdapter = + implicit def toExchangeAdapter(ce: Exchange): CamelExchangeAdapter = new CamelExchangeAdapter(ce) /** * Creates an CamelMessageAdapter for the given Camel message. */ - implicit def toMessageAdapter(cm: CamelMessage): CamelMessageAdapter = + implicit def toMessageAdapter(cm: CamelMessage): CamelMessageAdapter = new CamelMessageAdapter(cm) -} \ No newline at end of file +} diff --git a/akka-camel/src/main/scala/Producer.scala b/akka-camel/src/main/scala/Producer.scala index 72fd88658f..634cf60b3d 100644 --- a/akka-camel/src/main/scala/Producer.scala +++ b/akka-camel/src/main/scala/Producer.scala @@ -20,7 +20,7 @@ import se.scalablesolutions.akka.util.Logging * @author Martin Krasser */ trait Producer { this: Actor => - + private val headersToCopyDefault = Set(Message.MessageExchangeId) /** @@ -162,7 +162,7 @@ trait Producer { this: Actor => */ class ProducerResponseSender( headers: Map[String, Any], - sender: Option[ActorRef], + sender: Option[ActorRef], senderFuture: Option[CompletableFuture[Any]], producer: Actor) extends Synchronization with Logging { diff --git a/akka-camel/src/main/scala/component/ActorComponent.scala b/akka-camel/src/main/scala/component/ActorComponent.scala index 9bd543e830..e80595515e 100644 --- a/akka-camel/src/main/scala/component/ActorComponent.scala +++ b/akka-camel/src/main/scala/component/ActorComponent.scala @@ -27,7 +27,7 @@ class ActorComponent extends DefaultComponent { val idAndUuid = idAndUuidPair(remaining) new ActorEndpoint(uri, this, idAndUuid._1, idAndUuid._2) } - + private def idAndUuidPair(remaining: String): Tuple2[Option[String], Option[String]] = { remaining split ":" toList match { case id :: Nil => (Some(id), None) @@ -52,13 +52,13 @@ class ActorComponent extends DefaultComponent { * @author Martin Krasser */ -class ActorEndpoint(uri: String, - comp: ActorComponent, - val id: Option[String], +class ActorEndpoint(uri: String, + comp: ActorComponent, + val id: Option[String], val uuid: Option[String]) extends DefaultEndpoint(uri, comp) { /** - * @throws UnsupportedOperationException + * @throws UnsupportedOperationException */ def createConsumer(processor: Processor): Consumer = throw new UnsupportedOperationException("actor consumer not supported yet") @@ -106,7 +106,7 @@ class ActorProducer(val ep: ActorEndpoint) extends DefaultProducer(ep) { * Send the exchange in-message to the given actor using the ! operator. The message * send to the actor is of type se.scalablesolutions.akka.camel.Message. */ - protected def processInOnly(exchange: Exchange, actor: ActorRef): Unit = + protected def processInOnly(exchange: Exchange, actor: ActorRef): Unit = actor ! exchange.toRequestMessage(Map(Message.MessageExchangeId -> exchange.getExchangeId)) /** @@ -149,4 +149,4 @@ class ActorProducer(val ep: ActorEndpoint) extends DefaultProducer(ep) { */ class ActorNotRegisteredException(uri: String) extends RuntimeException { override def getMessage = "%s not registered" format uri -} \ No newline at end of file +} diff --git a/akka-camel/src/test/scala/CamelContextLifecycleTest.scala b/akka-camel/src/test/scala/CamelContextLifecycleTest.scala index e75329f5e9..b8caea0805 100644 --- a/akka-camel/src/test/scala/CamelContextLifecycleTest.scala +++ b/akka-camel/src/test/scala/CamelContextLifecycleTest.scala @@ -23,4 +23,4 @@ class CamelContextLifecycleTest extends JUnitSuite with CamelContextLifecycle { } class TestCamelContext extends DefaultCamelContext -} \ No newline at end of file +} diff --git a/akka-camel/src/test/scala/CamelExchangeAdapterTest.scala b/akka-camel/src/test/scala/CamelExchangeAdapterTest.scala index 9fe290c3c3..55a8fc98b1 100644 --- a/akka-camel/src/test/scala/CamelExchangeAdapterTest.scala +++ b/akka-camel/src/test/scala/CamelExchangeAdapterTest.scala @@ -106,4 +106,4 @@ class CamelExchangeAdapterTest extends JUnitSuite { exchange.setPattern(pattern) exchange } -} \ No newline at end of file +} diff --git a/akka-camel/src/test/scala/CamelMessageAdapterTest.scala b/akka-camel/src/test/scala/CamelMessageAdapterTest.scala index 5f63d1b91c..ca9c9ba66d 100644 --- a/akka-camel/src/test/scala/CamelMessageAdapterTest.scala +++ b/akka-camel/src/test/scala/CamelMessageAdapterTest.scala @@ -35,4 +35,4 @@ class CamelMessageAdapterTest extends JUnitSuite { } -} \ No newline at end of file +} diff --git a/akka-camel/src/test/scala/MessageTest.scala b/akka-camel/src/test/scala/MessageTest.scala index da317be902..b87a99e18c 100644 --- a/akka-camel/src/test/scala/MessageTest.scala +++ b/akka-camel/src/test/scala/MessageTest.scala @@ -70,4 +70,4 @@ class MessageTest extends JUnitSuite with BeforeAndAfterAll { Message("test1" , Map("A" -> "1")), Message("test1" , Map("A" -> "1", "B" -> "2")).removeHeader("B")) } -} \ No newline at end of file +} diff --git a/akka-camel/src/test/scala/ProducerFeatureTest.scala b/akka-camel/src/test/scala/ProducerFeatureTest.scala index acba99fde9..6f1f39abeb 100644 --- a/akka-camel/src/test/scala/ProducerFeatureTest.scala +++ b/akka-camel/src/test/scala/ProducerFeatureTest.scala @@ -17,7 +17,7 @@ object ProducerFeatureTest { class ProducerFeatureTest extends FeatureSpec with BeforeAndAfterAll with BeforeAndAfterEach with GivenWhenThen { import ProducerFeatureTest._ - + override protected def beforeAll = { ActorRegistry.shutdownAll CamelContextManager.init @@ -122,7 +122,7 @@ class ProducerFeatureTest extends FeatureSpec with BeforeAndAfterAll with Before } private def mockEndpoint = CamelContextManager.context.getEndpoint("mock:mock", classOf[MockEndpoint]) - + class TestRoute extends RouteBuilder { def configure { // for one-way messaging tests @@ -138,4 +138,4 @@ class ProducerFeatureTest extends FeatureSpec with BeforeAndAfterAll with Before }) } } -} \ No newline at end of file +} diff --git a/akka-camel/src/test/scala/component/ActorComponentFeatureTest.scala b/akka-camel/src/test/scala/component/ActorComponentFeatureTest.scala index 955ae82b96..7db119fa5e 100644 --- a/akka-camel/src/test/scala/component/ActorComponentFeatureTest.scala +++ b/akka-camel/src/test/scala/component/ActorComponentFeatureTest.scala @@ -11,17 +11,17 @@ class ActorComponentFeatureTest extends FeatureSpec with BeforeAndAfterAll with override protected def beforeAll = { ActorRegistry.shutdownAll CamelContextManager.init - CamelContextManager.start + CamelContextManager.start } override protected def afterAll = CamelContextManager.stop override protected def afterEach = ActorRegistry.shutdownAll - + feature("Communicate with an actor from a Camel application using actor endpoint URIs") { import CamelContextManager.template import Actor._ - + scenario("one-way communication using actor id") { val actor = actorOf(new Tester with Retain with Countdown[Message]) actor.start @@ -60,4 +60,4 @@ class ActorComponentFeatureTest extends FeatureSpec with BeforeAndAfterAll with } } } -} \ No newline at end of file +} diff --git a/akka-camel/src/test/scala/service/CamelServiceFeatureTest.scala b/akka-camel/src/test/scala/service/CamelServiceFeatureTest.scala index 5ecf95a4f0..fd106f799f 100644 --- a/akka-camel/src/test/scala/service/CamelServiceFeatureTest.scala +++ b/akka-camel/src/test/scala/service/CamelServiceFeatureTest.scala @@ -8,7 +8,7 @@ import se.scalablesolutions.akka.camel.{CamelContextManager, Message, Consumer} import Actor._ object CamelServiceFeatureTest { - + class TestConsumer(uri: String) extends Actor with Consumer { def endpointUri = uri protected def receive = { @@ -32,7 +32,7 @@ object CamelServiceFeatureTest { class CamelServiceFeatureTest extends FeatureSpec with BeforeAndAfterAll with GivenWhenThen { import CamelServiceFeatureTest._ - + var service: CamelService = CamelService.newInstance override protected def beforeAll = { @@ -46,7 +46,7 @@ class CamelServiceFeatureTest extends FeatureSpec with BeforeAndAfterAll with Gi service.consumerPublisher.actor.asInstanceOf[ConsumerPublisher].expectPublishCount(1) // start the CamelService service.load - // await publication of first test consumer + // await publication of first test consumer service.consumerPublisher.actor.asInstanceOf[ConsumerPublisher].awaitPublish } @@ -114,4 +114,4 @@ class CamelServiceFeatureTest extends FeatureSpec with BeforeAndAfterAll with Gi assert(response === "received msg3") } } -} \ No newline at end of file +} diff --git a/akka-camel/src/test/scala/service/ConsumerRegisteredTest.scala b/akka-camel/src/test/scala/service/ConsumerRegisteredTest.scala index 8041d71f7a..e69dd69339 100644 --- a/akka-camel/src/test/scala/service/ConsumerRegisteredTest.scala +++ b/akka-camel/src/test/scala/service/ConsumerRegisteredTest.scala @@ -27,7 +27,7 @@ object ConsumerRegisteredTest { class ConsumerRegisteredTest extends JUnitSuite { import ConsumerRegisteredTest._ - + @Test def shouldCreatePublishRequestList = { val as = List(actorOf[ConsumeAnnotatedActor]) val events = for (a <- as; e <- ConsumerRegistered.forConsumer(a)) yield e diff --git a/akka-core/src/main/java/se/scalablesolutions/akka/annotation/consume.java b/akka-core/src/main/java/se/scalablesolutions/akka/annotation/consume.java index 17ac05bf17..11552609f5 100644 --- a/akka-core/src/main/java/se/scalablesolutions/akka/annotation/consume.java +++ b/akka-core/src/main/java/se/scalablesolutions/akka/annotation/consume.java @@ -15,4 +15,4 @@ public @interface consume { public abstract String value(); -} \ No newline at end of file +} diff --git a/akka-core/src/main/java/se/scalablesolutions/akka/config/ActiveObjectGuiceModule.java b/akka-core/src/main/java/se/scalablesolutions/akka/config/ActiveObjectGuiceModule.java index 59dcfef9ea..60dfd4cadd 100644 --- a/akka-core/src/main/java/se/scalablesolutions/akka/config/ActiveObjectGuiceModule.java +++ b/akka-core/src/main/java/se/scalablesolutions/akka/config/ActiveObjectGuiceModule.java @@ -15,7 +15,7 @@ import com.google.inject.Singleton; */ public class ActiveObjectGuiceModule extends AbstractModule { private final List bindings; - + public ActiveObjectGuiceModule(final List bindings) { this.bindings = bindings; } @@ -25,7 +25,7 @@ public class ActiveObjectGuiceModule extends AbstractModule { for (int i = 0; i < bindings.size(); i++) { final DependencyBinding db = bindings.get(i); //if (db.getInterface() ne null) bind((Class) db.getInterface()).to((Class) db.getTarget()).in(Singleton.class); - //else + //else this.bind(db.getInterface()).toInstance(db.getTarget()); } } diff --git a/akka-core/src/main/java/se/scalablesolutions/akka/config/DependencyBinding.java b/akka-core/src/main/java/se/scalablesolutions/akka/config/DependencyBinding.java index f21871f68d..2956e6860f 100644 --- a/akka-core/src/main/java/se/scalablesolutions/akka/config/DependencyBinding.java +++ b/akka-core/src/main/java/se/scalablesolutions/akka/config/DependencyBinding.java @@ -10,7 +10,7 @@ package se.scalablesolutions.akka.config; public class DependencyBinding { private final Class intf; private final Object target; - + public DependencyBinding(final Class intf, final Object target) { this.intf = intf; this.target = target; diff --git a/akka-core/src/main/java/se/scalablesolutions/akka/remote/protobuf/RemoteProtocol.java b/akka-core/src/main/java/se/scalablesolutions/akka/remote/protobuf/RemoteProtocol.java index 69a50a4bd2..5958f38527 100644 --- a/akka-core/src/main/java/se/scalablesolutions/akka/remote/protobuf/RemoteProtocol.java +++ b/akka-core/src/main/java/se/scalablesolutions/akka/remote/protobuf/RemoteProtocol.java @@ -11,61 +11,61 @@ public final class RemoteProtocol { com.google.protobuf.GeneratedMessage { // Use ActorRefProtocol.newBuilder() to construct. private ActorRefProtocol() {} - + private static final ActorRefProtocol defaultInstance = new ActorRefProtocol(); public static ActorRefProtocol getDefaultInstance() { return defaultInstance; } - + public ActorRefProtocol getDefaultInstanceForType() { return defaultInstance; } - + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.internal_static_se_scalablesolutions_akka_remote_protobuf_ActorRefProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.internal_static_se_scalablesolutions_akka_remote_protobuf_ActorRefProtocol_fieldAccessorTable; } - + // required string uuid = 1; public static final int UUID_FIELD_NUMBER = 1; private boolean hasUuid; private java.lang.String uuid_ = ""; public boolean hasUuid() { return hasUuid; } public java.lang.String getUuid() { return uuid_; } - + // required string actorClassName = 2; public static final int ACTORCLASSNAME_FIELD_NUMBER = 2; private boolean hasActorClassName; private java.lang.String actorClassName_ = ""; public boolean hasActorClassName() { return hasActorClassName; } public java.lang.String getActorClassName() { return actorClassName_; } - + // required string sourceHostname = 3; public static final int SOURCEHOSTNAME_FIELD_NUMBER = 3; private boolean hasSourceHostname; private java.lang.String sourceHostname_ = ""; public boolean hasSourceHostname() { return hasSourceHostname; } public java.lang.String getSourceHostname() { return sourceHostname_; } - + // required uint32 sourcePort = 4; public static final int SOURCEPORT_FIELD_NUMBER = 4; private boolean hasSourcePort; private int sourcePort_ = 0; public boolean hasSourcePort() { return hasSourcePort; } public int getSourcePort() { return sourcePort_; } - + // required uint64 timeout = 5; public static final int TIMEOUT_FIELD_NUMBER = 5; private boolean hasTimeout; private long timeout_ = 0L; public boolean hasTimeout() { return hasTimeout; } public long getTimeout() { return timeout_; } - + public final boolean isInitialized() { if (!hasUuid) return false; if (!hasActorClassName) return false; @@ -74,7 +74,7 @@ public final class RemoteProtocol { if (!hasTimeout) return false; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (hasUuid()) { @@ -94,12 +94,12 @@ public final class RemoteProtocol { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (hasUuid()) { size += com.google.protobuf.CodedOutputStream @@ -125,7 +125,7 @@ public final class RemoteProtocol { memoizedSerializedSize = size; return size; } - + public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -183,31 +183,31 @@ public final class RemoteProtocol { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder { private se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol result; - + // Construct using se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol.newBuilder() private Builder() {} - + private static Builder create() { Builder builder = new Builder(); builder.result = new se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol(); return builder; } - + protected se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol internalGetResult() { return result; } - + public Builder clear() { if (result == null) { throw new IllegalStateException( @@ -216,20 +216,20 @@ public final class RemoteProtocol { result = new se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol(); return this; } - + public Builder clone() { return create().mergeFrom(result); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol.getDescriptor(); } - + public se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol getDefaultInstanceForType() { return se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol.getDefaultInstance(); } - + public boolean isInitialized() { return result.isInitialized(); } @@ -239,7 +239,7 @@ public final class RemoteProtocol { } return buildPartial(); } - + private se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol buildParsed() throws com.google.protobuf.InvalidProtocolBufferException { if (!isInitialized()) { @@ -248,7 +248,7 @@ public final class RemoteProtocol { } return buildPartial(); } - + public se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol buildPartial() { if (result == null) { throw new IllegalStateException( @@ -258,7 +258,7 @@ public final class RemoteProtocol { result = null; return returnMe; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol) { return mergeFrom((se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol)other); @@ -267,7 +267,7 @@ public final class RemoteProtocol { return this; } } - + public Builder mergeFrom(se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol other) { if (other == se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol.getDefaultInstance()) return this; if (other.hasUuid()) { @@ -288,7 +288,7 @@ public final class RemoteProtocol { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -333,8 +333,8 @@ public final class RemoteProtocol { } } } - - + + // required string uuid = 1; public boolean hasUuid() { return result.hasUuid(); @@ -355,7 +355,7 @@ public final class RemoteProtocol { result.uuid_ = getDefaultInstance().getUuid(); return this; } - + // required string actorClassName = 2; public boolean hasActorClassName() { return result.hasActorClassName(); @@ -376,7 +376,7 @@ public final class RemoteProtocol { result.actorClassName_ = getDefaultInstance().getActorClassName(); return this; } - + // required string sourceHostname = 3; public boolean hasSourceHostname() { return result.hasSourceHostname(); @@ -397,7 +397,7 @@ public final class RemoteProtocol { result.sourceHostname_ = getDefaultInstance().getSourceHostname(); return this; } - + // required uint32 sourcePort = 4; public boolean hasSourcePort() { return result.hasSourcePort(); @@ -415,7 +415,7 @@ public final class RemoteProtocol { result.sourcePort_ = 0; return this; } - + // required uint64 timeout = 5; public boolean hasTimeout() { return result.hasTimeout(); @@ -434,131 +434,131 @@ public final class RemoteProtocol { return this; } } - + static { se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.getDescriptor(); } - + static { se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.internalForceInit(); } } - + public static final class RemoteRequestProtocol extends com.google.protobuf.GeneratedMessage { // Use RemoteRequestProtocol.newBuilder() to construct. private RemoteRequestProtocol() {} - + private static final RemoteRequestProtocol defaultInstance = new RemoteRequestProtocol(); public static RemoteRequestProtocol getDefaultInstance() { return defaultInstance; } - + public RemoteRequestProtocol getDefaultInstanceForType() { return defaultInstance; } - + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.internal_static_se_scalablesolutions_akka_remote_protobuf_RemoteRequestProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.internal_static_se_scalablesolutions_akka_remote_protobuf_RemoteRequestProtocol_fieldAccessorTable; } - + // required uint64 id = 1; public static final int ID_FIELD_NUMBER = 1; private boolean hasId; private long id_ = 0L; public boolean hasId() { return hasId; } public long getId() { return id_; } - + // required uint32 protocol = 2; public static final int PROTOCOL_FIELD_NUMBER = 2; private boolean hasProtocol; private int protocol_ = 0; public boolean hasProtocol() { return hasProtocol; } public int getProtocol() { return protocol_; } - + // required bytes message = 3; public static final int MESSAGE_FIELD_NUMBER = 3; private boolean hasMessage; private com.google.protobuf.ByteString message_ = com.google.protobuf.ByteString.EMPTY; public boolean hasMessage() { return hasMessage; } public com.google.protobuf.ByteString getMessage() { return message_; } - + // optional bytes messageManifest = 4; public static final int MESSAGEMANIFEST_FIELD_NUMBER = 4; private boolean hasMessageManifest; private com.google.protobuf.ByteString messageManifest_ = com.google.protobuf.ByteString.EMPTY; public boolean hasMessageManifest() { return hasMessageManifest; } public com.google.protobuf.ByteString getMessageManifest() { return messageManifest_; } - + // optional string method = 5; public static final int METHOD_FIELD_NUMBER = 5; private boolean hasMethod; private java.lang.String method_ = ""; public boolean hasMethod() { return hasMethod; } public java.lang.String getMethod() { return method_; } - + // required string target = 6; public static final int TARGET_FIELD_NUMBER = 6; private boolean hasTarget; private java.lang.String target_ = ""; public boolean hasTarget() { return hasTarget; } public java.lang.String getTarget() { return target_; } - + // required string uuid = 7; public static final int UUID_FIELD_NUMBER = 7; private boolean hasUuid; private java.lang.String uuid_ = ""; public boolean hasUuid() { return hasUuid; } public java.lang.String getUuid() { return uuid_; } - + // required uint64 timeout = 8; public static final int TIMEOUT_FIELD_NUMBER = 8; private boolean hasTimeout; private long timeout_ = 0L; public boolean hasTimeout() { return hasTimeout; } public long getTimeout() { return timeout_; } - + // optional string supervisorUuid = 9; public static final int SUPERVISORUUID_FIELD_NUMBER = 9; private boolean hasSupervisorUuid; private java.lang.String supervisorUuid_ = ""; public boolean hasSupervisorUuid() { return hasSupervisorUuid; } public java.lang.String getSupervisorUuid() { return supervisorUuid_; } - + // required bool isActor = 10; public static final int ISACTOR_FIELD_NUMBER = 10; private boolean hasIsActor; private boolean isActor_ = false; public boolean hasIsActor() { return hasIsActor; } public boolean getIsActor() { return isActor_; } - + // required bool isOneWay = 11; public static final int ISONEWAY_FIELD_NUMBER = 11; private boolean hasIsOneWay; private boolean isOneWay_ = false; public boolean hasIsOneWay() { return hasIsOneWay; } public boolean getIsOneWay() { return isOneWay_; } - + // required bool isEscaped = 12; public static final int ISESCAPED_FIELD_NUMBER = 12; private boolean hasIsEscaped; private boolean isEscaped_ = false; public boolean hasIsEscaped() { return hasIsEscaped; } public boolean getIsEscaped() { return isEscaped_; } - + // optional .se.scalablesolutions.akka.remote.protobuf.ActorRefProtocol sender = 13; public static final int SENDER_FIELD_NUMBER = 13; private boolean hasSender; private se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol sender_ = se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol.getDefaultInstance(); public boolean hasSender() { return hasSender; } public se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol getSender() { return sender_; } - + public final boolean isInitialized() { if (!hasId) return false; if (!hasProtocol) return false; @@ -574,7 +574,7 @@ public final class RemoteProtocol { } return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (hasId()) { @@ -618,12 +618,12 @@ public final class RemoteProtocol { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (hasId()) { size += com.google.protobuf.CodedOutputStream @@ -681,7 +681,7 @@ public final class RemoteProtocol { memoizedSerializedSize = size; return size; } - + public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -739,31 +739,31 @@ public final class RemoteProtocol { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder { private se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol result; - + // Construct using se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol.newBuilder() private Builder() {} - + private static Builder create() { Builder builder = new Builder(); builder.result = new se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol(); return builder; } - + protected se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol internalGetResult() { return result; } - + public Builder clear() { if (result == null) { throw new IllegalStateException( @@ -772,20 +772,20 @@ public final class RemoteProtocol { result = new se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol(); return this; } - + public Builder clone() { return create().mergeFrom(result); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol.getDescriptor(); } - + public se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol getDefaultInstanceForType() { return se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol.getDefaultInstance(); } - + public boolean isInitialized() { return result.isInitialized(); } @@ -795,7 +795,7 @@ public final class RemoteProtocol { } return buildPartial(); } - + private se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol buildParsed() throws com.google.protobuf.InvalidProtocolBufferException { if (!isInitialized()) { @@ -804,7 +804,7 @@ public final class RemoteProtocol { } return buildPartial(); } - + public se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol buildPartial() { if (result == null) { throw new IllegalStateException( @@ -814,7 +814,7 @@ public final class RemoteProtocol { result = null; return returnMe; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol) { return mergeFrom((se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol)other); @@ -823,7 +823,7 @@ public final class RemoteProtocol { return this; } } - + public Builder mergeFrom(se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol other) { if (other == se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol.getDefaultInstance()) return this; if (other.hasId()) { @@ -868,7 +868,7 @@ public final class RemoteProtocol { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -950,8 +950,8 @@ public final class RemoteProtocol { } } } - - + + // required uint64 id = 1; public boolean hasId() { return result.hasId(); @@ -969,7 +969,7 @@ public final class RemoteProtocol { result.id_ = 0L; return this; } - + // required uint32 protocol = 2; public boolean hasProtocol() { return result.hasProtocol(); @@ -987,7 +987,7 @@ public final class RemoteProtocol { result.protocol_ = 0; return this; } - + // required bytes message = 3; public boolean hasMessage() { return result.hasMessage(); @@ -1008,7 +1008,7 @@ public final class RemoteProtocol { result.message_ = getDefaultInstance().getMessage(); return this; } - + // optional bytes messageManifest = 4; public boolean hasMessageManifest() { return result.hasMessageManifest(); @@ -1029,7 +1029,7 @@ public final class RemoteProtocol { result.messageManifest_ = getDefaultInstance().getMessageManifest(); return this; } - + // optional string method = 5; public boolean hasMethod() { return result.hasMethod(); @@ -1050,7 +1050,7 @@ public final class RemoteProtocol { result.method_ = getDefaultInstance().getMethod(); return this; } - + // required string target = 6; public boolean hasTarget() { return result.hasTarget(); @@ -1071,7 +1071,7 @@ public final class RemoteProtocol { result.target_ = getDefaultInstance().getTarget(); return this; } - + // required string uuid = 7; public boolean hasUuid() { return result.hasUuid(); @@ -1092,7 +1092,7 @@ public final class RemoteProtocol { result.uuid_ = getDefaultInstance().getUuid(); return this; } - + // required uint64 timeout = 8; public boolean hasTimeout() { return result.hasTimeout(); @@ -1110,7 +1110,7 @@ public final class RemoteProtocol { result.timeout_ = 0L; return this; } - + // optional string supervisorUuid = 9; public boolean hasSupervisorUuid() { return result.hasSupervisorUuid(); @@ -1131,7 +1131,7 @@ public final class RemoteProtocol { result.supervisorUuid_ = getDefaultInstance().getSupervisorUuid(); return this; } - + // required bool isActor = 10; public boolean hasIsActor() { return result.hasIsActor(); @@ -1149,7 +1149,7 @@ public final class RemoteProtocol { result.isActor_ = false; return this; } - + // required bool isOneWay = 11; public boolean hasIsOneWay() { return result.hasIsOneWay(); @@ -1167,7 +1167,7 @@ public final class RemoteProtocol { result.isOneWay_ = false; return this; } - + // required bool isEscaped = 12; public boolean hasIsEscaped() { return result.hasIsEscaped(); @@ -1185,7 +1185,7 @@ public final class RemoteProtocol { result.isEscaped_ = false; return this; } - + // optional .se.scalablesolutions.akka.remote.protobuf.ActorRefProtocol sender = 13; public boolean hasSender() { return result.hasSender(); @@ -1223,103 +1223,103 @@ public final class RemoteProtocol { return this; } } - + static { se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.getDescriptor(); } - + static { se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.internalForceInit(); } } - + public static final class RemoteReplyProtocol extends com.google.protobuf.GeneratedMessage { // Use RemoteReplyProtocol.newBuilder() to construct. private RemoteReplyProtocol() {} - + private static final RemoteReplyProtocol defaultInstance = new RemoteReplyProtocol(); public static RemoteReplyProtocol getDefaultInstance() { return defaultInstance; } - + public RemoteReplyProtocol getDefaultInstanceForType() { return defaultInstance; } - + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.internal_static_se_scalablesolutions_akka_remote_protobuf_RemoteReplyProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.internal_static_se_scalablesolutions_akka_remote_protobuf_RemoteReplyProtocol_fieldAccessorTable; } - + // required uint64 id = 1; public static final int ID_FIELD_NUMBER = 1; private boolean hasId; private long id_ = 0L; public boolean hasId() { return hasId; } public long getId() { return id_; } - + // optional uint32 protocol = 2; public static final int PROTOCOL_FIELD_NUMBER = 2; private boolean hasProtocol; private int protocol_ = 0; public boolean hasProtocol() { return hasProtocol; } public int getProtocol() { return protocol_; } - + // optional bytes message = 3; public static final int MESSAGE_FIELD_NUMBER = 3; private boolean hasMessage; private com.google.protobuf.ByteString message_ = com.google.protobuf.ByteString.EMPTY; public boolean hasMessage() { return hasMessage; } public com.google.protobuf.ByteString getMessage() { return message_; } - + // optional bytes messageManifest = 4; public static final int MESSAGEMANIFEST_FIELD_NUMBER = 4; private boolean hasMessageManifest; private com.google.protobuf.ByteString messageManifest_ = com.google.protobuf.ByteString.EMPTY; public boolean hasMessageManifest() { return hasMessageManifest; } public com.google.protobuf.ByteString getMessageManifest() { return messageManifest_; } - + // optional string exception = 5; public static final int EXCEPTION_FIELD_NUMBER = 5; private boolean hasException; private java.lang.String exception_ = ""; public boolean hasException() { return hasException; } public java.lang.String getException() { return exception_; } - + // optional string supervisorUuid = 6; public static final int SUPERVISORUUID_FIELD_NUMBER = 6; private boolean hasSupervisorUuid; private java.lang.String supervisorUuid_ = ""; public boolean hasSupervisorUuid() { return hasSupervisorUuid; } public java.lang.String getSupervisorUuid() { return supervisorUuid_; } - + // required bool isActor = 7; public static final int ISACTOR_FIELD_NUMBER = 7; private boolean hasIsActor; private boolean isActor_ = false; public boolean hasIsActor() { return hasIsActor; } public boolean getIsActor() { return isActor_; } - + // required bool isSuccessful = 8; public static final int ISSUCCESSFUL_FIELD_NUMBER = 8; private boolean hasIsSuccessful; private boolean isSuccessful_ = false; public boolean hasIsSuccessful() { return hasIsSuccessful; } public boolean getIsSuccessful() { return isSuccessful_; } - + public final boolean isInitialized() { if (!hasId) return false; if (!hasIsActor) return false; if (!hasIsSuccessful) return false; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (hasId()) { @@ -1348,12 +1348,12 @@ public final class RemoteProtocol { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (hasId()) { size += com.google.protobuf.CodedOutputStream @@ -1391,7 +1391,7 @@ public final class RemoteProtocol { memoizedSerializedSize = size; return size; } - + public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -1449,31 +1449,31 @@ public final class RemoteProtocol { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder { private se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol result; - + // Construct using se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol.newBuilder() private Builder() {} - + private static Builder create() { Builder builder = new Builder(); builder.result = new se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol(); return builder; } - + protected se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol internalGetResult() { return result; } - + public Builder clear() { if (result == null) { throw new IllegalStateException( @@ -1482,20 +1482,20 @@ public final class RemoteProtocol { result = new se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol(); return this; } - + public Builder clone() { return create().mergeFrom(result); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol.getDescriptor(); } - + public se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol getDefaultInstanceForType() { return se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol.getDefaultInstance(); } - + public boolean isInitialized() { return result.isInitialized(); } @@ -1505,7 +1505,7 @@ public final class RemoteProtocol { } return buildPartial(); } - + private se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol buildParsed() throws com.google.protobuf.InvalidProtocolBufferException { if (!isInitialized()) { @@ -1514,7 +1514,7 @@ public final class RemoteProtocol { } return buildPartial(); } - + public se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol buildPartial() { if (result == null) { throw new IllegalStateException( @@ -1524,7 +1524,7 @@ public final class RemoteProtocol { result = null; return returnMe; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol) { return mergeFrom((se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol)other); @@ -1533,7 +1533,7 @@ public final class RemoteProtocol { return this; } } - + public Builder mergeFrom(se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol other) { if (other == se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol.getDefaultInstance()) return this; if (other.hasId()) { @@ -1563,7 +1563,7 @@ public final class RemoteProtocol { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -1620,8 +1620,8 @@ public final class RemoteProtocol { } } } - - + + // required uint64 id = 1; public boolean hasId() { return result.hasId(); @@ -1639,7 +1639,7 @@ public final class RemoteProtocol { result.id_ = 0L; return this; } - + // optional uint32 protocol = 2; public boolean hasProtocol() { return result.hasProtocol(); @@ -1657,7 +1657,7 @@ public final class RemoteProtocol { result.protocol_ = 0; return this; } - + // optional bytes message = 3; public boolean hasMessage() { return result.hasMessage(); @@ -1678,7 +1678,7 @@ public final class RemoteProtocol { result.message_ = getDefaultInstance().getMessage(); return this; } - + // optional bytes messageManifest = 4; public boolean hasMessageManifest() { return result.hasMessageManifest(); @@ -1699,7 +1699,7 @@ public final class RemoteProtocol { result.messageManifest_ = getDefaultInstance().getMessageManifest(); return this; } - + // optional string exception = 5; public boolean hasException() { return result.hasException(); @@ -1720,7 +1720,7 @@ public final class RemoteProtocol { result.exception_ = getDefaultInstance().getException(); return this; } - + // optional string supervisorUuid = 6; public boolean hasSupervisorUuid() { return result.hasSupervisorUuid(); @@ -1741,7 +1741,7 @@ public final class RemoteProtocol { result.supervisorUuid_ = getDefaultInstance().getSupervisorUuid(); return this; } - + // required bool isActor = 7; public boolean hasIsActor() { return result.hasIsActor(); @@ -1759,7 +1759,7 @@ public final class RemoteProtocol { result.isActor_ = false; return this; } - + // required bool isSuccessful = 8; public boolean hasIsSuccessful() { return result.hasIsSuccessful(); @@ -1778,16 +1778,16 @@ public final class RemoteProtocol { return this; } } - + static { se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.getDescriptor(); } - + static { se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.internalForceInit(); } } - + private static com.google.protobuf.Descriptors.Descriptor internal_static_se_scalablesolutions_akka_remote_protobuf_ActorRefProtocol_descriptor; private static @@ -1803,7 +1803,7 @@ public final class RemoteProtocol { private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_se_scalablesolutions_akka_remote_protobuf_RemoteReplyProtocol_fieldAccessorTable; - + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -1868,6 +1868,6 @@ public final class RemoteProtocol { new com.google.protobuf.Descriptors.FileDescriptor[] { }, assigner); } - + public static void internalForceInit() {} } diff --git a/akka-core/src/main/java/se/scalablesolutions/akka/remote/protobuf/RemoteProtocol.proto b/akka-core/src/main/java/se/scalablesolutions/akka/remote/protobuf/RemoteProtocol.proto index cfb7464e61..537786f353 100644 --- a/akka-core/src/main/java/se/scalablesolutions/akka/remote/protobuf/RemoteProtocol.proto +++ b/akka-core/src/main/java/se/scalablesolutions/akka/remote/protobuf/RemoteProtocol.proto @@ -43,4 +43,4 @@ message RemoteReplyProtocol { optional string supervisorUuid = 6; required bool isActor = 7; required bool isSuccessful = 8; -} \ No newline at end of file +} diff --git a/akka-core/src/main/scala/actor/ActiveObject.scala b/akka-core/src/main/scala/actor/ActiveObject.scala index cec0fb4c2d..f6389ea1ba 100644 --- a/akka-core/src/main/scala/actor/ActiveObject.scala +++ b/akka-core/src/main/scala/actor/ActiveObject.scala @@ -30,8 +30,8 @@ object Annotations { } /** - * Configuration factory for Active Objects. - * + * Configuration factory for Active Objects. + * * FIXDOC: document ActiveObjectConfiguration */ final class ActiveObjectConfiguration { @@ -74,7 +74,7 @@ final class ActiveObjectConfiguration { */ object ActiveObject { import Actor.actorOf - + val AKKA_CAMEL_ROUTING_SCHEME = "akka" private[actor] val AW_PROXY_PREFIX = "$$ProxiedByAW".intern @@ -182,7 +182,7 @@ object ActiveObject { } @deprecated("use newInstance(intf: Class[T], target: AnyRef, config: ActiveObjectConfiguration) instead") - def newInstance[T](intf: Class[T], target: AnyRef, timeout: Long, + def newInstance[T](intf: Class[T], target: AnyRef, timeout: Long, dispatcher: MessageDispatcher, restartCallbacks: Option[RestartCallbacks]): T = { val actor = actorOf(new Dispatcher(false, restartCallbacks)) actor.dispatcher = dispatcher @@ -197,7 +197,7 @@ object ActiveObject { } @deprecated("use newInstance(target: Class[T], config: ActiveObjectConfiguration) instead") - def newInstance[T](target: Class[T], timeout: Long, transactionRequired: Boolean, + def newInstance[T](target: Class[T], timeout: Long, transactionRequired: Boolean, dispatcher: MessageDispatcher, restartCallbacks: Option[RestartCallbacks]): T = { val actor = actorOf(new Dispatcher(transactionRequired, restartCallbacks)) actor.dispatcher = dispatcher @@ -212,7 +212,7 @@ object ActiveObject { } @deprecated("use newInstance(intf: Class[T], target: AnyRef, config: ActiveObjectConfiguration) instead") - def newInstance[T](intf: Class[T], target: AnyRef, timeout: Long, transactionRequired: Boolean, + def newInstance[T](intf: Class[T], target: AnyRef, timeout: Long, transactionRequired: Boolean, dispatcher: MessageDispatcher, restartCallbacks: Option[RestartCallbacks]): T = { val actor = actorOf(new Dispatcher(transactionRequired, restartCallbacks)) actor.dispatcher = dispatcher @@ -227,7 +227,7 @@ object ActiveObject { } @deprecated("use newInstance(target: Class[T], config: ActiveObjectConfiguration) instead") - def newRemoteInstance[T](target: Class[T], timeout: Long, dispatcher: MessageDispatcher, + def newRemoteInstance[T](target: Class[T], timeout: Long, dispatcher: MessageDispatcher, hostname: String, port: Int, restartCallbacks: Option[RestartCallbacks]): T = { val actor = actorOf(new Dispatcher(false, restartCallbacks)) actor.dispatcher = dispatcher @@ -242,7 +242,7 @@ object ActiveObject { } @deprecated("use newInstance(intf: Class[T], target: AnyRef, config: ActiveObjectConfiguration) instead") - def newRemoteInstance[T](intf: Class[T], target: AnyRef, timeout: Long, dispatcher: MessageDispatcher, + def newRemoteInstance[T](intf: Class[T], target: AnyRef, timeout: Long, dispatcher: MessageDispatcher, hostname: String, port: Int, restartCallbacks: Option[RestartCallbacks]): T = { val actor = actorOf(new Dispatcher(false, restartCallbacks)) actor.dispatcher = dispatcher @@ -250,7 +250,7 @@ object ActiveObject { } @deprecated("use newInstance(target: Class[T], config: ActiveObjectConfiguration) instead") - def newRemoteInstance[T](target: Class[T], timeout: Long, transactionRequired: Boolean, + def newRemoteInstance[T](target: Class[T], timeout: Long, transactionRequired: Boolean, dispatcher: MessageDispatcher, hostname: String, port: Int): T = { val actor = actorOf(new Dispatcher(transactionRequired, None)) actor.dispatcher = dispatcher @@ -258,7 +258,7 @@ object ActiveObject { } @deprecated("use newInstance(target: Class[T], config: ActiveObjectConfiguration) instead") - def newRemoteInstance[T](target: Class[T], timeout: Long, transactionRequired: Boolean, dispatcher: MessageDispatcher, + def newRemoteInstance[T](target: Class[T], timeout: Long, transactionRequired: Boolean, dispatcher: MessageDispatcher, hostname: String, port: Int, restartCallbacks: Option[RestartCallbacks]): T = { val actor = actorOf(new Dispatcher(transactionRequired, restartCallbacks)) actor.dispatcher = dispatcher @@ -266,7 +266,7 @@ object ActiveObject { } @deprecated("use newInstance(intf: Class[T], target: AnyRef, config: ActiveObjectConfiguration) instead") - def newRemoteInstance[T](intf: Class[T], target: AnyRef, timeout: Long, transactionRequired: Boolean, + def newRemoteInstance[T](intf: Class[T], target: AnyRef, timeout: Long, transactionRequired: Boolean, dispatcher: MessageDispatcher, hostname: String, port: Int): T = { val actor = actorOf(new Dispatcher(transactionRequired, None)) actor.dispatcher = dispatcher @@ -274,7 +274,7 @@ object ActiveObject { } @deprecated("use newInstance(intf: Class[T], target: AnyRef, config: ActiveObjectConfiguration) instead") - def newRemoteInstance[T](intf: Class[T], target: AnyRef, timeout: Long, transactionRequired: Boolean, + def newRemoteInstance[T](intf: Class[T], target: AnyRef, timeout: Long, transactionRequired: Boolean, dispatcher: MessageDispatcher, hostname: String, port: Int, restartCallbacks: Option[RestartCallbacks]): T = { val actor = actorOf(new Dispatcher(transactionRequired, restartCallbacks)) actor.dispatcher = dispatcher @@ -374,7 +374,7 @@ object ActiveObject { this } - private[akka] def supervise(restartStrategy: RestartStrategy, components: List[Supervise]): Supervisor = + private[akka] def supervise(restartStrategy: RestartStrategy, components: List[Supervise]): Supervisor = Supervisor(SupervisorConfig(restartStrategy, components)) } @@ -556,12 +556,12 @@ private[akka] class Dispatcher(transactionalRequired: Boolean, val callbacks: Op preRestart = Some(try { targetInstance.getClass.getDeclaredMethod(pre, ZERO_ITEM_CLASS_ARRAY: _*) } catch { case e => throw new IllegalStateException( - "Could not find pre restart method [" + pre + "] \nin [" + + "Could not find pre restart method [" + pre + "] \nin [" + targetClass.getName + "]. \nIt must have a zero argument definition.") }) postRestart = Some(try { targetInstance.getClass.getDeclaredMethod(post, ZERO_ITEM_CLASS_ARRAY: _*) } catch { case e => throw new IllegalStateException( - "Could not find post restart method [" + post + "] \nin [" + + "Could not find post restart method [" + post + "] \nin [" + targetClass.getName + "]. \nIt must have a zero argument definition.") }) } @@ -571,11 +571,11 @@ private[akka] class Dispatcher(transactionalRequired: Boolean, val callbacks: Op if (preRestart.isDefined && preRestart.get.getParameterTypes.length != 0) throw new IllegalStateException( - "Method annotated with @prerestart or defined as a restart callback in \n[" + + "Method annotated with @prerestart or defined as a restart callback in \n[" + targetClass.getName + "] must have a zero argument definition") if (postRestart.isDefined && postRestart.get.getParameterTypes.length != 0) throw new IllegalStateException( - "Method annotated with @postrestart or defined as a restart callback in \n[" + + "Method annotated with @postrestart or defined as a restart callback in \n[" + targetClass.getName + "] must have a zero argument definition") if (preRestart.isDefined) preRestart.get.setAccessible(true) @@ -583,7 +583,7 @@ private[akka] class Dispatcher(transactionalRequired: Boolean, val callbacks: Op // see if we have a method annotated with @inittransactionalstate, if so invoke it initTxState = methods.find(m => m.isAnnotationPresent(Annotations.inittransactionalstate)) - if (initTxState.isDefined && initTxState.get.getParameterTypes.length != 0) + if (initTxState.isDefined && initTxState.get.getParameterTypes.length != 0) throw new IllegalStateException("Method annotated with @inittransactionalstate must have a zero argument definition") if (initTxState.isDefined) initTxState.get.setAccessible(true) } diff --git a/akka-core/src/main/scala/actor/Actor.scala b/akka-core/src/main/scala/actor/Actor.scala index 256a6c1784..eca9c9e63c 100644 --- a/akka-core/src/main/scala/actor/Actor.scala +++ b/akka-core/src/main/scala/actor/Actor.scala @@ -20,7 +20,7 @@ trait ActorWithNestedReceive extends Actor { processors.head forward message nestedReactsProcessors = processors.tail.reverse } - + protected def react: Receive protected def reactAgain(pf: Receive) = nestedReactsProcessors ::= actor(pf) protected def receive = processNestedReacts orElse react @@ -98,8 +98,8 @@ object Actor extends Logging { def actorOf[T <: Actor: Manifest]: ActorRef = new LocalActorRef(manifest[T].erasure.asInstanceOf[Class[_ <: Actor]]) /** - * Creates a Actor.actorOf out of the Actor. Allows you to pass in a factory function - * that creates the Actor. Please note that this function can be invoked multiple + * Creates a Actor.actorOf out of the Actor. Allows you to pass in a factory function + * that creates the Actor. Please note that this function can be invoked multiple * times if for example the Actor is supervised and needs to be restarted. *

* This function should NOT be used for remote actors. @@ -251,7 +251,7 @@ object Actor extends Logging { * *

* The Actor's API is available in the 'self' member variable. - * + * *

* Here you find functions like: * - !, !!, !!! and forward @@ -268,12 +268,12 @@ object Actor extends Logging { * - faultHandler = ... * - trapExit = ... * - etc. - * + * *

* This means that to use them you have to prefix them with 'self', like this: self ! Message * * However, for convenience you can import these functions and fields like below, which will allow you do - * drop the 'self' prefix: + * drop the 'self' prefix: *

  * class MyActor extends Actor {
  *   import self._
@@ -283,7 +283,7 @@ object Actor extends Logging {
  *   ...
  * }
  * 
- * + * *

* The Actor trait also has a 'log' member field that can be used for logging within the Actor. * @@ -295,20 +295,20 @@ trait Actor extends Logging { */ type Receive = Actor.Receive - /* - * For internal use only, functions as the implicit sender references when invoking + /* + * For internal use only, functions as the implicit sender references when invoking * one of the message send functions (!, !! and !!!). */ implicit val optionSelf: Option[ActorRef] = { val ref = Actor.actorRefInCreation.value Actor.actorRefInCreation.value = None if (ref.isEmpty) throw new ActorInitializationException( - "ActorRef for instance of actor [" + getClass.getName + "] is not in scope." + - "\n\tYou can not create an instance of an actor explicitly using 'new MyActor'." + - "\n\tYou have to use one of the factory methods in the 'Actor' object to create a new actor." + - "\n\tEither use:" + - "\n\t\t'val actor = Actor.actorOf[MyActor]', or" + - "\n\t\t'val actor = Actor.actorOf(new MyActor(..))'" + + "ActorRef for instance of actor [" + getClass.getName + "] is not in scope." + + "\n\tYou can not create an instance of an actor explicitly using 'new MyActor'." + + "\n\tYou have to use one of the factory methods in the 'Actor' object to create a new actor." + + "\n\tEither use:" + + "\n\t\t'val actor = Actor.actorOf[MyActor]', or" + + "\n\t\t'val actor = Actor.actorOf(new MyActor(..))'" + "\n\t\t'val actor = Actor.actor { case msg => .. } }'") else ref } @@ -329,7 +329,7 @@ trait Actor extends Logging { */ val self: ActorRef = optionSelf.get self.id = getClass.getName - + /** * User overridable callback/setting. *

@@ -408,7 +408,7 @@ trait Actor extends Logging { case UnlinkAndStop(child) => self.unlink(child); child.stop case Kill => throw new ActorKilledException("Actor [" + toString + "] was killed by a Kill message") } - + override def hashCode: Int = self.hashCode override def equals(that: Any): Boolean = self.equals(that) @@ -418,14 +418,14 @@ trait Actor extends Logging { /** * Base class for the different dispatcher types. - * + * * @author Jonas Bonér */ sealed abstract class DispatcherType /** * Module that holds the different dispatcher types. - * + * * @author Jonas Bonér */ object DispatcherType { diff --git a/akka-core/src/main/scala/actor/ActorRef.scala b/akka-core/src/main/scala/actor/ActorRef.scala index 4c92b33df6..5a1653e195 100644 --- a/akka-core/src/main/scala/actor/ActorRef.scala +++ b/akka-core/src/main/scala/actor/ActorRef.scala @@ -50,7 +50,7 @@ object ActorRef { /** * Deserializes the ActorRef instance from a byte array (Array[Byte]) into an ActorRef instance. */ - def fromBinary(bytes: Array[Byte]): ActorRef = + def fromBinary(bytes: Array[Byte]): ActorRef = fromProtocol(ActorRefProtocol.newBuilder.mergeFrom(bytes).build) /** @@ -73,32 +73,32 @@ object ActorRef { * Here is an example on how to create an actor with a default constructor. *

  *   import Actor._
- * 
+ *
  *   val actor = actorOf[MyActor]
  *   actor.start
  *   actor ! message
  *   actor.stop
  * 
- * - * You can also create and start actors like this: + * + * You can also create and start actors like this: *
  *   val actor = actorOf[MyActor].start
  * 
- * + * * Here is an example on how to create an actor with a non-default constructor. *
  *   import Actor._
- * 
+ *
  *   val actor = actorOf(new MyActor(...))
  *   actor.start
  *   actor ! message
  *   actor.stop
  * 
- * + * * @author Jonas Bonér */ trait ActorRef extends TransactionManagement { - + // Only mutable for RemoteServer in order to maintain identity across nodes @volatile protected[akka] var _uuid = UUID.newUuid.toString @volatile protected[this] var _isRunning = false @@ -211,14 +211,14 @@ trait ActorRef extends TransactionManagement { // protected[this] var _replyTo: Option[Either[ActorRef, CompletableFuture[Any]]] = None // protected[akka] def replyTo: Option[Either[ActorRef, CompletableFuture[Any]]] = guard.withGuard { _replyTo } // protected[akka] def replyTo_=(rt: Option[Either[ActorRef, CompletableFuture[Any]]]) = guard.withGuard { _replyTo = rt } - + protected[akka] var _sender: Option[ActorRef] = None protected[akka] var _senderFuture: Option[CompletableFuture[Any]] = None protected[akka] def sender: Option[ActorRef] = guard.withGuard { _sender } protected[akka] def senderFuture: Option[CompletableFuture[Any]] = guard.withGuard { _senderFuture } protected[akka] def sender_=(s: Option[ActorRef]) = guard.withGuard { _sender = s} protected[akka] def senderFuture_=(sf: Option[CompletableFuture[Any]]) = guard.withGuard { _senderFuture = sf} - + /** * Is the actor being restarted? */ @@ -240,7 +240,7 @@ trait ActorRef extends TransactionManagement { def uuid = _uuid /** - * Only for internal use. UUID is effectively final. + * Only for internal use. UUID is effectively final. */ protected[akka] def uuid_=(uid: String) = _uuid = uid @@ -340,7 +340,7 @@ trait ActorRef extends TransactionManagement { else throw new IllegalStateException("Can't forward message when initial sender is not an actor") } else throw new ActorInitializationException("Actor has not been started, you need to invoke 'actor.start' before using it") } - + /** * Use self.reply(..) to reply with a message to the original sender of the message currently * being processed. @@ -377,12 +377,12 @@ trait ActorRef extends TransactionManagement { * Serializes the ActorRef instance into a byte array (Array[Byte]). */ def toBinary: Array[Byte] - + /** * Returns the class for the Actor instance that is managed by the ActorRef. */ def actorClass: Class[_ <: Actor] - + /** * Sets the dispatcher for this actor. Needs to be invoked before the actor is started. */ @@ -397,12 +397,12 @@ trait ActorRef extends TransactionManagement { * Invoking 'makeRemote' means that an actor will be moved to and invoked on a remote host. */ def makeRemote(hostname: String, port: Int): Unit - + /** * Invoking 'makeRemote' means that an actor will be moved to and invoked on a remote host. */ def makeRemote(address: InetSocketAddress): Unit - + /** * Invoking 'makeTransactionRequired' means that the actor will **start** a new transaction if non exists. * However, it will always participate in an existing transaction. @@ -412,7 +412,7 @@ trait ActorRef extends TransactionManagement { * */ def makeTransactionRequired: Unit - + /** * Returns the home address and port for this actor. */ @@ -421,7 +421,7 @@ trait ActorRef extends TransactionManagement { /** * Set the home address and port for this actor. */ - def homeAddress_=(hostnameAndPort: Tuple2[String, Int]): Unit = + def homeAddress_=(hostnameAndPort: Tuple2[String, Int]): Unit = homeAddress_=(new InetSocketAddress(hostnameAndPort._1, hostnameAndPort._2)) /** @@ -469,7 +469,7 @@ trait ActorRef extends TransactionManagement { * To be invoked from within the actor itself. */ def unlink(actorRef: ActorRef): Unit - + /** * Atomically start and link an actor. *

@@ -511,12 +511,12 @@ trait ActorRef extends TransactionManagement { * To be invoked from within the actor itself. */ def spawnLinkRemote[T <: Actor : Manifest](hostname: String, port: Int): ActorRef - + /** * Returns the mailbox size. */ def mailboxSize: Int - + /** * Returns the supervisor, if there is one. */ @@ -540,7 +540,7 @@ trait ActorRef extends TransactionManagement { senderFuture: Option[CompletableFuture[T]]): CompletableFuture[T] protected[this] def actorInstance: AtomicReference[Actor] - + protected[akka] def actor: Actor = actorInstance.get protected[akka] def supervisor_=(sup: Option[ActorRef]): Unit @@ -557,7 +557,7 @@ trait ActorRef extends TransactionManagement { protected[akka] def linkedActors: JMap[String, ActorRef] - protected[akka] def linkedActorsAsList: List[ActorRef] + protected[akka] def linkedActorsAsList: List[ActorRef] override def hashCode: Int = HashCode.hash(HashCode.SEED, uuid) @@ -571,12 +571,7 @@ trait ActorRef extends TransactionManagement { protected def processSender(senderOption: Option[ActorRef], requestBuilder: RemoteRequestProtocol.Builder) = { senderOption.foreach { sender => - val address = sender.homeAddress - val server = RemoteServer.serverFor(address) match { - case Some(server) => server - case None => (new RemoteServer).start(address) - } - server.register(sender.uuid, sender) + RemoteServer.getOrCreateServer(sender.homeAddress).register(sender.uuid, sender) requestBuilder.setSender(sender.toProtocol) } } @@ -584,21 +579,21 @@ trait ActorRef extends TransactionManagement { /** * Local ActorRef that is used when referencing the Actor on its "home" node. - * + * * @author Jonas Bonér */ sealed class LocalActorRef private[akka]( private[this] var actorFactory: Either[Option[Class[_ <: Actor]], Option[() => Actor]] = Left(None)) extends ActorRef { - private[akka] def this(clazz: Class[_ <: Actor]) = this(Left(Some(clazz))) + private[akka] def this(clazz: Class[_ <: Actor]) = this(Left(Some(clazz))) private[akka] def this(factory: () => Actor) = this(Right(Some(factory))) // Only mutable for RemoteServer in order to maintain identity across nodes @volatile private[akka] var _remoteAddress: Option[InetSocketAddress] = None @volatile private[akka] var _linkedActors: Option[ConcurrentHashMap[String, ActorRef]] = None @volatile private[akka] var _supervisor: Option[ActorRef] = None - + protected[akka] val _mailbox: Deque[MessageInvocation] = new ConcurrentLinkedDeque[MessageInvocation] protected[this] val actorInstance = new AtomicReference[Actor](newActor) @@ -610,7 +605,7 @@ sealed class LocalActorRef private[akka]( private val actorSelfFields = findActorSelfField(actor.getClass) if (runActorInitialization) initializeActorInstance - + /** * Serializes the ActorRef instance into a Protocol Buffers (protobuf) Message. */ @@ -618,13 +613,13 @@ sealed class LocalActorRef private[akka]( val host = homeAddress.getHostName val port = homeAddress.getPort - if (!registeredInRemoteNodeDuringSerialization) { + if (!registeredInRemoteNodeDuringSerialization) { Actor.log.debug("Register serialized Actor [%s] as remote @ [%s:%s]", actorClass.getName, host, port) - if (RemoteServer.serverFor(host, port).isEmpty) (new RemoteServer).start(host, port) - RemoteServer.actorsFor(RemoteServer.Address(host, port)).actors.put(uuid, this) + RemoteServer.getOrCreateServer(homeAddress) + RemoteServer.registerActor(homeAddress, uuid, this) registeredInRemoteNodeDuringSerialization = true } - + ActorRefProtocol.newBuilder .setUuid(uuid) .setActorClassName(actorClass.getName) @@ -636,19 +631,19 @@ sealed class LocalActorRef private[akka]( /** * Returns the mailbox. - */ + */ protected[akka] def mailbox: Deque[MessageInvocation] = _mailbox - + /** * Serializes the ActorRef instance into a byte array (Array[Byte]). */ def toBinary: Array[Byte] = toProtocol.toByteArray - + /** * Returns the class for the Actor instance that is managed by the ActorRef. */ def actorClass: Class[_ <: Actor] = actor.getClass.asInstanceOf[Class[_ <: Actor]] - + /** * Sets the dispatcher for this actor. Needs to be invoked before the actor is started. */ @@ -698,7 +693,7 @@ sealed class LocalActorRef private[akka]( } /** - * Set the contact address for this actor. This is used for replying to messages + * Set the contact address for this actor. This is used for replying to messages * sent asynchronously when no reply channel exists. */ def homeAddress_=(address: InetSocketAddress): Unit = guard.withGuard { _homeAddress = address } @@ -857,7 +852,7 @@ sealed class LocalActorRef private[akka]( * Returns the mailbox size. */ def mailboxSize: Int = _mailbox.size - + /** * Shuts down and removes all linked actors. */ @@ -870,7 +865,7 @@ sealed class LocalActorRef private[akka]( * Returns the supervisor, if there is one. */ def supervisor: Option[ActorRef] = guard.withGuard { _supervisor } - + protected[akka] def supervisor_=(sup: Option[ActorRef]): Unit = guard.withGuard { _supervisor = sup } private def spawnButDoNotStart[T <: Actor: Manifest]: ActorRef = guard.withGuard { @@ -883,19 +878,19 @@ sealed class LocalActorRef private[akka]( isInInitialization = true Actor.actorRefInCreation.value = Some(this) val actor = actorFactory match { - case Left(Some(clazz)) => - try { - clazz.newInstance - } catch { + case Left(Some(clazz)) => + try { + clazz.newInstance + } catch { case e: InstantiationException => throw new ActorInitializationException( - "Could not instantiate Actor due to:\n" + e + - "\nMake sure Actor is NOT defined inside a class/trait," + + "Could not instantiate Actor due to:\n" + e + + "\nMake sure Actor is NOT defined inside a class/trait," + "\nif so put it outside the class/trait, f.e. in a companion object," + - "\nOR try to change: 'actorOf[MyActor]' to 'actorOf(new MyActor)'.") + "\nOR try to change: 'actorOf[MyActor]' to 'actorOf(new MyActor)'.") } - case Right(Some(factory)) => + case Right(Some(factory)) => factory() - case _ => + case _ => throw new ActorInitializationException( "Can't create Actor, no Actor class or factory function in scope") } @@ -904,7 +899,7 @@ sealed class LocalActorRef private[akka]( isInInitialization = false actor } - + protected[akka] def postMessageToMailbox(message: Any, senderOption: Option[ActorRef]): Unit = { sender = senderOption joinTransaction(message) @@ -951,13 +946,13 @@ sealed class LocalActorRef private[akka]( .setIsActor(true) .setIsOneWay(false) .setIsEscaped(false) - + //senderOption.foreach(sender => requestBuilder.setSender(sender.toProtocol)) RemoteProtocolBuilder.setMessage(message, requestBuilder) - + val id = registerSupervisorAsRemoteActor if (id.isDefined) requestBuilder.setSupervisorUuid(id.get) - + val future = RemoteClient.clientFor(remoteAddress.get).send(requestBuilder.build, senderFuture) if (future.isDefined) future.get else throw new IllegalStateException("Expected a future from remote call to actor " + toString) @@ -1078,7 +1073,7 @@ sealed class LocalActorRef private[akka]( // FIXME: implement support for maxNrOfRetries and withinTimeRange in RestartStrategy case AllForOneStrategy(maxNrOfRetries, withinTimeRange) => restartLinkedActors(reason) - + case OneForOneStrategy(maxNrOfRetries, withinTimeRange) => dead.restart(reason) } @@ -1128,7 +1123,7 @@ sealed class LocalActorRef private[akka]( if (linkedActors.isEmpty) { Actor.log.info( "All linked actors have died permanently (they were all configured as TEMPORARY)" + - "\n\tshutting down and unlinking supervisor actor as well [%s].", + "\n\tshutting down and unlinking supervisor actor as well [%s].", actorRef.id) _supervisor.foreach(_ ! UnlinkAndStop(this)) } @@ -1153,7 +1148,7 @@ sealed class LocalActorRef private[akka]( } else _linkedActors.get } - protected[akka] def linkedActorsAsList: List[ActorRef] = + protected[akka] def linkedActorsAsList: List[ActorRef] = linkedActors.values.toArray.toList.asInstanceOf[List[ActorRef]] private def nullOutActorRefReferencesFor(actor: Actor) = { @@ -1215,17 +1210,17 @@ sealed class LocalActorRef private[akka]( /** * Remote ActorRef that is used when referencing the Actor on a different node than its "home" node. - * This reference is network-aware (remembers its origin) and immutable. + * This reference is network-aware (remembers its origin) and immutable. * * @author Jonas Bonér */ private[akka] case class RemoteActorRef private[akka] ( // uuid: String, className: String, hostname: String, port: Int, timeOut: Long, isOnRemoteHost: Boolean) extends ActorRef { - uuuid: String, val className: String, val hostname: String, val port: Int, _timeout: Long) + uuuid: String, val className: String, val hostname: String, val port: Int, _timeout: Long) extends ActorRef { - _uuid = uuuid + _uuid = uuuid timeout = _timeout - + start lazy val remoteClient = RemoteClient.clientFor(hostname, port) @@ -1271,7 +1266,7 @@ private[akka] case class RemoteActorRef private[akka] ( _isRunning = false _isShutDown = true } - + // ==== NOT SUPPORTED ==== def toBinary: Array[Byte] = unsupported def actorClass: Class[_ <: Actor] = unsupported diff --git a/akka-core/src/main/scala/actor/ActorRegistry.scala b/akka-core/src/main/scala/actor/ActorRegistry.scala index 6fa40e8031..ea77b2c6b7 100644 --- a/akka-core/src/main/scala/actor/ActorRegistry.scala +++ b/akka-core/src/main/scala/actor/ActorRegistry.scala @@ -160,4 +160,4 @@ object ActorRegistry extends Logging { else log.warning("Can't send ActorRegistryEvent to [%s] since it is not running.", listener) } } -} \ No newline at end of file +} diff --git a/akka-core/src/main/scala/actor/Agent.scala b/akka-core/src/main/scala/actor/Agent.scala index 15e42d6a73..e65a5a5b74 100644 --- a/akka-core/src/main/scala/actor/Agent.scala +++ b/akka-core/src/main/scala/actor/Agent.scala @@ -3,47 +3,47 @@ */ package se.scalablesolutions.akka.actor - + import se.scalablesolutions.akka.stm.Ref - + import java.util.concurrent.atomic.AtomicReference import java.util.concurrent.CountDownLatch class AgentException private[akka](message: String) extends RuntimeException(message) - + /** * The Agent class was strongly inspired by the agent principle in Clojure. -*

+*

* -* Agents provide independent, asynchronous change of individual locations. -* Agents are bound to a single storage location for their lifetime, and -* only allow mutation of that location (to a new state) to occur as a -* result of an action. Actions are functions (with, optionally, additional -* arguments) that are asynchronously applied to an Agent's state and whose -* return value becomes the Agent's new state. Because the set of functions -* is open, the set of actions supported by an Agent is also open, a sharp +* Agents provide independent, asynchronous change of individual locations. +* Agents are bound to a single storage location for their lifetime, and +* only allow mutation of that location (to a new state) to occur as a +* result of an action. Actions are functions (with, optionally, additional +* arguments) that are asynchronously applied to an Agent's state and whose +* return value becomes the Agent's new state. Because the set of functions +* is open, the set of actions supported by an Agent is also open, a sharp * contrast to pattern matching message handling loops provided by Actors. -*

-* -* Agents are reactive, not autonomous - there is no imperative message loop -* and no blocking receive. The state of an Agent should be itself immutable -* (preferably an instance of one of Akka's persistent collections), and the -* state of an Agent is always immediately available for reading by any -* thread (using the '()' function) without any messages, i.e. observation +*

+* +* Agents are reactive, not autonomous - there is no imperative message loop +* and no blocking receive. The state of an Agent should be itself immutable +* (preferably an instance of one of Akka's persistent collections), and the +* state of an Agent is always immediately available for reading by any +* thread (using the '()' function) without any messages, i.e. observation * does not require cooperation or coordination. -*

+*

* -* The actions of all Agents get interleaved amongst threads in a thread pool. -* At any point in time, at most one action for each Agent is being executed. -* Actions dispatched to an agent from another single agent or thread will -* occur in the order they were sent, potentially interleaved with actions +* The actions of all Agents get interleaved amongst threads in a thread pool. +* At any point in time, at most one action for each Agent is being executed. +* Actions dispatched to an agent from another single agent or thread will +* occur in the order they were sent, potentially interleaved with actions * dispatched to the same agent from other sources. -*

+*

+* +* If an Agent is used within an enclosing transaction, then it will +* participate in that transaction. +*

* -* If an Agent is used within an enclosing transaction, then it will -* participate in that transaction. -*

-* * Example of usage: *

 * val agent = Agent(5)
@@ -56,65 +56,65 @@ class AgentException private[akka](message: String) extends RuntimeException(mes
 *
 * agent.close
 * 
-*

-* -* Agent is also monadic, which means that you can compose operations using +*

+* +* Agent is also monadic, which means that you can compose operations using * for-comprehensions. In monadic usage the original agents are not touched * but new agents are created. So the old values (agents) are still available * as-is. They are so-called 'persistent'. -*

-* +*

+* * Example of monadic usage: *

 * val agent1 = Agent(3)
 * val agent2 = Agent(5)
 *
 * for (value <- agent1) {
-*   result = value + 1 
+*   result = value + 1
 * }
-* 
-* val agent3 = 
-*   for (value <- agent1) yield value + 1 
-* 
+*
+* val agent3 =
+*   for (value <- agent1) yield value + 1
+*
 * val agent4 = for {
 *   value1 <- agent1
 *   value2 <- agent2
-* } yield value1 + value2 
+* } yield value1 + value2
 *
 * agent1.close
 * agent2.close
 * agent3.close
 * agent4.close
 * 
-*

-* -* IMPORTANT: -* You can *not* call 'agent.get', 'agent()' or use the monadic 'foreach', -* 'map' and 'flatMap' within an enclosing transaction since that would block -* the transaction indefinitely. But all other operations are fine. The system -* will raise an error (e.g. *not* deadlock) if you try to do so, so as long as +*

+* +* IMPORTANT: +* You can *not* call 'agent.get', 'agent()' or use the monadic 'foreach', +* 'map' and 'flatMap' within an enclosing transaction since that would block +* the transaction indefinitely. But all other operations are fine. The system +* will raise an error (e.g. *not* deadlock) if you try to do so, so as long as * you test your application thoroughly you should be fine. -* +* * @author Viktor Klang * @author Jonas Bonér */ sealed class Agent[T] private (initialValue: T) { import Agent._ import Actor._ - + private val dispatcher = actorOf(new AgentDispatcher[T](initialValue)).start dispatcher ! Value(initialValue) - + /** * Submits a request to read the internal state. - * - * A copy of the internal state will be returned, depending on the underlying - * effective copyStrategy. Internally leverages the asynchronous getValue() + * + * A copy of the internal state will be returned, depending on the underlying + * effective copyStrategy. Internally leverages the asynchronous getValue() * method and then waits for its result on a CountDownLatch. */ final def get: T = { if (dispatcher.isTransactionInScope) throw new AgentException( - "Can't call Agent.get within an enclosing transaction."+ + "Can't call Agent.get within an enclosing transaction."+ "\n\tWould block indefinitely.\n\tPlease refactor your code.") val ref = new AtomicReference[T] val latch = new CountDownLatch(1) @@ -122,10 +122,10 @@ sealed class Agent[T] private (initialValue: T) { latch.await ref.get } - + /** - * Submits a request to read the internal state. A copy of the internal state will be - * returned, depending on the underlying effective copyStrategy. Internally leverages + * Submits a request to read the internal state. A copy of the internal state will be + * returned, depending on the underlying effective copyStrategy. Internally leverages * the asynchronous getValue() method and then waits for its result on a CountDownLatch. */ final def apply(): T = get @@ -134,25 +134,25 @@ sealed class Agent[T] private (initialValue: T) { * Submits the provided function for execution against the internal agent's state. */ final def apply(message: (T => T)): Unit = dispatcher ! Function(message) - + /** * Submits a new value to be set as the new agent's internal state. */ final def apply(message: T): Unit = dispatcher ! Value(message) - + /** * Submits the provided function of type 'T => T' for execution against the internal agent's state. */ final def send(message: (T) => T): Unit = dispatcher ! Function(message) - + /** * Submits a new value to be set as the new agent's internal state. */ final def send(message: T): Unit = dispatcher ! Value(message) - + /** - * Asynchronously submits a procedure of type 'T => Unit' to read the internal state. - * The supplied procedure will be executed on the returned internal state value. A copy + * Asynchronously submits a procedure of type 'T => Unit' to read the internal state. + * The supplied procedure will be executed on the returned internal state value. A copy * of the internal state will be used, depending on the underlying effective copyStrategy. * Does not change the value of the agent (this). */ @@ -174,23 +174,23 @@ sealed class Agent[T] private (initialValue: T) { * Applies function with type 'T => B' to the agent's internal state. * Does not change the value of the agent (this). */ - final def foreach(f: (T) => Unit): Unit = f(get) + final def foreach(f: (T) => Unit): Unit = f(get) /** * Closes the agents and makes it eligable for garbage collection. - * + * * A closed agent can never be used again. */ def close = dispatcher.stop } - + /** * Provides factory methods to create Agents. * * @author Viktor Klang * @author Jonas Bonér */ -object Agent { +object Agent { /* * The internal messages for passing around requests. @@ -198,7 +198,7 @@ object Agent { private[akka] case class Value[T](value: T) private[akka] case class Function[T](fun: ((T) => T)) private[akka] case class Procedure[T](fun: ((T) => Unit)) - + /** * Creates a new Agent of type T with the initial value of value. */ @@ -214,9 +214,9 @@ final class AgentDispatcher[T] private[akka] (initialValue: T) extends Transacto import Agent._ import Actor._ log.debug("Starting up Agent [%s]", self.uuid) - + private lazy val value = Ref[T]() - + /** * Periodically handles incoming messages. */ @@ -228,11 +228,11 @@ final class AgentDispatcher[T] private[akka] (initialValue: T) extends Transacto case Procedure(proc: (T => Unit)) => proc(value.getOrElse(throw new AgentException("Could not read Agent's value; value is null"))) } - + /** - * Performs a CAS operation, atomically swapping the internal state with the value + * Performs a CAS operation, atomically swapping the internal state with the value * provided as a by-name parameter. */ private final def swap(newData: => T): Unit = value.swap(newData) } - + diff --git a/akka-core/src/main/scala/actor/BootableActorLoaderService.scala b/akka-core/src/main/scala/actor/BootableActorLoaderService.scala index 14ab2301df..de0d174fc7 100644 --- a/akka-core/src/main/scala/actor/BootableActorLoaderService.scala +++ b/akka-core/src/main/scala/actor/BootableActorLoaderService.scala @@ -29,21 +29,28 @@ trait BootableActorLoaderService extends Bootable with Logging { log.error("Could not find a deploy directory at [%s]", DEPLOY) System.exit(-1) } - val filesToDeploy = DEPLOY_DIR.listFiles.toArray.toList.asInstanceOf[List[File]].filter(_.getName.endsWith(".jar")) + val filesToDeploy = DEPLOY_DIR.listFiles.toArray.toList + .asInstanceOf[List[File]].filter(_.getName.endsWith(".jar")) var dependencyJars: List[URL] = Nil filesToDeploy.map { file => val jarFile = new JarFile(file) val en = jarFile.entries while (en.hasMoreElements) { val name = en.nextElement.getName - if (name.endsWith(".jar")) dependencyJars ::= new File(String.format("jar:file:%s!/%s", jarFile.getName, name)).toURI.toURL + if (name.endsWith(".jar")) dependencyJars ::= new File( + String.format("jar:file:%s!/%s", jarFile.getName, name)).toURI.toURL } } val toDeploy = filesToDeploy.map(_.toURI.toURL) log.info("Deploying applications from [%s]: [%s]", DEPLOY, toDeploy) log.debug("Loading dependencies [%s]", dependencyJars) val allJars = toDeploy ::: dependencyJars - new URLClassLoader(allJars.toArray.asInstanceOf[Array[URL]] , getClass.getClassLoader) + + val parentClassLoader = classOf[Seq[_]].getClassLoader + URLClassLoader.newInstance( + allJars.toArray.asInstanceOf[Array[URL]], + ClassLoader.getSystemClassLoader) + //parentClassLoader) } else getClass.getClassLoader) } diff --git a/akka-core/src/main/scala/actor/Scheduler.scala b/akka-core/src/main/scala/actor/Scheduler.scala index fcbba357ad..7bc9f6d48f 100644 --- a/akka-core/src/main/scala/actor/Scheduler.scala +++ b/akka-core/src/main/scala/actor/Scheduler.scala @@ -9,8 +9,10 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. + * + * Rework of David Pollak's ActorPing class in the Lift Project + * which is licensed under the Apache 2 License. */ - package se.scalablesolutions.akka.actor import java.util.concurrent._ @@ -19,59 +21,50 @@ import se.scalablesolutions.akka.config.ScalaConfig._ import se.scalablesolutions.akka.config.{AllForOneStrategy, OneForOneStrategy, FaultHandlingStrategy} import se.scalablesolutions.akka.util.Logging -case object UnSchedule -case class SchedulerException(msg: String, e: Throwable) extends RuntimeException(msg, e) - -/** - * Rework of David Pollak's ActorPing class in the Lift Project - * which is licensed under the Apache 2 License. - */ -class ScheduleActor(val receiver: ActorRef, val future: ScheduledFuture[AnyRef]) extends Actor with Logging { - self.lifeCycle = Some(LifeCycle(Permanent)) - - def receive = { - case UnSchedule => - Scheduler.stopSupervising(self) - future.cancel(true) - exit - } -} - -object Scheduler extends Actor { +object Scheduler { import Actor._ - + + case object UnSchedule + case class SchedulerException(msg: String, e: Throwable) extends RuntimeException(msg, e) + private var service = Executors.newSingleThreadScheduledExecutor(SchedulerThreadFactory) private val schedulers = new ConcurrentHashMap[ActorRef, ActorRef] - self.faultHandler = Some(OneForOneStrategy(5, 5000)) - self.trapExit = List(classOf[Throwable]) def schedule(receiver: ActorRef, message: AnyRef, initialDelay: Long, delay: Long, timeUnit: TimeUnit) = { try { - self.startLink(actorOf(new ScheduleActor( - receiver, - service.scheduleAtFixedRate(new java.lang.Runnable { - def run = receiver ! message; - }, initialDelay, delay, timeUnit).asInstanceOf[ScheduledFuture[AnyRef]]))) + val future = service.scheduleAtFixedRate( + new Runnable { def run = receiver ! message }, + initialDelay, delay, timeUnit).asInstanceOf[ScheduledFuture[AnyRef]] + val scheduler = actorOf(new ScheduleActor(future)).start + schedulers.put(scheduler, scheduler) } catch { case e => throw SchedulerException(message + " could not be scheduled on " + receiver, e) } } - def restart = service = Executors.newSingleThreadScheduledExecutor(SchedulerThreadFactory) - - def stopSupervising(actorRef: ActorRef) = { - self.unlink(actorRef) + def unschedule(actorRef: ActorRef) = { + actorRef ! UnSchedule schedulers.remove(actorRef) } - override def shutdown = { + def shutdown = { import scala.collection.JavaConversions._ schedulers.values.foreach(_ ! UnSchedule) + schedulers.clear service.shutdown } + def restart = { + shutdown + service = Executors.newSingleThreadScheduledExecutor(SchedulerThreadFactory) + } +} + +private class ScheduleActor(future: ScheduledFuture[AnyRef]) extends Actor with Logging { def receive = { - case _ => {} // ignore all messages + case Scheduler.UnSchedule => + future.cancel(true) + exit } } diff --git a/akka-core/src/main/scala/actor/Supervisor.scala b/akka-core/src/main/scala/actor/Supervisor.scala index 3f05f18548..f2c94f87e1 100644 --- a/akka-core/src/main/scala/actor/Supervisor.scala +++ b/akka-core/src/main/scala/actor/Supervisor.scala @@ -11,6 +11,7 @@ import se.scalablesolutions.akka.remote.RemoteServer import Actor._ import java.util.concurrent.{CopyOnWriteArrayList, ConcurrentHashMap} +import java.net.InetSocketAddress class SupervisorException private[akka](message: String) extends RuntimeException(message) @@ -19,7 +20,7 @@ class SupervisorException private[akka](message: String) extends RuntimeExceptio * These are not actors, if you need a supervisor that is an Actor then you have to use the 'SupervisorActor' * factory object. *

- * + * * Here is a sample on how to use it: *

  *  val supervisor = Supervisor(
@@ -49,7 +50,7 @@ object Supervisor {
 /**
  * Factory object for creating supervisors as Actors, it has both a declarative and programatic API.
  * 

- * + * * Here is a sample on how to use the programmatic API (note that the supervisor is automatically started): *

  * val supervisor = SupervisorActor(AllForOneStrategy(maxNrOfRetries, timeRange), Array(classOf[Throwable]))
@@ -67,22 +68,22 @@ object Supervisor {
  *        LifeCycle(Permanent)) ::
  *      Nil))
  * 
- * + * * You dynamically link and unlink child children using the 'link' and 'unlink' methods. *
  * supervisor.link(child)
  * supervisor.unlink(child)
  * 
- * + * * @author Jonas Bonér */ object SupervisorActor { - def apply(config: SupervisorConfig): ActorRef = { + def apply(config: SupervisorConfig): ActorRef = { val (handler, trapExits) = SupervisorFactory.retrieveFaultHandlerAndTrapExitsFrom(config) actorOf(new SupervisorActor(handler, trapExits)).start } - def apply(handler: FaultHandlingStrategy, trapExceptions: List[Class[_ <: Throwable]]): ActorRef = + def apply(handler: FaultHandlingStrategy, trapExceptions: List[Class[_ <: Throwable]]): ActorRef = actorOf(new SupervisorActor(handler, trapExceptions)).start } @@ -116,9 +117,9 @@ object SupervisorActor { */ object SupervisorFactory { def apply(config: SupervisorConfig) = new SupervisorFactory(config) - - private[akka] def retrieveFaultHandlerAndTrapExitsFrom(config: SupervisorConfig): - Tuple2[FaultHandlingStrategy, List[Class[_ <: Throwable]]] = config match { + + private[akka] def retrieveFaultHandlerAndTrapExitsFrom(config: SupervisorConfig): + Tuple2[FaultHandlingStrategy, List[Class[_ <: Throwable]]] = config match { case SupervisorConfig(RestartStrategy(scheme, maxNrOfRetries, timeRange, trapExceptions), _) => scheme match { case AllForOne => (AllForOneStrategy(maxNrOfRetries, timeRange), trapExceptions) @@ -128,8 +129,8 @@ object SupervisorFactory { } /** - * For internal use only. - * + * For internal use only. + * * @author Jonas Bonér */ class SupervisorFactory private[akka] (val config: SupervisorConfig) extends Logging { @@ -148,32 +149,32 @@ class SupervisorFactory private[akka] (val config: SupervisorConfig) extends Log /** * NOTE: - *

+ *

* The supervisor class is only used for the configuration system when configuring supervisor * hierarchies declaratively. Should not be used as part of the regular programming API. Instead * wire the children together using 'link', 'spawnLink' etc. and set the 'trapExit' flag in the * children that should trap error signals and trigger restart. - *

+ *

* See the ScalaDoc for the SupervisorFactory for an example on how to declaratively wire up children. * * @author Jonas Bonér - */ + */ sealed class Supervisor private[akka] ( handler: FaultHandlingStrategy, trapExceptions: List[Class[_ <: Throwable]]) extends Configurator { import Supervisor._ - + private val childActors = new ConcurrentHashMap[String, List[ActorRef]] - private val childSupervisors = new CopyOnWriteArrayList[Supervisor] + private val childSupervisors = new CopyOnWriteArrayList[Supervisor] private[akka] val supervisor = SupervisorActor(handler, trapExceptions) - + def uuid = supervisor.uuid - - def start: Supervisor = { + + def start: Supervisor = { ConfiguratorRepository.registerConfigurator(this) this } - + def shutdown: Unit = supervisor.stop def link(child: ActorRef) = supervisor.link(child) @@ -186,7 +187,7 @@ sealed class Supervisor private[akka] ( // FIXME recursive search + do not fix if we remove feature that Actors can be RESTful usin Jersey annotations def getComponentInterfaces: List[Class[_]] = childActors.values.toArray.toList.asInstanceOf[List[List[AnyRef]]].flatten.map(_.getClass) - + // FIXME recursive search + do not fix if we remove feature that Actors can be RESTful usin Jersey annotations def isDefined(clazz: Class[_]): Boolean = childActors.containsKey(clazz.getName) @@ -196,7 +197,7 @@ sealed class Supervisor private[akka] ( server match { case Supervise(actorRef, lifeCycle, remoteAddress) => val className = actorRef.actor.getClass.getName - val currentActors = { + val currentActors = { val list = childActors.get(className) if (list eq null) List[ActorRef]() else list @@ -204,11 +205,8 @@ sealed class Supervisor private[akka] ( childActors.put(className, actorRef :: currentActors) actorRef.lifeCycle = Some(lifeCycle) supervisor.link(actorRef) - remoteAddress.foreach { address => RemoteServer - .actorsFor(RemoteServer.Address(address.hostname, address.port)) - .actors.put(actorRef.id, actorRef) - } - + remoteAddress.foreach(address => + RemoteServer.registerActor(new InetSocketAddress(address.hostname, address.port), actorRef.uuid, actorRef)) case supervisorConfig @ SupervisorConfig(_, _) => // recursive supervisor configuration val childSupervisor = Supervisor(supervisorConfig) supervisor.link(childSupervisor.supervisor) @@ -231,11 +229,11 @@ sealed class Supervisor private[akka] ( * supervisor.link(child) * supervisor.unlink(child) *

- * + * * @author Jonas Bonér */ final class SupervisorActor private[akka] ( - handler: FaultHandlingStrategy, + handler: FaultHandlingStrategy, trapExceptions: List[Class[_ <: Throwable]]) extends Actor { import self._ trapExit = trapExceptions diff --git a/akka-core/src/main/scala/config/ActiveObjectConfigurator.scala b/akka-core/src/main/scala/config/ActiveObjectConfigurator.scala index 8419c7fcd9..88e495bbd0 100644 --- a/akka-core/src/main/scala/config/ActiveObjectConfigurator.scala +++ b/akka-core/src/main/scala/config/ActiveObjectConfigurator.scala @@ -18,7 +18,7 @@ import com.google.inject._ *

* If you don't want declarative configuration then you should use the ActiveObject * factory methods. - * + * * @author Jonas Bonér */ class ActiveObjectConfigurator { diff --git a/akka-core/src/main/scala/config/ActiveObjectGuiceConfigurator.scala b/akka-core/src/main/scala/config/ActiveObjectGuiceConfigurator.scala index 6f3a6177dc..9785ea2082 100644 --- a/akka-core/src/main/scala/config/ActiveObjectGuiceConfigurator.scala +++ b/akka-core/src/main/scala/config/ActiveObjectGuiceConfigurator.scala @@ -17,9 +17,9 @@ import java.net.InetSocketAddress import java.lang.reflect.Method /** - * This is an class for internal usage. Instead use the se.scalablesolutions.akka.config.ActiveObjectConfigurator + * This is an class for internal usage. Instead use the se.scalablesolutions.akka.config.ActiveObjectConfigurator * class for creating ActiveObjects. - * + * * @author Jonas Bonér */ private[akka] class ActiveObjectGuiceConfigurator extends ActiveObjectConfiguratorBase with Logging { @@ -85,15 +85,11 @@ private[akka] class ActiveObjectGuiceConfigurator extends ActiveObjectConfigurat val actorRef = Actor.actorOf(new Dispatcher(component.transactionRequired, component.lifeCycle.callbacks)) if (component.dispatcher.isDefined) actorRef.dispatcher = component.dispatcher.get val remoteAddress = - if (component.remoteAddress.isDefined) + if (component.remoteAddress.isDefined) Some(new InetSocketAddress(component.remoteAddress.get.hostname, component.remoteAddress.get.port)) else None val proxy = ActiveObject.newInstance(targetClass, actorRef, remoteAddress, component.timeout).asInstanceOf[AnyRef] - if (remoteAddress.isDefined) { - RemoteServer - .actorsFor(RemoteServer.Address(component.remoteAddress.get.hostname, component.remoteAddress.get.port)) - .activeObjects.put(targetClass.getName, proxy) - } + remoteAddress.foreach(address => RemoteServer.registerActiveObject(address, targetClass.getName, proxy)) supervised ::= Supervise(actorRef, component.lifeCycle) activeObjectRegistry.put(targetClass, (proxy, proxy, component)) new DependencyBinding(targetClass, proxy) @@ -106,16 +102,12 @@ private[akka] class ActiveObjectGuiceConfigurator extends ActiveObjectConfigurat val actorRef = Actor.actorOf(new Dispatcher(component.transactionRequired, component.lifeCycle.callbacks)) if (component.dispatcher.isDefined) actorRef.dispatcher = component.dispatcher.get val remoteAddress = - if (component.remoteAddress.isDefined) + if (component.remoteAddress.isDefined) Some(new InetSocketAddress(component.remoteAddress.get.hostname, component.remoteAddress.get.port)) else None val proxy = ActiveObject.newInstance( targetClass, targetInstance, actorRef, remoteAddress, component.timeout).asInstanceOf[AnyRef] - if (remoteAddress.isDefined) { - RemoteServer - .actorsFor(RemoteServer.Address(component.remoteAddress.get.hostname, component.remoteAddress.get.port)) - .activeObjects.put(targetClass.getName, proxy) - } + remoteAddress.foreach(address => RemoteServer.registerActiveObject(address, targetClass.getName, proxy)) supervised ::= Supervise(actorRef, component.lifeCycle) activeObjectRegistry.put(targetClass, (proxy, targetInstance, component)) new DependencyBinding(targetClass, proxy) @@ -166,4 +158,4 @@ private[akka] class ActiveObjectGuiceConfigurator extends ActiveObjectConfigurat if (supervisor.isDefined) supervisor.get.shutdown } } - \ No newline at end of file + diff --git a/akka-core/src/main/scala/config/Config.scala b/akka-core/src/main/scala/config/Config.scala index fbafdb9b68..0b492ec8fa 100644 --- a/akka-core/src/main/scala/config/Config.scala +++ b/akka-core/src/main/scala/config/Config.scala @@ -6,11 +6,13 @@ package se.scalablesolutions.akka.config import se.scalablesolutions.akka.util.Logging -import net.lag.configgy.{Configgy, ParseException} +import net.lag.configgy.{Config => CConfig, Configgy, ParseException} class ConfigurationException(message: String) extends RuntimeException(message) /** + * Loads up the configuration (from the akka.conf file). + * * @author Jonas Bonér */ object Config extends Logging { @@ -37,9 +39,10 @@ object Config extends Logging { log.info("Config loaded from -Dakka.config=%s", configFile) } catch { case e: ParseException => throw new ConfigurationException( - "Config could not be loaded from -Dakka.config=" + configFile + + "Config could not be loaded from -Dakka.config=" + configFile + "\n\tdue to: " + e.toString) } + Configgy.config } else if (getClass.getClassLoader.getResource("akka.conf") != null) { try { Configgy.configureFromResource("akka.conf", getClass.getClassLoader) @@ -49,6 +52,7 @@ object Config extends Logging { "Can't load 'akka.conf' config file from application classpath," + "\n\tdue to: " + e.toString) } + Configgy.config } else if (HOME.isDefined) { try { val configFile = HOME.get + "/config/akka.conf" @@ -60,23 +64,24 @@ object Config extends Logging { "\n\tbut the 'akka.conf' config file can not be found at [" + HOME.get + "/config/akka.conf]," + "\n\tdue to: " + e.toString) } + Configgy.config } else { - throw new ConfigurationException( + log.warning( "\nCan't load 'akka.conf'." + "\nOne of the three ways of locating the 'akka.conf' file needs to be defined:" + "\n\t1. Define the '-Dakka.config=...' system property option." + "\n\t2. Put the 'akka.conf' file on the classpath." + "\n\t3. Define 'AKKA_HOME' environment variable pointing to the root of the Akka distribution." + "\nI have no way of finding the 'akka.conf' configuration file." + - "\nAborting.") + "\nUsing default values everywhere.") + CConfig.fromString("") } - Configgy.config } - val CONFIG_VERSION = config.getString("akka.version", "0") + val CONFIG_VERSION = config.getString("akka.version", VERSION) if (VERSION != CONFIG_VERSION) throw new ConfigurationException( "Akka JAR version [" + VERSION + "] is different than the provided config ('akka.conf') version [" + CONFIG_VERSION + "]") - val startTime = System.currentTimeMillis + val startTime = System.currentTimeMillis def uptime = (System.currentTimeMillis - startTime) / 1000 } diff --git a/akka-core/src/main/scala/config/Configuration.scala b/akka-core/src/main/scala/config/Configuration.scala index 266422e7c1..faa5c912f1 100644 --- a/akka-core/src/main/scala/config/Configuration.scala +++ b/akka-core/src/main/scala/config/Configuration.scala @@ -57,4 +57,4 @@ class Component(@BeanProperty val intf: Class[_], @BeanProperty val timeout: Int) extends Server { def newWorker(proxy: ActiveObjectProxy) = se.scalablesolutions.akka.kernel.Supervise(proxy.server, lifeCycle.transform) } -*/ \ No newline at end of file +*/ diff --git a/akka-core/src/main/scala/config/Configurator.scala b/akka-core/src/main/scala/config/Configurator.scala index fcb354a1f7..58e37ce931 100644 --- a/akka-core/src/main/scala/config/Configurator.scala +++ b/akka-core/src/main/scala/config/Configurator.scala @@ -16,7 +16,7 @@ private[akka] trait Configurator { * @param clazz the class for the active object * @return the active object for the class */ - def getInstance[T](clazz: Class[T]): List[T] + def getInstance[T](clazz: Class[T]): List[T] def getComponentInterfaces: List[Class[_]] diff --git a/akka-core/src/main/scala/config/SupervisionConfig.scala b/akka-core/src/main/scala/config/SupervisionConfig.scala index 7f1cd308b3..dc04d9f38c 100644 --- a/akka-core/src/main/scala/config/SupervisionConfig.scala +++ b/akka-core/src/main/scala/config/SupervisionConfig.scala @@ -4,7 +4,7 @@ package se.scalablesolutions.akka.config -import se.scalablesolutions.akka.actor.{Actor, ActorRef} +import se.scalablesolutions.akka.actor.{Actor, ActorRef} import se.scalablesolutions.akka.dispatch.MessageDispatcher sealed abstract class FaultHandlingStrategy @@ -24,7 +24,7 @@ object ScalaConfig { abstract class Scope extends ConfigElement case class SupervisorConfig(restartStrategy: RestartStrategy, worker: List[Server]) extends Server - + class Supervise(val actorRef: ActorRef, val lifeCycle: LifeCycle, _remoteAddress: RemoteAddress) extends Server { val remoteAddress: Option[RemoteAddress] = if (_remoteAddress eq null) None else Some(_remoteAddress) } @@ -135,7 +135,7 @@ object JavaConfig { def transform = se.scalablesolutions.akka.config.ScalaConfig.RestartStrategy( scheme.transform, maxNrOfRetries, withinTimeRange, trapExceptions.toList) } - + class LifeCycle(@BeanProperty val scope: Scope, @BeanProperty val callbacks: RestartCallbacks) extends ConfigElement { def this(scope: Scope) = this(scope, null) def transform = { @@ -230,5 +230,5 @@ object JavaConfig { def newSupervised(actorRef: ActorRef) = se.scalablesolutions.akka.config.ScalaConfig.Supervise(actorRef, lifeCycle.transform) } - -} \ No newline at end of file + +} diff --git a/akka-core/src/main/scala/dispatch/AbstractReactorBasedEventDrivenDispatcher.scala b/akka-core/src/main/scala/dispatch/AbstractReactorBasedEventDrivenDispatcher.scala index 8d87272ef0..72e94526ce 100644 --- a/akka-core/src/main/scala/dispatch/AbstractReactorBasedEventDrivenDispatcher.scala +++ b/akka-core/src/main/scala/dispatch/AbstractReactorBasedEventDrivenDispatcher.scala @@ -15,8 +15,8 @@ abstract class AbstractReactorBasedEventDrivenDispatcher(val name: String) exten protected val messageInvokers = new HashMap[AnyRef, MessageInvoker] protected var selectorThread: Thread = _ protected val guard = new Object - - def dispatch(invocation: MessageInvocation) = queue.append(invocation) + + def dispatch(invocation: MessageInvocation) = queue.append(invocation) override def register(actorRef: ActorRef) = synchronized { messageInvokers.put(actorRef, new ActorMessageInvoker(actorRef)) diff --git a/akka-core/src/main/scala/dispatch/Dispatchers.scala b/akka-core/src/main/scala/dispatch/Dispatchers.scala index 6fa9ebd418..2f138f038b 100644 --- a/akka-core/src/main/scala/dispatch/Dispatchers.scala +++ b/akka-core/src/main/scala/dispatch/Dispatchers.scala @@ -45,7 +45,7 @@ object Dispatchers { super.register(actor) } } - + object globalReactorBasedSingleThreadEventDrivenDispatcher extends ReactorBasedSingleThreadEventDrivenDispatcher("global") object globalReactorBasedThreadPoolEventDrivenDispatcher extends ReactorBasedThreadPoolEventDrivenDispatcher("global") diff --git a/akka-core/src/main/scala/dispatch/ExecutorBasedEventDrivenDispatcher.scala b/akka-core/src/main/scala/dispatch/ExecutorBasedEventDrivenDispatcher.scala index b602dbb83b..a1af0c3877 100644 --- a/akka-core/src/main/scala/dispatch/ExecutorBasedEventDrivenDispatcher.scala +++ b/akka-core/src/main/scala/dispatch/ExecutorBasedEventDrivenDispatcher.scala @@ -96,7 +96,7 @@ class ExecutorBasedEventDrivenDispatcher(_name: String) extends MessageDispatche active = false references.clear } - + def usesActorMailbox = true def ensureNotActive: Unit = if (active) throw new IllegalStateException( diff --git a/akka-core/src/main/scala/dispatch/ExecutorBasedEventDrivenWorkStealingDispatcher.scala b/akka-core/src/main/scala/dispatch/ExecutorBasedEventDrivenWorkStealingDispatcher.scala index 7f95ebcc9b..438abadfda 100644 --- a/akka-core/src/main/scala/dispatch/ExecutorBasedEventDrivenWorkStealingDispatcher.scala +++ b/akka-core/src/main/scala/dispatch/ExecutorBasedEventDrivenWorkStealingDispatcher.scala @@ -32,7 +32,7 @@ class ExecutorBasedEventDrivenWorkStealingDispatcher(_name: String) extends Mess @volatile private var active: Boolean = false implicit def actorRef2actor(actorRef: ActorRef): Actor = actorRef.actor - + /** Type of the actors registered in this dispatcher. */ private var actorType:Option[Class[_]] = None @@ -51,7 +51,7 @@ class ExecutorBasedEventDrivenWorkStealingDispatcher(_name: String) extends Mess if (!tryProcessMailbox(invocation.receiver)) { // we are not able to process our mailbox (another thread is busy with it), so lets donate some of our mailbox // to another actor and then process his mailbox in stead. - findThief(invocation.receiver).foreach( tryDonateAndProcessMessages(invocation.receiver,_) ) + findThief(invocation.receiver).foreach( tryDonateAndProcessMessages(invocation.receiver,_) ) } } }) @@ -97,7 +97,7 @@ class ExecutorBasedEventDrivenWorkStealingDispatcher(_name: String) extends Mess // copy to prevent concurrent modifications having any impact val actors = pooledActors.toArray(new Array[ActorRef](pooledActors.size)) val i = if ( lastThiefIndex > actors.size ) 0 else lastThiefIndex - + // we risk to pick a thief which is unregistered from the dispatcher in the meantime, but that typically means // the dispatcher is being shut down... val (thief: Option[ActorRef], index: Int) = doFindThief(receiver, actors, i) diff --git a/akka-core/src/main/scala/dispatch/Future.scala b/akka-core/src/main/scala/dispatch/Future.scala index 3bdfc5fb26..d1b4f9572b 100644 --- a/akka-core/src/main/scala/dispatch/Future.scala +++ b/akka-core/src/main/scala/dispatch/Future.scala @@ -44,7 +44,7 @@ object Futures { def awaitEither[T](f1: Future[T], f2: Future[T]): Option[T] = { import Actor.Sender.Self import Actor.{spawn, actor} - + case class Result(res: Option[T]) val handOff = new SynchronousQueue[Option[T]] spawn { diff --git a/akka-core/src/main/scala/dispatch/ReactorBasedSingleThreadEventDrivenDispatcher.scala b/akka-core/src/main/scala/dispatch/ReactorBasedSingleThreadEventDrivenDispatcher.scala index fc99cf88d2..e8fbe9a221 100644 --- a/akka-core/src/main/scala/dispatch/ReactorBasedSingleThreadEventDrivenDispatcher.scala +++ b/akka-core/src/main/scala/dispatch/ReactorBasedSingleThreadEventDrivenDispatcher.scala @@ -37,7 +37,7 @@ class ReactorBasedSingleThreadEventDrivenDispatcher(name: String) extends Abstra } def isShutdown = !active - + def usesActorMailbox = false class Demultiplexer(private val messageQueue: ReactiveMessageQueue) extends MessageDemultiplexer { diff --git a/akka-core/src/main/scala/dispatch/ReactorBasedThreadPoolEventDrivenDispatcher.scala b/akka-core/src/main/scala/dispatch/ReactorBasedThreadPoolEventDrivenDispatcher.scala index 3f33d4ffc0..e73ad26013 100644 --- a/akka-core/src/main/scala/dispatch/ReactorBasedThreadPoolEventDrivenDispatcher.scala +++ b/akka-core/src/main/scala/dispatch/ReactorBasedThreadPoolEventDrivenDispatcher.scala @@ -125,16 +125,16 @@ class ReactorBasedThreadPoolEventDrivenDispatcher(_name: String) private def resume(actor: AnyRef) = synchronized { busyActors.add(actor) } - + private def suspend(actor: AnyRef) = synchronized { - busyActors.remove(actor) + busyActors.remove(actor) } - + private def passFairnessCheck(nrOfBusyMessages: Int) = { if (fair) true else nrOfBusyMessages < 100 } - + def usesActorMailbox = false def ensureNotActive: Unit = if (active) throw new IllegalStateException( diff --git a/akka-core/src/main/scala/dispatch/ThreadBasedDispatcher.scala b/akka-core/src/main/scala/dispatch/ThreadBasedDispatcher.scala index d13b41e574..f5d8c034c1 100644 --- a/akka-core/src/main/scala/dispatch/ThreadBasedDispatcher.scala +++ b/akka-core/src/main/scala/dispatch/ThreadBasedDispatcher.scala @@ -11,18 +11,18 @@ import se.scalablesolutions.akka.actor.{Actor, ActorRef, ActorMessageInvoker} /** * Dedicates a unique thread for each actor passed in as reference. Served through its messageQueue. - * + * * @author Jonas Bonér */ class ThreadBasedDispatcher(actor: ActorRef) extends MessageDispatcher { private val name = actor.getClass.getName + ":" + actor.uuid - private val threadName = "thread-based:dispatcher:" + name + private val threadName = "thread-based:dispatcher:" + name private val messageHandler = new ActorMessageInvoker(actor) private val queue = new BlockingMessageQueue(name) private var selectorThread: Thread = _ @volatile private var active: Boolean = false - def dispatch(invocation: MessageInvocation) = queue.append(invocation) + def dispatch(invocation: MessageInvocation) = queue.append(invocation) def start = if (!active) { active = true @@ -37,7 +37,7 @@ class ThreadBasedDispatcher(actor: ActorRef) extends MessageDispatcher { } selectorThread.start } - + def isShutdown = !active def usesActorMailbox = false diff --git a/akka-core/src/main/scala/dispatch/ThreadPoolBuilder.scala b/akka-core/src/main/scala/dispatch/ThreadPoolBuilder.scala index a5f097a84b..21753e77c9 100644 --- a/akka-core/src/main/scala/dispatch/ThreadPoolBuilder.scala +++ b/akka-core/src/main/scala/dispatch/ThreadPoolBuilder.scala @@ -18,7 +18,7 @@ trait ThreadPoolBuilder { private val NR_MAX_THREADS = 128 private val KEEP_ALIVE_TIME = 60000L // default is one minute private val MILLISECONDS = TimeUnit.MILLISECONDS - + private var threadPoolBuilder: ThreadPoolExecutor = _ private var boundedExecutorBound = -1 private var inProcessOfBuilding = false @@ -30,7 +30,7 @@ trait ThreadPoolBuilder { def isShutdown = executor.isShutdown - def buildThreadPool = synchronized { + def buildThreadPool: Unit = synchronized { ensureNotActive inProcessOfBuilding = false if (boundedExecutorBound > 0) { @@ -152,7 +152,7 @@ trait ThreadPoolBuilder { } def ensureNotActive: Unit - + /** * @author Jonas Bonér */ @@ -248,4 +248,4 @@ trait ThreadPoolBuilder { } } } -} \ No newline at end of file +} diff --git a/akka-core/src/main/scala/remote/BootableRemoteActorService.scala b/akka-core/src/main/scala/remote/BootableRemoteActorService.scala index 8aaec0661b..6917b38129 100644 --- a/akka-core/src/main/scala/remote/BootableRemoteActorService.scala +++ b/akka-core/src/main/scala/remote/BootableRemoteActorService.scala @@ -1,7 +1,7 @@ /** * Copyright (C) 2009-2010 Scalable Solutions AB */ - + package se.scalablesolutions.akka.remote import se.scalablesolutions.akka.actor.BootableActorLoaderService @@ -19,16 +19,16 @@ trait BootableRemoteActorService extends Bootable with Logging { protected lazy val remoteServerThread = new Thread(new Runnable() { def run = RemoteNode.start(self.applicationLoader) }, "Akka Remote Service") - + def startRemoteService = remoteServerThread.start - + abstract override def onLoad = { super.onLoad //Initialize BootableActorLoaderService before remote service if(config.getBool("akka.remote.server.service", true)){ - + if(config.getBool("akka.remote.cluster.service", true)) Cluster.start(self.applicationLoader) - + log.info("Initializing Remote Actors Service...") startRemoteService log.info("Remote Actors Service initialized!") diff --git a/akka-core/src/main/scala/remote/Cluster.scala b/akka-core/src/main/scala/remote/Cluster.scala index e2634b5c5d..948cb07a8b 100644 --- a/akka-core/src/main/scala/remote/Cluster.scala +++ b/akka-core/src/main/scala/remote/Cluster.scala @@ -62,7 +62,7 @@ trait Cluster { * @author Viktor Klang */ trait ClusterActor extends Actor with Cluster { - val name = config.getString("akka.remote.cluster.name") getOrElse "default" + val name = config.getString("akka.remote.cluster.name", "default") @volatile protected var serializer : Serializer = _ @@ -233,12 +233,13 @@ abstract class BasicClusterActor extends ClusterActor with Logging { */ object Cluster extends Cluster with Logging { lazy val DEFAULT_SERIALIZER_CLASS_NAME = Serializer.Java.getClass.getName + lazy val DEFAULT_CLUSTER_ACTOR_CLASS_NAME = classOf[JGroupsClusterActor].getName @volatile private[remote] var clusterActor: Option[ClusterActor] = None @volatile private[remote] var clusterActorRef: Option[ActorRef] = None private[remote] def createClusterActor(loader: ClassLoader): Option[ActorRef] = { - val name = config.getString("akka.remote.cluster.actor") + val name = config.getString("akka.remote.cluster.actor", DEFAULT_CLUSTER_ACTOR_CLASS_NAME) if (name.isEmpty) throw new IllegalArgumentException( "Can't start cluster since the 'akka.remote.cluster.actor' configuration option is not defined") @@ -246,19 +247,16 @@ object Cluster extends Cluster with Logging { "akka.remote.cluster.serializer", DEFAULT_SERIALIZER_CLASS_NAME)) .newInstance.asInstanceOf[Serializer] serializer.classLoader = Some(loader) + try { - name map { - fqn => - Actor.actorOf({ - val a = Class.forName(fqn).newInstance.asInstanceOf[ClusterActor] - a setSerializer serializer - a - }) - } - } - catch { - case e => - log.error(e, "Couldn't load Cluster provider: [%s]", name.getOrElse("Not specified")) + Some(Actor.actorOf { + val a = Class.forName(name).newInstance.asInstanceOf[ClusterActor] + a setSerializer serializer + a + }) + } catch { + case e => + log.error(e, "Couldn't load Cluster provider: [%s]", name) None } } @@ -286,9 +284,9 @@ object Cluster extends Cluster with Logging { def start(serializerClassLoader: Option[ClassLoader]): Unit = synchronized { log.info("Starting up Cluster Service...") if (clusterActor.isEmpty) { - for { + for { actorRef <- createClusterActor(serializerClassLoader getOrElse getClass.getClassLoader) - sup <- createSupervisor(actorRef) + sup <- createSupervisor(actorRef) } { clusterActorRef = Some(actorRef.start) clusterActor = Some(actorRef.actor.asInstanceOf[ClusterActor]) diff --git a/akka-cluster/src/main/scala/JGroupsClusterActor.scala b/akka-core/src/main/scala/remote/JGroupsClusterActor.scala similarity index 88% rename from akka-cluster/src/main/scala/JGroupsClusterActor.scala rename to akka-core/src/main/scala/remote/JGroupsClusterActor.scala index 5fce79bfae..4d04d87063 100644 --- a/akka-cluster/src/main/scala/JGroupsClusterActor.scala +++ b/akka-core/src/main/scala/remote/JGroupsClusterActor.scala @@ -1,13 +1,12 @@ -package se.scalablesolutions.akka.cluster.jgroups +package se.scalablesolutions.akka.remote import org.jgroups.{JChannel, View => JG_VIEW, Address, Message => JG_MSG, ExtendedMembershipListener, Receiver} import org.jgroups.util.Util -import se.scalablesolutions.akka.remote.BasicClusterActor - /** * Clustering support via JGroups. - * @Author Viktor Klang + * + * @author Viktor Klang */ class JGroupsClusterActor extends BasicClusterActor { import scala.collection.JavaConversions._ @@ -20,7 +19,7 @@ class JGroupsClusterActor extends BasicClusterActor { override def init = { super.init - log debug "Initiating JGroups-based cluster actor" + log info "Initiating JGroups-based cluster actor" isActive = true // Set up the JGroups local endpoint @@ -58,9 +57,9 @@ class JGroupsClusterActor extends BasicClusterActor { override def shutdown = { super.shutdown - log debug ("Shutting down %s", toString) + log info ("Shutting down %s", toString) isActive = false channel.foreach(Util shutdown _) channel = None } -} \ No newline at end of file +} diff --git a/akka-core/src/main/scala/remote/RemoteClient.scala b/akka-core/src/main/scala/remote/RemoteClient.scala index 6888d2c6c7..99573e7d24 100644 --- a/akka-core/src/main/scala/remote/RemoteClient.scala +++ b/akka-core/src/main/scala/remote/RemoteClient.scala @@ -28,7 +28,7 @@ import scala.collection.mutable.{HashSet, HashMap} /** * Atomic remote request/reply message id generator. - * + * * @author Jonas Bonér */ object RemoteRequestProtocolIdFactory { @@ -64,7 +64,7 @@ object RemoteClient extends Logging { def actorFor(className: String, timeout: Long, hostname: String, port: Int): ActorRef = actorFor(className, className, timeout, hostname, port) - def actorFor(actorRef: String, className: String, timeout: Long, hostname: String, port: Int): ActorRef = + def actorFor(actorRef: String, className: String, timeout: Long, hostname: String, port: Int): ActorRef = RemoteActorRef(actorRef, className, hostname, port, timeout) def clientFor(hostname: String, port: Int): RemoteClient = clientFor(new InetSocketAddress(hostname, port)) @@ -139,11 +139,11 @@ class RemoteClient(val hostname: String, val port: Int) extends Logging { Executors.newCachedThreadPool) private val bootstrap = new ClientBootstrap(channelFactory) - private val openChannels = new DefaultChannelGroup(classOf[RemoteClient].getName); - private val timer = new HashedWheelTimer private val remoteAddress = new InetSocketAddress(hostname, port) + private[remote] var connection: ChannelFuture = _ + private[remote] val openChannels = new DefaultChannelGroup(classOf[RemoteClient].getName); bootstrap.setPipelineFactory(new RemoteClientPipelineFactory(name, futures, supervisors, bootstrap, remoteAddress, timer, this)) bootstrap.setOption("tcpNoDelay", true) @@ -296,11 +296,10 @@ class RemoteClientHandler(val name: String, override def channelClosed(ctx: ChannelHandlerContext, event: ChannelStateEvent) = if (client.isRunning) { timer.newTimeout(new TimerTask() { def run(timeout: Timeout) = { + client.openChannels.remove(event.getChannel) log.debug("Remote client reconnecting to [%s]", remoteAddress) client.connection = bootstrap.connect(remoteAddress) - - // Wait until the connection attempt succeeds or fails. - client.connection.awaitUninterruptibly + client.connection.awaitUninterruptibly // Wait until the connection attempt succeeds or fails. if (!client.connection.isSuccess) { client.listeners.toArray.foreach(l => l.asInstanceOf[ActorRef] ! RemoteClientError(client.connection.getCause)) log.error(client.connection.getCause, "Reconnection to [%s] has failed", remoteAddress) diff --git a/akka-core/src/main/scala/remote/RemoteProtocolBuilder.scala b/akka-core/src/main/scala/remote/RemoteProtocolBuilder.scala index b9c446d3d3..3cb3d28178 100644 --- a/akka-core/src/main/scala/remote/RemoteProtocolBuilder.scala +++ b/akka-core/src/main/scala/remote/RemoteProtocolBuilder.scala @@ -22,7 +22,7 @@ object RemoteProtocolBuilder { SERIALIZER_JAVA_JSON.classLoader = Some(cl) SERIALIZER_SCALA_JSON.classLoader = Some(cl) } - + def getMessage(request: RemoteRequestProtocol): Any = { request.getProtocol match { case SerializationProtocol.JAVA => diff --git a/akka-core/src/main/scala/remote/RemoteServer.scala b/akka-core/src/main/scala/remote/RemoteServer.scala index 2617134d28..c329dd6be3 100644 --- a/akka-core/src/main/scala/remote/RemoteServer.scala +++ b/akka-core/src/main/scala/remote/RemoteServer.scala @@ -22,6 +22,8 @@ import org.jboss.netty.handler.codec.frame.{LengthFieldBasedFrameDecoder, Length import org.jboss.netty.handler.codec.protobuf.{ProtobufDecoder, ProtobufEncoder} import org.jboss.netty.handler.codec.compression.{ZlibEncoder, ZlibDecoder} +import scala.collection.mutable.Map + /** * Use this object if you need a single remote server on a specific node. * @@ -88,38 +90,52 @@ object RemoteServer { } } - class RemoteActorSet { - val actors = new ConcurrentHashMap[String, ActorRef] - val activeObjects = new ConcurrentHashMap[String, AnyRef] + private class RemoteActorSet { + private[RemoteServer] val actors = new ConcurrentHashMap[String, ActorRef] + private[RemoteServer] val activeObjects = new ConcurrentHashMap[String, AnyRef] } - private val remoteActorSets = new ConcurrentHashMap[Address, RemoteActorSet] - private val remoteServers = new ConcurrentHashMap[Address, RemoteServer] + private val guard = new ReadWriteGuard + private val remoteActorSets = Map[Address, RemoteActorSet]() + private val remoteServers = Map[Address, RemoteServer]() - private[akka] def actorsFor(remoteServerAddress: RemoteServer.Address): RemoteActorSet = { - val set = remoteActorSets.get(remoteServerAddress) - if (set ne null) set - else { - val remoteActorSet = new RemoteActorSet - remoteActorSets.put(remoteServerAddress, remoteActorSet) - remoteActorSet + private[akka] def registerActor(address: InetSocketAddress, uuid: String, actor: ActorRef) = guard.withWriteGuard { + actorsFor(RemoteServer.Address(address.getHostName, address.getPort)).actors.put(uuid, actor) + } + + private[akka] def registerActiveObject(address: InetSocketAddress, name: String, activeObject: AnyRef) = guard.withWriteGuard { + actorsFor(RemoteServer.Address(address.getHostName, address.getPort)).activeObjects.put(name, activeObject) + } + + private[akka] def getOrCreateServer(address: InetSocketAddress): RemoteServer = guard.withWriteGuard { + serverFor(address) match { + case Some(server) => server + case None => (new RemoteServer).start(address) } } - private[akka] def serverFor(hostname: String, port: Int): Option[RemoteServer] = { - val server = remoteServers.get(Address(hostname, port)) - if (server eq null) None - else Some(server) - } - private[akka] def serverFor(address: InetSocketAddress): Option[RemoteServer] = serverFor(address.getHostName, address.getPort) - private[remote] def register(hostname: String, port: Int, server: RemoteServer) = - remoteServers.put(Address(hostname, port), server) + private[akka] def serverFor(hostname: String, port: Int): Option[RemoteServer] = guard.withReadGuard { + remoteServers.get(Address(hostname, port)) + } - private[remote] def unregister(hostname: String, port: Int) = + private[akka] def register(hostname: String, port: Int, server: RemoteServer) = guard.withWriteGuard { + remoteServers.put(Address(hostname, port), server) + } + + private[akka] def unregister(hostname: String, port: Int) = guard.withWriteGuard { remoteServers.remove(Address(hostname, port)) + } + + private def actorsFor(remoteServerAddress: RemoteServer.Address): RemoteActorSet = { + remoteActorSets.get(remoteServerAddress).getOrElse { + val remoteActorSet = new RemoteActorSet + remoteActorSets.put(remoteServerAddress, remoteActorSet) + remoteActorSet + } + } } /** @@ -223,7 +239,7 @@ class RemoteServer extends Logging { /** * Register Remote Actor by a specific 'id' passed as argument. *

- * NOTE: If you use this method to register your remote actor then you must unregister the actor by this ID yourself. + * NOTE: If you use this method to register your remote actor then you must unregister the actor by this ID yourself. */ def register(id: String, actorRef: ActorRef) = synchronized { if (_isRunning) { @@ -246,9 +262,9 @@ class RemoteServer extends Logging { } /** - * Unregister Remote Actor by specific 'id'. + * Unregister Remote Actor by specific 'id'. *

- * NOTE: You need to call this method if you have registered an actor by a custom ID. + * NOTE: You need to call this method if you have registered an actor by a custom ID. */ def unregister(id: String) = synchronized { if (_isRunning) { diff --git a/akka-core/src/main/scala/routing/Iterators.scala b/akka-core/src/main/scala/routing/Iterators.scala index cb2945865f..fbb200a110 100644 --- a/akka-core/src/main/scala/routing/Iterators.scala +++ b/akka-core/src/main/scala/routing/Iterators.scala @@ -24,7 +24,7 @@ class CyclicIterator[T](items: List[T]) extends InfiniteIterator[T] { } } -/** +/** * This InfiniteIterator always returns the Actor that has the currently smallest mailbox * useful for work-stealing. */ @@ -32,4 +32,4 @@ class SmallestMailboxFirstIterator(items : List[ActorRef]) extends InfiniteItera def hasNext = items != Nil def next = items.reduceLeft((a1, a2) => if (a1.mailboxSize < a2.mailboxSize) a1 else a2) -} \ No newline at end of file +} diff --git a/akka-core/src/main/scala/routing/Listeners.scala b/akka-core/src/main/scala/routing/Listeners.scala index 47f1f30867..7b989836a5 100644 --- a/akka-core/src/main/scala/routing/Listeners.scala +++ b/akka-core/src/main/scala/routing/Listeners.scala @@ -8,7 +8,7 @@ import se.scalablesolutions.akka.actor.{Actor, ActorRef} sealed trait ListenerMessage case class Listen(listener: ActorRef) extends ListenerMessage -case class Deafen(listener: ActorRef) extends ListenerMessage +case class Deafen(listener: ActorRef) extends ListenerMessage case class WithListeners(f: Set[ActorRef] => Unit) extends ListenerMessage /** Listeners is a generic trait to implement listening capability on an Actor @@ -26,6 +26,6 @@ trait Listeners { self : Actor => case Deafen(l) => listeners( _ - l ) case WithListeners(f) => listeners foreach f } - + protected def gossip(msg : Any) = listeners foreach ( _ foreach ( _ ! msg ) ) -} \ No newline at end of file +} diff --git a/akka-core/src/main/scala/routing/Patterns.scala b/akka-core/src/main/scala/routing/Patterns.scala index 4381c6382b..2c9670f6b3 100644 --- a/akka-core/src/main/scala/routing/Patterns.scala +++ b/akka-core/src/main/scala/routing/Patterns.scala @@ -21,19 +21,19 @@ object Patterns { /** Interceptor is a filter(x,y) where x.isDefinedAt is considered to be always true */ - def intercept[A, B](interceptor: (A) => Unit, interceptee: PF[A, B]): PF[A, B] = + def intercept[A, B](interceptor: (A) => Unit, interceptee: PF[A, B]): PF[A, B] = filter({case a if a.isInstanceOf[A] => interceptor(a)}, interceptee) /** Creates a LoadBalancer from the thunk-supplied InfiniteIterator */ - def loadBalancerActor(actors: => InfiniteIterator[ActorRef]): ActorRef = + def loadBalancerActor(actors: => InfiniteIterator[ActorRef]): ActorRef = actorOf(new Actor with LoadBalancer { val seq = actors }).start /** Creates a Dispatcher given a routing and a message-transforming function */ - def dispatcherActor(routing: PF[Any, ActorRef], msgTransformer: (Any) => Any): ActorRef = + def dispatcherActor(routing: PF[Any, ActorRef], msgTransformer: (Any) => Any): ActorRef = actorOf(new Actor with Dispatcher { override def transform(msg: Any) = msgTransformer(msg) def routes = routing @@ -45,9 +45,9 @@ object Patterns { def routes = routing }).start - /** Creates an actor that pipes all incoming messages to + /** Creates an actor that pipes all incoming messages to * both another actor and through the supplied function */ - def loggerActor(actorToLog: ActorRef, logger: (Any) => Unit): ActorRef = + def loggerActor(actorToLog: ActorRef, logger: (Any) => Unit): ActorRef = dispatcherActor({case _ => actorToLog}, logger) -} \ No newline at end of file +} diff --git a/akka-core/src/main/scala/routing/Routers.scala b/akka-core/src/main/scala/routing/Routers.scala index 31402dab5a..4cc13cdbc3 100644 --- a/akka-core/src/main/scala/routing/Routers.scala +++ b/akka-core/src/main/scala/routing/Routers.scala @@ -6,7 +6,7 @@ package se.scalablesolutions.akka.patterns import se.scalablesolutions.akka.actor.{Actor, ActorRef} -/** +/** * A Dispatcher is a trait whose purpose is to route incoming messages to actors. */ trait Dispatcher { this: Actor => @@ -16,17 +16,17 @@ trait Dispatcher { this: Actor => protected def routes: PartialFunction[Any, ActorRef] protected def dispatch: Receive = { - case a if routes.isDefinedAt(a) => + case a if routes.isDefinedAt(a) => if (isSenderDefined) routes(a).forward(transform(a))(someSelf) - else routes(a).!(transform(a))(None) + else routes(a).!(transform(a))(None) } def receive = dispatch - + private def isSenderDefined = self.senderFuture.isDefined || self.sender.isDefined } -/** +/** * A LoadBalancer is a specialized kind of Dispatcher, that is supplied an InfiniteIterator of targets * to dispatch incoming messages to. */ @@ -34,4 +34,4 @@ trait LoadBalancer extends Dispatcher { self: Actor => protected def seq: InfiniteIterator[ActorRef] protected def routes = { case x if seq.hasNext => seq.next } -} \ No newline at end of file +} diff --git a/akka-core/src/main/scala/serialization/Binary.scala b/akka-core/src/main/scala/serialization/Binary.scala index 229c5ad616..af0505a574 100644 --- a/akka-core/src/main/scala/serialization/Binary.scala +++ b/akka-core/src/main/scala/serialization/Binary.scala @@ -317,4 +317,4 @@ case class BinaryStringByteArrayMap(val value: Map[String, Array[Byte]]) extends def this() = this(null) def fromBytes(bytes: Array[Byte]) = BinaryStringByteArrayMap(fromByteArray[Map[String, Array[Byte]]](bytes)) def toBytes: Array[Byte] = toByteArray(value) -} \ No newline at end of file +} diff --git a/akka-core/src/main/scala/serialization/Compression.scala b/akka-core/src/main/scala/serialization/Compression.scala index 36cb1574f6..5b8df9ada7 100644 --- a/akka-core/src/main/scala/serialization/Compression.scala +++ b/akka-core/src/main/scala/serialization/Compression.scala @@ -8,7 +8,7 @@ package se.scalablesolutions.akka.serialization * @author Jonas Bonér */ object Compression { - + /** * @author Jonas Bonér */ diff --git a/akka-core/src/main/scala/serialization/Serializable.scala b/akka-core/src/main/scala/serialization/Serializable.scala index e302ff7fb8..abe1295e4b 100644 --- a/akka-core/src/main/scala/serialization/Serializable.scala +++ b/akka-core/src/main/scala/serialization/Serializable.scala @@ -32,20 +32,20 @@ trait Serializable { /** * Serialization protocols. - * + * * @author Jonas Bonér */ object Serializable { /** - * Example on how to use the SBinary serialization protocol: + * Example on how to use the SBinary serialization protocol: *

    * case class User(val usernamePassword: Tuple2[String, String],
    *                 val email: String,
    *                 val age: Int)
    *   extends Serializable.SBinary[User] {
    *   def this() = this(null, null, 0)
-   *   import sbinary.DefaultProtocol._                                             
+   *   import sbinary.DefaultProtocol._
    *   implicit object UserFormat extends Format[User] {
    *     def reads(in : Input) = User(
    *       read[Tuple2[String, String]](in),
@@ -74,7 +74,7 @@ object Serializable {
   trait JSON extends Serializable {
     def toJSON: String
   }
-  
+
   /**
    * @author Jonas Bonér
    */
diff --git a/akka-core/src/main/scala/serialization/Serializer.scala b/akka-core/src/main/scala/serialization/Serializer.scala
index 8881bf2747..e960a1183d 100644
--- a/akka-core/src/main/scala/serialization/Serializer.scala
+++ b/akka-core/src/main/scala/serialization/Serializer.scala
@@ -34,7 +34,7 @@ class SerializerFactory {
   def getJavaJSON: JavaJSON.type = JavaJSON
   def getScalaJSON: ScalaJSON.type = ScalaJSON
   def getSBinary: SBinary.type = SBinary
-  def getProtobuf: Protobuf.type = Protobuf  
+  def getProtobuf: Protobuf.type = Protobuf
 }
 
 /**
@@ -67,7 +67,7 @@ object Serializer {
     }
 
     def in(bytes: Array[Byte], clazz: Option[Class[_]]): AnyRef = {
-      val in = 
+      val in =
         if (classLoader.isDefined) new ClassLoaderObjectInputStream(classLoader.get, new ByteArrayInputStream(bytes))
         else new ObjectInputStream(new ByteArrayInputStream(bytes))
       val obj = in.readObject
@@ -88,14 +88,14 @@ object Serializer {
         "Can't serialize a non-protobuf message using protobuf [" + obj + "]")
       obj.asInstanceOf[Message].toByteArray
     }
-    
+
     def in(bytes: Array[Byte], clazz: Option[Class[_]]): AnyRef = {
       if (!clazz.isDefined) throw new IllegalArgumentException(
-        "Need a protobuf message class to be able to serialize bytes using protobuf") 
+        "Need a protobuf message class to be able to serialize bytes using protobuf")
       // TODO: should we cache this method lookup?
       val message = clazz.get.getDeclaredMethod(
         "getDefaultInstance", EMPTY_CLASS_ARRAY: _*).invoke(null, EMPTY_ANY_REF_ARRAY: _*).asInstanceOf[Message]
-      message.toBuilder().mergeFrom(bytes).build                                                                                  
+      message.toBuilder().mergeFrom(bytes).build
     }
 
     def in(bytes: Array[Byte], clazz: Class[_]): AnyRef = {
@@ -124,7 +124,7 @@ object Serializer {
     def in(bytes: Array[Byte], clazz: Option[Class[_]]): AnyRef = {
       if (!clazz.isDefined) throw new IllegalArgumentException(
         "Can't deserialize JSON to instance if no class is provided")
-      val in = 
+      val in =
         if (classLoader.isDefined) new ClassLoaderObjectInputStream(classLoader.get, new ByteArrayInputStream(bytes))
         else new ObjectInputStream(new ByteArrayInputStream(bytes))
       val obj = mapper.readValue(in, clazz.get).asInstanceOf[AnyRef]
@@ -137,7 +137,7 @@ object Serializer {
       mapper.readValue(json, clazz).asInstanceOf[AnyRef]
     }
   }
-  
+
   /**
    * @author Jonas Bonér
    */
@@ -149,7 +149,7 @@ object Serializer {
 
     // FIXME set ClassLoader on SJSONSerializer.SJSON
     def in(bytes: Array[Byte], clazz: Option[Class[_]]): AnyRef = SJSONSerializer.SJSON.in(bytes)
-    
+
     import scala.reflect.Manifest
     def in[T](json: String)(implicit m: Manifest[T]): AnyRef = {
       SJSONSerializer.SJSON.in(json)(m)
@@ -168,13 +168,13 @@ object Serializer {
     import sbinary._
     import sbinary.Operations._
     import sbinary.DefaultProtocol._
-    
+
     def deepClone[T <: AnyRef](obj: T)(implicit w : Writes[T], r : Reads[T]): T = in[T](out[T](obj), None)
 
     def out[T](t : T)(implicit bin : Writes[T]): Array[Byte] = toByteArray[T](t)
 
     def in[T](array : Array[Byte], clazz: Option[Class[T]])(implicit bin : Reads[T]): T = fromByteArray[T](array)
- 
+
     def in[T](array : Array[Byte])(implicit bin : Reads[T]): T = fromByteArray[T](array)
   }
 }
diff --git a/akka-core/src/main/scala/stm/HashTrie.scala b/akka-core/src/main/scala/stm/HashTrie.scala
index 91930390c5..b26b31bba1 100644
--- a/akka-core/src/main/scala/stm/HashTrie.scala
+++ b/akka-core/src/main/scala/stm/HashTrie.scala
@@ -40,34 +40,34 @@ trait PersistentDataStructure
  * A clean-room port of Rich Hickey's persistent hash trie implementation from
  * Clojure (http://clojure.org).  Originally presented as a mutable structure in
  * a paper by Phil Bagwell.
- * 
+ *
  * @author Daniel Spiewak
  * @author Rich Hickey
  */
 @serializable
 final class HashTrie[K, +V] private (root: Node[K, V]) extends Map[K, V] with PersistentDataStructure {
   override lazy val size = root.size
-  
+
   def this() = this(new EmptyNode[K])
-  
+
   def get(key: K) = root(key, key.hashCode)
-  
+
   override def +[A >: V](pair: (K, A)) = update(pair._1, pair._2)
-  
+
   override def update[A >: V](key: K, value: A) = new HashTrie(root(0, key, key.hashCode) = value)
-  
+
   def -(key: K) = new HashTrie(root.remove(key, key.hashCode))
-  
+
   def iterator = root.elements
-  
+
   def empty[A]: HashTrie[K, A] = new HashTrie(new EmptyNode[K])
-  
+
   def diagnose = root.toString
 }
 
 object HashTrie {
   def apply[K, V](pairs: (K, V)*) = pairs.foldLeft(new HashTrie[K, V]) { _ + _ }
-  
+
   def unapplySeq[K, V](map: HashTrie[K, V]) = map.toSeq
 }
 
@@ -77,29 +77,29 @@ object HashTrie {
 @serializable
 private[stm] sealed trait Node[K, +V] {
   val size: Int
-  
+
   def apply(key: K, hash: Int): Option[V]
-  
+
   def update[A >: V](shift: Int, key: K, hash: Int, value: A): Node[K, A]
-  
+
   def remove(key: K, hash: Int): Node[K, V]
-  
+
   def elements: Iterator[(K, V)]
 }
 
 @serializable
 private[stm] class EmptyNode[K] extends Node[K, Nothing] {
   val size = 0
-  
+
   def apply(key: K, hash: Int) = None
-  
+
   def update[V](shift: Int, key: K, hash: Int, value: V) = new LeafNode(key, hash, value)
-  
+
   def remove(key: K, hash: Int) = this
-  
+
   lazy val elements = new Iterator[(K, Nothing)] {
     val hasNext = false
-    
+
     val next = null
   }
 }
@@ -111,9 +111,9 @@ private[stm] abstract class SingleNode[K, +V] extends Node[K, V] {
 
 private[stm] class LeafNode[K, +V](key: K, val hash: Int, value: V) extends SingleNode[K, V] {
   val size = 1
-  
+
   def apply(key: K, hash: Int) = if (this.key == key) Some(value) else None
-  
+
   def update[A >: V](shift: Int, key: K, hash: Int, value: A) = {
     if (this.key == key) {
       if (this.value == value) this else new LeafNode(key, hash, value)
@@ -123,53 +123,53 @@ private[stm] class LeafNode[K, +V](key: K, val hash: Int, value: V) extends Sing
       BitmappedNode(shift)(this, key, hash, value)
     }
   }
-  
+
   def remove(key: K, hash: Int) = if (this.key == key) new EmptyNode[K] else this
-  
+
   def elements = new Iterator[(K, V)] {
     var hasNext = true
-    
+
     def next = {
       hasNext = false
       (key, value)
     }
   }
-  
+
   override def toString = "LeafNode(" + key + " -> " + value + ")"
 }
 
 
 private[stm] class CollisionNode[K, +V](val hash: Int, bucket: List[(K, V)]) extends SingleNode[K, V] {
   lazy val size = bucket.length
-  
+
   def this(hash: Int, pairs: (K, V)*) = this(hash, pairs.toList)
-  
+
   def apply(key: K, hash: Int) = {
     for {
       (_, v) <- bucket find { case (k, _) => k == key }
     } yield v
   }
-  
+
   override def update[A >: V](shift: Int, key: K, hash: Int, value: A): Node[K, A] = {
     if (this.hash == hash) {
       var found = false
-      
+
       val newBucket = for ((k, v) <- bucket) yield {
         if (k == key) {
           found = true
           (key, value)
         } else (k, v)
       }
-      
+
       new CollisionNode(hash, if (found) newBucket else (key, value) :: bucket)
     } else {
       BitmappedNode(shift)(this, key, hash, value)
     }
   }
-  
+
   override def remove(key: K, hash: Int) = {
     val newBucket = bucket filter { case (k, _) => k != key }
-    
+
     if (newBucket.length == bucket.length) this else {
       if (newBucket.length == 1) {
         val (key, value) = newBucket.head
@@ -177,11 +177,11 @@ private[stm] class CollisionNode[K, +V](val hash: Int, bucket: List[(K, V)]) ext
       } else new CollisionNode(hash, newBucket)
     }
   }
-  
+
   def iterator = bucket.iterator
-  
+
   def elements = bucket.iterator
-  
+
   override def toString = "CollisionNode(" + bucket.toString + ")"
 }
 
@@ -191,38 +191,38 @@ private[stm] class BitmappedNode[K, +V](shift: Int)(table: Array[Node[K, V]], bi
       n <- table
       if n != null
     } yield n.size
-    
+
     sizes.foldLeft(0) { _ + _ }
   }
-  
+
   def apply(key: K, hash: Int) = {
     val i = (hash >>> shift) & 0x01f
     val mask = 1 << i
-    
+
     if ((bits & mask) == mask) table(i)(key, hash) else None
   }
-  
+
   override def update[A >: V](levelShift: Int, key: K, hash: Int, value: A): Node[K, A] = {
     val i = (hash >>> shift) & 0x01f
     val mask = 1 << i
-    
+
     if ((bits & mask) == mask) {
       val node = (table(i)(shift + 5, key, hash) = value)
-      
+
       if (node == table(i)) this else {
         val newTable = new Array[Node[K, A]](table.length)
         Array.copy(table, 0, newTable, 0, table.length)
-        
+
         newTable(i) = node
-        
+
         new BitmappedNode(shift)(newTable, bits)
       }
     } else {
       val newTable = new Array[Node[K, A]](Math.max(table.length, i + 1))
       Array.copy(table, 0, newTable, 0, table.length)
-      
+
       newTable(i) = new LeafNode(key, hash, value)
-      
+
       val newBits = bits | mask
       if (newBits == ~0) {
         new FullNode(shift)(newTable)
@@ -231,54 +231,54 @@ private[stm] class BitmappedNode[K, +V](shift: Int)(table: Array[Node[K, V]], bi
       }
     }
   }
-  
+
   def remove(key: K, hash: Int) = {
     val i = (hash >>> shift) & 0x01f
     val mask = 1 << i
-    
+
     if ((bits & mask) == mask) {
       val node = table(i).remove(key, hash)
-      
+
       if (node == table(i)) {
         this
       } else if (node.isInstanceOf[EmptyNode[_]]) {
         if (size == 1) new EmptyNode[K] else {
           val adjustedBits = bits ^ mask
           val log = Math.log(adjustedBits) / Math.log(2)
-          
+
           if (log.toInt.toDouble == log) {      // last one
             table(log.toInt)
           } else {
             val newTable = new Array[Node[K, V]](table.length)
             Array.copy(table, 0, newTable, 0, newTable.length)
-            
+
             newTable(i) = null
-            
+
             new BitmappedNode(shift)(newTable, adjustedBits)
           }
         }
       } else {
         val newTable = new Array[Node[K, V]](table.length)
         Array.copy(table, 0, newTable, 0, table.length)
-        
+
         newTable(i) = node
-        
+
         new BitmappedNode(shift)(newTable, bits)
       }
     } else this
   }
-  
+
   def elements = {
     table.foldLeft(emptyElements) { (it, e) =>
       if (e eq null) it else it ++ e.elements
     }
   }
-  
+
   override def toString = "BitmappedNode(" + size + "," + table.filter(_ ne null).toList.toString + ")"
-  
+
   private lazy val emptyElements: Iterator[(K, V)] = new Iterator[(K, V)] {
     val hasNext = false
-    
+
     val next = null
   }
 }
@@ -287,26 +287,26 @@ private[stm] class BitmappedNode[K, +V](shift: Int)(table: Array[Node[K, V]], bi
 private[stm] object BitmappedNode {
   def apply[K, V](shift: Int)(node: SingleNode[K, V], key: K, hash: Int, value: V) = {
     val table = new Array[Node[K, V]](Math.max((hash >>> shift) & 0x01f, (node.hash >>> shift) & 0x01f) + 1)
-    
+
     val preBits = {
       val i = (node.hash >>> shift) & 0x01f
       table(i) = node
       1 << i
     }
-    
+
     val bits = {
       val i = (hash >>> shift) & 0x01f
       val mask = 1 << i
-      
+
       if ((preBits & mask) == mask) {
         table(i) = (table(i)(shift + 5, key, hash) = value)
       } else {
         table(i) = new LeafNode(key, hash, value)
       }
-      
+
       preBits | mask
     }
-    
+
     new BitmappedNode(shift)(table, bits)
   }
 }
@@ -314,34 +314,34 @@ private[stm] object BitmappedNode {
 
 private[stm] class FullNode[K, +V](shift: Int)(table: Array[Node[K, V]]) extends Node[K, V] {
   lazy val size = table.foldLeft(0) { _ + _.size }
-  
+
   def apply(key: K, hash: Int) = table((hash >>> shift) & 0x01f)(key, hash)
-  
+
   def update[A >: V](levelShift: Int, key: K, hash: Int, value: A) = {
     val i = (hash >>> shift) & 0x01f
-    
+
     val node = (table(i)(shift + 5, key, hash) = value)
-    
+
     if (node == table(i)) this else {
             val newTable = new Array[Node[K, A]](32)
             Array.copy(table, 0, newTable, 0, 32)
-            
+
             newTable(i) = node
-            
+
             new FullNode(shift)(newTable)
      }
   }
-  
+
   def remove(key: K, hash: Int) = {
     val i = (hash >>> shift) & 0x01f
     val mask = 1 << i
-    
+
     val node = table(i).remove(key, hash)
-    
+
     if (node == table(i)) this else {
       val newTable = new Array[Node[K, V]](32)
       Array.copy(table, 0, newTable, 0, 32)
-      
+
       if (node.isInstanceOf[EmptyNode[_]]) {
         newTable(i) = null
         new BitmappedNode(shift)(newTable, ~mask)
@@ -351,14 +351,14 @@ private[stm] class FullNode[K, +V](shift: Int)(table: Array[Node[K, V]]) extends
       }
     }
   }
-  
+
   def elements = table.foldLeft(emptyElements) { _ ++ _.elements }
-  
+
   override def toString = "FullNode(" + table.foldLeft("") { _.toString + ", " + _.toString } + ")"
-  
+
   private lazy val emptyElements: Iterator[(K, V)] = new Iterator[(K, V)] {
     val hasNext = false
-    
+
     val next = null
   }
 }
diff --git a/akka-core/src/main/scala/stm/JTA.scala b/akka-core/src/main/scala/stm/JTA.scala
index fd2db0fc74..bb61973c91 100644
--- a/akka-core/src/main/scala/stm/JTA.scala
+++ b/akka-core/src/main/scala/stm/JTA.scala
@@ -12,13 +12,13 @@ import se.scalablesolutions.akka.util.Logging
 
 /**
  * Detects if there is a UserTransaction or TransactionManager available in the JNDI.
- * 
+ *
  * @author Jonas Bonér
  */
 object TransactionContainer extends Logging {
   val AKKA_JTA_TRANSACTION_SERVICE_CLASS = "se.scalablesolutions.akka.jta.AtomikosTransactionService"
   val DEFAULT_USER_TRANSACTION_NAME =                     "java:comp/UserTransaction"
-  val FALLBACK_TRANSACTION_MANAGER_NAMES =                "java:comp/TransactionManager" :: 
+  val FALLBACK_TRANSACTION_MANAGER_NAMES =                "java:comp/TransactionManager" ::
                                                           "java:appserver/TransactionManager" ::
                                                           "java:pm/TransactionManager" ::
                                                           "java:/TransactionManager" :: Nil
@@ -27,12 +27,12 @@ object TransactionContainer extends Logging {
   val JTA_PROVIDER = config.getString("akka.jta.provider", "from-jndi")
 
   private var synchronizationRegistry: Option[TransactionSynchronizationRegistry] = None
-  
+
   def apply(tm: Either[Option[UserTransaction], Option[TransactionManager]]) = new TransactionContainer(tm)
-  
+
   def apply(): TransactionContainer =
     JTA_PROVIDER match {
-      case "from-jndi" => 
+      case "from-jndi" =>
         new TransactionContainer(findUserTransaction match {
           case None => Right(findTransactionManager)
           case tm =>   Left(tm)
@@ -43,19 +43,19 @@ object TransactionContainer extends Logging {
                .newInstance.asInstanceOf[TransactionService]
                .transactionContainer
         } catch {
-          case e: ClassNotFoundException => 
+          case e: ClassNotFoundException =>
             throw new StmConfigurationException(
-              "JTA provider defined as 'atomikos', but the AtomikosTransactionService classes can not be found." + 
+              "JTA provider defined as 'atomikos', but the AtomikosTransactionService classes can not be found." +
               "\n\tPlease make sure you have 'akka-jta' JAR and its dependencies on your classpath.")
         }
-      case _ => 
+      case _ =>
         throw new StmConfigurationException(
         "No UserTransaction on TransactionManager could be found in scope." +
-        "\n\tEither add 'akka-jta' to the classpath or make sure there is a" + 
+        "\n\tEither add 'akka-jta' to the classpath or make sure there is a" +
         "\n\tTransactionManager or UserTransaction defined in the JNDI.")
-      
+
     }
-  
+
   def findUserTransaction: Option[UserTransaction] = {
     val located = createInitialContext.lookup(DEFAULT_USER_TRANSACTION_NAME)
     if (located eq null) None
@@ -74,7 +74,7 @@ object TransactionContainer extends Logging {
         log.info("JTA TransactionSynchronizationRegistry detected [%s]", located)
         synchronizationRegistry = Some(located.asInstanceOf[TransactionSynchronizationRegistry])
         synchronizationRegistry
-      }      
+      }
     }
   }
 
@@ -100,49 +100,49 @@ object TransactionContainer extends Logging {
  * JTA transaction container holding either a UserTransaction or a TransactionManager.
  * 

* The TransactionContainer is created using the factory val container = TransactionContainer() - * + * * @author Jonas Bonér */ class TransactionContainer private (val tm: Either[Option[UserTransaction], Option[TransactionManager]]) { def registerSynchronization(sync: Synchronization) = { TransactionContainer.findSynchronizationRegistry match { // try to use SynchronizationRegistry in JNDI - case Some(registry) => + case Some(registry) => registry.asInstanceOf[TransactionSynchronizationRegistry].registerInterposedSynchronization(sync) case None => tm match { case Right(Some(txMan)) => // try to use TransactionManager txMan.getTransaction.registerSynchronization(sync) case _ => - log.warning("Cannot find TransactionSynchronizationRegistry in JNDI, can't register STM synchronization") + log.warning("Cannot find TransactionSynchronizationRegistry in JNDI, can't register STM synchronization") } } } - + def begin = tm match { case Left(Some(userTx)) => userTx.begin case Right(Some(txMan)) => txMan.begin case _ => throw new StmConfigurationException("Does not have a UserTransaction or TransactionManager in scope") } - + def commit = tm match { case Left(Some(userTx)) => userTx.commit case Right(Some(txMan)) => txMan.commit case _ => throw new StmConfigurationException("Does not have a UserTransaction or TransactionManager in scope") } - + def rollback = tm match { case Left(Some(userTx)) => userTx.rollback case Right(Some(txMan)) => txMan.rollback case _ => throw new StmConfigurationException("Does not have a UserTransaction or TransactionManager in scope") } - + def getStatus = tm match { case Left(Some(userTx)) => userTx.getStatus case Right(Some(txMan)) => txMan.getStatus case _ => throw new StmConfigurationException("Does not have a UserTransaction or TransactionManager in scope") } - + def isInExistingTransaction = tm match { case Left(Some(userTx)) => userTx.getStatus == Status.STATUS_ACTIVE case Right(Some(txMan)) => txMan.getStatus == Status.STATUS_ACTIVE @@ -154,7 +154,7 @@ class TransactionContainer private (val tm: Either[Option[UserTransaction], Opti case Right(Some(txMan)) => txMan.getStatus == Status.STATUS_MARKED_ROLLBACK case _ => throw new StmConfigurationException("Does not have a UserTransaction or TransactionManager in scope") } - + def setRollbackOnly = tm match { case Left(Some(userTx)) => userTx.setRollbackOnly case Right(Some(txMan)) => txMan.setRollbackOnly @@ -165,7 +165,7 @@ class TransactionContainer private (val tm: Either[Option[UserTransaction], Opti case Right(Some(txMan)) => txMan.suspend case _ => throw new StmConfigurationException("Does not have a TransactionManager in scope") } - + def resume(tx: JtaTransaction) = tm match { case Right(Some(txMan)) => txMan.resume(tx) case _ => throw new StmConfigurationException("Does not have a TransactionManager in scope") @@ -197,6 +197,6 @@ class StmSynchronization(tc: TransactionContainer, tx: Transaction) extends Sync * @author Jonas Bonér */ trait TransactionService { - def transactionContainer: TransactionContainer + def transactionContainer: TransactionContainer } diff --git a/akka-core/src/main/scala/stm/ResultOrFailure.scala b/akka-core/src/main/scala/stm/ResultOrFailure.scala index ced5572104..6ddf8c9751 100644 --- a/akka-core/src/main/scala/stm/ResultOrFailure.scala +++ b/akka-core/src/main/scala/stm/ResultOrFailure.scala @@ -11,7 +11,7 @@ package se.scalablesolutions.akka.stm *

  * scala> ResultOrFailure(1)
  * res0: ResultOrFailure[Int] = ResultOrFailure@a96606
- *  
+ *
  * scala> res0()
  * res1: Int = 1
  *
@@ -19,13 +19,13 @@ package se.scalablesolutions.akka.stm
  *
  * scala> res0()
  * res3: Int = 3
- * 
+ *
  * scala> res0() = { println("Hello world"); 3}
  * Hello world
  *
  * scala> res0()
  * res5: Int = 3
- *  
+ *
  * scala> res0() = error("Lets see what happens here...")
  *
  * scala> res0()
diff --git a/akka-core/src/main/scala/stm/Transaction.scala b/akka-core/src/main/scala/stm/Transaction.scala
index d7874ffc15..7af7397bf3 100644
--- a/akka-core/src/main/scala/stm/Transaction.scala
+++ b/akka-core/src/main/scala/stm/Transaction.scala
@@ -306,22 +306,22 @@ object Transaction {
   private[akka] var transaction: Option[MultiverseTransaction] = None
   private[this] val persistentStateMap = new HashMap[String, Committable]
   private[akka] val depth = new AtomicInteger(0)
-  
+
   val jta: Option[TransactionContainer] =
     if (JTA_AWARE) Some(TransactionContainer())
     else None
-  
+
   log.trace("Creating %s", toString)
 
   // --- public methods ---------
 
   def begin = synchronized {
-    jta.foreach { txContainer => 
+    jta.foreach { txContainer =>
       txContainer.begin
       txContainer.registerSynchronization(new StmSynchronization(txContainer, this))
     }
   }
-  
+
   def commit = synchronized {
     log.trace("Committing transaction %s", toString)
     Transaction.atomic0 {
@@ -347,7 +347,7 @@ object Transaction {
   // --- internal methods ---------
 
   private def isJtaTxActive(status: Int) = status == Status.STATUS_ACTIVE
-  
+
   private[akka] def status_? = status
 
   private[akka] def increment = depth.incrementAndGet
diff --git a/akka-core/src/main/scala/stm/TransactionalState.scala b/akka-core/src/main/scala/stm/TransactionalState.scala
index 63f27a631d..2575194090 100644
--- a/akka-core/src/main/scala/stm/TransactionalState.scala
+++ b/akka-core/src/main/scala/stm/TransactionalState.scala
@@ -21,13 +21,13 @@ import org.multiverse.api.GlobalStmInstance.getGlobalStmInstance
  * val myVector = TransactionalVector()
  * val myRef = TransactionalRef()
  * 
- * + * *

* Example Java usage: *

  * TransactionalMap myMap = TransactionalState.newMap();
  * 
- * + * * @author Jonas Bonér */ object TransactionalState { @@ -58,7 +58,7 @@ trait Committable { object RefFactory { private val factory = getGlobalStmInstance.getProgrammaticReferenceFactoryBuilder.build - + def createRef[T] = factory.atomicCreateReference[T]() def createRef[T](value: T) = factory.atomicCreateReference(value) @@ -66,7 +66,7 @@ object RefFactory { /** * Alias to TransactionalRef. - * + * * @author Jonas Bonér */ object Ref { @@ -79,7 +79,7 @@ object Ref { /** * Alias to Ref. - * + * * @author Jonas Bonér */ object TransactionalRef { @@ -146,7 +146,7 @@ class TransactionalRef[T](initialOpt: Option[T] = None) extends Transactional { ensureIsInTransaction !ref.isNull } - + def isEmpty: Boolean = { ensureIsInTransaction ref.isNull @@ -171,7 +171,7 @@ class TransactionalRef[T](initialOpt: Option[T] = None) extends Transactional { * Necessary to keep from being implicitly converted to Iterable in for comprehensions. */ def withFilter(p: T => Boolean): WithFilter = new WithFilter(p) - + class WithFilter(p: T => Boolean) { def map[B](f: T => B): TransactionalRef[B] = self filter p map f def flatMap[B](f: T => TransactionalRef[B]): TransactionalRef[B] = self filter p flatMap f @@ -228,14 +228,14 @@ class TransactionalMap[K, V](initialOpt: Option[HashTrie[K, V]] = None) extends val uuid = UUID.newUuid.toString protected[this] val ref = new TransactionalRef(initialOpt.orElse(Some(new HashTrie[K, V]))) - - def -=(key: K) = { + + def -=(key: K) = { remove(key) this } def +=(key: K, value: V) = put(key, value) - + def +=(kv: (K, V)) = { put(kv._1,kv._2) this @@ -249,7 +249,7 @@ class TransactionalMap[K, V](initialOpt: Option[HashTrie[K, V]] = None) extends } def get(key: K): Option[V] = ref.get.get.get(key) - + override def put(key: K, value: V): Option[V] = { val map = ref.get.get val oldValue = map.get(key) @@ -262,7 +262,7 @@ class TransactionalMap[K, V](initialOpt: Option[HashTrie[K, V]] = None) extends val oldValue = map.get(key) ref.swap(map.update(key, value)) } - + def iterator = ref.get.get.iterator override def elements: Iterator[(K, V)] = ref.get.get.iterator @@ -272,15 +272,15 @@ class TransactionalMap[K, V](initialOpt: Option[HashTrie[K, V]] = None) extends override def clear = ref.swap(new HashTrie[K, V]) override def size: Int = ref.get.get.size - + override def hashCode: Int = System.identityHashCode(this); override def equals(other: Any): Boolean = - other.isInstanceOf[TransactionalMap[_, _]] && + other.isInstanceOf[TransactionalMap[_, _]] && other.hashCode == hashCode override def toString = if (outsideTransaction) "" else super.toString - + def outsideTransaction = org.multiverse.api.ThreadLocalTransaction.getThreadLocalTransaction eq null } @@ -302,9 +302,9 @@ class TransactionalVector[T](initialOpt: Option[Vector[T]] = None) extends Trans val uuid = UUID.newUuid.toString private[this] val ref = new TransactionalRef(initialOpt.orElse(Some(EmptyVector))) - + def clear = ref.swap(EmptyVector) - + def +(elem: T) = add(elem) def add(elem: T) = ref.swap(ref.get.get + elem) @@ -324,12 +324,12 @@ class TransactionalVector[T](initialOpt: Option[Vector[T]] = None) extends Trans override def hashCode: Int = System.identityHashCode(this); - override def equals(other: Any): Boolean = - other.isInstanceOf[TransactionalVector[_]] && + override def equals(other: Any): Boolean = + other.isInstanceOf[TransactionalVector[_]] && other.hashCode == hashCode override def toString = if (outsideTransaction) "" else super.toString - + def outsideTransaction = org.multiverse.api.ThreadLocalTransaction.getThreadLocalTransaction eq null } diff --git a/akka-core/src/main/scala/stm/Vector.scala b/akka-core/src/main/scala/stm/Vector.scala index a526906115..3f1f866692 100644 --- a/akka-core/src/main/scala/stm/Vector.scala +++ b/akka-core/src/main/scala/stm/Vector.scala @@ -43,19 +43,19 @@ import Vector._ * @author Rich Hickey */ @serializable -class Vector[+T] private (val length: Int, shift: Int, root: Array[AnyRef], tail: Array[AnyRef]) +class Vector[+T] private (val length: Int, shift: Int, root: Array[AnyRef], tail: Array[AnyRef]) extends IndexedSeq[T] with PersistentDataStructure { outer => private val tailOff = length - tail.length - + /* * The design of this data structure inherantly requires heterogenous arrays. * It is *possible* to design around this, but the result is comparatively * quite inefficient. With respect to this fact, I have left the original * (somewhat dynamically-typed) implementation in place. */ - + private[stm] def this() = this(0, 5, EmptyArray, EmptyArray) - + def apply(i: Int): T = { if (i >= 0 && i < length) { if (i >= tailOff) { @@ -63,24 +63,24 @@ class Vector[+T] private (val length: Int, shift: Int, root: Array[AnyRef], tail } else { var arr = root var level = shift - + while (level > 0) { arr = arr((i >>> level) & 0x01f).asInstanceOf[Array[AnyRef]] level -= 5 } - + arr(i & 0x01f).asInstanceOf[T] } } else throw new IndexOutOfBoundsException(i.toString) } - + def update[A >: T](i: Int, obj: A): Vector[A] = { if (i >= 0 && i < length) { if (i >= tailOff) { val newTail = new Array[AnyRef](tail.length) Array.copy(tail, 0, newTail, 0, tail.length) newTail(i & 0x01f) = obj.asInstanceOf[AnyRef] - + new Vector[A](length, shift, root, newTail) } else { new Vector[A](length, shift, doAssoc(shift, root, i, obj), tail) @@ -89,69 +89,69 @@ class Vector[+T] private (val length: Int, shift: Int, root: Array[AnyRef], tail this + obj } else throw new IndexOutOfBoundsException(i.toString) } - + private def doAssoc[A >: T](level: Int, arr: Array[AnyRef], i: Int, obj: A): Array[AnyRef] = { val ret = new Array[AnyRef](arr.length) Array.copy(arr, 0, ret, 0, arr.length) - + if (level == 0) { ret(i & 0x01f) = obj.asInstanceOf[AnyRef] } else { val subidx = (i >>> level) & 0x01f ret(subidx) = doAssoc(level - 5, arr(subidx).asInstanceOf[Array[AnyRef]], i, obj) } - + ret } - + def ++[A >: T](other: Iterable[A]) = other.foldLeft(this:Vector[A]) { _ + _ } - + def +[A >: T](obj: A): Vector[A] = { if (tail.length < 32) { val newTail = new Array[AnyRef](tail.length + 1) Array.copy(tail, 0, newTail, 0, tail.length) newTail(tail.length) = obj.asInstanceOf[AnyRef] - + new Vector[A](length + 1, shift, root, newTail) } else { var (newRoot, expansion) = pushTail(shift - 5, root, tail, null) var newShift = shift - + if (expansion ne null) { newRoot = array(newRoot, expansion) newShift += 5 } - + new Vector[A](length + 1, newShift, newRoot, array(obj.asInstanceOf[AnyRef])) } } - + private def pushTail(level: Int, arr: Array[AnyRef], tailNode: Array[AnyRef], expansion: AnyRef): (Array[AnyRef], AnyRef) = { val newChild = if (level == 0) tailNode else { val (newChild, subExpansion) = pushTail(level - 5, arr(arr.length - 1).asInstanceOf[Array[AnyRef]], tailNode, expansion) - + if (subExpansion eq null) { val ret = new Array[AnyRef](arr.length) Array.copy(arr, 0, ret, 0, arr.length) - + ret(arr.length - 1) = newChild - + return (ret, null) } else subExpansion } - + // expansion if (arr.length == 32) { - (arr, array(newChild)) + (arr, array(newChild)) } else { val ret = new Array[AnyRef](arr.length + 1) Array.copy(arr, 0, ret, 0, arr.length) ret(arr.length) = newChild - + (ret, null) } } - + /** * Removes the tail element of this vector. */ @@ -163,99 +163,99 @@ class Vector[+T] private (val length: Int, shift: Int, root: Array[AnyRef], tail } else if (tail.length > 1) { val newTail = new Array[AnyRef](tail.length - 1) Array.copy(tail, 0, newTail, 0, newTail.length) - + new Vector[T](length - 1, shift, root, newTail) } else { var (newRoot, pTail) = popTail(shift - 5, root, null) var newShift = shift - + if (newRoot eq null) { newRoot = EmptyArray } - + if (shift > 5 && newRoot.length == 1) { newRoot = newRoot(0).asInstanceOf[Array[AnyRef]] newShift -= 5 } - + new Vector[T](length - 1, newShift, newRoot, pTail.asInstanceOf[Array[AnyRef]]) } } - + private def popTail(shift: Int, arr: Array[AnyRef], pTail: AnyRef): (Array[AnyRef], AnyRef) = { val newPTail = if (shift > 0) { val (newChild, subPTail) = popTail(shift - 5, arr(arr.length - 1).asInstanceOf[Array[AnyRef]], pTail) - + if (newChild ne null) { val ret = new Array[AnyRef](arr.length) Array.copy(arr, 0, ret, 0, arr.length) - + ret(arr.length - 1) = newChild - + return (ret, subPTail) } subPTail } else if (shift == 0) { arr(arr.length - 1) } else pTail - + // contraction if (arr.length == 1) { (null, newPTail) - } else { + } else { val ret = new Array[AnyRef](arr.length - 1) Array.copy(arr, 0, ret, 0, ret.length) - + (ret, newPTail) } } - + override def filter(p: (T)=>Boolean) = { var back = new Vector[T] var i = 0 - + while (i < length) { val e = apply(i) if (p(e)) back += e - + i += 1 } - + back } - + def flatMap[A](f: (T)=>Iterable[A]): Vector[A] = { var back = new Vector[A] var i = 0 - + while (i < length) { f(apply(i)) foreach { back += _ } i += 1 } - + back } - + def map[A](f: (T)=>A): Vector[A] = { var back = new Vector[A] var i = 0 - + while (i < length) { back += f(apply(i)) i += 1 } - + back } - + override def reverse: Vector[T] = new VectorProjection[T] { override val length = outer.length - + override def apply(i: Int) = outer.apply(length - i - 1) } - + def subseq(from: Int, end: Int) = subVector(from, end) - + def subVector(from: Int, end: Int): Vector[T] = { if (from < 0) { throw new IndexOutOfBoundsException(from.toString) @@ -266,37 +266,37 @@ class Vector[+T] private (val length: Int, shift: Int, root: Array[AnyRef], tail } else { new VectorProjection[T] { override val length = end - from - + override def apply(i: Int) = outer.apply(i + from) } } } - + def zip[A](that: Vector[A]) = { var back = new Vector[(T, A)] var i = 0 - + val limit = Math.min(length, that.length) while (i < limit) { back += (apply(i), that(i)) i += 1 } - + back } - + def zipWithIndex = { var back = new Vector[(T, Int)] var i = 0 - + while (i < length) { back += (apply(i), i) i += 1 } - + back } - + override def equals(other: Any) = other match { case vec: Vector[_] => { var back = length == vec.length @@ -318,11 +318,11 @@ class Vector[+T] private (val length: Int, shift: Int, root: Array[AnyRef], tail object Vector { private[stm] val EmptyArray = new Array[AnyRef](0) - + def apply[T](elems: T*) = elems.foldLeft(EmptyVector:Vector[T]) { _ + _ } - + def unapplySeq[T](vec: Vector[T]): Option[Seq[T]] = Some(vec) - + @inline private[stm] def array(elems: AnyRef*) = { val back = new Array[AnyRef](elems.length) @@ -337,9 +337,9 @@ object EmptyVector extends Vector[Nothing] private[stm] abstract class VectorProjection[+T] extends Vector[T] { override val length: Int override def apply(i: Int): T - + override def +[A >: T](e: A) = innerCopy + e - + override def update[A >: T](i: Int, e: A) = { if (i < 0) { throw new IndexOutOfBoundsException(i.toString) @@ -347,7 +347,7 @@ private[stm] abstract class VectorProjection[+T] extends Vector[T] { throw new IndexOutOfBoundsException(i.toString) } else innerCopy(i) = e } - + private lazy val innerCopy = foldLeft(EmptyVector:Vector[T]) { _ + _ } } diff --git a/akka-core/src/main/scala/util/Bootable.scala b/akka-core/src/main/scala/util/Bootable.scala index 172be3fd43..4a8e086914 100644 --- a/akka-core/src/main/scala/util/Bootable.scala +++ b/akka-core/src/main/scala/util/Bootable.scala @@ -7,4 +7,4 @@ package se.scalablesolutions.akka.util trait Bootable { def onLoad {} def onUnload {} -} \ No newline at end of file +} diff --git a/akka-core/src/main/scala/util/HashCode.scala b/akka-core/src/main/scala/util/HashCode.scala index 0f9e8cad9d..83fea18489 100644 --- a/akka-core/src/main/scala/util/HashCode.scala +++ b/akka-core/src/main/scala/util/HashCode.scala @@ -21,7 +21,7 @@ import java.lang.{Float => JFloat, Double => JDouble} * result * } *
- * + * * @author Jonas Bonér */ object HashCode { diff --git a/akka-core/src/test/java/se/scalablesolutions/akka/actor/ProtobufProtocol.java b/akka-core/src/test/java/se/scalablesolutions/akka/actor/ProtobufProtocol.java index 9995225cf5..31b97339d1 100644 --- a/akka-core/src/test/java/se/scalablesolutions/akka/actor/ProtobufProtocol.java +++ b/akka-core/src/test/java/se/scalablesolutions/akka/actor/ProtobufProtocol.java @@ -11,54 +11,54 @@ public final class ProtobufProtocol { com.google.protobuf.GeneratedMessage { // Use ProtobufPOJO.newBuilder() to construct. private ProtobufPOJO() {} - + private static final ProtobufPOJO defaultInstance = new ProtobufPOJO(); public static ProtobufPOJO getDefaultInstance() { return defaultInstance; } - + public ProtobufPOJO getDefaultInstanceForType() { return defaultInstance; } - + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return se.scalablesolutions.akka.actor.ProtobufProtocol.internal_static_se_scalablesolutions_akka_actor_ProtobufPOJO_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return se.scalablesolutions.akka.actor.ProtobufProtocol.internal_static_se_scalablesolutions_akka_actor_ProtobufPOJO_fieldAccessorTable; } - + // required uint64 id = 1; public static final int ID_FIELD_NUMBER = 1; private boolean hasId; private long id_ = 0L; public boolean hasId() { return hasId; } public long getId() { return id_; } - + // required string name = 2; public static final int NAME_FIELD_NUMBER = 2; private boolean hasName; private java.lang.String name_ = ""; public boolean hasName() { return hasName; } public java.lang.String getName() { return name_; } - + // required bool status = 3; public static final int STATUS_FIELD_NUMBER = 3; private boolean hasStatus; private boolean status_ = false; public boolean hasStatus() { return hasStatus; } public boolean getStatus() { return status_; } - + public final boolean isInitialized() { if (!hasId) return false; if (!hasName) return false; if (!hasStatus) return false; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (hasId()) { @@ -72,12 +72,12 @@ public final class ProtobufProtocol { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (hasId()) { size += com.google.protobuf.CodedOutputStream @@ -95,7 +95,7 @@ public final class ProtobufProtocol { memoizedSerializedSize = size; return size; } - + public static se.scalablesolutions.akka.actor.ProtobufProtocol.ProtobufPOJO parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -153,31 +153,31 @@ public final class ProtobufProtocol { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(se.scalablesolutions.akka.actor.ProtobufProtocol.ProtobufPOJO prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder { private se.scalablesolutions.akka.actor.ProtobufProtocol.ProtobufPOJO result; - + // Construct using se.scalablesolutions.akka.actor.ProtobufProtocol.ProtobufPOJO.newBuilder() private Builder() {} - + private static Builder create() { Builder builder = new Builder(); builder.result = new se.scalablesolutions.akka.actor.ProtobufProtocol.ProtobufPOJO(); return builder; } - + protected se.scalablesolutions.akka.actor.ProtobufProtocol.ProtobufPOJO internalGetResult() { return result; } - + public Builder clear() { if (result == null) { throw new IllegalStateException( @@ -186,20 +186,20 @@ public final class ProtobufProtocol { result = new se.scalablesolutions.akka.actor.ProtobufProtocol.ProtobufPOJO(); return this; } - + public Builder clone() { return create().mergeFrom(result); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return se.scalablesolutions.akka.actor.ProtobufProtocol.ProtobufPOJO.getDescriptor(); } - + public se.scalablesolutions.akka.actor.ProtobufProtocol.ProtobufPOJO getDefaultInstanceForType() { return se.scalablesolutions.akka.actor.ProtobufProtocol.ProtobufPOJO.getDefaultInstance(); } - + public boolean isInitialized() { return result.isInitialized(); } @@ -209,7 +209,7 @@ public final class ProtobufProtocol { } return buildPartial(); } - + private se.scalablesolutions.akka.actor.ProtobufProtocol.ProtobufPOJO buildParsed() throws com.google.protobuf.InvalidProtocolBufferException { if (!isInitialized()) { @@ -218,7 +218,7 @@ public final class ProtobufProtocol { } return buildPartial(); } - + public se.scalablesolutions.akka.actor.ProtobufProtocol.ProtobufPOJO buildPartial() { if (result == null) { throw new IllegalStateException( @@ -228,7 +228,7 @@ public final class ProtobufProtocol { result = null; return returnMe; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof se.scalablesolutions.akka.actor.ProtobufProtocol.ProtobufPOJO) { return mergeFrom((se.scalablesolutions.akka.actor.ProtobufProtocol.ProtobufPOJO)other); @@ -237,7 +237,7 @@ public final class ProtobufProtocol { return this; } } - + public Builder mergeFrom(se.scalablesolutions.akka.actor.ProtobufProtocol.ProtobufPOJO other) { if (other == se.scalablesolutions.akka.actor.ProtobufProtocol.ProtobufPOJO.getDefaultInstance()) return this; if (other.hasId()) { @@ -252,7 +252,7 @@ public final class ProtobufProtocol { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -289,8 +289,8 @@ public final class ProtobufProtocol { } } } - - + + // required uint64 id = 1; public boolean hasId() { return result.hasId(); @@ -308,7 +308,7 @@ public final class ProtobufProtocol { result.id_ = 0L; return this; } - + // required string name = 2; public boolean hasName() { return result.hasName(); @@ -329,7 +329,7 @@ public final class ProtobufProtocol { result.name_ = getDefaultInstance().getName(); return this; } - + // required bool status = 3; public boolean hasStatus() { return result.hasStatus(); @@ -348,22 +348,22 @@ public final class ProtobufProtocol { return this; } } - + static { se.scalablesolutions.akka.actor.ProtobufProtocol.getDescriptor(); } - + static { se.scalablesolutions.akka.actor.ProtobufProtocol.internalForceInit(); } } - + private static com.google.protobuf.Descriptors.Descriptor internal_static_se_scalablesolutions_akka_actor_ProtobufPOJO_descriptor; private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_se_scalablesolutions_akka_actor_ProtobufPOJO_fieldAccessorTable; - + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -397,6 +397,6 @@ public final class ProtobufProtocol { new com.google.protobuf.Descriptors.FileDescriptor[] { }, assigner); } - + public static void internalForceInit() {} } diff --git a/akka-core/src/test/scala/ActorFireForgetRequestReplySpec.scala b/akka-core/src/test/scala/ActorFireForgetRequestReplySpec.scala index 7c3a827ab5..9fbd39f90e 100644 --- a/akka-core/src/test/scala/ActorFireForgetRequestReplySpec.scala +++ b/akka-core/src/test/scala/ActorFireForgetRequestReplySpec.scala @@ -12,9 +12,9 @@ object ActorFireForgetRequestReplySpec { self.dispatcher = Dispatchers.newThreadBasedDispatcher(self) def receive = { - case "Send" => + case "Send" => self.reply("Reply") - case "SendImplicit" => + case "SendImplicit" => self.sender.get ! "ReplyImplicit" } } @@ -34,7 +34,7 @@ object ActorFireForgetRequestReplySpec { state.finished.await } } - } + } object state { var s = "NIL" @@ -51,7 +51,7 @@ class ActorFireForgetRequestReplySpec extends JUnitSuite { val replyActor = actorOf[ReplyActor].start val senderActor = actorOf(new SenderActor(replyActor)).start senderActor ! "Init" - try { state.finished.await(1L, TimeUnit.SECONDS) } + try { state.finished.await(1L, TimeUnit.SECONDS) } catch { case e: TimeoutException => fail("Never got the message") } assert("Reply" === state.s) } @@ -62,7 +62,7 @@ class ActorFireForgetRequestReplySpec extends JUnitSuite { val replyActor = actorOf[ReplyActor].start val senderActor = actorOf(new SenderActor(replyActor)).start senderActor ! "InitImplicit" - try { state.finished.await(1L, TimeUnit.SECONDS) } + try { state.finished.await(1L, TimeUnit.SECONDS) } catch { case e: TimeoutException => fail("Never got the message") } assert("ReplyImplicit" === state.s) } diff --git a/akka-core/src/test/scala/ActorPatternsTest.scala b/akka-core/src/test/scala/ActorPatternsTest.scala index a7bdfb36fa..fac59a163c 100644 --- a/akka-core/src/test/scala/ActorPatternsTest.scala +++ b/akka-core/src/test/scala/ActorPatternsTest.scala @@ -19,7 +19,6 @@ class ActorPatternsTest extends junit.framework.TestCase with Suite with MustMat import Patterns._ @Test def testDispatcher = { val (testMsg1,testMsg2,testMsg3,testMsg4) = ("test1","test2","test3","test4") - val targetOk = new AtomicInteger(0) val t1 = actorOf( new Actor() { def receive = { @@ -82,8 +81,8 @@ class ActorPatternsTest extends junit.framework.TestCase with Suite with MustMat t1ProcessedCount.get must be < (t2ProcessedCount.get) // because t1 is much slower and thus has a bigger mailbox all the time for(a <- List(t1,t2,d)) a.stop } - - @Test def testListener = { + + @Test def testListener = { val latch = new CountDownLatch(2) val num = new AtomicInteger(0) val i = actorOf(new Actor with Listeners { @@ -92,17 +91,17 @@ class ActorPatternsTest extends junit.framework.TestCase with Suite with MustMat } }) i.start - - def newListener = actor { - case "bar" => + + def newListener = actor { + case "bar" => num.incrementAndGet latch.countDown } - + val a1 = newListener val a2 = newListener val a3 = newListener - + i ! Listen(a1) i ! Listen(a2) i ! Listen(a3) @@ -115,4 +114,4 @@ class ActorPatternsTest extends junit.framework.TestCase with Suite with MustMat num.get must be (2) for(a <- List(i,a1,a2,a3)) a.stop } -} \ No newline at end of file +} diff --git a/akka-core/src/test/scala/ActorRegistrySpec.scala b/akka-core/src/test/scala/ActorRegistrySpec.scala index 6a25e066b6..0a9d23c6c3 100644 --- a/akka-core/src/test/scala/ActorRegistrySpec.scala +++ b/akka-core/src/test/scala/ActorRegistrySpec.scala @@ -13,12 +13,12 @@ object ActorRegistrySpec { record = "pong" + record self.reply("got ping") } - } + } } class ActorRegistrySpec extends JUnitSuite { import ActorRegistrySpec._ - + @Test def shouldGetActorByIdFromActorRegistry { ActorRegistry.shutdownAll val actor = actorOf[TestActor] diff --git a/akka-core/src/test/scala/AgentSpec.scala b/akka-core/src/test/scala/AgentSpec.scala index c4bc3e44d0..acec2ccf89 100644 --- a/akka-core/src/test/scala/AgentSpec.scala +++ b/akka-core/src/test/scala/AgentSpec.scala @@ -88,7 +88,7 @@ class AgentSpec extends junit.framework.TestCase with Suite with MustMatchers { result must be(4) agent1.close } - + @Test def testAgentMap = { val agent1 = Agent(3) val result = for (first <- agent1) yield first + 1 diff --git a/akka-core/src/test/scala/AgentUtilTest.scala b/akka-core/src/test/scala/AgentUtilTest.scala index 348bf52a2b..b999586cc4 100644 --- a/akka-core/src/test/scala/AgentUtilTest.scala +++ b/akka-core/src/test/scala/AgentUtilTest.scala @@ -20,4 +20,4 @@ class ActorUtilTest extends junit.framework.TestCase with Suite with MustMatcher val done = latch.await(5,TimeUnit.SECONDS) done must be (true) } -} \ No newline at end of file +} diff --git a/akka-core/src/test/scala/ClientInitiatedRemoteActorSpec.scala b/akka-core/src/test/scala/ClientInitiatedRemoteActorSpec.scala index 45ff025f8e..18a1bed543 100644 --- a/akka-core/src/test/scala/ClientInitiatedRemoteActorSpec.scala +++ b/akka-core/src/test/scala/ClientInitiatedRemoteActorSpec.scala @@ -13,7 +13,7 @@ import Actor._ case class Send(actor: Actor) object RemoteActorSpecActorUnidirectional { - val latch = new CountDownLatch(1) + val latch = new CountDownLatch(1) } class RemoteActorSpecActorUnidirectional extends Actor { self.dispatcher = Dispatchers.newThreadBasedDispatcher(self) diff --git a/akka-core/src/test/scala/ExecutorBasedEventDrivenDispatcherActorSpec.scala b/akka-core/src/test/scala/ExecutorBasedEventDrivenDispatcherActorSpec.scala index cdab6ac71e..f876d59527 100644 --- a/akka-core/src/test/scala/ExecutorBasedEventDrivenDispatcherActorSpec.scala +++ b/akka-core/src/test/scala/ExecutorBasedEventDrivenDispatcherActorSpec.scala @@ -17,19 +17,19 @@ object ExecutorBasedEventDrivenDispatcherActorSpec { } } - object OneWayTestActor { - val oneWay = new CountDownLatch(1) + object OneWayTestActor { + val oneWay = new CountDownLatch(1) } class OneWayTestActor extends Actor { self.dispatcher = Dispatchers.newExecutorBasedEventDrivenDispatcher(self.uuid) def receive = { case "OneWay" => OneWayTestActor.oneWay.countDown } - } + } } class ExecutorBasedEventDrivenDispatcherActorSpec extends JUnitSuite { import ExecutorBasedEventDrivenDispatcherActorSpec._ - + private val unit = TimeUnit.MILLISECONDS @Test def shouldSendOneWay = { diff --git a/akka-core/src/test/scala/ExecutorBasedEventDrivenDispatcherActorsSpec.scala b/akka-core/src/test/scala/ExecutorBasedEventDrivenDispatcherActorsSpec.scala index 563dcf9262..b2c9cf4422 100644 --- a/akka-core/src/test/scala/ExecutorBasedEventDrivenDispatcherActorsSpec.scala +++ b/akka-core/src/test/scala/ExecutorBasedEventDrivenDispatcherActorsSpec.scala @@ -39,7 +39,7 @@ class ExecutorBasedEventDrivenDispatcherActorsSpec extends JUnitSuite with MustM val fFinished = new CountDownLatch(10) val s = actorOf(new SlowActor(sFinished)).start val f = actorOf(new FastActor(fFinished)).start - + // send a lot of stuff to s for (i <- 1 to 50) { s ! i diff --git a/akka-core/src/test/scala/ExecutorBasedEventDrivenWorkStealingDispatcherSpec.scala b/akka-core/src/test/scala/ExecutorBasedEventDrivenWorkStealingDispatcherSpec.scala index 7c056c80ac..64f5a95173 100644 --- a/akka-core/src/test/scala/ExecutorBasedEventDrivenWorkStealingDispatcherSpec.scala +++ b/akka-core/src/test/scala/ExecutorBasedEventDrivenWorkStealingDispatcherSpec.scala @@ -10,7 +10,7 @@ import Actor._ import java.util.concurrent.{TimeUnit, CountDownLatch} -object ExecutorBasedEventDrivenWorkStealingDispatcherSpec { +object ExecutorBasedEventDrivenWorkStealingDispatcherSpec { val delayableActorDispatcher = Dispatchers.newExecutorBasedEventDrivenWorkStealingDispatcher("pooled-dispatcher") val sharedActorDispatcher = Dispatchers.newExecutorBasedEventDrivenWorkStealingDispatcher("pooled-dispatcher") val parentActorDispatcher = Dispatchers.newExecutorBasedEventDrivenWorkStealingDispatcher("pooled-dispatcher") @@ -28,7 +28,7 @@ object ExecutorBasedEventDrivenWorkStealingDispatcherSpec { } } } - + class FirstActor extends Actor { self.dispatcher = sharedActorDispatcher def receive = {case _ => {}} @@ -53,7 +53,7 @@ object ExecutorBasedEventDrivenWorkStealingDispatcherSpec { */ class ExecutorBasedEventDrivenWorkStealingDispatcherSpec extends JUnitSuite with MustMatchers { import ExecutorBasedEventDrivenWorkStealingDispatcherSpec._ - + @Test def fastActorShouldStealWorkFromSlowActor { val finishedCounter = new CountDownLatch(110) @@ -78,12 +78,12 @@ class ExecutorBasedEventDrivenWorkStealingDispatcherSpec extends JUnitSuite with } finishedCounter.await(5, TimeUnit.SECONDS) - fast.actor.asInstanceOf[DelayableActor].invocationCount must be > + fast.actor.asInstanceOf[DelayableActor].invocationCount must be > (slow.actor.asInstanceOf[DelayableActor].invocationCount) slow.stop fast.stop } - + @Test def canNotUseActorsOfDifferentTypesInSameDispatcher: Unit = { val first = actorOf[FirstActor] val second = actorOf[SecondActor] diff --git a/akka-core/src/test/scala/ForwardActorSpec.scala b/akka-core/src/test/scala/ForwardActorSpec.scala index d8813a3fb8..e3ab0bded7 100644 --- a/akka-core/src/test/scala/ForwardActorSpec.scala +++ b/akka-core/src/test/scala/ForwardActorSpec.scala @@ -52,12 +52,12 @@ object ForwardActorSpec { def receive = { case _ => {} } - } + } } class ForwardActorSpec extends JUnitSuite { import ForwardActorSpec._ - + @Test def shouldForwardActorReferenceWhenInvokingForwardOnBang { val senderActor = actorOf[BangSenderActor] @@ -76,6 +76,6 @@ class ForwardActorSpec extends JUnitSuite { val senderActor = actorOf[BangBangSenderActor] senderActor.start val latch = senderActor.actor.asInstanceOf[BangBangSenderActor].latch - assert(latch.await(1L, TimeUnit.SECONDS)) + assert(latch.await(1L, TimeUnit.SECONDS)) } } diff --git a/akka-core/src/test/scala/FutureSpec.scala b/akka-core/src/test/scala/FutureSpec.scala index 1cdb071620..e3436ef53b 100644 --- a/akka-core/src/test/scala/FutureSpec.scala +++ b/akka-core/src/test/scala/FutureSpec.scala @@ -14,12 +14,12 @@ object FutureSpec { case "Failure" => throw new RuntimeException("expected") } - } + } } class FutureSpec extends JUnitSuite { import FutureSpec._ - + @Test def shouldActorReplyResultThroughExplicitFuture { val actor = actorOf[TestActor] actor.start diff --git a/akka-core/src/test/scala/InMemoryActorSpec.scala b/akka-core/src/test/scala/InMemoryActorSpec.scala index 433e959a73..814e3fb841 100644 --- a/akka-core/src/test/scala/InMemoryActorSpec.scala +++ b/akka-core/src/test/scala/InMemoryActorSpec.scala @@ -32,7 +32,7 @@ import InMemoryActorSpec._ class InMemStatefulActor(expectedInvocationCount: Int) extends Transactor { def this() = this(0) self.timeout = 5000 - + val notifier = new CountDownLatch(expectedInvocationCount) private lazy val mapState = TransactionalState.newMap[String, String] @@ -102,7 +102,7 @@ class InMemStatefulActor(expectedInvocationCount: Int) extends Transactor { @serializable class InMemFailerActor extends Transactor { - + def receive = { case "Failure" => throw new RuntimeException("expected") diff --git a/akka-core/src/test/scala/Messages.scala b/akka-core/src/test/scala/Messages.scala index a189110c42..436257e3b5 100644 --- a/akka-core/src/test/scala/Messages.scala +++ b/akka-core/src/test/scala/Messages.scala @@ -21,7 +21,7 @@ case class User(val usernamePassword: Tuple2[String, String], val age: Int) extends Serializable.SBinary[User] { def this() = this(null, null, 0) - import sbinary.DefaultProtocol._ + import sbinary.DefaultProtocol._ implicit object UserFormat extends Format[User] { def reads(in : Input) = User( read[Tuple2[String, String]](in), diff --git a/akka-core/src/test/scala/ProtobufActorMessageSerializationSpec.scala b/akka-core/src/test/scala/ProtobufActorMessageSerializationSpec.scala index 0a6710262e..fbf5411e02 100644 --- a/akka-core/src/test/scala/ProtobufActorMessageSerializationSpec.scala +++ b/akka-core/src/test/scala/ProtobufActorMessageSerializationSpec.scala @@ -68,4 +68,4 @@ class ProtobufActorMessageSerializationSpec extends JUnitSuite { actor.stop } } - \ No newline at end of file + diff --git a/akka-core/src/test/scala/ReactorBasedSingleThreadEventDrivenDispatcherActorSpec.scala b/akka-core/src/test/scala/ReactorBasedSingleThreadEventDrivenDispatcherActorSpec.scala index f5210ce610..726f79fa22 100644 --- a/akka-core/src/test/scala/ReactorBasedSingleThreadEventDrivenDispatcherActorSpec.scala +++ b/akka-core/src/test/scala/ReactorBasedSingleThreadEventDrivenDispatcherActorSpec.scala @@ -19,20 +19,20 @@ object ReactorBasedSingleThreadEventDrivenDispatcherActorSpec { } } - object OneWayTestActor { - val oneWay = new CountDownLatch(1) + object OneWayTestActor { + val oneWay = new CountDownLatch(1) } class OneWayTestActor extends Actor { self.dispatcher = Dispatchers.newExecutorBasedEventDrivenDispatcher(self.uuid) def receive = { case "OneWay" => OneWayTestActor.oneWay.countDown } - } + } } class ReactorBasedSingleThreadEventDrivenDispatcherActorSpec extends JUnitSuite { import ReactorBasedSingleThreadEventDrivenDispatcherActorSpec._ - + private val unit = TimeUnit.MILLISECONDS @Test def shouldSendOneWay = { diff --git a/akka-core/src/test/scala/ReactorBasedThreadPoolEventDrivenDispatcherActorSpec.scala b/akka-core/src/test/scala/ReactorBasedThreadPoolEventDrivenDispatcherActorSpec.scala index 0efe8483e9..b1f3dae678 100644 --- a/akka-core/src/test/scala/ReactorBasedThreadPoolEventDrivenDispatcherActorSpec.scala +++ b/akka-core/src/test/scala/ReactorBasedThreadPoolEventDrivenDispatcherActorSpec.scala @@ -16,7 +16,7 @@ object ReactorBasedThreadPoolEventDrivenDispatcherActorSpec { case "Failure" => throw new RuntimeException("expected") } - } + } } class ReactorBasedThreadPoolEventDrivenDispatcherActorSpec extends JUnitSuite { diff --git a/akka-core/src/test/scala/RemoteSupervisorSpec.scala b/akka-core/src/test/scala/RemoteSupervisorSpec.scala index 52d531dadf..0fcefc3cd3 100644 --- a/akka-core/src/test/scala/RemoteSupervisorSpec.scala +++ b/akka-core/src/test/scala/RemoteSupervisorSpec.scala @@ -353,7 +353,7 @@ class RemoteSupervisorSpec extends JUnitSuite { } /* - + @Test def shouldOneWayKillSingleActorOneForOne = { clearMessageLogs val sup = getSingleActorOneForOneSupervisor diff --git a/akka-core/src/test/scala/SchedulerSpec.scala b/akka-core/src/test/scala/SchedulerSpec.scala index effceb88ed..e0b12a1b4b 100644 --- a/akka-core/src/test/scala/SchedulerSpec.scala +++ b/akka-core/src/test/scala/SchedulerSpec.scala @@ -27,4 +27,4 @@ class SchedulerSpec extends JUnitSuite { */ assert(true) } -} \ No newline at end of file +} diff --git a/akka-core/src/test/scala/ServerInitiatedRemoteActorSample.scala b/akka-core/src/test/scala/ServerInitiatedRemoteActorSample.scala index 8d3a6a70b5..dad54e6d3a 100644 --- a/akka-core/src/test/scala/ServerInitiatedRemoteActorSample.scala +++ b/akka-core/src/test/scala/ServerInitiatedRemoteActorSample.scala @@ -25,7 +25,7 @@ object ServerInitiatedRemoteActorServer { } object ServerInitiatedRemoteActorClient extends Logging { - + def run = { val actor = RemoteClient.actorFor("hello-service", "localhost", 9999) val result = actor !! "Hello" diff --git a/akka-core/src/test/scala/ServerInitiatedRemoteActorSpec.scala b/akka-core/src/test/scala/ServerInitiatedRemoteActorSpec.scala index 7caa593b88..328b8b70b6 100644 --- a/akka-core/src/test/scala/ServerInitiatedRemoteActorSpec.scala +++ b/akka-core/src/test/scala/ServerInitiatedRemoteActorSpec.scala @@ -12,7 +12,7 @@ object ServerInitiatedRemoteActorSpec { val HOSTNAME = "localhost" val PORT = 9990 var server: RemoteServer = null - + case class Send(actor: ActorRef) object RemoteActorSpecActorUnidirectional { @@ -135,4 +135,4 @@ class ServerInitiatedRemoteActorSpec extends JUnitSuite { actor.stop } } - \ No newline at end of file + diff --git a/akka-core/src/test/scala/SupervisorSpec.scala b/akka-core/src/test/scala/SupervisorSpec.scala index 73b763a227..bcf8496582 100644 --- a/akka-core/src/test/scala/SupervisorSpec.scala +++ b/akka-core/src/test/scala/SupervisorSpec.scala @@ -21,7 +21,7 @@ object SupervisorSpec { messageLog.clear oneWayLog.clear } - + class PingPong1Actor extends Actor { import self._ //dispatcher = Dispatchers.newThreadBasedDispatcher(self) @@ -82,7 +82,7 @@ object SupervisorSpec { */ class SupervisorSpec extends JUnitSuite { import SupervisorSpec._ - + var pingpong1: ActorRef = _ var pingpong2: ActorRef = _ var pingpong3: ActorRef = _ @@ -110,7 +110,7 @@ class SupervisorSpec extends JUnitSuite { @Test def shouldKillSingleActorOneForOne = { clearMessageLogs val sup = getSingleActorOneForOneSupervisor - + intercept[RuntimeException] { pingpong1 !! (Die, 5000) } @@ -123,7 +123,7 @@ class SupervisorSpec extends JUnitSuite { @Test def shouldCallKillCallSingleActorOneForOne = { clearMessageLogs val sup = getSingleActorOneForOneSupervisor - + expect("pong") { (pingpong1 !! (Ping, 5000)).getOrElse("nil") } @@ -150,7 +150,7 @@ class SupervisorSpec extends JUnitSuite { @Test def shouldKillSingleActorAllForOne = { clearMessageLogs val sup = getSingleActorAllForOneSupervisor - + intercept[RuntimeException] { pingpong1 !! (Die, 5000) } @@ -163,7 +163,7 @@ class SupervisorSpec extends JUnitSuite { @Test def shouldCallKillCallSingleActorAllForOne = { clearMessageLogs val sup = getSingleActorAllForOneSupervisor - + expect("pong") { (pingpong1 !! (Ping, 5000)).getOrElse("nil") } @@ -190,7 +190,7 @@ class SupervisorSpec extends JUnitSuite { @Test def shouldKillMultipleActorsOneForOne1 = { clearMessageLogs val sup = getMultipleActorsOneForOneConf - + intercept[RuntimeException] { pingpong1 !! (Die, 5000) } @@ -203,7 +203,7 @@ class SupervisorSpec extends JUnitSuite { @Test def shouldKillMultipleActorsOneForOne2 = { clearMessageLogs val sup = getMultipleActorsOneForOneConf - + intercept[RuntimeException] { pingpong3 !! (Die, 5000) } @@ -216,7 +216,7 @@ class SupervisorSpec extends JUnitSuite { @Test def shouldKillCallMultipleActorsOneForOne = { clearMessageLogs val sup = getMultipleActorsOneForOneConf - + expect("pong") { (pingpong1 !! (Ping, 5000)).getOrElse("nil") } @@ -271,7 +271,7 @@ class SupervisorSpec extends JUnitSuite { @Test def shouldKillMultipleActorsAllForOne = { clearMessageLogs val sup = getMultipleActorsAllForOneConf - + intercept[RuntimeException] { pingpong2 !! (Die, 5000) } @@ -290,7 +290,7 @@ class SupervisorSpec extends JUnitSuite { @Test def shouldCallKillCallMultipleActorsAllForOne = { clearMessageLogs val sup = getMultipleActorsAllForOneConf - + expect("pong") { (pingpong1 !! (Ping, 5000)).getOrElse("nil") } @@ -351,7 +351,7 @@ class SupervisorSpec extends JUnitSuite { @Test def shouldOneWayKillSingleActorOneForOne = { clearMessageLogs val sup = getSingleActorOneForOneSupervisor - + pingpong1 ! Die expect("DIE") { @@ -362,7 +362,7 @@ class SupervisorSpec extends JUnitSuite { @Test def shouldOneWayCallKillCallSingleActorOneForOne = { clearMessageLogs val sup = getSingleActorOneForOneSupervisor - + pingpong1 ! OneWay expect("oneway") { @@ -374,7 +374,7 @@ class SupervisorSpec extends JUnitSuite { messageLog.poll(5, TimeUnit.SECONDS) } pingpong1 ! OneWay - + expect("oneway") { oneWayLog.poll(5, TimeUnit.SECONDS) } @@ -383,7 +383,7 @@ class SupervisorSpec extends JUnitSuite { @Test def shouldRestartKilledActorsForNestedSupervisorHierarchy = { clearMessageLogs val sup = getNestedSupervisorsAllForOneConf - + expect("pong") { (pingpong1 !! (Ping, 5000)).getOrElse("nil") diff --git a/akka-core/src/test/scala/ThreadBasedActorSpec.scala b/akka-core/src/test/scala/ThreadBasedActorSpec.scala index 93bc065c4b..d10a39965b 100644 --- a/akka-core/src/test/scala/ThreadBasedActorSpec.scala +++ b/akka-core/src/test/scala/ThreadBasedActorSpec.scala @@ -10,19 +10,19 @@ import Actor._ object ThreadBasedActorSpec { class TestActor extends Actor { self.dispatcher = Dispatchers.newThreadBasedDispatcher(self) - + def receive = { case "Hello" => self.reply("World") case "Failure" => throw new RuntimeException("expected") } - } + } } class ThreadBasedActorSpec extends JUnitSuite { import ThreadBasedActorSpec._ - + private val unit = TimeUnit.MILLISECONDS @Test def shouldSendOneWay { diff --git a/akka-core/src/test/scala/ThreadBasedDispatcherSpec.scala b/akka-core/src/test/scala/ThreadBasedDispatcherSpec.scala index 5e0b9783f7..bdacd3208c 100644 --- a/akka-core/src/test/scala/ThreadBasedDispatcherSpec.scala +++ b/akka-core/src/test/scala/ThreadBasedDispatcherSpec.scala @@ -19,7 +19,7 @@ class ThreadBasedDispatcherSpec extends JUnitSuite { val key1 = actorOf(new Actor { def receive = { case _ => {}} }) val key2 = actorOf(new Actor { def receive = { case _ => {}} }) val key3 = actorOf(new Actor { def receive = { case _ => {}} }) - + class TestMessageHandle(handleLatch: CountDownLatch) extends MessageInvoker { val guardLock: Lock = new ReentrantLock @@ -88,4 +88,4 @@ class ThreadBasedDispatcherSpec extends JUnitSuite { dispatcher.shutdown } } -*/ \ No newline at end of file +*/ diff --git a/akka-core/src/test/scala/TransactionalRefSpec.scala b/akka-core/src/test/scala/TransactionalRefSpec.scala index 14a0a8f186..d21f2af872 100644 --- a/akka-core/src/test/scala/TransactionalRefSpec.scala +++ b/akka-core/src/test/scala/TransactionalRefSpec.scala @@ -87,15 +87,15 @@ class TransactionalRefSpec extends Spec with ShouldMatchers { val value1 = atomic { ref1.get.get } val value2 = atomic { ref2.get.get } - + value1 should be(1) value2 should be(2) } it("should be able to be used in a 'foreach' for comprehension") { val ref = Ref(3) - - var result = 0 + + var result = 0 atomic { for (value <- ref) { @@ -133,7 +133,7 @@ class TransactionalRefSpec extends Spec with ShouldMatchers { value3 should be(3) } - + it("should be able to be used in a 'filter' for comprehension") { val ref1 = Ref(1) @@ -142,7 +142,7 @@ class TransactionalRefSpec extends Spec with ShouldMatchers { } val optLess2 = atomic { refLess2.get } - + val refGreater2 = atomic { for (value <- ref1 if value > 2) yield value } diff --git a/akka-http/src/main/resources/META-INF/services/javax.ws.rs.ext.MessageBodyWriter_FIXME b/akka-http/src/main/resources/META-INF/services/javax.ws.rs.ext.MessageBodyWriter_FIXME index f88c0c8601..51bc8cccd2 100644 --- a/akka-http/src/main/resources/META-INF/services/javax.ws.rs.ext.MessageBodyWriter_FIXME +++ b/akka-http/src/main/resources/META-INF/services/javax.ws.rs.ext.MessageBodyWriter_FIXME @@ -1 +1 @@ -se.scalablesolutions.akka.rest.ListWriter \ No newline at end of file +se.scalablesolutions.akka.rest.ListWriter diff --git a/akka-http/src/main/scala/ActorComponentProvider.scala b/akka-http/src/main/scala/ActorComponentProvider.scala index ed51482604..52512b6929 100644 --- a/akka-http/src/main/scala/ActorComponentProvider.scala +++ b/akka-http/src/main/scala/ActorComponentProvider.scala @@ -13,7 +13,7 @@ import se.scalablesolutions.akka.actor.Actor class ActorComponentProvider(val clazz: Class[_], val configurators: List[Configurator]) extends IoCFullyManagedComponentProvider with Logging { - + override def getScope = ComponentScope.Singleton override def getInstance: AnyRef = { @@ -26,4 +26,4 @@ class ActorComponentProvider(val clazz: Class[_], val configurators: List[Config "No Actor or Active Object for class [" + clazz + "] could be found.\nMake sure you have defined and configured the class as an Active Object or Actor in a supervisor hierarchy.") else instances.head.asInstanceOf[AnyRef] } -} \ No newline at end of file +} diff --git a/akka-http/src/main/scala/AkkaBroadcaster.scala b/akka-http/src/main/scala/AkkaBroadcaster.scala index fd0d851c6a..57d8ccd549 100644 --- a/akka-http/src/main/scala/AkkaBroadcaster.scala +++ b/akka-http/src/main/scala/AkkaBroadcaster.scala @@ -9,15 +9,15 @@ import se.scalablesolutions.akka.actor.Actor._ class AkkaBroadcaster extends org.atmosphere.jersey.JerseyBroadcaster { name = classOf[AkkaBroadcaster].getName - + val caster = actor { case f : Function0[_] => f() } override def destroy { super.destroy caster.stop } - + protected override def broadcast(r : AtmosphereResource[_,_], e : AtmosphereResourceEvent[_,_]) = { caster ! (() => super.broadcast(r,e)) } -} \ No newline at end of file +} diff --git a/akka-http/src/main/scala/AkkaClusterBroadcastFilter.scala b/akka-http/src/main/scala/AkkaClusterBroadcastFilter.scala index 210d6e48c4..af5e83e71c 100644 --- a/akka-http/src/main/scala/AkkaClusterBroadcastFilter.scala +++ b/akka-http/src/main/scala/AkkaClusterBroadcastFilter.scala @@ -1,7 +1,7 @@ /** * Copyright (C) 2009-2010 Scalable Solutions AB */ - + package se.scalablesolutions.akka.comet import se.scalablesolutions.akka.actor.Actor @@ -24,8 +24,8 @@ class AkkaClusterBroadcastFilter extends Actor with ClusterBroadcastFilter[AnyRe @BeanProperty var clusterName = "" @BeanProperty var broadcaster : Broadcaster = null - /** - * Stops the actor + /** + * Stops the actor */ def destroy: Unit = self.stop @@ -36,14 +36,14 @@ class AkkaClusterBroadcastFilter extends Actor with ClusterBroadcastFilter[AnyRe */ def filter(o : AnyRef) = new BroadcastFilter.BroadcastAction(o match { case ClusterCometBroadcast(_,m) => m //Do not re-broadcast, just unbox and pass along - + case m : AnyRef => { //Relay message to the cluster and pass along Cluster.relayMessage(classOf[AkkaClusterBroadcastFilter],ClusterCometBroadcast(clusterName,m)) m } }) - def receive = { + def receive = { //Only handle messages intended for this particular instance case b @ ClusterCometBroadcast(c, _) if (c == clusterName) && (broadcaster ne null) => broadcaster broadcast b case _ => @@ -51,4 +51,4 @@ class AkkaClusterBroadcastFilter extends Actor with ClusterBroadcastFilter[AnyRe //Since this class is instantiated by Atmosphere, we need to make sure it's started self.start -} \ No newline at end of file +} diff --git a/akka-http/src/main/scala/AkkaCometServlet.scala b/akka-http/src/main/scala/AkkaCometServlet.scala index cae6dd3000..0ce6f8312a 100644 --- a/akka-http/src/main/scala/AkkaCometServlet.scala +++ b/akka-http/src/main/scala/AkkaCometServlet.scala @@ -60,7 +60,7 @@ class AkkaServlet extends org.atmosphere.cpr.AtmosphereServlet with Logging { */ override def createCometSupportResolver() : CometSupportResolver = { import scala.collection.JavaConversions._ - + new DefaultCometSupportResolver(config) { type CS = CometSupport[_ <: AtmosphereResource[_,_]] override def resolveMultipleNativeSupportConflict(available : JList[Class[_ <: CS]]) : CS = { @@ -70,7 +70,7 @@ class AkkaServlet extends org.atmosphere.cpr.AtmosphereServlet with Logging { case _ => super.resolveMultipleNativeSupportConflict(available) } } - + override def resolve(useNativeIfPossible : Boolean, useBlockingAsDefault : Boolean) : CS = { val predef = config.getInitParameter("cometSupport") if (testClassExists(predef)) newCometSupport(predef) diff --git a/akka-http/src/main/scala/AkkaLoader.scala b/akka-http/src/main/scala/AkkaLoader.scala index 3d9af36dfd..b9633e71ec 100644 --- a/akka-http/src/main/scala/AkkaLoader.scala +++ b/akka-http/src/main/scala/AkkaLoader.scala @@ -14,7 +14,7 @@ class AkkaLoader extends Logging { @volatile private var hasBooted = false @volatile private var _bundles: Option[Bootable] = None - + def bundles = _bundles; /* @@ -58,4 +58,4 @@ class AkkaLoader extends Logging { log.info(" Running version %s", Config.VERSION) log.info("==============================") } -} \ No newline at end of file +} diff --git a/akka-http/src/main/scala/AkkaServlet.scala b/akka-http/src/main/scala/AkkaServlet.scala index 32b10b354b..aecdaa9671 100644 --- a/akka-http/src/main/scala/AkkaServlet.scala +++ b/akka-http/src/main/scala/AkkaServlet.scala @@ -30,4 +30,4 @@ class AkkaServlet extends ServletContainer { webApplication.initiate(resourceConfig, new ActorComponentProviderFactory(configurators)) } -} \ No newline at end of file +} diff --git a/akka-http/src/main/scala/Initializer.scala b/akka-http/src/main/scala/Initializer.scala index 809d5ec743..d47357c710 100644 --- a/akka-http/src/main/scala/Initializer.scala +++ b/akka-http/src/main/scala/Initializer.scala @@ -11,7 +11,7 @@ import se.scalablesolutions.akka.config.Config import se.scalablesolutions.akka.util.{Logging, Bootable} import javax.servlet.{ServletContextListener, ServletContextEvent} - + /** * This class can be added to web.xml mappings as a listener to start and shutdown Akka. * @@ -22,13 +22,13 @@ import javax.servlet.{ServletContextListener, ServletContextEvent} * * ... * - */ + */ class Initializer extends ServletContextListener { lazy val loader = new AkkaLoader - - def contextDestroyed(e: ServletContextEvent): Unit = + + def contextDestroyed(e: ServletContextEvent): Unit = loader.shutdown - - def contextInitialized(e: ServletContextEvent): Unit = + + def contextInitialized(e: ServletContextEvent): Unit = loader.boot(true, new BootableActorLoaderService with BootableRemoteActorService with CamelService) - } \ No newline at end of file + } diff --git a/akka-http/src/main/scala/Security.scala b/akka-http/src/main/scala/Security.scala index b5e993fd27..72d79db3d9 100644 --- a/akka-http/src/main/scala/Security.scala +++ b/akka-http/src/main/scala/Security.scala @@ -103,9 +103,11 @@ class AkkaSecurityFilterFactory extends ResourceFilterFactory with Logging { } } - lazy val authenticatorFQN = - Config.config.getString("akka.rest.authenticator") - .getOrElse(throw new IllegalStateException("akka.rest.authenticator")) + lazy val authenticatorFQN = { + val auth = Config.config.getString("akka.rest.authenticator", "N/A") + if (auth == "N/A") throw new IllegalStateException("The config option 'akka.rest.authenticator' is not defined in 'akka.conf'") + auth + } /** * Currently we always take the first, since there usually should be at most one authentication actor, but a round-robin @@ -399,19 +401,31 @@ trait SpnegoAuthenticationActor extends AuthenticationActor[SpnegoCredentials] w /** * principal name for the HTTP kerberos service, i.e HTTP/ { server } @ { realm } */ - lazy val servicePrincipal = Config.config.getString("akka.rest.kerberos.servicePrincipal").getOrElse(throw new IllegalStateException("akka.rest.kerberos.servicePrincipal")) + lazy val servicePrincipal = { + val p = Config.config.getString("akka.rest.kerberos.servicePrincipal", "N/A") + if (p == "N/A") throw new IllegalStateException("The config option 'akka.rest.kerberos.servicePrincipal' is not defined in 'akka.conf'") + p + } /** * keytab location with credentials for the service principal */ - lazy val keyTabLocation = Config.config.getString("akka.rest.kerberos.keyTabLocation").getOrElse(throw new IllegalStateException("akka.rest.kerberos.keyTabLocation")) + lazy val keyTabLocation = { + val p = Config.config.getString("akka.rest.kerberos.keyTabLocation", "N/A") + if (p == "N/A") throw new IllegalStateException("The config option 'akka.rest.kerberos.keyTabLocation' is not defined in 'akka.conf'") + p + } - lazy val kerberosDebug = Config.config.getString("akka.rest.kerberos.kerberosDebug").getOrElse("false") + lazy val kerberosDebug = { + val p = Config.config.getString("akka.rest.kerberos.kerberosDebug", "N/A") + if (p == "N/A") throw new IllegalStateException("The config option 'akka.rest.kerberos.kerberosDebug' is not defined in 'akka.conf'") + p + } /** * is not used by this authenticator, so accept an empty value */ - lazy val realm = Config.config.getString("akka.rest.kerberos.realm").getOrElse("") + lazy val realm = Config.config.getString("akka.rest.kerberos.realm", "") /** * verify the kerberos token from a client with the server diff --git a/akka-http/src/test/scala/AllTest.scala b/akka-http/src/test/scala/AllTest.scala index 71708b63b3..8bb7eb7923 100644 --- a/akka-http/src/test/scala/AllTest.scala +++ b/akka-http/src/test/scala/AllTest.scala @@ -12,4 +12,4 @@ object AllTest extends TestCase { } def main(args: Array[String]) = junit.textui.TestRunner.run(suite) -} \ No newline at end of file +} diff --git a/akka-http/src/test/scala/SecuritySpec.scala b/akka-http/src/test/scala/SecuritySpec.scala index 79a3d95805..2ee7596a25 100644 --- a/akka-http/src/test/scala/SecuritySpec.scala +++ b/akka-http/src/test/scala/SecuritySpec.scala @@ -32,7 +32,7 @@ object BasicAuthenticatorSpec { class BasicAuthenticatorSpec extends junit.framework.TestCase with Suite with MockitoSugar with MustMatchers { import BasicAuthenticatorSpec._ - + val authenticator = actorOf[BasicAuthenticator] authenticator.start @@ -57,13 +57,13 @@ class BasicAuthenticatorSpec extends junit.framework.TestCase val result: AnyRef = (authenticator !! (Authenticate(req, List("chef")), 10000)).get result must be(OK) - // the authenticator must have set a security context + // the authenticator must have set a security context verify(req).setSecurityContext(any[SecurityContext]) } @Test def testUnauthorized = { val req = mock[ContainerRequest] - + // fake a basic auth header -> this will authenticate the user when(req.getHeaderValue("Authorization")).thenReturn("Basic " + new String(Base64.encode("foo:bar"))) when(req.isUserInRole("chef")).thenReturn(false) // this will deny access diff --git a/akka-jta/src/main/scala/TransactionContext.scala b/akka-jta/src/main/scala/TransactionContext.scala index e6ac00de8b..c66c48d5b9 100644 --- a/akka-jta/src/main/scala/TransactionContext.scala +++ b/akka-jta/src/main/scala/TransactionContext.scala @@ -11,7 +11,7 @@ import se.scalablesolutions.akka.util.Logging import se.scalablesolutions.akka.config.Config._ /** - * The TransactionContext object manages the transactions. + * The TransactionContext object manages the transactions. * Can be used as higher-order functional 'atomic blocks' or monadic. * * Manages a thread-local stack of TransactionContexts. @@ -19,7 +19,7 @@ import se.scalablesolutions.akka.config.Config._ * Example usage 1: *
  * import TransactionContext._
- * 
+ *
  * withTxRequired {
  *   ... // transactional stuff
  * }
@@ -53,7 +53,7 @@ import se.scalablesolutions.akka.config.Config._
  * @author Jonas Bonér
  */
 object TransactionContext extends TransactionProtocol with Logging {
-  implicit val tc = TransactionContainer()                    
+  implicit val tc = TransactionContainer()
 
   private[TransactionContext] val stack = new scala.util.DynamicVariable(new TransactionContext(tc))
 
@@ -68,7 +68,7 @@ object TransactionContext extends TransactionProtocol with Logging {
    *         if (status != Status.STATUS_ROLLEDBACK &&
    *             status != Status.STATUS_ROLLING_BACK &&
    *             status != Status.STATUS_MARKED_ROLLBACK) {
-   *           log.debug("Flushing EntityManager...") 
+   *           log.debug("Flushing EntityManager...")
    *           em.flush // flush EntityManager on success
    *         }
    *       } catch {
@@ -87,16 +87,16 @@ object TransactionContext extends TransactionProtocol with Logging {
    *     }
    *   })
    * 
- * You should also override the 'joinTransaction' and 'handleException' methods. - * See ScalaDoc for these methods in the 'TransactionProtocol' for details. + * You should also override the 'joinTransaction' and 'handleException' methods. + * See ScalaDoc for these methods in the 'TransactionProtocol' for details. */ def registerSynchronization(sync: Synchronization) = synchronization.add(sync) - + /** * Registeres a join transaction function. *

* Here is an example on how to integrate with JPA EntityManager. - * + * *

    * TransactionContext.registerJoinTransactionFun(() => {
    *   val em: EntityManager = ... // get the EntityManager
@@ -105,12 +105,12 @@ object TransactionContext extends TransactionProtocol with Logging {
    * 
*/ def registerJoinTransactionFun(fn: () => Unit) = joinTransactionFuns.add(fn) - + /** * Handle exception. Can be overriden by concrete transaction service implementation. *

* Here is an example on how to handle JPA exceptions. - * + * *

    * TransactionContext.registerExceptionNotToRollbackOn(classOf[NoResultException])
    * TransactionContext.registerExceptionNotToRollbackOn(classOf[NonUniqueResultException])
diff --git a/akka-jta/src/main/scala/TransactionProtocol.scala b/akka-jta/src/main/scala/TransactionProtocol.scala
index c23ec26fd7..866ae72ec8 100644
--- a/akka-jta/src/main/scala/TransactionProtocol.scala
+++ b/akka-jta/src/main/scala/TransactionProtocol.scala
@@ -66,12 +66,12 @@ import javax.transaction.{
  * @author Jonas Bonér
  */
 trait TransactionProtocol extends Logging {
-  
+
   protected val synchronization: JList[Synchronization] = new CopyOnWriteArrayList[Synchronization]
   protected val joinTransactionFuns: JList[() => Unit] = new CopyOnWriteArrayList[() => Unit]
   protected val exceptionsNotToRollbackOn: JList[Class[_ <: Exception]] = new CopyOnWriteArrayList[Class[_ <: Exception]]
 
-  def joinTransaction: Unit = { 
+  def joinTransaction: Unit = {
     val it = joinTransactionFuns.iterator
     while (it.hasNext) {
       val fn = it.next
@@ -94,7 +94,7 @@ trait TransactionProtocol extends Logging {
   /**
    * Wraps body in a transaction with REQUIRED semantics.
    * 

- * Creates a new transaction if no transaction is active in scope, else joins the outer transaction. + * Creates a new transaction if no transaction is active in scope, else joins the outer transaction. */ def withTxRequired[T](body: => T): T = { val tm = TransactionContext.getTransactionContainer @@ -157,7 +157,7 @@ trait TransactionProtocol extends Logging { * Throws a TransactionRequiredException if there is no transaction active in scope. */ def withTxMandatory[T](body: => T): T = { - if (!isInExistingTransaction(TransactionContext.getTransactionContainer)) + if (!isInExistingTransaction(TransactionContext.getTransactionContainer)) throw new TransactionRequiredException("No active TX at method with TX type set to MANDATORY") body } @@ -168,7 +168,7 @@ trait TransactionProtocol extends Logging { * Throws a SystemException in case of an existing transaction in scope. */ def withTxNever[T](body: => T): T = { - if (isInExistingTransaction(TransactionContext.getTransactionContainer)) + if (isInExistingTransaction(TransactionContext.getTransactionContainer)) throw new SystemException("Detected active TX at method with TX type set to NEVER") body } @@ -199,7 +199,7 @@ trait TransactionProtocol extends Logging { * @param tm the transaction manager * @return boolean */ - protected def isInExistingTransaction(tm: TransactionContainer): Boolean = + protected def isInExistingTransaction(tm: TransactionContainer): Boolean = tm.getStatus != Status.STATUS_NO_TRANSACTION /** @@ -208,7 +208,7 @@ trait TransactionProtocol extends Logging { * @param tm the transaction manager * @return boolean */ - protected def isRollbackOnly(tm: TransactionContainer): Boolean = + protected def isRollbackOnly(tm: TransactionContainer): Boolean = tm.getStatus == Status.STATUS_MARKED_ROLLBACK /** diff --git a/akka-kernel/src/main/scala/EmbeddedAppServer.scala b/akka-kernel/src/main/scala/EmbeddedAppServer.scala index dc52076a81..a49d6276d1 100644 --- a/akka-kernel/src/main/scala/EmbeddedAppServer.scala +++ b/akka-kernel/src/main/scala/EmbeddedAppServer.scala @@ -1,7 +1,7 @@ /** * Copyright (C) 2009-2010 Scalable Solutions AB */ - + package se.scalablesolutions.akka.kernel import com.sun.grizzly.http.SelectorThread @@ -19,25 +19,25 @@ import se.scalablesolutions.akka.comet.AkkaServlet */ trait EmbeddedAppServer extends Bootable with Logging { self : BootableActorLoaderService => - + import se.scalablesolutions.akka.config.Config._ - + val REST_HOSTNAME = config.getString("akka.rest.hostname", "localhost") val REST_URL = "http://" + REST_HOSTNAME val REST_PORT = config.getInt("akka.rest.port", 9998) - + protected var jerseySelectorThread: Option[SelectorThread] = None - + abstract override def onLoad = { super.onLoad if (config.getBool("akka.rest.service", true)) { - + val uri = UriBuilder.fromUri(REST_URL).port(REST_PORT).build() val scheme = uri.getScheme if (!scheme.equalsIgnoreCase("http")) throw new IllegalArgumentException( "The URI scheme, of the URI " + REST_URL + ", must be equal (ignoring case) to 'http'") - + log.info("Attempting to start REST service on uri [%s]",uri) val adapter = new ServletAdapter @@ -57,17 +57,17 @@ trait EmbeddedAppServer extends Bootable with Logging { t.setEnableAsyncExecution(true) t.setAsyncHandler(ah) t.listen - t + t } log.info("REST service started successfully. Listening to port [%s]", REST_PORT) } } - + abstract override def onUnload = { - super.onUnload + super.onUnload if (jerseySelectorThread.isDefined) { log.info("Shutting down REST service (Jersey)") jerseySelectorThread.get.stopEndpoint } } -} \ No newline at end of file +} diff --git a/akka-kernel/src/main/scala/Kernel.scala b/akka-kernel/src/main/scala/Kernel.scala index 0a10681960..db460062c8 100644 --- a/akka-kernel/src/main/scala/Kernel.scala +++ b/akka-kernel/src/main/scala/Kernel.scala @@ -15,17 +15,17 @@ object Main { } /** - * The Akka Kernel, is used to start And shutdown Akka in standalone/kernel mode. - * + * The Akka Kernel, is used to start And shutdown Akka in standalone/kernel mode. + * * @author Jonas Bonér */ object Kernel extends AkkaLoader { /** * Boots up the Kernel with default bootables */ - def boot: Unit = boot(true, - new EmbeddedAppServer with BootableActorLoaderService - with BootableRemoteActorService + def boot: Unit = boot(true, + new EmbeddedAppServer with BootableActorLoaderService + with BootableRemoteActorService with CamelService) //For testing purposes only diff --git a/akka-persistence/akka-persistence-cassandra/src/main/scala/CassandraStorageBackend.scala b/akka-persistence/akka-persistence-cassandra/src/main/scala/CassandraStorageBackend.scala index f9273f05dd..d380953159 100644 --- a/akka-persistence/akka-persistence-cassandra/src/main/scala/CassandraStorageBackend.scala +++ b/akka-persistence/akka-persistence-cassandra/src/main/scala/CassandraStorageBackend.scala @@ -123,7 +123,7 @@ private[akka] object CassandraStorageBackend extends * if start is not defined, assume start = 0 * if start == 0 and finish == 0, return an empty collection */ - def getVectorStorageRangeFor(name: String, start: Option[Int], finish: Option[Int], count: Int): + def getVectorStorageRangeFor(name: String, start: Option[Int], finish: Option[Int], count: Int): List[Array[Byte]] = { val startBytes = if (start.isDefined) intToBytes(start.get) else null val finishBytes = if (finish.isDefined) intToBytes(finish.get) else null diff --git a/akka-persistence/akka-persistence-cassandra/src/test/resources/storage-conf.xml b/akka-persistence/akka-persistence-cassandra/src/test/resources/storage-conf.xml index 13df178689..b01e547665 100644 --- a/akka-persistence/akka-persistence-cassandra/src/test/resources/storage-conf.xml +++ b/akka-persistence/akka-persistence-cassandra/src/test/resources/storage-conf.xml @@ -21,15 +21,15 @@ - akka - 9160 - false @@ -228,16 +228,16 @@ 64 @@ -257,7 +257,7 @@ - + diff --git a/akka-spring/src/main/scala/ActiveObjectBeanDefinitionParser.scala b/akka-spring/src/main/scala/ActiveObjectBeanDefinitionParser.scala index d22029e5ce..0189147994 100644 --- a/akka-spring/src/main/scala/ActiveObjectBeanDefinitionParser.scala +++ b/akka-spring/src/main/scala/ActiveObjectBeanDefinitionParser.scala @@ -14,7 +14,7 @@ import org.w3c.dom.Element * @author michaelkober */ class ActiveObjectBeanDefinitionParser extends AbstractSingleBeanDefinitionParser with ActiveObjectParser { - /* + /* * @see org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser#doParse(org.w3c.dom.Element, org.springframework.beans.factory.xml.ParserContext, org.springframework.beans.factory.support.BeanDefinitionBuilder) */ override def doParse(element: Element, parserContext: ParserContext, builder: BeanDefinitionBuilder) { @@ -25,5 +25,5 @@ class ActiveObjectBeanDefinitionParser extends AbstractSingleBeanDefinitionParse /* * @see org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser#getBeanClass(org.w3c.dom.Element) */ - override def getBeanClass(element: Element) = classOf[ActiveObjectFactoryBean] -} \ No newline at end of file + override def getBeanClass(element: Element): Class[_] = classOf[ActiveObjectFactoryBean] +} diff --git a/akka-spring/src/main/scala/ActiveObjectFactoryBean.scala b/akka-spring/src/main/scala/ActiveObjectFactoryBean.scala index c8dea6dfb9..66ef87a15d 100644 --- a/akka-spring/src/main/scala/ActiveObjectFactoryBean.scala +++ b/akka-spring/src/main/scala/ActiveObjectFactoryBean.scala @@ -103,4 +103,4 @@ class ActiveObjectFactoryBean extends AbstractFactoryBean[AnyRef] { import DispatcherFactoryBean._ createNewInstance(dispatcher) } -} \ No newline at end of file +} diff --git a/akka-spring/src/main/scala/ActiveObjectParser.scala b/akka-spring/src/main/scala/ActiveObjectParser.scala index 9e64cce987..dd48f8dbe1 100644 --- a/akka-spring/src/main/scala/ActiveObjectParser.scala +++ b/akka-spring/src/main/scala/ActiveObjectParser.scala @@ -16,7 +16,7 @@ trait ActiveObjectParser extends BeanParser with DispatcherParser { /** * Parses the given element and returns a ActiveObjectProperties. * @param element dom element to parse - * @return configuration for the active object + * @return configuration for the active object */ def parseActiveObject(element: Element): ActiveObjectProperties = { val objectProperties = new ActiveObjectProperties() @@ -63,4 +63,4 @@ trait ActiveObjectParser extends BeanParser with DispatcherParser { objectProperties } -} \ No newline at end of file +} diff --git a/akka-spring/src/main/scala/ActiveObjectProperties.scala b/akka-spring/src/main/scala/ActiveObjectProperties.scala index 528b44885c..e273d27a8d 100644 --- a/akka-spring/src/main/scala/ActiveObjectProperties.scala +++ b/akka-spring/src/main/scala/ActiveObjectProperties.scala @@ -22,7 +22,7 @@ class ActiveObjectProperties { var port: Int = _ var lifecyclye: String = "" var dispatcher: DispatcherProperties = _ - + /** * Sets the properties to the given builder. @@ -41,4 +41,4 @@ class ActiveObjectProperties { builder.addPropertyValue(DISPATCHER_TAG, dispatcher) } -} \ No newline at end of file +} diff --git a/akka-spring/src/main/scala/AkkaNamespaceHandler.scala b/akka-spring/src/main/scala/AkkaNamespaceHandler.scala index a0e47cb638..88f2b4c81b 100644 --- a/akka-spring/src/main/scala/AkkaNamespaceHandler.scala +++ b/akka-spring/src/main/scala/AkkaNamespaceHandler.scala @@ -16,4 +16,4 @@ class AkkaNamespaceHandler extends NamespaceHandlerSupport { registerBeanDefinitionParser(SUPERVISION_TAG, new SupervisionBeanDefinitionParser()); registerBeanDefinitionParser(DISPATCHER_TAG, new DispatcherBeanDefinitionParser()); } -} \ No newline at end of file +} diff --git a/akka-spring/src/main/scala/AkkaSpringConfigurationTags.scala b/akka-spring/src/main/scala/AkkaSpringConfigurationTags.scala index 236cce03a5..8ceb1b8f6a 100644 --- a/akka-spring/src/main/scala/AkkaSpringConfigurationTags.scala +++ b/akka-spring/src/main/scala/AkkaSpringConfigurationTags.scala @@ -68,7 +68,7 @@ object AkkaSpringConfigurationTags { val VAL_LIFECYCYLE_TEMPORARY = "temporary" val VAL_LIFECYCYLE_PERMANENT = "permanent" - // Failover + // Failover val VAL_ALL_FOR_ONE = "AllForOne" val VAL_ONE_FOR_ONE = "OneForOne" @@ -76,7 +76,7 @@ object AkkaSpringConfigurationTags { val VAL_ABORT_POLICY = "abort-policy" val VAL_CALLER_RUNS_POLICY = "caller-runs-policy" val VAL_DISCARD_OLDEST_POLICY = "discard-oldest-policy" - val VAL_DISCARD_POLICY = "discard-policy" + val VAL_DISCARD_POLICY = "discard-policy" // dispatcher queue types val VAL_BOUNDED_LINKED_BLOCKING_QUEUE = "bounded-linked-blocking-queue" @@ -90,4 +90,4 @@ object AkkaSpringConfigurationTags { val REACTOR_BASED_SINGLE_THREAD_EVENT_DRIVEN = "reactor-based-single-thread-event-driven" val THREAD_BASED = "thread-based" -} \ No newline at end of file +} diff --git a/akka-spring/src/main/scala/BeanParser.scala b/akka-spring/src/main/scala/BeanParser.scala index b79db3c1a8..1bbba9f09f 100644 --- a/akka-spring/src/main/scala/BeanParser.scala +++ b/akka-spring/src/main/scala/BeanParser.scala @@ -39,4 +39,4 @@ trait BeanParser extends Logging { } } -} \ No newline at end of file +} diff --git a/akka-spring/src/main/scala/DispatcherBeanDefinitionParser.scala b/akka-spring/src/main/scala/DispatcherBeanDefinitionParser.scala index 731414581d..826125fcfc 100644 --- a/akka-spring/src/main/scala/DispatcherBeanDefinitionParser.scala +++ b/akka-spring/src/main/scala/DispatcherBeanDefinitionParser.scala @@ -24,5 +24,5 @@ class DispatcherBeanDefinitionParser extends AbstractSingleBeanDefinitionParser /* * @see org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser#getBeanClass(org.w3c.dom.Element) */ - override def getBeanClass(element: Element) = classOf[DispatcherFactoryBean] -} \ No newline at end of file + override def getBeanClass(element: Element): Class[_] = classOf[DispatcherFactoryBean] +} diff --git a/akka-spring/src/main/scala/DispatcherFactoryBean.scala b/akka-spring/src/main/scala/DispatcherFactoryBean.scala index c314c43f4a..ac4172a696 100644 --- a/akka-spring/src/main/scala/DispatcherFactoryBean.scala +++ b/akka-spring/src/main/scala/DispatcherFactoryBean.scala @@ -80,4 +80,4 @@ class DispatcherFactoryBean extends AbstractFactoryBean[MessageDispatcher] { import DispatcherFactoryBean._ createNewInstance(properties) } -} \ No newline at end of file +} diff --git a/akka-spring/src/main/scala/DispatcherParser.scala b/akka-spring/src/main/scala/DispatcherParser.scala index e8b47979d0..dc156c3d58 100644 --- a/akka-spring/src/main/scala/DispatcherParser.scala +++ b/akka-spring/src/main/scala/DispatcherParser.scala @@ -32,7 +32,7 @@ trait DispatcherParser extends BeanParser { properties.dispatcherType = mandatory(dispatcherElement, TYPE) if (properties.dispatcherType == THREAD_BASED) { if (dispatcherElement.getParentNode.getNodeName != "active-object") { - throw new IllegalArgumentException("Thread based dispatcher must be nested in active-object element!") + throw new IllegalArgumentException("Thread based dispatcher must be nested in active-object element!") } } val threadPoolElement = DomUtils.getChildElementByTagName(dispatcherElement, THREAD_POOL_TAG); @@ -84,4 +84,4 @@ trait DispatcherParser extends BeanParser { (ref != null) && !ref.isEmpty } -} \ No newline at end of file +} diff --git a/akka-spring/src/main/scala/SupervisionBeanDefinitionParser.scala b/akka-spring/src/main/scala/SupervisionBeanDefinitionParser.scala index 172e38dbfc..dde14f3cb2 100644 --- a/akka-spring/src/main/scala/SupervisionBeanDefinitionParser.scala +++ b/akka-spring/src/main/scala/SupervisionBeanDefinitionParser.scala @@ -58,8 +58,8 @@ class SupervisionBeanDefinitionParser extends AbstractSingleBeanDefinitionParser trapExits.map(DomUtils.getTextValue(_).toClass).toArray } - /* + /* * @see org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser#getBeanClass(org.w3c.dom.Element) */ - override def getBeanClass(element: Element) = classOf[SupervisionFactoryBean] -} \ No newline at end of file + override def getBeanClass(element: Element): Class[_] = classOf[SupervisionFactoryBean] +} diff --git a/akka-spring/src/main/scala/SupervisionFactoryBean.scala b/akka-spring/src/main/scala/SupervisionFactoryBean.scala index 4f048d9f3a..d82d329f79 100644 --- a/akka-spring/src/main/scala/SupervisionFactoryBean.scala +++ b/akka-spring/src/main/scala/SupervisionFactoryBean.scala @@ -58,4 +58,4 @@ class SupervisionFactoryBean extends AbstractFactoryBean[ActiveObjectConfigurato } } } -} \ No newline at end of file +} diff --git a/akka-spring/src/test/scala/ActiveObjectBeanDefinitionParserTest.scala b/akka-spring/src/test/scala/ActiveObjectBeanDefinitionParserTest.scala index 2bfbaf0551..e7ed68c379 100644 --- a/akka-spring/src/test/scala/ActiveObjectBeanDefinitionParserTest.scala +++ b/akka-spring/src/test/scala/ActiveObjectBeanDefinitionParserTest.scala @@ -18,7 +18,7 @@ import org.w3c.dom.Element @RunWith(classOf[JUnitRunner]) class ActiveObjectBeanDefinitionParserTest extends Spec with ShouldMatchers { private class Parser extends ActiveObjectParser - + describe("An ActiveObjectParser") { val parser = new Parser() it("should parse the active object configuration") { @@ -63,4 +63,4 @@ class ActiveObjectBeanDefinitionParserTest extends Spec with ShouldMatchers { assert(props.port == 9999) } } -} \ No newline at end of file +} diff --git a/akka-spring/src/test/scala/DispatcherBeanDefinitionParserTest.scala b/akka-spring/src/test/scala/DispatcherBeanDefinitionParserTest.scala index 75a5cb6d7a..bd5490a1b0 100644 --- a/akka-spring/src/test/scala/DispatcherBeanDefinitionParserTest.scala +++ b/akka-spring/src/test/scala/DispatcherBeanDefinitionParserTest.scala @@ -18,7 +18,7 @@ class DispatcherBeanDefinitionParserTest extends Spec with ShouldMatchers { describe("A DispatcherBeanDefinitionParser") { val parser = new DispatcherBeanDefinitionParser() - + it("should be able to parse the dispatcher configuration") { val xml = service = on name = "default" # The name of the cluster - actor = "se.scalablesolutions.akka.cluster.jgroups.JGroupsClusterActor" # FQN of an implementation of ClusterActor + actor = "se.scalablesolutions.akka.remote.JGroupsClusterActor" # FQN of an implementation of ClusterActor serializer = "se.scalablesolutions.akka.serialization.Serializer$Java$" # FQN of the serializer class diff --git a/embedded-repo/com/redis/redisclient/1.1/redisclient-1.1.jar b/embedded-repo/com/redis/redisclient/1.1/redisclient-1.1.jar new file mode 100644 index 0000000000..5d2a6a3632 Binary files /dev/null and b/embedded-repo/com/redis/redisclient/1.1/redisclient-1.1.jar differ diff --git a/embedded-repo/com/redis/redisclient/2.8.0.Beta1-1.3/redisclient-2.8.0.Beta1-1.3.pom b/embedded-repo/com/redis/redisclient/1.1/redisclient-1.1.pom similarity index 91% rename from embedded-repo/com/redis/redisclient/2.8.0.Beta1-1.3/redisclient-2.8.0.Beta1-1.3.pom rename to embedded-repo/com/redis/redisclient/1.1/redisclient-1.1.pom index abe6cdb5c0..16dd81402a 100755 --- a/embedded-repo/com/redis/redisclient/2.8.0.Beta1-1.3/redisclient-2.8.0.Beta1-1.3.pom +++ b/embedded-repo/com/redis/redisclient/1.1/redisclient-1.1.pom @@ -3,6 +3,6 @@ 4.0.0 com.redis redisclient - 2.8.0.Beta1-1.3 + 1.1 jar diff --git a/embedded-repo/com/redis/redisclient/1.2/redisclient-1.2.jar b/embedded-repo/com/redis/redisclient/1.2/redisclient-1.2.jar new file mode 100644 index 0000000000..91ff84b97c Binary files /dev/null and b/embedded-repo/com/redis/redisclient/1.2/redisclient-1.2.jar differ diff --git a/embedded-repo/com/redis/redisclient/2.8.0.Beta1-1.2/redisclient-2.8.0.Beta1-1.2.jar b/embedded-repo/com/redis/redisclient/2.8.0.Beta1-1.2/redisclient-2.8.0.Beta1-1.2.jar new file mode 100644 index 0000000000..3f1593380b Binary files /dev/null and b/embedded-repo/com/redis/redisclient/2.8.0.Beta1-1.2/redisclient-2.8.0.Beta1-1.2.jar differ diff --git a/embedded-repo/com/redis/redisclient/2.8.0.Beta1-1.3-SNAPSHOT/redisclient-2.8.0.Beta1-1.3-SNAPSHOT.pom b/embedded-repo/com/redis/redisclient/2.8.0.Beta1-1.2/redisclient-2.8.0.Beta1-1.2.pom similarity index 89% rename from embedded-repo/com/redis/redisclient/2.8.0.Beta1-1.3-SNAPSHOT/redisclient-2.8.0.Beta1-1.3-SNAPSHOT.pom rename to embedded-repo/com/redis/redisclient/2.8.0.Beta1-1.2/redisclient-2.8.0.Beta1-1.2.pom index 898a59f413..68f3763187 100755 --- a/embedded-repo/com/redis/redisclient/2.8.0.Beta1-1.3-SNAPSHOT/redisclient-2.8.0.Beta1-1.3-SNAPSHOT.pom +++ b/embedded-repo/com/redis/redisclient/2.8.0.Beta1-1.2/redisclient-2.8.0.Beta1-1.2.pom @@ -3,6 +3,6 @@ 4.0.0 com.redis redisclient - 2.8.0.Beta1-1.3-SNAPSHOT + 2.8.0.Beta1-1.2 jar diff --git a/embedded-repo/com/redis/redisclient/2.8.0.Beta1-1.3-SNAPSHOT/redisclient-2.8.0.Beta1-1.3-SNAPSHOT.jar b/embedded-repo/com/redis/redisclient/2.8.0.Beta1-1.3-SNAPSHOT/redisclient-2.8.0.Beta1-1.3-SNAPSHOT.jar index 52125e6d52..0daede37f0 100644 Binary files a/embedded-repo/com/redis/redisclient/2.8.0.Beta1-1.3-SNAPSHOT/redisclient-2.8.0.Beta1-1.3-SNAPSHOT.jar and b/embedded-repo/com/redis/redisclient/2.8.0.Beta1-1.3-SNAPSHOT/redisclient-2.8.0.Beta1-1.3-SNAPSHOT.jar differ diff --git a/embedded-repo/com/redis/redisclient/2.8.0.Beta1-1.3/redisclient-2.8.0.Beta1-1.3.jar b/embedded-repo/com/redis/redisclient/2.8.0.Beta1-1.3/redisclient-2.8.0.Beta1-1.3.jar deleted file mode 100644 index 687ea683e7..0000000000 Binary files a/embedded-repo/com/redis/redisclient/2.8.0.Beta1-1.3/redisclient-2.8.0.Beta1-1.3.jar and /dev/null differ diff --git a/embedded-repo/net/lag/configgy/2.8.0.RC2-1.5.2-SNAPSHOT/configgy-2.8.0.RC2-1.5.2-SNAPSHOT.jar b/embedded-repo/net/lag/configgy/2.8.0.RC2-1.5.2-SNAPSHOT/configgy-2.8.0.RC2-1.5.2-SNAPSHOT.jar new file mode 100644 index 0000000000..2866c13503 Binary files /dev/null and b/embedded-repo/net/lag/configgy/2.8.0.RC2-1.5.2-SNAPSHOT/configgy-2.8.0.RC2-1.5.2-SNAPSHOT.jar differ diff --git a/embedded-repo/net/lag/configgy/2.8.0.RC2-1.5.2-SNAPSHOT/configgy-2.8.0.RC2-1.5.2-SNAPSHOT.pom b/embedded-repo/net/lag/configgy/2.8.0.RC2-1.5.2-SNAPSHOT/configgy-2.8.0.RC2-1.5.2-SNAPSHOT.pom new file mode 100644 index 0000000000..6f13f19cfa --- /dev/null +++ b/embedded-repo/net/lag/configgy/2.8.0.RC2-1.5.2-SNAPSHOT/configgy-2.8.0.RC2-1.5.2-SNAPSHOT.pom @@ -0,0 +1,9 @@ + + + 4.0.0 + net.lag + configgy + 2.8.0.RC2-1.5.2-SNAPSHOT + POM was created from install:install-file + diff --git a/embedded-repo/net/lag/configgy/2.8.0.RC2-1.5.2-SNAPSHOT/maven-metadata-local.xml b/embedded-repo/net/lag/configgy/2.8.0.RC2-1.5.2-SNAPSHOT/maven-metadata-local.xml new file mode 100644 index 0000000000..dad62dda16 --- /dev/null +++ b/embedded-repo/net/lag/configgy/2.8.0.RC2-1.5.2-SNAPSHOT/maven-metadata-local.xml @@ -0,0 +1,12 @@ + + + net.lag + configgy + 2.8.0.RC2-1.5.2-SNAPSHOT + + + true + + 20100519155407 + + diff --git a/embedded-repo/net/lag/configgy/maven-metadata-local.xml b/embedded-repo/net/lag/configgy/maven-metadata-local.xml new file mode 100644 index 0000000000..8992b6209e --- /dev/null +++ b/embedded-repo/net/lag/configgy/maven-metadata-local.xml @@ -0,0 +1,12 @@ + + + net.lag + configgy + 2.8.0.RC2-1.5.2-SNAPSHOT + + + 2.8.0.RC2-1.5.2-SNAPSHOT + + 20100519155407 + + diff --git a/embedded-repo/shoal-jxta/jxta/1.1-20090818/LICENSE.txt b/embedded-repo/shoal-jxta/jxta/1.1-20090818/LICENSE.txt new file mode 100644 index 0000000000..4aea53745d --- /dev/null +++ b/embedded-repo/shoal-jxta/jxta/1.1-20090818/LICENSE.txt @@ -0,0 +1,263 @@ +COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 + +1. Definitions. + + 1.1. Contributor. means each individual or entity that creates or contributes to the creation of Modifications. + + 1.2. Contributor Version. means the combination of the Original Software, prior Modifications used by a Contributor (if any), and the Modifications made by that particular Contributor. + + 1.3. Covered Software. means (a) the Original Software, or (b) Modifications, or (c) the combination of files containing Original Software with files containing Modifications, in each case including portions thereof. + + 1.4. Executable. means the Covered Software in any form other than Source Code. + + 1.5. Initial Developer. means the individual or entity that first makes Original Software available under this License. + + 1.6. Larger Work. means a work which combines Covered Software or portions thereof with code not governed by the terms of this License. + + 1.7. License. means this document. + + 1.8. Licensable. means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein. + + 1.9. Modifications. means the Source Code and Executable form of any of the following: + + A. Any file that results from an addition to, deletion from or modification of the contents of a file containing Original Software or previous Modifications; + + B. Any new file that contains any part of the Original Software or previous Modification; or + + C. Any new file that is contributed or otherwise made available under the terms of this License. + + 1.10. Original Software. means the Source Code and Executable form of computer software code that is originally released under this License. + + 1.11. Patent Claims. means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor. + + 1.12. Source Code. means (a) the common form of computer software code in which modifications are made and (b) associated documentation included in or with such code. + + 1.13. You. (or .Your.) means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, .You. includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, .control. means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. + +2. License Grants. + + 2.1. The Initial Developer Grant. + + Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, the Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license: + + (a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer, to use, reproduce, modify, display, perform, sublicense and distribute the Original Software (or portions thereof), with or without Modifications, and/or as part of a Larger Work; and + + (b) under Patent Claims infringed by the making, using or selling of Original Software, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Software (or portions thereof). + + (c) The licenses granted in Sections 2.1(a) and (b) are effective on the date Initial Developer first distributes or otherwise makes the Original Software available to a third party under the terms of this License. + + (d) Notwithstanding Section 2.1(b) above, no patent license is granted: (1) for code that You delete from the Original Software, or (2) for infringements caused by: (i) the modification of the Original Software, or (ii) the combination of the Original Software with other software or devices. + + 2.2. Contributor Grant. + + Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: + + (a) under intellectual property rights (other than patent or trademark) Licensable by Contributor to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof), either on an unmodified basis, with other Modifications, as Covered Software and/or as part of a Larger Work; and + + (b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: (1) Modifications made by that Contributor (or portions thereof); and (2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination). + + (c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first distributes or otherwise makes the Modifications available to a third party. + + (d) Notwithstanding Section 2.2(b) above, no patent license is granted: (1) for any code that Contributor has deleted from the Contributor Version; (2) for infringements caused by: (i) third party modifications of Contributor Version, or (ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or (3) under Patent Claims infringed by Covered Software in the absence of Modifications made by that Contributor. + +3. Distribution Obligations. + + 3.1. Availability of Source Code. + Any Covered Software that You distribute or otherwise make available in Executable form must also be made available in Source Code form and that Source Code form must be distributed only under the terms of this License. You must include a copy of this License with every copy of the Source Code form of the Covered Software You distribute or otherwise make available. You must inform recipients of any such Covered Software in Executable form as to how they can obtain such Covered Software in Source Code form in a reasonable manner on or through a medium customarily used for software exchange. + + 3.2. Modifications. + The Modifications that You create or to which You contribute are governed by the terms of this License. You represent that You believe Your Modifications are Your original creation(s) and/or You have sufficient rights to grant the rights conveyed by this License. + + 3.3. Required Notices. + You must include a notice in each of Your Modifications that identifies You as the Contributor of the Modification. You may not remove or alter any copyright, patent or trademark notices contained within the Covered Software, or any notices of licensing or any descriptive text giving attribution to any Contributor or the Initial Developer. + + 3.4. Application of Additional Terms. + You may not offer or impose any terms on any Covered Software in Source Code form that alters or restricts the applicable version of this License or the recipients. rights hereunder. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, you may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear that any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer. + + 3.5. Distribution of Executable Versions. + You may distribute the Executable form of the Covered Software under the terms of this License or under the terms of a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable form does not attempt to limit or alter the recipient.s rights in the Source Code form from the rights set forth in this License. If You distribute the Covered Software in Executable form under a different license, You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer. + + 3.6. Larger Works. + You may create a Larger Work by combining Covered Software with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Software. + +4. Versions of the License. + + 4.1. New Versions. + Sun Microsystems, Inc. is the initial license steward and may publish revised and/or new versions of this License from time to time. Each version will be given a distinguishing version number. Except as provided in Section 4.3, no one other than the license steward has the right to modify this License. + + 4.2. Effect of New Versions. + You may always continue to use, distribute or otherwise make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. If the Initial Developer includes a notice in the Original Software prohibiting it from being distributed or otherwise made available under any subsequent version of the License, You must distribute and make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. Otherwise, You may also choose to use, distribute or otherwise make the Covered Software available under the terms of any subsequent version of the License published by the license steward. + + 4.3. Modified Versions. + When You are an Initial Developer and You want to create a new license for Your Original Software, You may create and use a modified version of this License if You: (a) rename the license and remove any references to the name of the license steward (except to note that the license differs from this License); and (b) otherwise make it clear that the license contains terms which differ from this License. + +5. DISCLAIMER OF WARRANTY. + + COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN .AS IS. BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. + +6. TERMINATION. + + 6.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive. + + 6.2. If You assert a patent infringement claim (excluding declaratory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You assert such claim is referred to as .Participant.) alleging that the Participant Software (meaning the Contributor Version where the Participant is a Contributor or the Original Software where the Participant is the Initial Developer) directly or indirectly infringes any patent, then any and all rights granted directly or indirectly to You by such Participant, the Initial Developer (if the Initial Developer is not the Participant) and all Contributors under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively and automatically at the expiration of such 60 day notice period, unless if within such 60 day period You withdraw Your claim with respect to the Participant Software against such Participant either unilaterally or pursuant to a written agreement with Participant. + + 6.3. In the event of termination under Sections 6.1 or 6.2 above, all end user licenses that have been validly granted by You or any distributor hereunder prior to termination (excluding licenses granted to You by any distributor) shall survive termination. + +7. LIMITATION OF LIABILITY. + + UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY.S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. + +8. U.S. GOVERNMENT END USERS. + + The Covered Software is a .commercial item,. as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of .commercial computer software. (as that term is defined at 48 C.F.R. º 252.227-7014(a)(1)) and .commercial computer software documentation. as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Software with only those rights set forth herein. This U.S. Government Rights clause is in lieu of, and supersedes, any other FAR, DFAR, or other clause or provision that addresses Government rights in computer software under this License. + +9. MISCELLANEOUS. + + This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by the law of the jurisdiction specified in a notice contained within the Original Software (except to the extent applicable law, if any, provides otherwise), excluding such jurisdiction.s conflict-of-law provisions. Any litigation relating to this License shall be subject to the jurisdiction of the courts located in the jurisdiction and venue specified in a notice contained within the Original Software, with the losing party responsible for costs, including, without limitation, court costs and reasonable attorneys. fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License. You agree that You alone are responsible for compliance with the United States export administration regulations (and the export control laws and regulation of any other countries) when You use, distribute or otherwise make available any Covered Software. + +10. RESPONSIBILITY FOR CLAIMS. + + As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability. + + NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) + + The code released under the CDDL shall be governed by the laws of the State of California (excluding conflict-of-law provisions). Any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California and the state courts of the State of California, with venue lying in Santa Clara County, California. + + +The GNU General Public License (GPL) Version 2, June 1991 + + +Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + +Preamble + +The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. + +When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. + +We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. + +Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and modification follow. + + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. + +You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. + + c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. + +3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. + +If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. + +5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. + +7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. + +This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. + +9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. + +10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. + +NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +END OF TERMS AND CONDITIONS + + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. + + One line to give the program's name and a brief idea of what it does. + + Copyright (C) + + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. + + signature of Ty Coon, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. + + +"CLASSPATH" EXCEPTION TO THE GPL VERSION 2 + +Certain source files distributed by Sun Microsystems, Inc. are subject to the following clarification and special exception to the GPL Version 2, but only where Sun has expressly included in the particular source file's header the words + +"Sun designates this particular file as subject to the "Classpath" exception as provided by Sun in the License file that accompanied this code." + +Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License Version 2 cover the whole combination. + +As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module.? An independent module is a module which is not derived from or based on this library.? If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so.? If you do not wish to do so, delete this exception statement from your version. diff --git a/embedded-repo/shoal-jxta/jxta/1.1-20090818/jxta-1.1-20090818.jar b/embedded-repo/shoal-jxta/jxta/1.1-20090818/jxta-1.1-20090818.jar new file mode 100644 index 0000000000..6b539cce4a Binary files /dev/null and b/embedded-repo/shoal-jxta/jxta/1.1-20090818/jxta-1.1-20090818.jar differ diff --git a/embedded-repo/shoal-jxta/jxta/1.1-20090818/jxta-1.1-20090818.pom b/embedded-repo/shoal-jxta/jxta/1.1-20090818/jxta-1.1-20090818.pom new file mode 100755 index 0000000000..c0f3c68341 --- /dev/null +++ b/embedded-repo/shoal-jxta/jxta/1.1-20090818/jxta-1.1-20090818.pom @@ -0,0 +1,8 @@ + + + 4.0.0 + shoal-jxta + jxta + 1.1-20090818 + jar + \ No newline at end of file diff --git a/embedded-repo/shoal-jxta/shoal/1.1-20090818/LICENSE.txt b/embedded-repo/shoal-jxta/shoal/1.1-20090818/LICENSE.txt new file mode 100644 index 0000000000..4aea53745d --- /dev/null +++ b/embedded-repo/shoal-jxta/shoal/1.1-20090818/LICENSE.txt @@ -0,0 +1,263 @@ +COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 + +1. Definitions. + + 1.1. Contributor. means each individual or entity that creates or contributes to the creation of Modifications. + + 1.2. Contributor Version. means the combination of the Original Software, prior Modifications used by a Contributor (if any), and the Modifications made by that particular Contributor. + + 1.3. Covered Software. means (a) the Original Software, or (b) Modifications, or (c) the combination of files containing Original Software with files containing Modifications, in each case including portions thereof. + + 1.4. Executable. means the Covered Software in any form other than Source Code. + + 1.5. Initial Developer. means the individual or entity that first makes Original Software available under this License. + + 1.6. Larger Work. means a work which combines Covered Software or portions thereof with code not governed by the terms of this License. + + 1.7. License. means this document. + + 1.8. Licensable. means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein. + + 1.9. Modifications. means the Source Code and Executable form of any of the following: + + A. Any file that results from an addition to, deletion from or modification of the contents of a file containing Original Software or previous Modifications; + + B. Any new file that contains any part of the Original Software or previous Modification; or + + C. Any new file that is contributed or otherwise made available under the terms of this License. + + 1.10. Original Software. means the Source Code and Executable form of computer software code that is originally released under this License. + + 1.11. Patent Claims. means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor. + + 1.12. Source Code. means (a) the common form of computer software code in which modifications are made and (b) associated documentation included in or with such code. + + 1.13. You. (or .Your.) means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, .You. includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, .control. means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. + +2. License Grants. + + 2.1. The Initial Developer Grant. + + Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, the Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license: + + (a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer, to use, reproduce, modify, display, perform, sublicense and distribute the Original Software (or portions thereof), with or without Modifications, and/or as part of a Larger Work; and + + (b) under Patent Claims infringed by the making, using or selling of Original Software, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Software (or portions thereof). + + (c) The licenses granted in Sections 2.1(a) and (b) are effective on the date Initial Developer first distributes or otherwise makes the Original Software available to a third party under the terms of this License. + + (d) Notwithstanding Section 2.1(b) above, no patent license is granted: (1) for code that You delete from the Original Software, or (2) for infringements caused by: (i) the modification of the Original Software, or (ii) the combination of the Original Software with other software or devices. + + 2.2. Contributor Grant. + + Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: + + (a) under intellectual property rights (other than patent or trademark) Licensable by Contributor to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof), either on an unmodified basis, with other Modifications, as Covered Software and/or as part of a Larger Work; and + + (b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: (1) Modifications made by that Contributor (or portions thereof); and (2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination). + + (c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first distributes or otherwise makes the Modifications available to a third party. + + (d) Notwithstanding Section 2.2(b) above, no patent license is granted: (1) for any code that Contributor has deleted from the Contributor Version; (2) for infringements caused by: (i) third party modifications of Contributor Version, or (ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or (3) under Patent Claims infringed by Covered Software in the absence of Modifications made by that Contributor. + +3. Distribution Obligations. + + 3.1. Availability of Source Code. + Any Covered Software that You distribute or otherwise make available in Executable form must also be made available in Source Code form and that Source Code form must be distributed only under the terms of this License. You must include a copy of this License with every copy of the Source Code form of the Covered Software You distribute or otherwise make available. You must inform recipients of any such Covered Software in Executable form as to how they can obtain such Covered Software in Source Code form in a reasonable manner on or through a medium customarily used for software exchange. + + 3.2. Modifications. + The Modifications that You create or to which You contribute are governed by the terms of this License. You represent that You believe Your Modifications are Your original creation(s) and/or You have sufficient rights to grant the rights conveyed by this License. + + 3.3. Required Notices. + You must include a notice in each of Your Modifications that identifies You as the Contributor of the Modification. You may not remove or alter any copyright, patent or trademark notices contained within the Covered Software, or any notices of licensing or any descriptive text giving attribution to any Contributor or the Initial Developer. + + 3.4. Application of Additional Terms. + You may not offer or impose any terms on any Covered Software in Source Code form that alters or restricts the applicable version of this License or the recipients. rights hereunder. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, you may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear that any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer. + + 3.5. Distribution of Executable Versions. + You may distribute the Executable form of the Covered Software under the terms of this License or under the terms of a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable form does not attempt to limit or alter the recipient.s rights in the Source Code form from the rights set forth in this License. If You distribute the Covered Software in Executable form under a different license, You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer. + + 3.6. Larger Works. + You may create a Larger Work by combining Covered Software with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Software. + +4. Versions of the License. + + 4.1. New Versions. + Sun Microsystems, Inc. is the initial license steward and may publish revised and/or new versions of this License from time to time. Each version will be given a distinguishing version number. Except as provided in Section 4.3, no one other than the license steward has the right to modify this License. + + 4.2. Effect of New Versions. + You may always continue to use, distribute or otherwise make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. If the Initial Developer includes a notice in the Original Software prohibiting it from being distributed or otherwise made available under any subsequent version of the License, You must distribute and make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. Otherwise, You may also choose to use, distribute or otherwise make the Covered Software available under the terms of any subsequent version of the License published by the license steward. + + 4.3. Modified Versions. + When You are an Initial Developer and You want to create a new license for Your Original Software, You may create and use a modified version of this License if You: (a) rename the license and remove any references to the name of the license steward (except to note that the license differs from this License); and (b) otherwise make it clear that the license contains terms which differ from this License. + +5. DISCLAIMER OF WARRANTY. + + COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN .AS IS. BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. + +6. TERMINATION. + + 6.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive. + + 6.2. If You assert a patent infringement claim (excluding declaratory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You assert such claim is referred to as .Participant.) alleging that the Participant Software (meaning the Contributor Version where the Participant is a Contributor or the Original Software where the Participant is the Initial Developer) directly or indirectly infringes any patent, then any and all rights granted directly or indirectly to You by such Participant, the Initial Developer (if the Initial Developer is not the Participant) and all Contributors under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively and automatically at the expiration of such 60 day notice period, unless if within such 60 day period You withdraw Your claim with respect to the Participant Software against such Participant either unilaterally or pursuant to a written agreement with Participant. + + 6.3. In the event of termination under Sections 6.1 or 6.2 above, all end user licenses that have been validly granted by You or any distributor hereunder prior to termination (excluding licenses granted to You by any distributor) shall survive termination. + +7. LIMITATION OF LIABILITY. + + UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY.S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. + +8. U.S. GOVERNMENT END USERS. + + The Covered Software is a .commercial item,. as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of .commercial computer software. (as that term is defined at 48 C.F.R. º 252.227-7014(a)(1)) and .commercial computer software documentation. as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Software with only those rights set forth herein. This U.S. Government Rights clause is in lieu of, and supersedes, any other FAR, DFAR, or other clause or provision that addresses Government rights in computer software under this License. + +9. MISCELLANEOUS. + + This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by the law of the jurisdiction specified in a notice contained within the Original Software (except to the extent applicable law, if any, provides otherwise), excluding such jurisdiction.s conflict-of-law provisions. Any litigation relating to this License shall be subject to the jurisdiction of the courts located in the jurisdiction and venue specified in a notice contained within the Original Software, with the losing party responsible for costs, including, without limitation, court costs and reasonable attorneys. fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License. You agree that You alone are responsible for compliance with the United States export administration regulations (and the export control laws and regulation of any other countries) when You use, distribute or otherwise make available any Covered Software. + +10. RESPONSIBILITY FOR CLAIMS. + + As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability. + + NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) + + The code released under the CDDL shall be governed by the laws of the State of California (excluding conflict-of-law provisions). Any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California and the state courts of the State of California, with venue lying in Santa Clara County, California. + + +The GNU General Public License (GPL) Version 2, June 1991 + + +Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + +Preamble + +The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. + +When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. + +We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. + +Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and modification follow. + + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. + +You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. + + c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. + +3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. + +If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. + +5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. + +7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. + +This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. + +9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. + +10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. + +NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +END OF TERMS AND CONDITIONS + + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. + + One line to give the program's name and a brief idea of what it does. + + Copyright (C) + + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. + + signature of Ty Coon, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. + + +"CLASSPATH" EXCEPTION TO THE GPL VERSION 2 + +Certain source files distributed by Sun Microsystems, Inc. are subject to the following clarification and special exception to the GPL Version 2, but only where Sun has expressly included in the particular source file's header the words + +"Sun designates this particular file as subject to the "Classpath" exception as provided by Sun in the License file that accompanied this code." + +Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License Version 2 cover the whole combination. + +As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module.? An independent module is a module which is not derived from or based on this library.? If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so.? If you do not wish to do so, delete this exception statement from your version. diff --git a/embedded-repo/shoal-jxta/shoal/1.1-20090818/shoal-1.1-20090818.jar b/embedded-repo/shoal-jxta/shoal/1.1-20090818/shoal-1.1-20090818.jar new file mode 100644 index 0000000000..3e13c87681 Binary files /dev/null and b/embedded-repo/shoal-jxta/shoal/1.1-20090818/shoal-1.1-20090818.jar differ diff --git a/embedded-repo/shoal-jxta/shoal/1.1-20090818/shoal-1.1-20090818.pom b/embedded-repo/shoal-jxta/shoal/1.1-20090818/shoal-1.1-20090818.pom new file mode 100755 index 0000000000..3174de1e4a --- /dev/null +++ b/embedded-repo/shoal-jxta/shoal/1.1-20090818/shoal-1.1-20090818.pom @@ -0,0 +1,8 @@ + + + 4.0.0 + shoal-jxta + shoal + 1.1-20090818 + jar + \ No newline at end of file diff --git a/embedded-repo/sjson/json/sjson/0.4/sjson-0.4.jar b/embedded-repo/sjson/json/sjson/0.4/sjson-0.4.jar new file mode 100644 index 0000000000..dcab322c81 Binary files /dev/null and b/embedded-repo/sjson/json/sjson/0.4/sjson-0.4.jar differ diff --git a/embedded-repo/sjson/json/sjson/0.4/sjson-0.4.pom b/embedded-repo/sjson/json/sjson/0.4/sjson-0.4.pom new file mode 100755 index 0000000000..784adff55e --- /dev/null +++ b/embedded-repo/sjson/json/sjson/0.4/sjson-0.4.pom @@ -0,0 +1,8 @@ + + + 4.0.0 + sjson.json + sjson + 0.4 + jar + diff --git a/embedded-repo/sjson/json/sjson/0.5-2.8.Beta1/sjson-0.5-2.8.Beta1.jar b/embedded-repo/sjson/json/sjson/0.5-2.8.Beta1/sjson-0.5-2.8.Beta1.jar deleted file mode 100644 index ee12289db9..0000000000 Binary files a/embedded-repo/sjson/json/sjson/0.5-2.8.Beta1/sjson-0.5-2.8.Beta1.jar and /dev/null differ diff --git a/embedded-repo/sjson/json/sjson/0.5-SNAPSHOT-2.8.RC2/sjson-0.5-SNAPSHOT-2.8.RC2.jar b/embedded-repo/sjson/json/sjson/0.5-SNAPSHOT-2.8.RC2/sjson-0.5-SNAPSHOT-2.8.RC2.jar new file mode 100644 index 0000000000..11d149aeee Binary files /dev/null and b/embedded-repo/sjson/json/sjson/0.5-SNAPSHOT-2.8.RC2/sjson-0.5-SNAPSHOT-2.8.RC2.jar differ diff --git a/embedded-repo/sjson/json/sjson/0.5-SNAPSHOT-2.8.RC2/sjson-0.5-SNAPSHOT-2.8.RC2.pom b/embedded-repo/sjson/json/sjson/0.5-SNAPSHOT-2.8.RC2/sjson-0.5-SNAPSHOT-2.8.RC2.pom new file mode 100644 index 0000000000..fa80e90e01 --- /dev/null +++ b/embedded-repo/sjson/json/sjson/0.5-SNAPSHOT-2.8.RC2/sjson-0.5-SNAPSHOT-2.8.RC2.pom @@ -0,0 +1,9 @@ + + + 4.0.0 + sjson.json + sjson + 0.5-SNAPSHOT-2.8.RC2 + POM was created from install:install-file + diff --git a/embedded-repo/sjson/json/sjson/maven-metadata-local.xml b/embedded-repo/sjson/json/sjson/maven-metadata-local.xml new file mode 100644 index 0000000000..d19a0cb3f9 --- /dev/null +++ b/embedded-repo/sjson/json/sjson/maven-metadata-local.xml @@ -0,0 +1,13 @@ + + + sjson.json + sjson + 0.5_2.8.0.RC2-SNAPSHOT + + + 0.5_2.8.0.RC2-SNAPSHOT + 0.5-SNAPSHOT-2.8.RC2 + + 20100519171604 + + diff --git a/project/build.properties b/project/build.properties index b52f2291c7..35eb8818d2 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1,7 +1,7 @@ project.organization=se.scalablesolutions.akka project.name=akka project.version=0.9 -scala.version=2.8.0.Beta1 -sbt.version=0.7.3 +scala.version=2.8.0.RC2 +sbt.version=0.7.4 def.scala.version=2.7.7 -build.scala.versions=2.8.0.Beta1 +build.scala.versions=2.8.0.RC2 diff --git a/project/build/AkkaProject.scala b/project/build/AkkaProject.scala index 5139e4f392..0ea1c70608 100644 --- a/project/build/AkkaProject.scala +++ b/project/build/AkkaProject.scala @@ -17,7 +17,7 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { val ATMO_VERSION = "0.5.4" val CASSANDRA_VERSION = "0.5.0" val LIFT_VERSION = "2.0-scala280-SNAPSHOT" - val SCALATEST_VERSION = "1.0.1-for-scala-2.8.0.Beta1-with-test-interfaces-0.3-SNAPSHOT" + val SCALATEST_VERSION = "1.2-for-scala-2.8.0.RC2-SNAPSHOT" // ------------------------------------------------------------ lazy val deployPath = info.projectPath / "deploy" @@ -56,12 +56,10 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { lazy val akka_http = project("akka-http", "akka-http", new AkkaHttpProject(_), akka_core, akka_camel) lazy val akka_camel = project("akka-camel", "akka-camel", new AkkaCamelProject(_), akka_core) lazy val akka_persistence = project("akka-persistence", "akka-persistence", new AkkaPersistenceParentProject(_)) - lazy val akka_cluster = project("akka-cluster", "akka-cluster", new AkkaClusterProject(_), akka_core) lazy val akka_spring = project("akka-spring", "akka-spring", new AkkaSpringProject(_), akka_core) lazy val akka_jta = project("akka-jta", "akka-jta", new AkkaJTAProject(_), akka_core) lazy val akka_kernel = project("akka-kernel", "akka-kernel", new AkkaKernelProject(_), - akka_core, akka_http, akka_spring, akka_camel, akka_persistence, - akka_cluster, akka_amqp) + akka_core, akka_http, akka_spring, akka_camel, akka_persistence, akka_amqp) // functional tests in java lazy val akka_fun_test = project("akka-fun-test-java", "akka-fun-test-java", new AkkaFunTestProject(_), akka_kernel) @@ -85,11 +83,11 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { // create a manifest with all akka jars and dependency jars on classpath override def manifestClassPath = Some(allArtifacts.getFiles .filter(_.getName.endsWith(".jar")) + .filter(!_.getName.contains("scala-library")) .map("lib_managed/scala_%s/compile/".format(buildScalaVersion) + _.getName) .mkString(" ") + " scala-library.jar" + " dist/akka-core_%s-%s.jar".format(buildScalaVersion, version) + - " dist/akka-cluster%s-%s.jar".format(buildScalaVersion, version) + " dist/akka-http_%s-%s.jar".format(buildScalaVersion, version) + " dist/akka-camel_%s-%s.jar".format(buildScalaVersion, version) + " dist/akka-amqp_%s-%s.jar".format(buildScalaVersion, version) + @@ -138,9 +136,9 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { class AkkaCoreProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) { val netty = "org.jboss.netty" % "netty" % "3.2.0.CR1" % "compile" val commons_io = "commons-io" % "commons-io" % "1.4" % "compile" - val dispatch_json = "net.databinder" % "dispatch-json_2.8.0.Beta1" % "0.6.6" % "compile" - val dispatch_http = "net.databinder" % "dispatch-http_2.8.0.Beta1" % "0.6.6" % "compile" - val sjson = "sjson.json" % "sjson" % "0.5-2.8.Beta1" % "compile" + val dispatch_json = "net.databinder" % "dispatch-json_2.8.0.RC2" % "0.7.3" % "compile" + val dispatch_htdisttp = "net.databinder" % "dispatch-http_2.8.0.RC2" % "0.7.3" % "compile" + val sjson = "sjson.json" % "sjson" % "0.5-SNAPSHOT-2.8.RC2" % "compile" val sbinary = "sbinary" % "sbinary" % "2.8.0.Beta1-2.8.0.Beta1-0.3.1-SNAPSHOT" % "compile" val jackson = "org.codehaus.jackson" % "jackson-mapper-asl" % "1.2.1" % "compile" val jackson_core = "org.codehaus.jackson" % "jackson-core-asl" % "1.2.1" % "compile" @@ -149,11 +147,12 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { val jta_1_1 = "org.apache.geronimo.specs" % "geronimo-jta_1.1_spec" % "1.1.1" % "compile" val werkz = "org.codehaus.aspectwerkz" % "aspectwerkz-nodeps-jdk5" % "2.1" % "compile" val werkz_core = "org.codehaus.aspectwerkz" % "aspectwerkz-jdk5" % "2.1" % "compile" - val configgy = "net.lag" % "configgy" % "2.8.0.Beta1-1.5-SNAPSHOT" % "compile" + val configgy = "net.lag" % "configgy" % "2.8.0.RC2-1.5.2-SNAPSHOT" % "compile" val guicey = "org.guiceyfruit" % "guice-all" % "2.0" % "compile" val aopalliance = "aopalliance" % "aopalliance" % "1.0" % "compile" val protobuf = "com.google.protobuf" % "protobuf-java" % "2.2.0" % "compile" val multiverse = "org.multiverse" % "multiverse-alpha" % "0.5" % "compile" + val jgroups = "jgroups" % "jgroups" % "2.8.0.CR7" % "compile" // testing val scalatest = "org.scalatest" % "scalatest" % SCALATEST_VERSION % "test" @@ -232,10 +231,6 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { new AkkaCassandraProject(_), akka_persistence_common) } - class AkkaClusterProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) { - val jgroups = "jgroups" % "jgroups" % "2.8.0.CR7" % "compile" - } - class AkkaKernelProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) class AkkaSpringProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) { diff --git a/scripts/remove_trailing_whitespace.sh b/scripts/remove_trailing_whitespace.sh index 16e19e4c97..631473b8f7 100755 --- a/scripts/remove_trailing_whitespace.sh +++ b/scripts/remove_trailing_whitespace.sh @@ -1,3 +1,2 @@ #!/bin/sh -echo "removing all trailing whitespace from all *.scala, *.html and *.xml files" -find . -type f -name '*.scala' -exec sed -i 's/[ \t]*$//' {} \; \ No newline at end of file +sed -i '' 's/[[:space:]]*$//g' **/*.* \ No newline at end of file