Scala 2.8: use Java annotation with an array parameter
- by yournamehere
I'm trying to implement an JavaEE Session Bean with Scala 2.8.
Because it's a Remote Session Bean, i have to annotate it with the following Java Annotation:
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface Remote {
Class[] value() default {};
}
I only found this example for scala 2.7.
In Scala 2.7, its possible to define the session bean like this:
@Remote {val value = Array(classOf[ITest])}
class MyEJB
...
How can i use this annotation the same way with Scala 2.8? I already tried many different versions, all resulting in "annotation argument needs to be a constant", "illegal start of simple expression".
All of these definitions don't work:
@Remote{val value = Array(classOf[PersonScalaEJB])}
@Remote(val value = Array(classOf[PersonScalaEJB]))
@Remote(Array(classOf[PersonScalaEJB]))