org.beanlet.web
Annotation Type Session


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

Session beanlets do not provide direct access to the underlying objects. Instead, clients obtain a stub that delegates invocations to the underlying instance. In case of request beanlets, the stub creates a new instance per HTTP session. This instance is always assigned while performing a request for that particular HTTP session. Session beanlet instances only exist while the session, for which they were created, is active. These beanlet instances are destroyed when their HTTP session is invalidated or expired.
Session beanlets are non reentrant by default, which means that only one thread can invoke a method of the beanlet instance at the same time. This feature is provided by the stub, which controls all access to the underlying instance. Session beanlets can also be configured to be reentrant.

XML Representation

The following xml-fragment shows how to express this annotation in xml. The 'session' tag does not specify any element attribute, which means that this tag is applied to the beanlet's class. The attribute can be specified optionally if the annotation specifies a default value for the particular annotation method.
<beanlets xmlns="http://beanlet.org/schema/beanlet"
          xmlns:web="http://beanlet.org/schema/web"
          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
                              http://beanlet.org/schema/web http://beanlet.org/schema/web/beanlet_web_1_0.xsd">
  <beanlet name="foo" type="com.acme.Foo">
    <web:session reentrant="false"/>
  </beanlet>
</beanlets>

See Also:
ScopeAnnotation

Optional Element Summary
 boolean reentrant
          Specifies whether the beanlet instances should be reentrant or not.
 

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.