Thursday, June 16, 2011

Best We Can Get--Working For Now

After reviewing many posts I have observed the consensus opinion that to make the no-interface feature of EJB 3.1 work in Scala you must decorate your bean with the new LocalBean annotation like this:


package com.scalaejb

import javax.ejb.{Stateless,LocalBean}

@Stateless
@LocalBean
class ScalaEjbImpl {
def sayHi( name:String ) { println("Hi 4, "+name ) }
}

This works. For me this is acceptable but mildly disappointing. Most of the time when I want local-only access to a bean, this approach is fine. But if I do want a remotely visible API for my bean then presumably I'll also need to specify a dummy local interface as well, something I wouldn't need to do if my bean were written in Java.

So, good 'nuf, I suppose.

No comments:

Post a Comment