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 Annotation>
           
 
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, boolean startup, String[] dependencies, String jndiName)
           
 
Method Summary
 void addInterceptor(Interceptor interceptor)
           
 void addInterceptor(Object interceptorInstance)
           
 boolean beanClassHasAnnotation(Class annotationType)
           
 boolean beanClassHasAnnotation(String annotationName)
           
 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)
           
protected  void checkPersistenceContextForComponentType()
           
protected  void checkSynchronizedForComponentType()
           
static Class<javassist.util.proxy.ProxyObject> createProxyFactory(ComponentType type, Class beanClass, Collection<Class> businessInterfaces)
           
 List<Object> createUserInterceptors(InterceptorType type)
           
 void destroy(Object bean)
           
 void disinject(Object bean)
          Null out any @In attributes of a component instance.
static Component forName(String name)
           
 Set<Class> getBusinessInterfaces()
           
static Set<Class> getBusinessInterfaces(Class clazz)
           
 List<Interceptor> getClientSideInterceptors()
          For use with Seam debug page.
static String getComponentName(Class<?> clazz)
           
 Method getCreateMethod()
           
 Method getDefaultRemoveMethod()
           
 String[] getDependencies()
           
 Method getDestroyMethod()
           
 Collection<Namespace> getImports()
           
 List<Component.BijectedAttribute<In>> getInAttributes()
           
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, boolean create, boolean allowAutocreation)
           
static Object getInstance(String name, ScopeType scope)
           
static Object getInstance(String name, ScopeType scope, boolean create)
           
static Object getInstance(String name, ScopeType scope, boolean create, boolean allowAutocreation)
           
static Object getInstanceFromFactory(String name)
           
 List<Interceptor> getInterceptors(InterceptorType type)
           
 String getName()
           
 Namespace getNamespace()
           
 List<Component.BijectedAttribute<Out>> getOutAttributes()
           
 List<Component.BijectedAttribute> getPersistenceContextAttributes()
           
 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()
           
 boolean hasConversationManagementMethods()
           
 boolean hasCreateMethod()
           
 boolean hasDefaultRemoveMethod()
           
 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 isConversationManagementMethod(Method method)
           
 boolean isInstance(Object bean)
           
 boolean isInterceptionEnabled()
           
 boolean isLifecycleMethod(Method method)
           
 boolean isPerNestedConversation()
           
 boolean isSecure()
           
 boolean isStartup()
           
 boolean isSynchronize()
           
 boolean needsInjection()
           
 boolean needsOutjection()
           
 Object newInstance()
           
 void outject(Object bean, boolean enforceRequired)
          Outject context variable values from @Out attributes of a component instance.
protected  void postConstruct(Object bean)
           
protected  void postConstructEntityBean(Object bean)
           
protected  void postConstructJavaBean(Object bean)
           
protected  void postConstructSessionBean(Object bean)
           
 String toString()
           
 Object wrap(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 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,
                 boolean startup,
                 String[] dependencies,
                 String jndiName)
Method Detail

checkSynchronizedForComponentType

protected void checkSynchronizedForComponentType()

checkPersistenceContextForComponentType

protected void checkPersistenceContextForComponentType()

addInterceptor

public void addInterceptor(Object interceptorInstance)

addInterceptor

public void addInterceptor(Interceptor interceptor)

beanClassHasAnnotation

public boolean beanClassHasAnnotation(Class annotationType)

beanClassHasAnnotation

public boolean beanClassHasAnnotation(String annotationName)

businessInterfaceHasAnnotation

public boolean businessInterfaceHasAnnotation(Class annotationType)

getName

public String getName()

getType

public ComponentType getType()

getScope

public ScopeType getScope()

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)

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()

getOutAttributes

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

getInAttributes

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

needsInjection

public boolean needsInjection()

needsOutjection

public boolean needsOutjection()

instantiate

protected Object instantiate()
                      throws Exception
Throws:
Exception

postConstruct

protected void postConstruct(Object bean)
                      throws Exception
Throws:
Exception

instantiateSessionBean

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

postConstructSessionBean

protected void postConstructSessionBean(Object bean)
                                 throws Exception,
                                        NamingException
Throws:
Exception
NamingException

instantiateEntityBean

protected Object instantiateEntityBean()
                                throws Exception
Throws:
Exception

postConstructEntityBean

protected void postConstructEntityBean(Object bean)
                                throws Exception
Throws:
Exception

instantiateJavaBean

protected Object instantiateJavaBean()
                              throws Exception
Throws:
Exception

postConstructJavaBean

protected void postConstructJavaBean(Object bean)
                              throws Exception
Throws:
Exception

destroy

public void destroy(Object bean)

wrap

public Object wrap(Object bean,
                   javassist.util.proxy.MethodHandler interceptor)
            throws Exception
Wrap a Javassist 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()

getComponentName

public static String getComponentName(Class<?> clazz)

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,
                                 boolean create,
                                 boolean allowAutocreation)

getInstance

public static Object getInstance(String name,
                                 ScopeType scope)

getInstance

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

getInstance

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

getInstanceFromFactory

public static Object getInstanceFromFactory(String name)

newInstance

public Object newInstance()

hasDefaultRemoveMethod

public boolean hasDefaultRemoveMethod()

getDefaultRemoveMethod

public Method getDefaultRemoveMethod()

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)

getPostActivateMethod

public Method getPostActivateMethod()

getPrePassivateMethod

public Method getPrePassivateMethod()

getPostConstructMethod

public Method getPostConstructMethod()

getPreDestroyMethod

public Method getPreDestroyMethod()

getTimeout

public long getTimeout()

callComponentMethod

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

toString

public String toString()
Overrides:
toString in class Object

createProxyFactory

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

isInterceptionEnabled

public boolean isInterceptionEnabled()

isStartup

public boolean isStartup()

isSynchronize

public boolean isSynchronize()

getDependencies

public String[] getDependencies()

isLifecycleMethod

public boolean isLifecycleMethod(Method method)

isConversationManagementMethod

public boolean isConversationManagementMethod(Method method)

getPersistenceContextAttributes

public List<Component.BijectedAttribute> getPersistenceContextAttributes()

getImports

public 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.