Java Code Examples for org.omg.PortableInterceptor.Interceptor#name()

The following examples show how to use org.omg.PortableInterceptor.Interceptor#name() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PIHandlerImpl.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Called by ORBInitInfo when an interceptor needs to be registered.
 * The type is one of:
 * <ul>
 *   <li>INTERCEPTOR_TYPE_CLIENT - ClientRequestInterceptor
 *   <li>INTERCEPTOR_TYPE_SERVER - ServerRequestInterceptor
 *   <li>INTERCEPTOR_TYPE_IOR - IORInterceptor
 * </ul>
 *
 * @exception DuplicateName Thrown if an interceptor of the given
 *     name already exists for the given type.
 */
public void register_interceptor( Interceptor interceptor, int type )
    throws DuplicateName
{
    // We will assume interceptor is not null, since it is called
    // internally.
    if( (type >= InterceptorList.NUM_INTERCEPTOR_TYPES) || (type < 0) ) {
        throw wrapper.typeOutOfRange( new Integer( type ) ) ;
    }

    String interceptorName = interceptor.name();

    if( interceptorName == null ) {
        throw wrapper.nameNull() ;
    }

    // Register with interceptor list:
    interceptorList.register_interceptor( interceptor, type );
}
 
Example 2
Source File: PIHandlerImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Called by ORBInitInfo when an interceptor needs to be registered.
 * The type is one of:
 * <ul>
 *   <li>INTERCEPTOR_TYPE_CLIENT - ClientRequestInterceptor
 *   <li>INTERCEPTOR_TYPE_SERVER - ServerRequestInterceptor
 *   <li>INTERCEPTOR_TYPE_IOR - IORInterceptor
 * </ul>
 *
 * @exception DuplicateName Thrown if an interceptor of the given
 *     name already exists for the given type.
 */
public void register_interceptor( Interceptor interceptor, int type )
    throws DuplicateName
{
    // We will assume interceptor is not null, since it is called
    // internally.
    if( (type >= InterceptorList.NUM_INTERCEPTOR_TYPES) || (type < 0) ) {
        throw wrapper.typeOutOfRange( new Integer( type ) ) ;
    }

    String interceptorName = interceptor.name();

    if( interceptorName == null ) {
        throw wrapper.nameNull() ;
    }

    // Register with interceptor list:
    interceptorList.register_interceptor( interceptor, type );
}
 
Example 3
Source File: PIHandlerImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Called by ORBInitInfo when an interceptor needs to be registered.
 * The type is one of:
 * <ul>
 *   <li>INTERCEPTOR_TYPE_CLIENT - ClientRequestInterceptor
 *   <li>INTERCEPTOR_TYPE_SERVER - ServerRequestInterceptor
 *   <li>INTERCEPTOR_TYPE_IOR - IORInterceptor
 * </ul>
 *
 * @exception DuplicateName Thrown if an interceptor of the given
 *     name already exists for the given type.
 */
public void register_interceptor( Interceptor interceptor, int type )
    throws DuplicateName
{
    // We will assume interceptor is not null, since it is called
    // internally.
    if( (type >= InterceptorList.NUM_INTERCEPTOR_TYPES) || (type < 0) ) {
        throw wrapper.typeOutOfRange( new Integer( type ) ) ;
    }

    String interceptorName = interceptor.name();

    if( interceptorName == null ) {
        throw wrapper.nameNull() ;
    }

    // Register with interceptor list:
    interceptorList.register_interceptor( interceptor, type );
}
 
Example 4
Source File: PIHandlerImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Called by ORBInitInfo when an interceptor needs to be registered.
 * The type is one of:
 * <ul>
 *   <li>INTERCEPTOR_TYPE_CLIENT - ClientRequestInterceptor
 *   <li>INTERCEPTOR_TYPE_SERVER - ServerRequestInterceptor
 *   <li>INTERCEPTOR_TYPE_IOR - IORInterceptor
 * </ul>
 *
 * @exception DuplicateName Thrown if an interceptor of the given
 *     name already exists for the given type.
 */
public void register_interceptor( Interceptor interceptor, int type )
    throws DuplicateName
{
    // We will assume interceptor is not null, since it is called
    // internally.
    if( (type >= InterceptorList.NUM_INTERCEPTOR_TYPES) || (type < 0) ) {
        throw wrapper.typeOutOfRange( new Integer( type ) ) ;
    }

    String interceptorName = interceptor.name();

    if( interceptorName == null ) {
        throw wrapper.nameNull() ;
    }

    // Register with interceptor list:
    interceptorList.register_interceptor( interceptor, type );
}
 
Example 5
Source File: PIHandlerImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Called by ORBInitInfo when an interceptor needs to be registered.
 * The type is one of:
 * <ul>
 *   <li>INTERCEPTOR_TYPE_CLIENT - ClientRequestInterceptor
 *   <li>INTERCEPTOR_TYPE_SERVER - ServerRequestInterceptor
 *   <li>INTERCEPTOR_TYPE_IOR - IORInterceptor
 * </ul>
 *
 * @exception DuplicateName Thrown if an interceptor of the given
 *     name already exists for the given type.
 */
public void register_interceptor( Interceptor interceptor, int type )
    throws DuplicateName
{
    // We will assume interceptor is not null, since it is called
    // internally.
    if( (type >= InterceptorList.NUM_INTERCEPTOR_TYPES) || (type < 0) ) {
        throw wrapper.typeOutOfRange( new Integer( type ) ) ;
    }

    String interceptorName = interceptor.name();

    if( interceptorName == null ) {
        throw wrapper.nameNull() ;
    }

    // Register with interceptor list:
    interceptorList.register_interceptor( interceptor, type );
}
 
Example 6
Source File: PIHandlerImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Called by ORBInitInfo when an interceptor needs to be registered.
 * The type is one of:
 * <ul>
 *   <li>INTERCEPTOR_TYPE_CLIENT - ClientRequestInterceptor
 *   <li>INTERCEPTOR_TYPE_SERVER - ServerRequestInterceptor
 *   <li>INTERCEPTOR_TYPE_IOR - IORInterceptor
 * </ul>
 *
 * @exception DuplicateName Thrown if an interceptor of the given
 *     name already exists for the given type.
 */
public void register_interceptor( Interceptor interceptor, int type )
    throws DuplicateName
{
    // We will assume interceptor is not null, since it is called
    // internally.
    if( (type >= InterceptorList.NUM_INTERCEPTOR_TYPES) || (type < 0) ) {
        throw wrapper.typeOutOfRange( new Integer( type ) ) ;
    }

    String interceptorName = interceptor.name();

    if( interceptorName == null ) {
        throw wrapper.nameNull() ;
    }

    // Register with interceptor list:
    interceptorList.register_interceptor( interceptor, type );
}
 
Example 7
Source File: PIHandlerImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Called by ORBInitInfo when an interceptor needs to be registered.
 * The type is one of:
 * <ul>
 *   <li>INTERCEPTOR_TYPE_CLIENT - ClientRequestInterceptor
 *   <li>INTERCEPTOR_TYPE_SERVER - ServerRequestInterceptor
 *   <li>INTERCEPTOR_TYPE_IOR - IORInterceptor
 * </ul>
 *
 * @exception DuplicateName Thrown if an interceptor of the given
 *     name already exists for the given type.
 */
public void register_interceptor( Interceptor interceptor, int type )
    throws DuplicateName
{
    // We will assume interceptor is not null, since it is called
    // internally.
    if( (type >= InterceptorList.NUM_INTERCEPTOR_TYPES) || (type < 0) ) {
        throw wrapper.typeOutOfRange( new Integer( type ) ) ;
    }

    String interceptorName = interceptor.name();

    if( interceptorName == null ) {
        throw wrapper.nameNull() ;
    }

    // Register with interceptor list:
    interceptorList.register_interceptor( interceptor, type );
}
 
Example 8
Source File: PIHandlerImpl.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Called by ORBInitInfo when an interceptor needs to be registered.
 * The type is one of:
 * <ul>
 *   <li>INTERCEPTOR_TYPE_CLIENT - ClientRequestInterceptor
 *   <li>INTERCEPTOR_TYPE_SERVER - ServerRequestInterceptor
 *   <li>INTERCEPTOR_TYPE_IOR - IORInterceptor
 * </ul>
 *
 * @exception DuplicateName Thrown if an interceptor of the given
 *     name already exists for the given type.
 */
public void register_interceptor( Interceptor interceptor, int type )
    throws DuplicateName
{
    // We will assume interceptor is not null, since it is called
    // internally.
    if( (type >= InterceptorList.NUM_INTERCEPTOR_TYPES) || (type < 0) ) {
        throw wrapper.typeOutOfRange( new Integer( type ) ) ;
    }

    String interceptorName = interceptor.name();

    if( interceptorName == null ) {
        throw wrapper.nameNull() ;
    }

    // Register with interceptor list:
    interceptorList.register_interceptor( interceptor, type );
}
 
Example 9
Source File: PIHandlerImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Called by ORBInitInfo when an interceptor needs to be registered.
 * The type is one of:
 * <ul>
 *   <li>INTERCEPTOR_TYPE_CLIENT - ClientRequestInterceptor
 *   <li>INTERCEPTOR_TYPE_SERVER - ServerRequestInterceptor
 *   <li>INTERCEPTOR_TYPE_IOR - IORInterceptor
 * </ul>
 *
 * @exception DuplicateName Thrown if an interceptor of the given
 *     name already exists for the given type.
 */
public void register_interceptor( Interceptor interceptor, int type )
    throws DuplicateName
{
    // We will assume interceptor is not null, since it is called
    // internally.
    if( (type >= InterceptorList.NUM_INTERCEPTOR_TYPES) || (type < 0) ) {
        throw wrapper.typeOutOfRange( new Integer( type ) ) ;
    }

    String interceptorName = interceptor.name();

    if( interceptorName == null ) {
        throw wrapper.nameNull() ;
    }

    // Register with interceptor list:
    interceptorList.register_interceptor( interceptor, type );
}
 
Example 10
Source File: PIHandlerImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Called by ORBInitInfo when an interceptor needs to be registered.
 * The type is one of:
 * <ul>
 *   <li>INTERCEPTOR_TYPE_CLIENT - ClientRequestInterceptor
 *   <li>INTERCEPTOR_TYPE_SERVER - ServerRequestInterceptor
 *   <li>INTERCEPTOR_TYPE_IOR - IORInterceptor
 * </ul>
 *
 * @exception DuplicateName Thrown if an interceptor of the given
 *     name already exists for the given type.
 */
public void register_interceptor( Interceptor interceptor, int type )
    throws DuplicateName
{
    // We will assume interceptor is not null, since it is called
    // internally.
    if( (type >= InterceptorList.NUM_INTERCEPTOR_TYPES) || (type < 0) ) {
        throw wrapper.typeOutOfRange( new Integer( type ) ) ;
    }

    String interceptorName = interceptor.name();

    if( interceptorName == null ) {
        throw wrapper.nameNull() ;
    }

    // Register with interceptor list:
    interceptorList.register_interceptor( interceptor, type );
}
 
Example 11
Source File: InterceptorList.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Registers an interceptor of the given type into the interceptor list.
 * The type is one of:
 * <ul>
 *   <li>INTERCEPTOR_TYPE_CLIENT - ClientRequestInterceptor
 *   <li>INTERCEPTOR_TYPE_SERVER - ServerRequestInterceptor
 *   <li>INTERCEPTOR_TYPE_IOR - IORInterceptor
 * </ul>
 *
 * @exception DuplicateName Thrown if an interceptor of the given
 *     name already exists for the given type.
 */
void register_interceptor( Interceptor interceptor, int type )
    throws DuplicateName
{
    // If locked, deny any further addition of interceptors.
    if( locked ) {
        throw wrapper.interceptorListLocked() ;
    }

    // Cache interceptor name:
    String interceptorName = interceptor.name();
    boolean anonymous = interceptorName.equals( "" );
    boolean foundDuplicate = false;
    Interceptor[] interceptorList = interceptors[type];

    // If this is not an anonymous interceptor,
    // search for an interceptor of the same name in this category:
    if( !anonymous ) {
        int size = interceptorList.length;

        // An O(n) search will suffice because register_interceptor is not
        // likely to be called often.
        for( int i = 0; i < size; i++ ) {
            Interceptor in = (Interceptor)interceptorList[i];
            if( in.name().equals( interceptorName ) ) {
                foundDuplicate = true;
                break;
            }
        }
    }

    if( !foundDuplicate ) {
        growInterceptorArray( type );
        interceptors[type][interceptors[type].length-1] = interceptor;
    }
    else {
        throw new DuplicateName( interceptorName );
    }
}
 
Example 12
Source File: InterceptorList.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * Registers an interceptor of the given type into the interceptor list.
 * The type is one of:
 * <ul>
 *   <li>INTERCEPTOR_TYPE_CLIENT - ClientRequestInterceptor
 *   <li>INTERCEPTOR_TYPE_SERVER - ServerRequestInterceptor
 *   <li>INTERCEPTOR_TYPE_IOR - IORInterceptor
 * </ul>
 *
 * @exception DuplicateName Thrown if an interceptor of the given
 *     name already exists for the given type.
 */
void register_interceptor( Interceptor interceptor, int type )
    throws DuplicateName
{
    // If locked, deny any further addition of interceptors.
    if( locked ) {
        throw wrapper.interceptorListLocked() ;
    }

    // Cache interceptor name:
    String interceptorName = interceptor.name();
    boolean anonymous = interceptorName.equals( "" );
    boolean foundDuplicate = false;
    Interceptor[] interceptorList = interceptors[type];

    // If this is not an anonymous interceptor,
    // search for an interceptor of the same name in this category:
    if( !anonymous ) {
        int size = interceptorList.length;

        // An O(n) search will suffice because register_interceptor is not
        // likely to be called often.
        for( int i = 0; i < size; i++ ) {
            Interceptor in = (Interceptor)interceptorList[i];
            if( in.name().equals( interceptorName ) ) {
                foundDuplicate = true;
                break;
            }
        }
    }

    if( !foundDuplicate ) {
        growInterceptorArray( type );
        interceptors[type][interceptors[type].length-1] = interceptor;
    }
    else {
        throw new DuplicateName( interceptorName );
    }
}
 
Example 13
Source File: InterceptorList.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Registers an interceptor of the given type into the interceptor list.
 * The type is one of:
 * <ul>
 *   <li>INTERCEPTOR_TYPE_CLIENT - ClientRequestInterceptor
 *   <li>INTERCEPTOR_TYPE_SERVER - ServerRequestInterceptor
 *   <li>INTERCEPTOR_TYPE_IOR - IORInterceptor
 * </ul>
 *
 * @exception DuplicateName Thrown if an interceptor of the given
 *     name already exists for the given type.
 */
void register_interceptor( Interceptor interceptor, int type )
    throws DuplicateName
{
    // If locked, deny any further addition of interceptors.
    if( locked ) {
        throw wrapper.interceptorListLocked() ;
    }

    // Cache interceptor name:
    String interceptorName = interceptor.name();
    boolean anonymous = interceptorName.equals( "" );
    boolean foundDuplicate = false;
    Interceptor[] interceptorList = interceptors[type];

    // If this is not an anonymous interceptor,
    // search for an interceptor of the same name in this category:
    if( !anonymous ) {
        int size = interceptorList.length;

        // An O(n) search will suffice because register_interceptor is not
        // likely to be called often.
        for( int i = 0; i < size; i++ ) {
            Interceptor in = (Interceptor)interceptorList[i];
            if( in.name().equals( interceptorName ) ) {
                foundDuplicate = true;
                break;
            }
        }
    }

    if( !foundDuplicate ) {
        growInterceptorArray( type );
        interceptors[type][interceptors[type].length-1] = interceptor;
    }
    else {
        throw new DuplicateName( interceptorName );
    }
}
 
Example 14
Source File: InterceptorList.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Registers an interceptor of the given type into the interceptor list.
 * The type is one of:
 * <ul>
 *   <li>INTERCEPTOR_TYPE_CLIENT - ClientRequestInterceptor
 *   <li>INTERCEPTOR_TYPE_SERVER - ServerRequestInterceptor
 *   <li>INTERCEPTOR_TYPE_IOR - IORInterceptor
 * </ul>
 *
 * @exception DuplicateName Thrown if an interceptor of the given
 *     name already exists for the given type.
 */
void register_interceptor( Interceptor interceptor, int type )
    throws DuplicateName
{
    // If locked, deny any further addition of interceptors.
    if( locked ) {
        throw wrapper.interceptorListLocked() ;
    }

    // Cache interceptor name:
    String interceptorName = interceptor.name();
    boolean anonymous = interceptorName.equals( "" );
    boolean foundDuplicate = false;
    Interceptor[] interceptorList = interceptors[type];

    // If this is not an anonymous interceptor,
    // search for an interceptor of the same name in this category:
    if( !anonymous ) {
        int size = interceptorList.length;

        // An O(n) search will suffice because register_interceptor is not
        // likely to be called often.
        for( int i = 0; i < size; i++ ) {
            Interceptor in = (Interceptor)interceptorList[i];
            if( in.name().equals( interceptorName ) ) {
                foundDuplicate = true;
                break;
            }
        }
    }

    if( !foundDuplicate ) {
        growInterceptorArray( type );
        interceptors[type][interceptors[type].length-1] = interceptor;
    }
    else {
        throw new DuplicateName( interceptorName );
    }
}
 
Example 15
Source File: InterceptorList.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Registers an interceptor of the given type into the interceptor list.
 * The type is one of:
 * <ul>
 *   <li>INTERCEPTOR_TYPE_CLIENT - ClientRequestInterceptor
 *   <li>INTERCEPTOR_TYPE_SERVER - ServerRequestInterceptor
 *   <li>INTERCEPTOR_TYPE_IOR - IORInterceptor
 * </ul>
 *
 * @exception DuplicateName Thrown if an interceptor of the given
 *     name already exists for the given type.
 */
void register_interceptor( Interceptor interceptor, int type )
    throws DuplicateName
{
    // If locked, deny any further addition of interceptors.
    if( locked ) {
        throw wrapper.interceptorListLocked() ;
    }

    // Cache interceptor name:
    String interceptorName = interceptor.name();
    boolean anonymous = interceptorName.equals( "" );
    boolean foundDuplicate = false;
    Interceptor[] interceptorList = interceptors[type];

    // If this is not an anonymous interceptor,
    // search for an interceptor of the same name in this category:
    if( !anonymous ) {
        int size = interceptorList.length;

        // An O(n) search will suffice because register_interceptor is not
        // likely to be called often.
        for( int i = 0; i < size; i++ ) {
            Interceptor in = (Interceptor)interceptorList[i];
            if( in.name().equals( interceptorName ) ) {
                foundDuplicate = true;
                break;
            }
        }
    }

    if( !foundDuplicate ) {
        growInterceptorArray( type );
        interceptors[type][interceptors[type].length-1] = interceptor;
    }
    else {
        throw new DuplicateName( interceptorName );
    }
}
 
Example 16
Source File: InterceptorList.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Registers an interceptor of the given type into the interceptor list.
 * The type is one of:
 * <ul>
 *   <li>INTERCEPTOR_TYPE_CLIENT - ClientRequestInterceptor
 *   <li>INTERCEPTOR_TYPE_SERVER - ServerRequestInterceptor
 *   <li>INTERCEPTOR_TYPE_IOR - IORInterceptor
 * </ul>
 *
 * @exception DuplicateName Thrown if an interceptor of the given
 *     name already exists for the given type.
 */
void register_interceptor( Interceptor interceptor, int type )
    throws DuplicateName
{
    // If locked, deny any further addition of interceptors.
    if( locked ) {
        throw wrapper.interceptorListLocked() ;
    }

    // Cache interceptor name:
    String interceptorName = interceptor.name();
    boolean anonymous = interceptorName.equals( "" );
    boolean foundDuplicate = false;
    Interceptor[] interceptorList = interceptors[type];

    // If this is not an anonymous interceptor,
    // search for an interceptor of the same name in this category:
    if( !anonymous ) {
        int size = interceptorList.length;

        // An O(n) search will suffice because register_interceptor is not
        // likely to be called often.
        for( int i = 0; i < size; i++ ) {
            Interceptor in = (Interceptor)interceptorList[i];
            if( in.name().equals( interceptorName ) ) {
                foundDuplicate = true;
                break;
            }
        }
    }

    if( !foundDuplicate ) {
        growInterceptorArray( type );
        interceptors[type][interceptors[type].length-1] = interceptor;
    }
    else {
        throw new DuplicateName( interceptorName );
    }
}
 
Example 17
Source File: InterceptorList.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Registers an interceptor of the given type into the interceptor list.
 * The type is one of:
 * <ul>
 *   <li>INTERCEPTOR_TYPE_CLIENT - ClientRequestInterceptor
 *   <li>INTERCEPTOR_TYPE_SERVER - ServerRequestInterceptor
 *   <li>INTERCEPTOR_TYPE_IOR - IORInterceptor
 * </ul>
 *
 * @exception DuplicateName Thrown if an interceptor of the given
 *     name already exists for the given type.
 */
void register_interceptor( Interceptor interceptor, int type )
    throws DuplicateName
{
    // If locked, deny any further addition of interceptors.
    if( locked ) {
        throw wrapper.interceptorListLocked() ;
    }

    // Cache interceptor name:
    String interceptorName = interceptor.name();
    boolean anonymous = interceptorName.equals( "" );
    boolean foundDuplicate = false;
    Interceptor[] interceptorList = interceptors[type];

    // If this is not an anonymous interceptor,
    // search for an interceptor of the same name in this category:
    if( !anonymous ) {
        int size = interceptorList.length;

        // An O(n) search will suffice because register_interceptor is not
        // likely to be called often.
        for( int i = 0; i < size; i++ ) {
            Interceptor in = (Interceptor)interceptorList[i];
            if( in.name().equals( interceptorName ) ) {
                foundDuplicate = true;
                break;
            }
        }
    }

    if( !foundDuplicate ) {
        growInterceptorArray( type );
        interceptors[type][interceptors[type].length-1] = interceptor;
    }
    else {
        throw new DuplicateName( interceptorName );
    }
}
 
Example 18
Source File: InterceptorList.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Registers an interceptor of the given type into the interceptor list.
 * The type is one of:
 * <ul>
 *   <li>INTERCEPTOR_TYPE_CLIENT - ClientRequestInterceptor
 *   <li>INTERCEPTOR_TYPE_SERVER - ServerRequestInterceptor
 *   <li>INTERCEPTOR_TYPE_IOR - IORInterceptor
 * </ul>
 *
 * @exception DuplicateName Thrown if an interceptor of the given
 *     name already exists for the given type.
 */
void register_interceptor( Interceptor interceptor, int type )
    throws DuplicateName
{
    // If locked, deny any further addition of interceptors.
    if( locked ) {
        throw wrapper.interceptorListLocked() ;
    }

    // Cache interceptor name:
    String interceptorName = interceptor.name();
    boolean anonymous = interceptorName.equals( "" );
    boolean foundDuplicate = false;
    Interceptor[] interceptorList = interceptors[type];

    // If this is not an anonymous interceptor,
    // search for an interceptor of the same name in this category:
    if( !anonymous ) {
        int size = interceptorList.length;

        // An O(n) search will suffice because register_interceptor is not
        // likely to be called often.
        for( int i = 0; i < size; i++ ) {
            Interceptor in = (Interceptor)interceptorList[i];
            if( in.name().equals( interceptorName ) ) {
                foundDuplicate = true;
                break;
            }
        }
    }

    if( !foundDuplicate ) {
        growInterceptorArray( type );
        interceptors[type][interceptors[type].length-1] = interceptor;
    }
    else {
        throw new DuplicateName( interceptorName );
    }
}
 
Example 19
Source File: InterceptorList.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Registers an interceptor of the given type into the interceptor list.
 * The type is one of:
 * <ul>
 *   <li>INTERCEPTOR_TYPE_CLIENT - ClientRequestInterceptor
 *   <li>INTERCEPTOR_TYPE_SERVER - ServerRequestInterceptor
 *   <li>INTERCEPTOR_TYPE_IOR - IORInterceptor
 * </ul>
 *
 * @exception DuplicateName Thrown if an interceptor of the given
 *     name already exists for the given type.
 */
void register_interceptor( Interceptor interceptor, int type )
    throws DuplicateName
{
    // If locked, deny any further addition of interceptors.
    if( locked ) {
        throw wrapper.interceptorListLocked() ;
    }

    // Cache interceptor name:
    String interceptorName = interceptor.name();
    boolean anonymous = interceptorName.equals( "" );
    boolean foundDuplicate = false;
    Interceptor[] interceptorList = interceptors[type];

    // If this is not an anonymous interceptor,
    // search for an interceptor of the same name in this category:
    if( !anonymous ) {
        int size = interceptorList.length;

        // An O(n) search will suffice because register_interceptor is not
        // likely to be called often.
        for( int i = 0; i < size; i++ ) {
            Interceptor in = (Interceptor)interceptorList[i];
            if( in.name().equals( interceptorName ) ) {
                foundDuplicate = true;
                break;
            }
        }
    }

    if( !foundDuplicate ) {
        growInterceptorArray( type );
        interceptors[type][interceptors[type].length-1] = interceptor;
    }
    else {
        throw new DuplicateName( interceptorName );
    }
}
 
Example 20
Source File: InterceptorList.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Registers an interceptor of the given type into the interceptor list.
 * The type is one of:
 * <ul>
 *   <li>INTERCEPTOR_TYPE_CLIENT - ClientRequestInterceptor
 *   <li>INTERCEPTOR_TYPE_SERVER - ServerRequestInterceptor
 *   <li>INTERCEPTOR_TYPE_IOR - IORInterceptor
 * </ul>
 *
 * @exception DuplicateName Thrown if an interceptor of the given
 *     name already exists for the given type.
 */
void register_interceptor( Interceptor interceptor, int type )
    throws DuplicateName
{
    // If locked, deny any further addition of interceptors.
    if( locked ) {
        throw wrapper.interceptorListLocked() ;
    }

    // Cache interceptor name:
    String interceptorName = interceptor.name();
    boolean anonymous = interceptorName.equals( "" );
    boolean foundDuplicate = false;
    Interceptor[] interceptorList = interceptors[type];

    // If this is not an anonymous interceptor,
    // search for an interceptor of the same name in this category:
    if( !anonymous ) {
        int size = interceptorList.length;

        // An O(n) search will suffice because register_interceptor is not
        // likely to be called often.
        for( int i = 0; i < size; i++ ) {
            Interceptor in = (Interceptor)interceptorList[i];
            if( in.name().equals( interceptorName ) ) {
                foundDuplicate = true;
                break;
            }
        }
    }

    if( !foundDuplicate ) {
        growInterceptorArray( type );
        interceptors[type][interceptors[type].length-1] = interceptor;
    }
    else {
        throw new DuplicateName( interceptorName );
    }
}