This page is no longer maintained — Please continue to the home page at www.scala-lang.org

ANN: The Skalman Container: A minimalistic JEE container/framework for Scala

No replies
Jonas Bonér
Joined: 2008-12-19,
User offline. Last seen 42 years 45 weeks ago.

Hi guys.

I have thrown up the little "JEE container" framework that I wrote for
my company (Triental AB) last year. At least it can be used as a
starting point for a real Scala container.

I don't know if anyone might find it useful. Feel free to email me if
you have any questions or want to improve the code in any way (if the
latter, just fork my github branch and hack away).
I have already written some about what we did on my blog
(http://jonasboner.com) but this all that I thought might be generic
enough to be useful for someone else.
If there is a need I'll try to document it up some more.

In short it has support for:

----
- JPA -
JPA Template, Generic Repository etc.

----
- JTA -
EJB-style TX semantics: REQUIRED, REQUIRES_NEW, MANDATORY, NEVER, SUPPORTS.
It hooks into Hibernate/JPA.
Can make use of the AOP framework to allow decorating your methods with:

import javax.ejb.{TransactionAttribute, TransactionAttributeType}

trait Foo {
  @TransactionAttribute(TransactionAttributeType.REQUIRED)
  def foo(msg: String)
}

----
- AOP -
A simple generic Interceptor/AOP framework.
Uses either annotations or the AspectJ pointcut parser.
See my blog for a detailed post (last half):
http://jonasboner.com/2008/12/09/real-world-scala-managing-cross-cutting...

----
- Caching -
Annotate your methods with '@Cacheable' to have the cached in a
performant way.

----
- DI -
We used the Cake Pattern, but used Guice at one point, should be easy
to add that again if requested.
See this article for details:
http://jonasboner.com/2008/10/06/real-world-scala-dependency-injection-d...

You can find all code here:
http://github.com/jboner/skalman/tree/master

I am discussing with the Lift guys to incorporate some if this into
Lift. In particular the JTA stuff. Don't know how much though.

Thanks.

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland