Class InterceptorList
- java.lang.Object
-
- com.sun.corba.ee.impl.interceptors.InterceptorList
-
public class InterceptorList extends java.lang.ObjectProvides a repository of registered Portable Interceptors, organized by type. This list is designed to be accessed as efficiently as possible during runtime, with the expense of added complexity during initialization and interceptor registration. The class is designed to easily allow for the addition of new interceptor types.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.lang.Class[]classTypes(package private) static intINTERCEPTOR_TYPE_CLIENT(package private) static intINTERCEPTOR_TYPE_IOR(package private) static intINTERCEPTOR_TYPE_SERVERprivate Interceptor[][]interceptorsprivate booleanlocked(package private) static intNUM_INTERCEPTOR_TYPESprivate static InterceptorsSystemExceptionwrapper
-
Constructor Summary
Constructors Constructor Description InterceptorList()Creates a new Interceptor List.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voiddestroyAll()Destroys all interceptors in this list by invoking their destroy() method.(package private) Interceptor[]getInterceptors(int type)Retrieves an array of interceptors of the given type.private voidgrowInterceptorArray(int type)Grows the given interceptor array by one:(package private) booleanhasInterceptorsOfType(int type)Returns true if there is at least one interceptor of the given type, or false if not.private voidinitInterceptorArrays()Initializes all interceptors arrays to zero-length arrays of the correct type, based on the classTypes list.(package private) voidlock()Locks this interceptor list so that no more interceptors may be registered.(package private) voidregister_interceptor(Interceptor interceptor, int type)Registers an interceptor of the given type into the interceptor list.(package private) voidsortInterceptors()Sort interceptors.
-
-
-
Field Detail
-
wrapper
private static final InterceptorsSystemException wrapper
-
INTERCEPTOR_TYPE_CLIENT
static final int INTERCEPTOR_TYPE_CLIENT
- See Also:
- Constant Field Values
-
INTERCEPTOR_TYPE_SERVER
static final int INTERCEPTOR_TYPE_SERVER
- See Also:
- Constant Field Values
-
INTERCEPTOR_TYPE_IOR
static final int INTERCEPTOR_TYPE_IOR
- See Also:
- Constant Field Values
-
NUM_INTERCEPTOR_TYPES
static final int NUM_INTERCEPTOR_TYPES
- See Also:
- Constant Field Values
-
classTypes
static final java.lang.Class[] classTypes
-
locked
private boolean locked
-
interceptors
private Interceptor[][] interceptors
-
-
Method Detail
-
register_interceptor
void register_interceptor(Interceptor interceptor, int type) throws DuplicateName
Registers an interceptor of the given type into the interceptor list. The type is one of:- INTERCEPTOR_TYPE_CLIENT - ClientRequestInterceptor
- INTERCEPTOR_TYPE_SERVER - ServerRequestInterceptor
- INTERCEPTOR_TYPE_IOR - IORInterceptor
- Throws:
DuplicateName- Thrown if an interceptor of the given name already exists for the given type.
-
lock
void lock()
Locks this interceptor list so that no more interceptors may be registered. This method is called after all interceptors are registered for security reasons.
-
getInterceptors
Interceptor[] getInterceptors(int type)
Retrieves an array of interceptors of the given type. For efficiency, the type parameter is assumed to be valid.
-
hasInterceptorsOfType
boolean hasInterceptorsOfType(int type)
Returns true if there is at least one interceptor of the given type, or false if not.
-
initInterceptorArrays
private void initInterceptorArrays()
Initializes all interceptors arrays to zero-length arrays of the correct type, based on the classTypes list.
-
growInterceptorArray
private void growInterceptorArray(int type)
Grows the given interceptor array by one:
-
destroyAll
void destroyAll()
Destroys all interceptors in this list by invoking their destroy() method.
-
sortInterceptors
void sortInterceptors()
Sort interceptors.
-
-