Class InterceptorList


  • public class InterceptorList
    extends java.lang.Object
    Provides 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.
    • Constructor Detail

      • InterceptorList

        InterceptorList()
        Creates a new Interceptor List. Constructor is package scope so only the ORB can create it.
    • 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.