org.actorsguildframework.annotations
Annotation Type Bean


@Documented
@Target(value=TYPE)
@Retention(value=RUNTIME)
@Inherited
public @interface Bean

Declares this class to be a Agent-managed bean. You must create such beans using Agent.create(Class, org.actorsguildframework.Props). The @Bean annotation is optional and only needed if you want to change the bean's default configuration. Agent-managed beans can use the Prop and DefaultValue annotations.


Required Element Summary
 boolean threadSafe
          Specifies whether the bean uses thread-safe property and constructor implementations.
 

Element Detail

threadSafe

public abstract boolean threadSafe
Specifies whether the bean uses thread-safe property and constructor implementations. If true, all values set in the constructor, initializer and Prop property implementations are synchronized on the bean instance. If false, the bean does not use any synchronization and can only be used in a single threaded or with manualsynchronization.

Please note that even with threadSafe set to true, Prop annotated read-write fields are not synchronized and thus not thread-safe. In Actors this is not necessarily a problem though, because in Actors all messages are automatically synchronized.