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
DefaultProxyInstantiator
implementation 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 ProxyInstantiator
INSTANCE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cleanup()
boolean
isUsingConstructor()
Indicates whether this instantiator calls proxy class' no-arg constructor or whether it uses an alternative mechanism to obtain a proxy class instance.<T> T
newInstance(Class<T> clazz)
Create a new instance of a proxy class.<T> UnproxyableResolutionException
validateNoargConstructor(Constructor<T> constructor, Class<?> clazz, jakarta.enterprise.inject.spi.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:ProxyInstantiator
Create a new instance of a proxy class. This method needs to be run from a privileged context.- Specified by:
newInstance
in interfaceProxyInstantiator
- Type Parameters:
T
- the proxy class- Parameters:
clazz
- the class- Returns:
- an instance of a proxy class
- Throws:
InstantiationException
IllegalAccessException
-
validateNoargConstructor
public <T> UnproxyableResolutionException validateNoargConstructor(Constructor<T> constructor, Class<?> clazz, jakarta.enterprise.inject.spi.Bean<?> declaringBean) throws UnproxyableResolutionException
Description copied from interface:ProxyInstantiator
Validate, whether the given constructor is sufficient for a class to be proxyable.- Specified by:
validateNoargConstructor
in interfaceProxyInstantiator
- Parameters:
constructor
- the given constructorclazz
- the given classdeclaringBean
- the declaring bean- Returns:
- an
UnproxyableResolutionException
if the given class is not proxyable due to the given constructor, null otherwise - Throws:
UnproxyableResolutionException
-
isUsingConstructor
public boolean isUsingConstructor()
Description copied from interface:ProxyInstantiator
Indicates whether this instantiator calls proxy class' no-arg constructor or whether it uses an alternative mechanism to obtain a proxy class instance.- Specified by:
isUsingConstructor
in interfaceProxyInstantiator
- Returns:
- true if this implementation uses proxy class' no-arg constructor for creating new instances, false otherwise
-
cleanup
public void cleanup()
- Specified by:
cleanup
in interfaceorg.jboss.weld.bootstrap.api.Service
-
-