org.actorsguildframework.annotations
Annotation Type Initializer


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

Methods marked as @Initializer will be invoked in Actors and Beans, after the completion of the object's construction phase. All properties that have been given to Agent.create(Class, org.actorsguildframework.Props) will be set before the initializer is called. Initializers must not take or return any arguments. You can have any number of initializers in your class, including its sub-class(es). The framework will first invoke the initializers at the top of the class hierarchy (the super class) and then go down until it reaches the initializers of the instantiated class. If you override a initializer, only the new initializer will be called. The order of execution within one level of the class hierarchy is undefined. The main purpose of an initializer is to complete the initialization of a bean. You can also use it to check the validity of properties (for example, whether all required properties have been set). In actors, the initializer has the same synchronization guarantees as the constructor. Thus, everything you do in the initializer will be visible to all single-threaded messages. In plain beans, there are no synchronization guarantees.