renamed api-java to fun-test-java + upgrade guiceyfruit to 2.0
This commit is contained in:
parent
8c11f04262
commit
9235b0e221
40 changed files with 363 additions and 630 deletions
|
|
@ -70,14 +70,40 @@
|
|||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$APPLICATION_HOME_DIR$/lib/javaee.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library">
|
||||
<library name="aspectwerkz 2.1">
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/../lib/aspectwerkz-nodeps-jdk5-2.1.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="file://$MODULE_DIR$/../../../java/aspectwerkz4/src/main" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module" module-name="akka-util-java" exported="" />
|
||||
<orderEntry type="library" exported="" name="Maven: org.guiceyfruit:guice-core:2.0-beta-4" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: org.guiceyfruit:guice-jsr250:2.0-beta-4" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: javax.annotation:jsr250-api:1.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: org.scala-lang:scala-library:2.7.3" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: net.lag:configgy:1.2" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: org.guiceyfruit:guiceyfruit-core:2.0-beta-7" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: org.guiceyfruit:guice-all:2.0-beta-7" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: org.codehaus.aspectwerkz:aspectwerkz-nodeps-jdk5:2.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: net.lag:configgy:1.3" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: org.scala-lang:scala-compiler:2.7.4" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: org.scala-tools:vscaladoc:1.1-md-3" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: markdownj:markdownj:1.0.2b4-0.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: junit:junit:4.5" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: org.scala-tools.testing:specs:1.4.4" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: org.guiceyfruit:guiceyfruit-core:2.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: org.guiceyfruit:guice-all:2.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: javax.annotation:com.springsource.javax.annotation:1.0.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: org.aopalliance:com.springsource.org.aopalliance:1.0.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: com.google.code.google-collections:google-collect:snapshot-20080530" level="project" />
|
||||
|
|
@ -125,27 +151,6 @@
|
|||
<orderEntry type="library" exported="" name="Maven: log4j:log4j:1.2.13" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.scala-tools.testing:scalatest:0.9.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.jteigen.scalatest:junit4runner:1.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: junit:junit:4.5" level="project" />
|
||||
<orderEntry type="module-library">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$APPLICATION_HOME_DIR$/lib/javaee.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library">
|
||||
<library name="aspectwerkz 2.1">
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/../lib/aspectwerkz-nodeps-jdk5-2.1.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="file://$MODULE_DIR$/../../../java/aspectwerkz4/src/main" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</orderEntry>
|
||||
</component>
|
||||
</module>
|
||||
|
||||
|
|
|
|||
|
|
@ -33,12 +33,12 @@
|
|||
<dependency>
|
||||
<groupId>net.lag</groupId>
|
||||
<artifactId>configgy</artifactId>
|
||||
<version>1.2</version>
|
||||
<version>1.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.guiceyfruit</groupId>
|
||||
<artifactId>guiceyfruit-core</artifactId>
|
||||
<version>2.0-beta-7</version>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.guiceyfruit</groupId>
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ sealed class TransactionalAroundAdvice(target: Class[_],
|
|||
activeTx = None
|
||||
}
|
||||
|
||||
private def handleResult(result: ErrRef[AnyRef]): AnyRef = {
|
||||
private def handleResult(result: ResultOrFailure[AnyRef]): AnyRef = {
|
||||
try {
|
||||
result()
|
||||
} catch {
|
||||
|
|
@ -162,11 +162,11 @@ sealed class TransactionalAroundAdvice(target: Class[_],
|
|||
|
||||
private def sendOneWay(joinpoint: JoinPoint) = server ! Invocation(joinpoint, activeTx)
|
||||
|
||||
private def sendAndReceiveEventually(joinpoint: JoinPoint): ErrRef[AnyRef] = {
|
||||
private def sendAndReceiveEventually(joinpoint: JoinPoint): ResultOrFailure[AnyRef] = {
|
||||
server !!! (Invocation(joinpoint, activeTx), {
|
||||
var ref = ErrRef(activeTx)
|
||||
ref() = throw new ActiveObjectInvocationTimeoutException("Invocation to active object [" + targetInstance.getClass.getName + "] timed out after " + server.timeout + " milliseconds")
|
||||
ref
|
||||
var resultOrFailure = ResultOrFailure(activeTx)
|
||||
resultOrFailure() = throw new ActiveObjectInvocationTimeoutException("Invocation to active object [" + targetInstance.getClass.getName + "] timed out after " + server.timeout + " milliseconds")
|
||||
resultOrFailure
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -216,13 +216,15 @@ sealed class TransactionalAroundAdvice(target: Class[_],
|
|||
private[kernel] class Dispatcher(val targetName: String) extends GenericServer {
|
||||
override def body: PartialFunction[Any, Unit] = {
|
||||
|
||||
case (tx: Option[Transaction], joinpoint: JoinPoint) =>
|
||||
case Invocation(joinpoint: JoinPoint, tx: Option[Transaction]) =>
|
||||
ActiveObject.threadBoundTx.set(tx)
|
||||
try {
|
||||
reply(ErrRef(joinpoint.proceed, tx))
|
||||
reply(ResultOrFailure(joinpoint.proceed, tx))
|
||||
} catch {
|
||||
case e =>
|
||||
val ref = ErrRef(tx); ref() = throw e; reply(ref)
|
||||
val resultOrFailure = ResultOrFailure(tx)
|
||||
resultOrFailure() = throw e
|
||||
reply(resultOrFailure)
|
||||
}
|
||||
|
||||
case 'exit =>
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ package se.scalablesolutions.akka.kernel
|
|||
*
|
||||
* Usage:
|
||||
* <pre>
|
||||
* scala> ErrRef(1)
|
||||
* res0: ErrRef[Int] = ErrRef@a96606
|
||||
* scala> ResultOrFailure(1)
|
||||
* res0: ResultOrFailure[Int] = ResultOrFailure@a96606
|
||||
*
|
||||
* scala> res0()
|
||||
* res1: Int = 1
|
||||
|
|
@ -30,7 +30,7 @@ package se.scalablesolutions.akka.kernel
|
|||
*
|
||||
* scala> res0()
|
||||
* java.lang.RuntimeException: Lets see what happens here...
|
||||
* at ErrRef.apply(RefExcept.scala:11)
|
||||
* at ResultOrFailure.apply(RefExcept.scala:11)
|
||||
* at .<init>(<console>:6)
|
||||
* at .<clinit>(<console>)
|
||||
* at Re...
|
||||
|
|
@ -38,7 +38,7 @@ package se.scalablesolutions.akka.kernel
|
|||
*
|
||||
* @author <a href="http://jonasboner.com">Jonas Bonér</a>
|
||||
*/
|
||||
class ErrRef[Payload](payload: Payload, val tx: Option[Transaction]) {
|
||||
class ResultOrFailure[Payload](payload: Payload, val tx: Option[Transaction]) {
|
||||
private[this] var contents: Either[Throwable, Payload] = Right(payload)
|
||||
|
||||
def update(value: => Payload) = {
|
||||
|
|
@ -50,9 +50,9 @@ class ErrRef[Payload](payload: Payload, val tx: Option[Transaction]) {
|
|||
case Left(e) => throw e.fillInStackTrace
|
||||
}
|
||||
|
||||
override def toString(): String = "ErrRef[" + contents + "]"
|
||||
override def toString(): String = "ResultOrFailure[" + contents + "]"
|
||||
}
|
||||
object ErrRef {
|
||||
def apply[Payload](payload: Payload, tx: Option[Transaction]) = new ErrRef(payload, tx)
|
||||
def apply[AnyRef](tx: Option[Transaction]) = new ErrRef(new Object, tx)
|
||||
object ResultOrFailure {
|
||||
def apply[Payload](payload: Payload, tx: Option[Transaction]) = new ResultOrFailure(payload, tx)
|
||||
def apply[AnyRef](tx: Option[Transaction]) = new ResultOrFailure(new Object, tx)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue