站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss Seam 1.2.0 patch1 API 英文版文档

Component (JBoss Seam API Documentation) - JBoss Seam 1.2.0 patch1 API 英文版文档


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>
           
 class Component.BijectedField<T extends Annotation>
           
 class Component.BijectedMethod<T extends Annotation>
           
static class Component.ConstantInitialValue
           
static class Component.ELInitialValue
           
static interface Component.InitialValue
           
static class Component.ListInitialValue
           
static class Component.MapInitialValue
           
 
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)
           
 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()
           
 String[] getDependencies()
           
 Method getDestroyMethod()
           
 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, 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()
           
 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()
           
 Set<Method> getValidateMethods()
           
 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 isConversationManagementMethod(Method method)
           
 boolean isInstance(Object bean)
           
 boolean isLifecycleMethod(Method method)
           
 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 org.jboss.seam.Model
forClass, getBeanClass, getValidator
 
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)

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)

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

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

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

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

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

isLifecycleMethod

public boolean isLifecycleMethod(Method method)

isConversationManagementMethod

public boolean isConversationManagementMethod(Method method)

getPersistenceContextAttributes

public List<Component.BijectedAttribute> getPersistenceContextAttributes()