Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Converted all TypedActor tests to interface-impl, code and tests compile
- Loading branch information
Jonas Bonér
committed
Jul 27, 2010
1 parent
add7702
commit e33e92c
Showing
37 changed files
with
484 additions
and
398 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
akka-camel/src/test/java/se/scalablesolutions/akka/camel/PojoBaseIntf.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package se.scalablesolutions.akka.camel; | ||
|
||
import org.apache.camel.Body; | ||
import org.apache.camel.Header; | ||
|
||
import se.scalablesolutions.akka.actor.annotation.consume; | ||
|
||
/** | ||
* @author Martin Krasser | ||
*/ | ||
public interface PojoBaseIntf { | ||
|
||
public String m1(String b, String h); | ||
@consume("direct:m2base") | ||
public String m2(@Body String b, @Header("test") String h); | ||
@consume("direct:m3base") | ||
public String m3(@Body String b, @Header("test") String h); | ||
@consume("direct:m4base") | ||
public String m4(@Body String b, @Header("test") String h); | ||
public void m5(@Body String b, @Header("test") String h); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...se/scalablesolutions/akka/camel/Pojo.java → ...solutions/akka/camel/PojoNonConsumer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
akka-camel/src/test/java/se/scalablesolutions/akka/camel/PojoNonConsumerIntf.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package se.scalablesolutions.akka.camel; | ||
|
||
/** | ||
* @author Martin Krasser | ||
*/ | ||
public interface PojoNonConsumerIntf { | ||
|
||
public String foo(String s); | ||
} |
3 changes: 2 additions & 1 deletion
3
akka-camel/src/test/java/se/scalablesolutions/akka/camel/PojoRemote.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
akka-camel/src/test/java/se/scalablesolutions/akka/camel/PojoRemoteIntf.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package se.scalablesolutions.akka.camel; | ||
|
||
import se.scalablesolutions.akka.actor.annotation.consume; | ||
|
||
/** | ||
* @author Martin Krasser | ||
*/ | ||
public interface PojoRemoteIntf { | ||
|
||
@consume("direct:remote-active-object") | ||
public String foo(String s); | ||
} |
3 changes: 2 additions & 1 deletion
3
akka-camel/src/test/java/se/scalablesolutions/akka/camel/PojoSingle.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
akka-camel/src/test/java/se/scalablesolutions/akka/camel/PojoSingleIntf.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package se.scalablesolutions.akka.camel; | ||
|
||
import se.scalablesolutions.akka.actor.annotation.consume; | ||
|
||
/** | ||
* @author Martin Krasser | ||
*/ | ||
public interface PojoSingleIntf { | ||
|
||
@consume("direct:foo") | ||
public void foo(String b); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
akka-camel/src/test/java/se/scalablesolutions/akka/camel/PojoSubIntf.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package se.scalablesolutions.akka.camel; | ||
|
||
import org.apache.camel.Body; | ||
import org.apache.camel.Header; | ||
|
||
import se.scalablesolutions.akka.actor.annotation.consume; | ||
|
||
public interface PojoSubIntf extends PojoBaseIntf { | ||
@consume("direct:m1sub") | ||
public String m1(@Body String b, @Header("test") String h); | ||
|
||
@Override | ||
public String m2(String b, String h); | ||
|
||
@Override | ||
@consume("direct:m3sub") | ||
public String m3(@Body String b, @Header("test") String h); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 9 additions & 83 deletions
92
akka-core/src/test/java/se/scalablesolutions/akka/actor/NestedTransactionalTypedActor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,86 +1,12 @@ | ||
package se.scalablesolutions.akka.actor; | ||
|
||
import se.scalablesolutions.akka.actor.annotation.transactionrequired; | ||
import se.scalablesolutions.akka.actor.annotation.inittransactionalstate; | ||
import se.scalablesolutions.akka.stm.*; | ||
|
||
@transactionrequired | ||
public class NestedTransactionalTypedActor { | ||
private TransactionalMap<String, String> mapState; | ||
private TransactionalVector<String> vectorState; | ||
private Ref<String> refState; | ||
private boolean isInitialized = false; | ||
|
||
@inittransactionalstate | ||
public void init() { | ||
if (!isInitialized) { | ||
mapState = new TransactionalMap(); | ||
vectorState = new TransactionalVector(); | ||
refState = new Ref(); | ||
isInitialized = true; | ||
} | ||
} | ||
|
||
public String getMapState(String key) { | ||
return (String) mapState.get(key).get(); | ||
} | ||
|
||
|
||
public String getVectorState() { | ||
return (String) vectorState.last(); | ||
} | ||
|
||
|
||
public String getRefState() { | ||
return (String) refState.get().get(); | ||
} | ||
|
||
|
||
public void setMapState(String key, String msg) { | ||
mapState.put(key, msg); | ||
} | ||
|
||
|
||
public void setVectorState(String msg) { | ||
vectorState.add(msg); | ||
} | ||
|
||
|
||
public void setRefState(String msg) { | ||
refState.swap(msg); | ||
} | ||
|
||
|
||
public void success(String key, String msg) { | ||
mapState.put(key, msg); | ||
vectorState.add(msg); | ||
refState.swap(msg); | ||
} | ||
|
||
|
||
public String failure(String key, String msg, TypedActorFailer failer) { | ||
mapState.put(key, msg); | ||
vectorState.add(msg); | ||
refState.swap(msg); | ||
failer.fail(); | ||
return msg; | ||
} | ||
|
||
|
||
public void thisMethodHangs(String key, String msg, TypedActorFailer failer) { | ||
setMapState(key, msg); | ||
} | ||
|
||
/* | ||
public void clashOk(String key, String msg, InMemClasher clasher) { | ||
mapState.put(key, msg); | ||
clasher.clash(); | ||
} | ||
public void clashNotOk(String key, String msg, InMemClasher clasher) { | ||
mapState.put(key, msg); | ||
clasher.clash(); | ||
this.success("clash", "clash"); | ||
} | ||
*/ | ||
public interface NestedTransactionalTypedActor { | ||
public String getMapState(String key); | ||
public String getVectorState(); | ||
public String getRefState(); | ||
public void setMapState(String key, String msg); | ||
public void setVectorState(String msg); | ||
public void setRefState(String msg); | ||
public void success(String key, String msg); | ||
public String failure(String key, String msg, TypedActorFailer failer); | ||
} |
Oops, something went wrong.