org.beanlet
Annotation Type Singleton


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

  • Beanlets without any scope annotation and beanlets marked with this annotation are called vanilla beanlets. Vanilla beanlets do not have a stub that controls access to the beanlet instance. Clients have access to the actual object. In short, they can invoke methods directly on the beanlet instance.
    The container guarantees that only a single instance of this beanlet exists at the same time. This particular instance is always returned upon request.

    XML Representation

    The following xml-fragment shows how to express this annotation in xml. The 'singleton' tag does not specify any element attribute, which means that this tag is applied to the beanlet's class.
    <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">
        <singleton/>
      </beanlet>
    </beanlets>



    Copyright © 2006-2012. All Rights Reserved.