org.jboss.weld.bean
Class ForwardingBean<T>

java.lang.Object
  extended by org.jboss.weld.bean.ForwardingBean<T>
Type Parameters:
T -
All Implemented Interfaces:
javax.enterprise.context.spi.Contextual<T>, javax.enterprise.inject.spi.Bean<T>
Direct Known Subclasses:
ForwardingDecorator

public abstract class ForwardingBean<T>
extends Object
implements javax.enterprise.inject.spi.Bean<T>

A delegating bean

Author:
Pete Muir

Constructor Summary
ForwardingBean()
           
 
Method Summary
 T create(javax.enterprise.context.spi.CreationalContext<T> creationalContext)
          Creates an instance of the delegate
protected abstract  javax.enterprise.inject.spi.Bean<T> delegate()
          Abstract getter for the delegate
 void destroy(T instance, javax.enterprise.context.spi.CreationalContext<T> creationalContext)
          Destroys an instance through the delegate
 boolean equals(Object obj)
          Compares an object with the delegate
 Class<?> getBeanClass()
           
 Set<javax.enterprise.inject.spi.InjectionPoint> getInjectionPoints()
           
 String getName()
          Gets the name of the delegate
 Set<Annotation> getQualifiers()
          Gets the binding types of the delegate
 Class<? extends Annotation> getScope()
          Gets the scope type of the delegate
 Set<Class<? extends Annotation>> getStereotypes()
          The stereotypes applied to this bean
 Set<Type> getTypes()
          Gets the API types of the delegate
 int hashCode()
          Gets the hash code of the delegate
 boolean isAlternative()
           
 boolean isNullable()
          Indicates if the delegate is nullable
 String toString()
          Returns a string representation
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ForwardingBean

public ForwardingBean()
Method Detail

create

public T create(javax.enterprise.context.spi.CreationalContext<T> creationalContext)
Creates an instance of the delegate

Specified by:
create in interface javax.enterprise.context.spi.Contextual<T>
Returns:
an instance of the delegate

delegate

protected abstract javax.enterprise.inject.spi.Bean<T> delegate()
Abstract getter for the delegate

Returns:
The delegate

destroy

public void destroy(T instance,
                    javax.enterprise.context.spi.CreationalContext<T> creationalContext)
Destroys an instance through the delegate

Specified by:
destroy in interface javax.enterprise.context.spi.Contextual<T>
Parameters:
instance - The instance to destroy

equals

public boolean equals(Object obj)
Compares an object with the delegate

Overrides:
equals in class Object
Returns:
True if equals, false otherwise

getBeanClass

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

getQualifiers

public Set<Annotation> getQualifiers()
Gets the binding types of the delegate

Specified by:
getQualifiers in interface javax.enterprise.inject.spi.Bean<T>
Returns:
The binding types

getInjectionPoints

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

getName

public String getName()
Gets the name of the delegate

Specified by:
getName in interface javax.enterprise.inject.spi.Bean<T>
Returns:
The name

getStereotypes

public Set<Class<? extends Annotation>> getStereotypes()
The stereotypes applied to this bean

Specified by:
getStereotypes in interface javax.enterprise.inject.spi.Bean<T>
Returns:
stereotypes if any

getScope

public Class<? extends Annotation> getScope()
Gets the scope type of the delegate

Specified by:
getScope in interface javax.enterprise.inject.spi.Bean<T>
Returns:
The scope type

getTypes

public Set<Type> getTypes()
Gets the API types of the delegate

Specified by:
getTypes in interface javax.enterprise.inject.spi.Bean<T>
Returns:
The API types

hashCode

public int hashCode()
Gets the hash code of the delegate

Overrides:
hashCode in class Object
Returns:
The hash code

isNullable

public boolean isNullable()
Indicates if the delegate is nullable

Specified by:
isNullable in interface javax.enterprise.inject.spi.Bean<T>
Returns:
True if nullable, false otherwise

isAlternative

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

toString

public String toString()
Returns a string representation

Overrides:
toString in class Object
Returns:
The string representation


Copyright © 2013 Seam Framework. All Rights Reserved.