org.omg.PortableInterceptor.ORBInitInfoPackage.DuplicateName Java Examples

The following examples show how to use org.omg.PortableInterceptor.ORBInitInfoPackage.DuplicateName. 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 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 #2
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 #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 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 #5
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 #6
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 #7
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 #8
Source File: ORBInitInfoImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This operation is used to add a server-side request Interceptor to
 * the list of server-side request Interceptors.
 * <p>
 * If a server-side request Interceptor has already been registered
 * with this Interceptor's name, DuplicateName is raised.
 */
public void add_server_request_interceptor (
    ServerRequestInterceptor interceptor)
    throws DuplicateName
{
    checkStage();
    if( interceptor == null ) nullParam();

    orb.getPIHandler().register_interceptor( interceptor,
        InterceptorList.INTERCEPTOR_TYPE_SERVER );
}
 
Example #9
Source File: ORBInitInfoImpl.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public void add_client_request_interceptor_with_policy (
    ClientRequestInterceptor interceptor, Policy[] policies )
    throws DuplicateName
{
    // XXX ignore policies for now
    add_client_request_interceptor( interceptor ) ;
}
 
Example #10
Source File: ORBInitInfoImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public void add_ior_interceptor_with_policy (
    IORInterceptor interceptor, Policy[] policies )
    throws DuplicateName, PolicyError
{
    // XXX ignore policies for now
    add_ior_interceptor( interceptor ) ;
}
 
Example #11
Source File: ORBInitInfoImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This operation is used to add an IOR Interceptor to
 * the list of IOR Interceptors.
 * <p>
 * If an IOR Interceptor has already been registered
 * with this Interceptor's name, DuplicateName is raised.
 */
public void add_ior_interceptor (
    IORInterceptor interceptor )
    throws DuplicateName
{
    checkStage();
    if( interceptor == null ) nullParam();

    orb.getPIHandler().register_interceptor( interceptor,
        InterceptorList.INTERCEPTOR_TYPE_IOR );
}
 
Example #12
Source File: ORBInitInfoImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This operation is used to add an IOR Interceptor to
 * the list of IOR Interceptors.
 * <p>
 * If an IOR Interceptor has already been registered
 * with this Interceptor's name, DuplicateName is raised.
 */
public void add_ior_interceptor (
    IORInterceptor interceptor )
    throws DuplicateName
{
    checkStage();
    if( interceptor == null ) nullParam();

    orb.getPIHandler().register_interceptor( interceptor,
        InterceptorList.INTERCEPTOR_TYPE_IOR );
}
 
Example #13
Source File: ORBInitInfoImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void add_server_request_interceptor_with_policy (
    ServerRequestInterceptor interceptor, Policy[] policies )
    throws DuplicateName, PolicyError
{
    // XXX ignore policies for now
    add_server_request_interceptor( interceptor ) ;
}
 
Example #14
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 #15
Source File: ORBInitInfoImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This operation is used to add a client-side request Interceptor to
 * the list of client-side request Interceptors.
 * <p>
 * If a client-side request Interceptor has already been registered
 * with this Interceptor's name, DuplicateName is raised.
 */
public void add_client_request_interceptor (
    ClientRequestInterceptor interceptor)
    throws DuplicateName
{
    checkStage();
    if( interceptor == null ) nullParam();

    orb.getPIHandler().register_interceptor( interceptor,
        InterceptorList.INTERCEPTOR_TYPE_CLIENT );
}
 
Example #16
Source File: ORBInitInfoImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void add_client_request_interceptor_with_policy (
    ClientRequestInterceptor interceptor, Policy[] policies )
    throws DuplicateName
{
    // XXX ignore policies for now
    add_client_request_interceptor( interceptor ) ;
}
 
Example #17
Source File: ORBInitInfoImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This operation is used to add an IOR Interceptor to
 * the list of IOR Interceptors.
 * <p>
 * If an IOR Interceptor has already been registered
 * with this Interceptor's name, DuplicateName is raised.
 */
public void add_ior_interceptor (
    IORInterceptor interceptor )
    throws DuplicateName
{
    checkStage();
    if( interceptor == null ) nullParam();

    orb.getPIHandler().register_interceptor( interceptor,
        InterceptorList.INTERCEPTOR_TYPE_IOR );
}
 
Example #18
Source File: ORBInitInfoImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void add_ior_interceptor_with_policy (
    IORInterceptor interceptor, Policy[] policies )
    throws DuplicateName, PolicyError
{
    // XXX ignore policies for now
    add_ior_interceptor( interceptor ) ;
}
 
Example #19
Source File: ORBInitInfoImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public void add_server_request_interceptor_with_policy (
    ServerRequestInterceptor interceptor, Policy[] policies )
    throws DuplicateName, PolicyError
{
    // XXX ignore policies for now
    add_server_request_interceptor( interceptor ) ;
}
 
Example #20
Source File: ORBInitInfoImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This operation is used to add a client-side request Interceptor to
 * the list of client-side request Interceptors.
 * <p>
 * If a client-side request Interceptor has already been registered
 * with this Interceptor's name, DuplicateName is raised.
 */
public void add_client_request_interceptor (
    ClientRequestInterceptor interceptor)
    throws DuplicateName
{
    checkStage();
    if( interceptor == null ) nullParam();

    orb.getPIHandler().register_interceptor( interceptor,
        InterceptorList.INTERCEPTOR_TYPE_CLIENT );
}
 
Example #21
Source File: ORBInitInfoImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public void add_client_request_interceptor_with_policy (
    ClientRequestInterceptor interceptor, Policy[] policies )
    throws DuplicateName
{
    // XXX ignore policies for now
    add_client_request_interceptor( interceptor ) ;
}
 
Example #22
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 #23
Source File: ORBInitInfoImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This operation is used to add an IOR Interceptor to
 * the list of IOR Interceptors.
 * <p>
 * If an IOR Interceptor has already been registered
 * with this Interceptor's name, DuplicateName is raised.
 */
public void add_ior_interceptor (
    IORInterceptor interceptor )
    throws DuplicateName
{
    checkStage();
    if( interceptor == null ) nullParam();

    orb.getPIHandler().register_interceptor( interceptor,
        InterceptorList.INTERCEPTOR_TYPE_IOR );
}
 
Example #24
Source File: ORBInitInfoImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void add_ior_interceptor_with_policy (
    IORInterceptor interceptor, Policy[] policies )
    throws DuplicateName, PolicyError
{
    // XXX ignore policies for now
    add_ior_interceptor( interceptor ) ;
}
 
Example #25
Source File: ORBInitInfoImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This operation is used to add a server-side request Interceptor to
 * the list of server-side request Interceptors.
 * <p>
 * If a server-side request Interceptor has already been registered
 * with this Interceptor's name, DuplicateName is raised.
 */
public void add_server_request_interceptor (
    ServerRequestInterceptor interceptor)
    throws DuplicateName
{
    checkStage();
    if( interceptor == null ) nullParam();

    orb.getPIHandler().register_interceptor( interceptor,
        InterceptorList.INTERCEPTOR_TYPE_SERVER );
}
 
Example #26
Source File: ORBInitInfoImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void add_server_request_interceptor_with_policy (
    ServerRequestInterceptor interceptor, Policy[] policies )
    throws DuplicateName, PolicyError
{
    // XXX ignore policies for now
    add_server_request_interceptor( interceptor ) ;
}
 
Example #27
Source File: ORBInitInfoImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This operation is used to add a client-side request Interceptor to
 * the list of client-side request Interceptors.
 * <p>
 * If a client-side request Interceptor has already been registered
 * with this Interceptor's name, DuplicateName is raised.
 */
public void add_client_request_interceptor (
    ClientRequestInterceptor interceptor)
    throws DuplicateName
{
    checkStage();
    if( interceptor == null ) nullParam();

    orb.getPIHandler().register_interceptor( interceptor,
        InterceptorList.INTERCEPTOR_TYPE_CLIENT );
}
 
Example #28
Source File: ORBInitInfoImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void add_client_request_interceptor_with_policy (
    ClientRequestInterceptor interceptor, Policy[] policies )
    throws DuplicateName
{
    // XXX ignore policies for now
    add_client_request_interceptor( interceptor ) ;
}
 
Example #29
Source File: ORBInitInfoImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void add_server_request_interceptor_with_policy (
    ServerRequestInterceptor interceptor, Policy[] policies )
    throws DuplicateName, PolicyError
{
    // XXX ignore policies for now
    add_server_request_interceptor( interceptor ) ;
}
 
Example #30
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 );
    }
}