org.jboss.solder.bean
Class ImmutableBean<T>
java.lang.Object
org.jboss.solder.bean.AbstractImmutableBean<T>
org.jboss.solder.bean.ImmutableBean<T>
- All Implemented Interfaces:
- javax.enterprise.context.spi.Contextual<T>, javax.enterprise.inject.spi.Bean<T>
- Direct Known Subclasses:
- ImmutablePassivationCapableBean
public class ImmutableBean<T>
- extends AbstractImmutableBean<T>
- implements javax.enterprise.inject.spi.Bean<T>
A base class for implementing Bean. The attributes are immutable, and
collections are defensively copied on instantiation. It uses the defaults
from the specification for properties if not specified.
This bean delegates it's lifecycle to the callbacks on the provided
ContextualLifecycle.
- Author:
- Stuart Douglas, Pete Muir
- See Also:
AbstractImmutableBean,
BeanBuilder,
ImmutablePassivationCapableBean
|
Constructor Summary |
ImmutableBean(Class<?> beanClass,
String name,
Set<Annotation> qualifiers,
Class<? extends Annotation> scope,
Set<Class<? extends Annotation>> stereotypes,
Set<Type> types,
boolean alternative,
boolean nullable,
Set<javax.enterprise.inject.spi.InjectionPoint> injectionPoints,
ContextualLifecycle<T> contextualLifecycle,
String toString)
Create a new, immutable bean. |
|
Method Summary |
T |
create(javax.enterprise.context.spi.CreationalContext<T> arg0)
|
void |
destroy(T arg0,
javax.enterprise.context.spi.CreationalContext<T> arg1)
|
| Methods inherited from interface javax.enterprise.inject.spi.Bean |
getBeanClass, getInjectionPoints, getName, getQualifiers, getScope, getStereotypes, getTypes, isAlternative, isNullable |
ImmutableBean
public ImmutableBean(Class<?> beanClass,
String name,
Set<Annotation> qualifiers,
Class<? extends Annotation> scope,
Set<Class<? extends Annotation>> stereotypes,
Set<Type> types,
boolean alternative,
boolean nullable,
Set<javax.enterprise.inject.spi.InjectionPoint> injectionPoints,
ContextualLifecycle<T> contextualLifecycle,
String toString)
- Create a new, immutable bean. All arguments passed as collections are
defensively copied.
- Parameters:
beanClass - The Bean class, may not be nullname - The bean namequalifiers - The bean's qualifiers, if null, a singleton set of
Default is usedscope - The bean's scope, if null, the default scope of
Dependent is usedstereotypes - The bean's stereotypes, if null, an empty set is usedtypes - The bean's types, if null, the beanClass and Object
will be usedalternative - True if the bean is an alternativenullable - True if the bean is nullableinjectionPoints - the bean's injection points, if null an empty set
is usedcontextualLifecycle - Handler for create(CreationalContext)
and destroy(Object, CreationalContext)toString - the string representation of the bean, if null the built
in representation is used, which states the bean class and
qualifiers
- Throws:
IllegalArgumentException - if the beanClass is null
create
public T create(javax.enterprise.context.spi.CreationalContext<T> arg0)
- Specified by:
create in interface javax.enterprise.context.spi.Contextual<T>
destroy
public void destroy(T arg0,
javax.enterprise.context.spi.CreationalContext<T> arg1)
- Specified by:
destroy in interface javax.enterprise.context.spi.Contextual<T>
Copyright © 2008-2011 Seam Framework. All Rights Reserved.