org.actorsguildframework.annotations
Annotation Type Message


@Documented
@Target(value=METHOD)
@Retention(value=RUNTIME)
@Inherited
public @interface Message

Message marks a method of an Actor as message receiver.

There are several prerequisites for such a method, beside the annotation:

  1. All arguments must be immutable (Java primitives, String, Enum or classes with implementing Immutable) or Serializable (much slower, will be serialized and deserialized)
  2. The method must return the type AsyncResult (with T being immutable as well)
  3. The method must not be abstract, static or final
  4. The method must be public
A Message implementation can throw any exception. Please note that non-RuntimeExceptions will be wrapped and transported to the caller as WrappedException.