org.jboss.seam
Class Component

java.lang.Object
  extended by org.jboss.seam.Component

@Scope(value=APPLICATION)
public class Component
extends Object

A Seam component is any POJO managed by Seam. A POJO is recognized as a Seam component if it has a @Name annotation

Version:
$Revision: 1.218 $
Author:
Thomas Heute, Gavin King

Nested Class Summary
static class Component.ConstantInitialValue
           
static class Component.ELInitialValue
           
static interface Component.InitialValue
           
 
Field Summary
static String PROPERTIES
           
 
Constructor Summary
Component(Class<?> clazz)
           
Component(Class<?> clazz, Context applicationContext)
           
Component(Class<?> clazz, String componentName)
           
Component(Class<?> clazz, String componentName, ScopeType componentScope, String jndiName)
           
 
Method Summary
 void addInterceptor(Interceptor interceptor)
           
 boolean beanClassHasAnnotation(Class annotationType)
           
 boolean businessInterfaceHasAnnotation(Class annotationType)
           
 Object callComponentMethod(Object instance, Method method, Object... parameters)
           
 void callCreateMethod(Object instance)
           
 void callDestroyMethod(Object instance)
           
 void callPostActivateMethod(Object instance)
           
 void callPostConstructMethod(Object instance)
           
 void callPreDestroyMethod(Object instance)
           
 void callPrePassivateMethod(Object instance)
           
static Class<net.sf.cglib.proxy.Factory> createProxyFactory(ComponentType type, Class beanClass, Collection<Class> businessInterfaces)
           
 List<Object> createUserInterceptors(InterceptorType type)
           
 void disinject(Object bean)
          Null out any @In attributes of a component instance.
static Component forName(String name)
           
 Class<?> getBeanClass()
           
 Set<Class> getBusinessInterfaces()
           
static Set<Class> getBusinessInterfaces(Class clazz)
           
 List<Interceptor> getClientSideInterceptors()
          For use with Seam debug page.
 Method getCreateMethod()
           
 String[] getDependencies()
           
 Method getDestroyMethod()
           
 Set<Field> getInFields()
           
 Set<Method> getInMethods()
           
static Object getInstance(Class<?> clazz)
           
static Object getInstance(Class<?> clazz, boolean create)
           
static Object getInstance(Class<?> clazz, ScopeType scope)
           
static Object getInstance(Class<?> clazz, ScopeType scope, boolean create)
           
static Object getInstance(String name)
           
static Object getInstance(String name, boolean create)
           
static Object getInstance(String name, ScopeType scope)
           
static Object getInstance(String name, ScopeType scope, boolean create)
           
static Object getInstanceFromFactory(String name)
           
 InterceptionType getInterceptionType()
           
 List<Interceptor> getInterceptors(InterceptorType type)
           
 String getName()
           
 Set<Field> getOutFields()
           
 Set<Method> getOutMethods()
           
 Method getPostActivateMethod()
           
 Method getPostConstructMethod()
           
 Method getPreDestroyMethod()
           
 Method getPrePassivateMethod()
           
 Method getRemoveMethod(String name)
           
 Collection<Method> getRemoveMethods()
           
 ScopeType getScope()
           
 List<Interceptor> getServerSideInterceptors()
          For use with Seam debug page.
 long getTimeout()
           
 ComponentType getType()
           
 Method getUnwrapMethod()
           
 Set<Method> getValidateMethods()
           
 org.hibernate.validator.ClassValidator getValidator()
           
 boolean hasCreateMethod()
           
 boolean hasDestroyMethod()
           
 boolean hasPostActivateMethod()
           
 boolean hasPostConstructMethod()
           
 boolean hasPreDestroyMethod()
           
 boolean hasPrePassivateMethod()
           
 boolean hasUnwrapMethod()
           
 void initialize(Object bean)
           
 void inject(Object bean, boolean enforceRequired)
          Inject context variable values into @In attributes of a component instance.
protected  Object instantiate()
           
protected  Object instantiateEntityBean()
           
protected  Object instantiateJavaBean()
           
protected  Object instantiateSessionBean()
           
 boolean isInstance(Object bean)
           
 boolean isStartup()
           
 boolean needsInjection()
           
 boolean needsOutjection()
           
 Object newInstance()
           
 void outject(Object bean, boolean enforceRequired)
          Outject context variable values from @Out attributes of a component instance.
 String toString()
           
 Object wrap(Object bean, net.sf.cglib.proxy.MethodInterceptor interceptor)
          Wrap a CGLIB interceptor around an instance of the component
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROPERTIES

public static final String PROPERTIES
See Also:
Constant Field Values
Constructor Detail

Component

public Component(Class<?> clazz)

Component

public Component(Class<?> clazz,
                 String componentName)

Component

public Component(Class<?> clazz,
                 Context applicationContext)

Component

public Component(Class<?> clazz,
                 String componentName,
                 ScopeType componentScope,
                 String jndiName)
Method Detail

addInterceptor

public void addInterceptor(Interceptor interceptor)

beanClassHasAnnotation

public boolean beanClassHasAnnotation(Class annotationType)

businessInterfaceHasAnnotation

public boolean businessInterfaceHasAnnotation(Class annotationType)

getBeanClass

public Class<?> getBeanClass()

getName

public String getName()

getType

public ComponentType getType()

getScope

public ScopeType getScope()

getValidator

public org.hibernate.validator.ClassValidator getValidator()

getInterceptors

public List<Interceptor> getInterceptors(InterceptorType type)

createUserInterceptors

public List<Object> createUserInterceptors(InterceptorType type)

getServerSideInterceptors

public List<Interceptor> getServerSideInterceptors()
For use with Seam debug page.

Returns:
the server-side interceptor stack

getClientSideInterceptors

public List<Interceptor> getClientSideInterceptors()
For use with Seam debug page.

Returns:
the client-side interceptor stack

getDestroyMethod

public Method getDestroyMethod()

getRemoveMethods

public Collection<Method> getRemoveMethods()

getRemoveMethod

public Method getRemoveMethod(String name)

getValidateMethods

public Set<Method> getValidateMethods()

hasPreDestroyMethod

public boolean hasPreDestroyMethod()

hasPostConstructMethod

public boolean hasPostConstructMethod()

hasPrePassivateMethod

public boolean hasPrePassivateMethod()

hasPostActivateMethod

public boolean hasPostActivateMethod()

hasDestroyMethod

public boolean hasDestroyMethod()

hasCreateMethod

public boolean hasCreateMethod()

getCreateMethod

public Method getCreateMethod()

hasUnwrapMethod

public boolean hasUnwrapMethod()

getUnwrapMethod

public Method getUnwrapMethod()

getOutFields

public Set<Field> getOutFields()

getOutMethods

public Set<Method> getOutMethods()

getInMethods

public Set<Method> getInMethods()

getInFields

public Set<Field> getInFields()

needsInjection

public boolean needsInjection()

needsOutjection

public boolean needsOutjection()

instantiate

protected Object instantiate()
                      throws Exception
Throws:
Exception

instantiateSessionBean

protected Object instantiateSessionBean()
                                 throws Exception,
                                        NamingException
Throws:
Exception
NamingException

instantiateEntityBean

protected Object instantiateEntityBean()
                                throws Exception
Throws:
Exception

instantiateJavaBean

protected Object instantiateJavaBean()
                              throws Exception
Throws:
Exception

wrap

public Object wrap(Object bean,
                   net.sf.cglib.proxy.MethodInterceptor interceptor)
            throws Exception
Wrap a CGLIB interceptor around an instance of the component

Throws:
Exception

initialize

public void initialize(Object bean)
                throws Exception
Throws:
Exception

inject

public void inject(Object bean,
                   boolean enforceRequired)
Inject context variable values into @In attributes of a component instance.

Parameters:
bean - a Seam component instance
enforceRequired - should we enforce required=true?

disinject

public void disinject(Object bean)
Null out any @In attributes of a component instance.

Parameters:
bean - a Seam component instance

outject

public void outject(Object bean,
                    boolean enforceRequired)
Outject context variable values from @Out attributes of a component instance.

Parameters:
bean - a Seam component instance
enforceRequired - should we enforce required=true?

isInstance

public boolean isInstance(Object bean)

getBusinessInterfaces

public static Set<Class> getBusinessInterfaces(Class clazz)

getBusinessInterfaces

public Set<Class> getBusinessInterfaces()

forName

public static Component forName(String name)

getInstance

public static Object getInstance(Class<?> clazz)

getInstance

public static Object getInstance(Class<?> clazz,
                                 boolean create)

getInstance

public static Object getInstance(Class<?> clazz,
                                 ScopeType scope)

getInstance

public static Object getInstance(Class<?> clazz,
                                 ScopeType scope,
                                 boolean create)

getInstance

public static Object getInstance(String name)

getInstance

public static Object getInstance(String name,
                                 boolean create)

getInstance

public static Object getInstance(String name,
                                 ScopeType scope)

getInstance

public static Object getInstance(String name,
                                 ScopeType scope,
                                 boolean create)

getInstanceFromFactory

public static Object getInstanceFromFactory(String name)

newInstance

public Object newInstance()

callCreateMethod

public void callCreateMethod(Object instance)

callDestroyMethod

public void callDestroyMethod(Object instance)

callPreDestroyMethod

public void callPreDestroyMethod(Object instance)

callPostConstructMethod

public void callPostConstructMethod(Object instance)

callPrePassivateMethod

public void callPrePassivateMethod(Object instance)

callPostActivateMethod

public void callPostActivateMethod(Object instance)

callComponentMethod

public Object callComponentMethod(Object instance,
                                  Method method,
                                  Object... parameters)

toString

public String toString()
Overrides:
toString in class Object

createProxyFactory

public static Class<net.sf.cglib.proxy.Factory> createProxyFactory(ComponentType type,
                                                                   Class beanClass,
                                                                   Collection<Class> businessInterfaces)

getInterceptionType

public InterceptionType getInterceptionType()

isStartup

public boolean isStartup()

getDependencies

public String[] getDependencies()

getPostActivateMethod

public Method getPostActivateMethod()

getPrePassivateMethod

public Method getPrePassivateMethod()

getPostConstructMethod

public Method getPostConstructMethod()

getPreDestroyMethod

public Method getPreDestroyMethod()

getTimeout

public long getTimeout()