splitted kernel up in core + many sub modules

This commit is contained in:
jboner 2009-09-01 08:56:44 +02:00
parent deeaa923d1
commit ab6637044f
154 changed files with 1510 additions and 2651 deletions

View file

@ -0,0 +1,11 @@
/**
* Copyright (C) 2009 Scalable Solutions.
*/
package se.scalablesolutions.akka.annotation;
import java.lang.annotation.*;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface configuration {}

View file

@ -0,0 +1,11 @@
/**
* Copyright (C) 2009 Scalable Solutions.
*/
package se.scalablesolutions.akka.annotation;
import java.lang.annotation.*;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface immutable {}

View file

@ -0,0 +1,11 @@
/**
* Copyright (C) 2009 Scalable Solutions.
*/
package se.scalablesolutions.akka.annotation;
import java.lang.annotation.*;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface oneway {}

View file

@ -0,0 +1,11 @@
/**
* Copyright (C) 2009 Scalable Solutions.
*/
package se.scalablesolutions.akka.annotation;
import java.lang.annotation.*;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface postrestart {}

View file

@ -0,0 +1,11 @@
/**
* Copyright (C) 2009 Scalable Solutions.
*/
package se.scalablesolutions.akka.annotation;
import java.lang.annotation.*;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface prerestart {}

View file

@ -0,0 +1,11 @@
/**
* Copyright (C) 2009 Scalable Solutions.
*/
package se.scalablesolutions.akka.annotation;
import java.lang.annotation.*;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface state {}

View file

@ -0,0 +1,11 @@
/**
* Copyright (C) 2009 Scalable Solutions.
*/
package se.scalablesolutions.akka.annotation;
import java.lang.annotation.*;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface transactionrequired {}

View file

@ -0,0 +1,32 @@
/**
* Copyright (C) 2009 Scalable Solutions.
*/
package se.scalablesolutions.akka.kernel.config;
import java.util.List;
import com.google.inject.AbstractModule;
import com.google.inject.Singleton;
//import com.google.inject.jsr250.ResourceProviderFactory;
/**
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/
public class ActiveObjectGuiceModule extends AbstractModule {
private final List<DependencyBinding> bindings;
public ActiveObjectGuiceModule(final List<DependencyBinding> bindings) {
this.bindings = bindings;
}
protected void configure() {
//bind(ResourceProviderFactory.class);
for (int i = 0; i < bindings.size(); i++) {
final DependencyBinding db = bindings.get(i);
//if (db.getInterface() != null) bind((Class) db.getInterface()).to((Class) db.getTarget()).in(Singleton.class);
//else
this.bind(db.getInterface()).toInstance(db.getTarget());
}
}
}

View file

@ -0,0 +1,24 @@
/**
* Copyright (C) 2009 Scalable Solutions.
*/
package se.scalablesolutions.akka.kernel.config;
/**
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/
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;
}
public Class getInterface() {
return intf;
}
public Object getTarget() {
return target;
}
}

View file

@ -0,0 +1,38 @@
/**
* Copyright (C) 2009 Scalable Solutions.
*/
package se.scalablesolutions.akka.kernel.nio.protobuf;
/*
Compile with:
cd ./util-java/src/main/java
protoc se/scalablesolutions/akka/kernel/nio/protobuf/RemoteProtocol.proto --java_out .
*/
option optimize_for = SPEED;
message RemoteRequest {
required uint64 id = 1;
required uint32 protocol = 2;
required bytes message = 3;
optional bytes messageManifest = 4;
optional string method = 5;
required string target = 6;
required uint64 timeout = 7;
optional string supervisorUuid = 8;
required bool isActor = 9;
required bool isOneWay = 10;
required bool isEscaped = 11;
}
message RemoteReply {
required uint64 id = 1;
optional uint32 protocol = 2;
optional bytes message = 3;
optional bytes messageManifest = 4;
optional string exception = 5;
optional string supervisorUuid = 6;
required bool isActor = 7;
required bool isSuccessful = 8;
}