org.jboss.seam
Class Component

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

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

Metamodel class for component classes. A Seam component is any class with a @Name annotation.

Author:
Thomas Heute, Gavin King

Nested Class Summary
static interface Component.BijectedAttribute<T extends java.lang.annotation.Annotation>
           
 
Field Summary
static java.lang.String PROPERTIES
           
 
Constructor Summary
Component(java.lang.Class<?> clazz)
           
Component(java.lang.Class<?> clazz, Context applicationContext)
           
Component(java.lang.Class<?> clazz, java.lang.String componentName)
           
Component(java.lang.Class<?> clazz, java.lang.String componentName, ScopeType componentScope, boolean startup, java.lang.String[] dependencies, java.lang.String jndiName)
           
 
Method Summary
 void addInterceptor(Interceptor interceptor)
           
 void addInterceptor(java.lang.Object interceptorInstance)
           
 boolean beanClassHasAnnotation(java.lang.Class annotationType)
           
 boolean beanClassHasAnnotation(java.lang.String annotationName)
           
 boolean businessInterfaceHasAnnotation(java.lang.Class annotationType)
           
 java.lang.Object callComponentMethod(java.lang.Object instance, java.lang.reflect.Method method, java.lang.Object... parameters)
           
 void callCreateMethod(java.lang.Object instance)
           
 void callDestroyMethod(java.lang.Object instance)
           
 void callPostActivateMethod(java.lang.Object instance)
           
 void callPostConstructMethod(java.lang.Object instance)
           
 void callPreDestroyMethod(java.lang.Object instance)
           
 void callPrePassivateMethod(java.lang.Object instance)
           
protected  void checkPersistenceContextForComponentType()
           
protected  void checkSynchronizedForComponentType()
           
static java.lang.Class<javassist.util.proxy.ProxyObject> createProxyFactory(ComponentType type, java.lang.Class beanClass, java.util.Collection<java.lang.Class> businessInterfaces)
           
 java.util.List<java.lang.Object> createUserInterceptors(InterceptorType type)
           
 void destroy(java.lang.Object bean)
           
 void disinject(java.lang.Object bean)
          Null out any @In attributes of a component instance.
static Component forName(java.lang.String name)
           
 java.util.Set<java.lang.Class> getBusinessInterfaces()
           
static java.util.Set<java.lang.Class> getBusinessInterfaces(java.lang.Class clazz)
           
 java.util.List<Interceptor> getClientSideInterceptors()
          For use with Seam debug page.
static java.lang.String getComponentName(java.lang.Class<?> clazz)
           
 java.lang.reflect.Method getCreateMethod()
           
 java.lang.reflect.Method getDefaultRemoveMethod()
           
 java.lang.String[] getDependencies()
           
 java.lang.reflect.Method getDestroyMethod()
           
 java.util.Collection<Namespace> getImports()
           
 java.util.List<Component.BijectedAttribute<In>> getInAttributes()
           
static java.lang.Object getInstance(java.lang.Class<?> clazz)
           
static java.lang.Object getInstance(java.lang.Class<?> clazz, boolean create)
           
static java.lang.Object getInstance(java.lang.Class<?> clazz, ScopeType scope)
           
static java.lang.Object getInstance(java.lang.Class<?> clazz, ScopeType scope, boolean create)
           
static java.lang.Object getInstance(java.lang.String name)
           
static java.lang.Object getInstance(java.lang.String name, boolean create)
           
static java.lang.Object getInstance(java.lang.String name, boolean create, boolean allowAutocreation)
           
static java.lang.Object getInstance(java.lang.String name, ScopeType scope)
           
static java.lang.Object getInstance(java.lang.String name, ScopeType scope, boolean create)
           
static java.lang.Object getInstance(java.lang.String name, ScopeType scope, boolean create, boolean allowAutocreation)
           
static java.lang.Object getInstanceFromFactory(java.lang.String name)
           
 java.util.List<Interceptor> getInterceptors(InterceptorType type)
           
 java.lang.String getName()
           
 Namespace getNamespace()
           
 java.util.List<Component.BijectedAttribute<Out>> getOutAttributes()
           
 java.util.List<Component.BijectedAttribute> getPersistenceContextAttributes()
           
 java.lang.reflect.Method getPostActivateMethod()
           
 java.lang.reflect.Method getPostConstructMethod()
           
 java.lang.reflect.Method getPreDestroyMethod()
           
 java.lang.reflect.Method getPrePassivateMethod()
           
 java.lang.reflect.Method getRemoveMethod(java.lang.String name)
           
 java.util.Collection<java.lang.reflect.Method> getRemoveMethods()
           
 ScopeType getScope()
           
 java.util.List<Interceptor> getServerSideInterceptors()
          For use with Seam debug page.
 long getTimeout()
           
 ComponentType getType()
           
 java.lang.reflect.Method getUnwrapMethod()
           
 boolean hasConversationManagementMethods()
           
 boolean hasCreateMethod()
           
 boolean hasDefaultRemoveMethod()
           
 boolean hasDestroyMethod()
           
 boolean hasPostActivateMethod()
           
 boolean hasPostConstructMethod()
           
 boolean hasPreDestroyMethod()
           
 boolean hasPrePassivateMethod()
           
 boolean hasUnwrapMethod()
           
 void initialize(java.lang.Object bean)
           
 void inject(java.lang.Object bean, boolean enforceRequired)
          Inject context variable values into @In attributes of a component instance.
protected  java.lang.Object instantiate()
           
protected  java.lang.Object instantiateEntityBean()
           
protected  java.lang.Object instantiateJavaBean()
           
protected  java.lang.Object instantiateSessionBean()
           
 boolean isConversationManagementMethod(java.lang.reflect.Method method)
           
 boolean isInstance(java.lang.Object bean)
           
 boolean isInterceptionEnabled()
           
 boolean isLifecycleMethod(java.lang.reflect.Method method)
           
 boolean isPerNestedConversation()
           
 boolean isSecure()
           
 boolean isStartup()
           
 boolean isSynchronize()
           
 boolean needsInjection()
           
 boolean needsOutjection()
           
 java.lang.Object newInstance()
           
 void outject(java.lang.Object bean, boolean enforceRequired)
          Outject context variable values from @Out attributes of a component instance.
protected  void postConstruct(java.lang.Object bean)
           
protected  void postConstructEntityBean(java.lang.Object bean)
           
protected  void postConstructJavaBean(java.lang.Object bean)
           
protected  void postConstructSessionBean(java.lang.Object bean)
           
 java.lang.String toString()
           
 java.lang.Object wrap(java.lang.Object bean, javassist.util.proxy.MethodHandler interceptor)
          Wrap a Javassist interceptor around an instance of the component
 
Methods inherited from class org.jboss.seam.Model
forClass, getBeanClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROPERTIES

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

Component

public Component(java.lang.Class<?> clazz)

Component

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

Component

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

Component

public Component(java.lang.Class<?> clazz,
                 java.lang.String componentName,
                 ScopeType componentScope,
                 boolean startup,
                 java.lang.String[] dependencies,
                 java.lang.String jndiName)
Method Detail

checkSynchronizedForComponentType

protected void checkSynchronizedForComponentType()

checkPersistenceContextForComponentType

protected void checkPersistenceContextForComponentType()

addInterceptor

public void addInterceptor(java.lang.Object interceptorInstance)

addInterceptor

public void addInterceptor(Interceptor interceptor)

beanClassHasAnnotation

public boolean beanClassHasAnnotation(java.lang.Class annotationType)

beanClassHasAnnotation

public boolean beanClassHasAnnotation(java.lang.String annotationName)

businessInterfaceHasAnnotation

public boolean businessInterfaceHasAnnotation(java.lang.Class annotationType)

getName

public java.lang.String getName()

getType

public ComponentType getType()

getScope

public ScopeType getScope()

getInterceptors

public java.util.List<Interceptor> getInterceptors(InterceptorType type)

createUserInterceptors

public java.util.List<java.lang.Object> createUserInterceptors(InterceptorType type)

getServerSideInterceptors

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

Returns:
the server-side interceptor stack

getClientSideInterceptors

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

Returns:
the client-side interceptor stack

getDestroyMethod

public java.lang.reflect.Method getDestroyMethod()

getRemoveMethods

public java.util.Collection<java.lang.reflect.Method> getRemoveMethods()

getRemoveMethod

public java.lang.reflect.Method getRemoveMethod(java.lang.String name)

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 java.lang.reflect.Method getCreateMethod()

hasUnwrapMethod

public boolean hasUnwrapMethod()

getUnwrapMethod

public java.lang.reflect.Method getUnwrapMethod()

getOutAttributes

public java.util.List<Component.BijectedAttribute<Out>> getOutAttributes()

getInAttributes

public java.util.List<Component.BijectedAttribute<In>> getInAttributes()

needsInjection

public boolean needsInjection()

needsOutjection

public boolean needsOutjection()

instantiate

protected java.lang.Object instantiate()
                                throws java.lang.Exception
Throws:
java.lang.Exception

postConstruct

protected void postConstruct(java.lang.Object bean)
                      throws java.lang.Exception
Throws:
java.lang.Exception

instantiateSessionBean

protected java.lang.Object instantiateSessionBean()
                                           throws java.lang.Exception,
                                                  javax.naming.NamingException
Throws:
java.lang.Exception
javax.naming.NamingException

postConstructSessionBean

protected void postConstructSessionBean(java.lang.Object bean)
                                 throws java.lang.Exception,
                                        javax.naming.NamingException
Throws:
java.lang.Exception
javax.naming.NamingException

instantiateEntityBean

protected java.lang.Object instantiateEntityBean()
                                          throws java.lang.Exception
Throws:
java.lang.Exception

postConstructEntityBean

protected void postConstructEntityBean(java.lang.Object bean)
                                throws java.lang.Exception
Throws:
java.lang.Exception

instantiateJavaBean

protected java.lang.Object instantiateJavaBean()
                                        throws java.lang.Exception
Throws:
java.lang.Exception

postConstructJavaBean

protected void postConstructJavaBean(java.lang.Object bean)
                              throws java.lang.Exception
Throws:
java.lang.Exception

destroy

public void destroy(java.lang.Object bean)

wrap

public java.lang.Object wrap(java.lang.Object bean,
                             javassist.util.proxy.MethodHandler interceptor)
                      throws java.lang.Exception
Wrap a Javassist interceptor around an instance of the component

Throws:
java.lang.Exception

initialize

public void initialize(java.lang.Object bean)
                throws java.lang.Exception
Throws:
java.lang.Exception

inject

public void inject(java.lang.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(java.lang.Object bean)
Null out any @In attributes of a component instance.

Parameters:
bean - a Seam component instance

outject

public void outject(java.lang.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(java.lang.Object bean)

getBusinessInterfaces

public static java.util.Set<java.lang.Class> getBusinessInterfaces(java.lang.Class clazz)

getBusinessInterfaces

public java.util.Set<java.lang.Class> getBusinessInterfaces()

getComponentName

public static java.lang.String getComponentName(java.lang.Class<?> clazz)

forName

public static Component forName(java.lang.String name)

getInstance

public static java.lang.Object getInstance(java.lang.Class<?> clazz)

getInstance

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

getInstance

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

getInstance

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

getInstance

public static java.lang.Object getInstance(java.lang.String name)

getInstance

public static java.lang.Object getInstance(java.lang.String name,
                                           boolean create)

getInstance

public static java.lang.Object getInstance(java.lang.String name,
                                           boolean create,
                                           boolean allowAutocreation)

getInstance

public static java.lang.Object getInstance(java.lang.String name,
                                           ScopeType scope)

getInstance

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

getInstance

public static java.lang.Object getInstance(java.lang.String name,
                                           ScopeType scope,
                                           boolean create,
                                           boolean allowAutocreation)

getInstanceFromFactory

public static java.lang.Object getInstanceFromFactory(java.lang.String name)

newInstance

public java.lang.Object newInstance()

hasDefaultRemoveMethod

public boolean hasDefaultRemoveMethod()

getDefaultRemoveMethod

public java.lang.reflect.Method getDefaultRemoveMethod()

callCreateMethod

public void callCreateMethod(java.lang.Object instance)

callDestroyMethod

public void callDestroyMethod(java.lang.Object instance)

callPreDestroyMethod

public void callPreDestroyMethod(java.lang.Object instance)

callPostConstructMethod

public void callPostConstructMethod(java.lang.Object instance)

callPrePassivateMethod

public void callPrePassivateMethod(java.lang.Object instance)

callPostActivateMethod

public void callPostActivateMethod(java.lang.Object instance)

getPostActivateMethod

public java.lang.reflect.Method getPostActivateMethod()

getPrePassivateMethod

public java.lang.reflect.Method getPrePassivateMethod()

getPostConstructMethod

public java.lang.reflect.Method getPostConstructMethod()

getPreDestroyMethod

public java.lang.reflect.Method getPreDestroyMethod()

getTimeout

public long getTimeout()

callComponentMethod

public java.lang.Object callComponentMethod(java.lang.Object instance,
                                            java.lang.reflect.Method method,
                                            java.lang.Object... parameters)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

createProxyFactory

public static java.lang.Class<javassist.util.proxy.ProxyObject> createProxyFactory(ComponentType type,
                                                                                   java.lang.Class beanClass,
                                                                                   java.util.Collection<java.lang.Class> businessInterfaces)

isInterceptionEnabled

public boolean isInterceptionEnabled()

isStartup

public boolean isStartup()

isSynchronize

public boolean isSynchronize()

getDependencies

public java.lang.String[] getDependencies()

isLifecycleMethod

public boolean isLifecycleMethod(java.lang.reflect.Method method)

isConversationManagementMethod

public boolean isConversationManagementMethod(java.lang.reflect.Method method)

getPersistenceContextAttributes

public java.util.List<Component.BijectedAttribute> getPersistenceContextAttributes()

getImports

public java.util.Collection<Namespace> getImports()

getNamespace

public Namespace getNamespace()

isPerNestedConversation

public boolean isPerNestedConversation()

hasConversationManagementMethods

public boolean hasConversationManagementMethods()

isSecure

public boolean isSecure()


Copyright © 2011 Seam Framework. All Rights Reserved.