org.beanlet
Annotation Type Stateless


@ScopeAnnotation
@Retention(value=RUNTIME)
@Target(value=TYPE)
public @interface Stateless

Stateless beanlets do not share any state between subsequent method invocations. Stateless beanlet instances are pooled and methods called on stateless beanlet stubs are delegated to one of the pooled instances. If multiple invocations are made on the same stub reference, different beanlet instances can be used to perform the call.
Beanlet instances are added and removed from the pool at the container's discretion. Requesting a beanlet stub through the APIs, or dependency injection does not necessarily result in the creation of a new beanlet instance. In general, the number of pooled beanlet instances depends on the number of concurrent requests made to these stubs.
Stateless beanlets can be configured to be reentrant and singleton.

XML Representation

The following xml-fragment shows how to express this annotation in xml. The 'stateless' tag does not specify any element attribute, which means that this tag is applied to the beanlet's class. The attributes can be specified optionally if the annotation specifies a default value for the particular annotation methods.
<beanlets xmlns="http://beanlet.org/schema/beanlet"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://beanlet.org/schema/beanlet http://beanlet.org/schema/beanlet/beanlet_1_0.xsd">
  <beanlet name="foo" type="com.acme.Foo">
    <stateless singleton="false" reentrant="false"/>
  </beanlet>
</beanlets>

See Also:
Stateful, ScopeAnnotation

Optional Element Summary
 boolean reentrant
          Specifies whether the beanlet instances should be reentrant or not.
 boolean singleton
          Set to true to declare this beanlet to be a singleton beanlet.
 

singleton

public abstract boolean singleton
Set to true to declare this beanlet to be a singleton beanlet. Only one beanlet instance will exist at the same time for singleton beanlets.

Default:
false

reentrant

public abstract boolean reentrant
Specifies whether the beanlet instances should be reentrant or not. Instances of reentrant beanlets can be invoked by multiple threads at the same time.

Default:
false


Copyright © 2006-2012. All Rights Reserved.