Top Inners Fields Constructors Methods
org.jvnet.hk2.internal

public Class ConstructorInterceptorHandler

extends Object
Class Inheritance
Imports
java.lang.reflect.AccessibleObject, .Constructor, java.util.ArrayList, .HashMap, .List, .RandomAccess, org.aopalliance.intercept.ConstructorInterceptor, .ConstructorInvocation, org.glassfish.hk2.api.HK2Invocation, org.glassfish.hk2.utilities.reflection.ReflectionHelper

Author
jwells

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private static final ConstructorAction

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static Object

Returns:

The constructed object (as massaged by the interceptors)
construct
(Constructor<?>
The constructor to invoke
c
,
Object[]
The arguments to give to the constructor (intially)
args
,
boolean
Whether or not CCL should be neutral around calls to the constructor
neutralCCL
,
List<ConstructorInterceptor>
The set of interceptors (may be null or empty)
interceptors
,
ConstructorAction
The action to perform to construct the object
action
)

Call this to construct objects taking constructor interceptors into consideration

public static Object

Returns:

The constructed object (as massaged by the interceptors)
construct
(Constructor<?>
The constructor to invoke
c
,
Object[]
The arguments to give to the constructor (intially)
args
,
boolean
Whether or not CCL should be neutral around calls to the constructor
neutralCCL
,
List<ConstructorInterceptor>
The set of interceptors (may be null or empty)
interceptors
)

Call this to construct objects taking constructor interceptors into consideration

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_ACTIONback to summary
private static final ConstructorAction DEFAULT_ACTION

Constructor Detail

ConstructorInterceptorHandlerback to summary
public ConstructorInterceptorHandler()

Method Detail

constructback to summary
public static Object construct(Constructor<?> c, Object[] args, boolean neutralCCL, List<ConstructorInterceptor> interceptors, ConstructorAction action) throws Throwable

Call this to construct objects taking constructor interceptors into consideration

Parameters
c:Constructor<?>

The constructor to invoke

args:Object[]

The arguments to give to the constructor (intially)

neutralCCL:boolean

Whether or not CCL should be neutral around calls to the constructor

interceptors:List<ConstructorInterceptor>

The set of interceptors (may be null or empty)

action:ConstructorAction

The action to perform to construct the object

Returns:Object

The constructed object (as massaged by the interceptors)

Exceptions
Throwable:
On error
constructback to summary
public static Object construct(Constructor<?> c, Object[] args, boolean neutralCCL, List<ConstructorInterceptor> interceptors) throws Throwable

Call this to construct objects taking constructor interceptors into consideration

Parameters
c:Constructor<?>

The constructor to invoke

args:Object[]

The arguments to give to the constructor (intially)

neutralCCL:boolean

Whether or not CCL should be neutral around calls to the constructor

interceptors:List<ConstructorInterceptor>

The set of interceptors (may be null or empty)

Returns:Object

The constructed object (as massaged by the interceptors)

Exceptions
Throwable:
On error
org.jvnet.hk2.internal back to summary

private Class ConstructorInterceptorHandler.ConstructorInvocationImpl

extends Object
implements ConstructorInvocation, HK2Invocation
Class Inheritance
  • java.lang.Object
  • org.jvnet.hk2.internal.ConstructorInterceptorHandler.ConstructorInvocationImpl
All Implemented Interfaces
org.glassfish.hk2.api.HK2Invocation, org.aopalliance.intercept.ConstructorInvocation, org.aopalliance.intercept.Invocation, org.aopalliance.intercept.Joinpoint

Field Summary

Modifier and TypeField and Description
private final Object[]
private final Constructor<?>
c

private final ConstructorAction
private final int
private final List<ConstructorInterceptor>
private Object
private final boolean
private HashMap<String, Object>

Constructor Summary

AccessConstructor and Description
private
ConstructorInvocationImpl(Constructor<?> c, Object[] args, boolean neutralCCL, ConstructorAction finalAction, int index, List<ConstructorInterceptor> interceptors, HashMap<String, Object> userData)

Method Summary

Modifier and TypeMethod and Description
public Object[]
getArguments()

Implements org.aopalliance.intercept.Invocation.getArguments.

Get the arguments as an array object.

public Constructor<T>
public AccessibleObject
getStaticPart()

Implements org.aopalliance.intercept.Joinpoint.getStaticPart.

Return the static part of this joinpoint.

public Object
getThis()

Implements org.aopalliance.intercept.Joinpoint.getThis.

Return the object that holds the current joinpoint's static part.

public Object
getUserData(String key)

Implements org.glassfish.hk2.api.HK2Invocation.getUserData.

Gets the user data associated with the given key

public Object
proceed()

Implements org.aopalliance.intercept.Joinpoint.proceed.

Proceed to the next interceptor in the chain.

public void
setUserData(String key, Object data)

Implements org.glassfish.hk2.api.HK2Invocation.setUserData.

Sets the user data to be associated with the invocation frame.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

argsback to summary
private final Object[] args
cback to summary
private final Constructor<?> c
finalActionback to summary
private final ConstructorAction finalAction
indexback to summary
private final int index
interceptorsback to summary
private final List<ConstructorInterceptor> interceptors
myThisback to summary
private Object myThis
neutralCCLback to summary
private final boolean neutralCCL
userDataback to summary
private HashMap<String, Object> userData

Constructor Detail

ConstructorInvocationImplback to summary
private ConstructorInvocationImpl(Constructor<?> c, Object[] args, boolean neutralCCL, ConstructorAction finalAction, int index, List<ConstructorInterceptor> interceptors, HashMap<String, Object> userData)

Method Detail

getArgumentsback to summary
public Object[] getArguments()

Implements org.aopalliance.intercept.Invocation.getArguments.

Doc from org.aopalliance.intercept.Invocation.getArguments.

Get the arguments as an array object. It is possible to change element values within this array to change the arguments.

Annotations
@Override
getConstructorback to summary
public Constructor<T> getConstructor()

Implements org.aopalliance.intercept.ConstructorInvocation.getConstructor.

Doc from org.aopalliance.intercept.ConstructorInvocation.getConstructor.

Get the constructor being called.

This method is a friendly implementation of the Joinpoint#getStaticPart() method (same result).

Annotations
@SuppressWarnings:rawtypes
@Override
getStaticPartback to summary
public AccessibleObject getStaticPart()

Implements org.aopalliance.intercept.Joinpoint.getStaticPart.

Doc from org.aopalliance.intercept.Joinpoint.getStaticPart.

Return the static part of this joinpoint.

The static part is an accessible object on which a chain of interceptors is installed.

Annotations
@Override
getThisback to summary
public Object getThis()

Implements org.aopalliance.intercept.Joinpoint.getThis.

Doc from org.aopalliance.intercept.Joinpoint.getThis.

Return the object that holds the current joinpoint's static part.

For instance, the target object for an invocation.

Annotations
@Override
getUserDataback to summary
public Object getUserData(String key)

Implements org.glassfish.hk2.api.HK2Invocation.getUserData.

Doc from org.glassfish.hk2.api.HK2Invocation.getUserData.

Gets the user data associated with the given key

Annotations
@Override
proceedback to summary
public Object proceed() throws Throwable

Implements org.aopalliance.intercept.Joinpoint.proceed.

Doc from org.aopalliance.intercept.Joinpoint.proceed.

Proceed to the next interceptor in the chain.

The implementation and the semantics of this method depends on the actual joinpoint type (see the children interfaces).

Annotations
@Override
Exceptions
Throwable:
if the joinpoint throws an exception
setUserDataback to summary
public void setUserData(String key, Object data)

Implements org.glassfish.hk2.api.HK2Invocation.setUserData.

Doc from org.glassfish.hk2.api.HK2Invocation.setUserData.

Sets the user data to be associated with the invocation frame. The key may not be null. If data is null then the data associated with the key is removed

Annotations
@Override