Package org.beanlet

Contains all of the core beanlet interfaces and bootstrap classes.

See:
          Description

Interface Summary
BeanletContext<T> Provides beanlet instances access to their runtime context.
BeanletFactory<T> Factory for creating beanlet references.
BeanletMetaData<T> Provides information on the beanlet definition.
BeanletReference<T> Represents a reference to a beanlet.
Event Root interface of all events.
FactoryBeanlet<T> Beanlets implementing this interface can act as a factory.
Interceptor Classes implementing this interface can configured to intercept invocations.
InvocationContext Allow interceptor and lifecycle methods to control the behavior of the invocation chain.
MetaData Root interface of all meta data objects.
Provider<T> Provides instances of T.
 

Class Summary
BeanletApplicationContext Bootstrap class for the application container.
 

Enum Summary
AttributeAccessType Specifies the access rights for attributes.
RetentionPolicy Beanlet retention policy.
WiringMode Specifies the wiring mode.
 

Exception Summary
BeanletApplicationException Thrown to indicate a general application error.
BeanletCreationException Thrown if an instance for the specified beanlet could not be created, or obtained for some reason.
BeanletDefinitionException Indicates an invalid beanlet definition.
BeanletEventException Generic event exception.
BeanletEventNotExecutableException Thrown if specified event cannot be executed.
BeanletException Indicates that there is an issue with the specified beanlet.
BeanletExecutionException Exception thrown if any exception is raised during event execution.
BeanletNotActiveException Thrown if the specified beanlet has not yet been activated.
BeanletNotFoundException Thrown if no beanlet is registered for the specified name.
BeanletNotOfRequiredTypeException Thrown if required type does not matched found type.
BeanletStateException Indicates that beanlet is not in required state to perform operation.
BeanletTypeIsDuplicateException Indicates that multiple beanlets match the member type.
BeanletTypeMismatchException Thrown if injectant does not match member type.
BeanletTypeNotFoundException Exception thrown if no beanlet type matches member type.
BeanletValidationException Thrown if beanlet validation failed.
BeanletWiringException Thrown if any of the members, for which injection is required, cannot be wired.
 

Annotation Types Summary
AroundInvoke Designates a method to intercept invocations on a beanlet.
Attribute Exposes methods or fields as beanlet attributes.
CollectionValue Represents a collection of values.
Dependency Used to specify an explicit dependency.
Entry Represents a single map entry.
ExcludeClassInterceptors Used to exclude class-level interceptors for a business method.
ExcludeDefaultInterceptors Used to exclude default interceptors for a class or method.
Execute Methods declared with this annotation are executed by one or more background threads.
Factory Beanlets implementing this annotation can act as a factory.
IgnoreDependency Used to ignore the dependencies of the element that is subject to injection.
Inject Members marked with this annotation are injected by the application container during beanlet instance creation.
Interceptors Declares a list of interceptors.
Lazy Beanlets marked with this annotations are not eagerly instantiated.
MapValue Represents a map of key/value entries.
Operation Exposes methods as beanlet operations.
PostConstruct The PostConstruct annotation is used on a method that needs to be executed after dependency injection is done to perform any initialization.
PreDestroy The PreDestroy annotation is used on methods as a callback notification to signal that the beanlet instance is in the process of being removed by the container.
Proxy Specifies interfaces to be exposed by beanlet.
ProxyMethod Methods marked with this annotation are so-called proxy methods.
Remove Applied to a business method of a class.
Retention Indicates what action is to be taken in case an exception is encountered on beanlet invocation.
Schedule Methods declared with this annotation are scheduled to be executed by a background thread.
ScopeAnnotation Annotations marked with the ScopeAnnotation are beanlet scope annotations.
Singleton Beanlets without any scope annotation and beanlets marked with this annotation are called vanilla beanlets.
Start The Start annotation is used on a method that needs to be called after initialization of a beanlet.
Stateful Stateful beanlet maintain conversational state between calls on the same object.
Stateless Stateless beanlets do not share any state between subsequent method invocations.
StaticFactory Applied to static methods or static fields to denote a factory.
Stop Defines a stop lifecycle method.
SuppressWarnings Indicates that no warnings need to be generated for the annotated element.
Value Defines an object.
Wiring Allows members to be wired with implicitely selected objects.
 

Package org.beanlet Description

Contains all of the core beanlet interfaces and bootstrap classes.

Beanlet Scopes

The Beanlet core packages come with three object scopes:

Static versus Non-Static

Beanlets are created in either a static or a non-static context. Static, in this context, means that beanlets are created independently from the current state of the container or application. Static beanlets are created at the container's discretion and therefore do not allow applications to pass any state to this component while it is being created. Non-static beanlets are only created upon application request. Applications can pass objects - or state if you will - by using wiring BY_INFO dependency injection. Use the BeanletMetaData interface to find out if a beanlet is static programmatically.

The static property of a beanlet is derived from the selected beanlet scope, i.e., singleton vanilla beanlets are static, where non-singleton vanilla beanlets are non-static. The following table shows the static property for all core beanlet scopes.


singletonreentrantstatic
VanillatrueN/Atrue
VanillafalseN/Afalse
Statefultrue/falsetrue/falsefalse
Statelesstrue/falsetrue/falsetrue


The static property has also effect on the lifecycle management of beanlets as is explained by the next paragraph.

Beanlet Lifecycle Management

The container is responsible for managaging the lifecycle of beanlets. Two lifecycle levels can be identified. That is, at instance-level and at business-level.

Instance-Level

Instance-level lifecycle methods are invoked during the process of creating or destroying individual beanlet instances. These lifecycle methods are marked with the PostConstruct and PreDestroy annotations, respectively. These methods are invoked in an unspecified context. This means that transactions, for instance, are not supported for these methods.
The PostConstruct method is invoked right after dependency injection. This method has to be completed before any business methods can be invoked on the instance. The PreDestroy method is the last method to be invoked on the beanlet instance. Whether the PreDestroy method is actually invoked depends on the RetentionPolicy specified by the beanlet.

Business-Level

Business-level lifecycle methods are in genereral no different from any other business methods, except that they are invoked by the container directly. These lifecycle methods are marked with the Start and Stop annotations, respectively.
For non-static beanlets, business-level lifeycle methods are processed at beanlet instance level. This is quite similar to the instance-level lifecycle methods described above, except that the business-level lifecycle methods do run in a specified context (and thus support transactions). As a result, the Start and Stop methods of a non-static beanlet can be invoked multiple times, namely once per constructed instance.
For static beanlets, business-level lifecycle methods are processed at beanlet level. If a beanlet specifies a Start method, the container requests a beanlet instance during deployment and invokes this Start method. The Stop method is invoked if the beanlet is being undeployed. In other words, the Start and Stop for static beanlets are invoked only once.

Beanlet Definitions

Throughout this API, the following definitions are used:



Copyright © 2006-2012. All Rights Reserved.