Package org.jboss.weld.bean.proxy
Class DefaultProxyInstantiator
- java.lang.Object
-
- org.jboss.weld.bean.proxy.DefaultProxyInstantiator
-
- All Implemented Interfaces:
ProxyInstantiator,org.jboss.weld.bootstrap.api.Service
public final class DefaultProxyInstantiator extends Object implements ProxyInstantiator
DefaultProxyInstantiatorimplementation that uses proxy class' no-arg constructor to create a new instance.- Author:
- Jozef Hartinger
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jboss.weld.bean.proxy.ProxyInstantiator
ProxyInstantiator.Factory
-
-
Field Summary
Fields Modifier and Type Field Description static ProxyInstantiatorINSTANCE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanup()booleanisUsingConstructor()Indicates whether this instantiator calls proxy class' no-arg constructor or whether it uses an alternative mechanism to obtain a proxy class instance.<T> TnewInstance(Class<T> clazz)Create a new instance of a proxy class.<T> UnproxyableResolutionExceptionvalidateNoargConstructor(Constructor<T> constructor, Class<?> clazz, Bean<?> declaringBean)Validate, whether the given constructor is sufficient for a class to be proxyable.
-
-
-
Field Detail
-
INSTANCE
public static final ProxyInstantiator INSTANCE
-
-
Method Detail
-
newInstance
public <T> T newInstance(Class<T> clazz) throws InstantiationException, IllegalAccessException
Description copied from interface:ProxyInstantiatorCreate a new instance of a proxy class. This method needs to be run from a privileged context.- Specified by:
newInstancein interfaceProxyInstantiator- Type Parameters:
T- the proxy class- Parameters:
clazz- the class- Returns:
- an instance of a proxy class
- Throws:
InstantiationExceptionIllegalAccessException
-
validateNoargConstructor
public <T> UnproxyableResolutionException validateNoargConstructor(Constructor<T> constructor, Class<?> clazz, Bean<?> declaringBean) throws UnproxyableResolutionException
Description copied from interface:ProxyInstantiatorValidate, whether the given constructor is sufficient for a class to be proxyable.- Specified by:
validateNoargConstructorin interfaceProxyInstantiator- Parameters:
constructor- the given constructorclazz- the given classdeclaringBean- the declaring bean- Returns:
- an
UnproxyableResolutionExceptionif the given class is not proxyable due to the given constructor, null otherwise - Throws:
UnproxyableResolutionException
-
isUsingConstructor
public boolean isUsingConstructor()
Description copied from interface:ProxyInstantiatorIndicates whether this instantiator calls proxy class' no-arg constructor or whether it uses an alternative mechanism to obtain a proxy class instance.- Specified by:
isUsingConstructorin interfaceProxyInstantiator- Returns:
- true if this implementation uses proxy class' no-arg constructor for creating new instances, false otherwise
-
cleanup
public void cleanup()
- Specified by:
cleanupin interfaceorg.jboss.weld.bootstrap.api.Service
-
-