org.jboss.weld.extensions.bean
Class AbstractImmutableBean<T>

java.lang.Object
  extended by org.jboss.weld.extensions.bean.AbstractImmutableBean<T>
All Implemented Interfaces:
javax.enterprise.context.spi.Contextual<T>, javax.enterprise.inject.spi.Bean<T>
Direct Known Subclasses:
ImmutableBean, ImmutableNarrowingBean

public abstract class AbstractImmutableBean<T>
extends Object
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 class does not provide any bean lifecycle operations

Author:
Pete Muir
See Also:
ImmutableBean, ImmutableNarrowingBean

Constructor Summary
AbstractImmutableBean(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, String toString)
          Create a new, immutable bean.
 
Method Summary
 Class<?> getBeanClass()
           
 Set<javax.enterprise.inject.spi.InjectionPoint> getInjectionPoints()
           
 String getName()
           
 Set<Annotation> getQualifiers()
           
 Class<? extends Annotation> getScope()
           
 Set<Class<? extends Annotation>> getStereotypes()
           
 Set<Type> getTypes()
           
 boolean isAlternative()
           
 boolean isNullable()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.enterprise.context.spi.Contextual
create, destroy
 

Constructor Detail

AbstractImmutableBean

public AbstractImmutableBean(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,
                             String toString)
Create a new, immutable bean. All arguments passed as collections are defensively copied.

Parameters:
beanClass - The Bean class, may not be null
name - The bean name
qualifiers - The bean's qualifiers, if null, a singleton set of Default is used
scope - The bean's scope, if null, the default scope of Dependent is used
stereotypes - The bean's stereotypes, if null, an empty set is used
types - The bean's types, if null, the beanClass and Object will be used
alternative - True if the bean is an alternative
nullable - True if the bean is nullable
injectionPoints - the bean's injection points, if null an empty set is used
beanLifecycle - Handler for Contextual.create(CreationalContext) and Contextual.destroy(Object, CreationalContext)
Throws:
IllegalArgumentException - if the beanClass is null
Method Detail

getBeanClass

public Class<?> getBeanClass()
Specified by:
getBeanClass in interface javax.enterprise.inject.spi.Bean<T>

getInjectionPoints

public Set<javax.enterprise.inject.spi.InjectionPoint> getInjectionPoints()
Specified by:
getInjectionPoints in interface javax.enterprise.inject.spi.Bean<T>

getName

public String getName()
Specified by:
getName in interface javax.enterprise.inject.spi.Bean<T>

getQualifiers

public Set<Annotation> getQualifiers()
Specified by:
getQualifiers in interface javax.enterprise.inject.spi.Bean<T>

getScope

public Class<? extends Annotation> getScope()
Specified by:
getScope in interface javax.enterprise.inject.spi.Bean<T>

getStereotypes

public Set<Class<? extends Annotation>> getStereotypes()
Specified by:
getStereotypes in interface javax.enterprise.inject.spi.Bean<T>

getTypes

public Set<Type> getTypes()
Specified by:
getTypes in interface javax.enterprise.inject.spi.Bean<T>

isAlternative

public boolean isAlternative()
Specified by:
isAlternative in interface javax.enterprise.inject.spi.Bean<T>

isNullable

public boolean isNullable()
Specified by:
isNullable in interface javax.enterprise.inject.spi.Bean<T>

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2008-2010 Seam Framework. All Rights Reserved.