Java Code Examples for com.sun.corba.se.spi.ior.IORFactories#makeIOR()

The following examples show how to use com.sun.corba.se.spi.ior.IORFactories#makeIOR() . 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: CDROutputStream_1_0.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public void write_Object(org.omg.CORBA.Object ref)
{
    if (ref == null) {
        IOR nullIOR = IORFactories.makeIOR( orb ) ;
        nullIOR.write(parent);
        return;
    }

    // IDL to Java formal 01-06-06 1.21.4.2
    if (ref instanceof org.omg.CORBA.LocalObject)
        throw wrapper.writeLocalObject(CompletionStatus.COMPLETED_MAYBE);

    IOR ior = ORBUtility.connectAndGetIOR( orb, ref ) ;
    ior.write(parent);
    return;
}
 
Example 2
Source File: CDROutputStream_1_0.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public void write_Object(org.omg.CORBA.Object ref)
{
    if (ref == null) {
        IOR nullIOR = IORFactories.makeIOR( orb ) ;
        nullIOR.write(parent);
        return;
    }

    // IDL to Java formal 01-06-06 1.21.4.2
    if (ref instanceof org.omg.CORBA.LocalObject)
        throw wrapper.writeLocalObject(CompletionStatus.COMPLETED_MAYBE);

    IOR ior = ORBUtility.connectAndGetIOR( orb, ref ) ;
    ior.write(parent);
    return;
}
 
Example 3
Source File: ReplyMessage_1_1.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public void read(org.omg.CORBA.portable.InputStream istream) {
    super.read(istream);
    this.service_contexts
        = new ServiceContexts((org.omg.CORBA_2_3.portable.InputStream) istream);
    this.request_id = istream.read_ulong();
    this.reply_status = istream.read_long();
    isValidReplyStatus(this.reply_status); // raises exception on error

    // The code below reads the reply body in some cases
    // SYSTEM_EXCEPTION & LOCATION_FORWARD
    if (this.reply_status == SYSTEM_EXCEPTION) {

        String reposId = istream.read_string();
        this.exClassName = ORBUtility.classNameOf(reposId);
        this.minorCode = istream.read_long();
        int status = istream.read_long();

        switch (status) {
        case CompletionStatus._COMPLETED_YES:
            this.completionStatus = CompletionStatus.COMPLETED_YES;
            break;
        case CompletionStatus._COMPLETED_NO:
            this.completionStatus = CompletionStatus.COMPLETED_NO;
            break;
        case CompletionStatus._COMPLETED_MAYBE:
            this.completionStatus = CompletionStatus.COMPLETED_MAYBE;
            break;
        default:
            throw wrapper.badCompletionStatusInReply(
                CompletionStatus.COMPLETED_MAYBE, new Integer(status) );
        }
    } else if (this.reply_status == USER_EXCEPTION) {
        // do nothing. The client stub will read the exception from body.
    } else if (this.reply_status == LOCATION_FORWARD) {
        CDRInputStream cdr = (CDRInputStream) istream;
        this.ior = IORFactories.makeIOR(cdr) ;
    }
}
 
Example 4
Source File: ORBImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Convert an object ref to a string.
 * @param obj The object to stringify.
 * @return A stringified object reference.
 */
public synchronized String object_to_string(org.omg.CORBA.Object obj)
{
    checkShutdownState();

    // Handle the null objref case
    if (obj == null) {
        IOR nullIOR = IORFactories.makeIOR( this ) ;
        return nullIOR.stringify();
    }

    IOR ior = null ;

    try {
        ior = ORBUtility.connectAndGetIOR( this, obj ) ;
    } catch (BAD_PARAM bp) {
        // Throw MARSHAL instead if this is a LOCAL_OBJECT_NOT_ALLOWED error.
        if (bp.minor == ORBUtilSystemException.LOCAL_OBJECT_NOT_ALLOWED) {
            throw omgWrapper.notAnObjectImpl( bp ) ;
        } else
            // Not a local object problem: just rethrow the exception.
            // Do not wrap and log this, since it was already logged at its
            // point of origin.
            throw bp ;
    }

    return ior.stringify() ;
}
 
Example 5
Source File: LocateReplyMessage_1_1.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void read(org.omg.CORBA.portable.InputStream istream) {
    super.read(istream);
    this.request_id = istream.read_ulong();
    this.reply_status = istream.read_long();
    isValidReplyStatus(this.reply_status); // raises exception on error

    // The code below reads the reply body if status is OBJECT_FORWARD
    if (this.reply_status == OBJECT_FORWARD) {
        CDRInputStream cdr = (CDRInputStream) istream;
        this.ior = IORFactories.makeIOR( cdr ) ;
    }
}
 
Example 6
Source File: IDLJavaSerializationOutputStream.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public final void write_Object(org.omg.CORBA.Object value) {
    if (value == null) {
        IOR nullIOR = IORFactories.makeIOR(orb);
        nullIOR.write(parent);
        return;
    }
    // IDL to Java formal 01-06-06 1.21.4.2
    if (value instanceof org.omg.CORBA.LocalObject) {
        throw wrapper.writeLocalObject(CompletionStatus.COMPLETED_MAYBE);
    }
    IOR ior = ORBUtility.connectAndGetIOR(orb, value);
    ior.write(parent);
    return;
}
 
Example 7
Source File: LocateReplyMessage_1_1.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void read(org.omg.CORBA.portable.InputStream istream) {
    super.read(istream);
    this.request_id = istream.read_ulong();
    this.reply_status = istream.read_long();
    isValidReplyStatus(this.reply_status); // raises exception on error

    // The code below reads the reply body if status is OBJECT_FORWARD
    if (this.reply_status == OBJECT_FORWARD) {
        CDRInputStream cdr = (CDRInputStream) istream;
        this.ior = IORFactories.makeIOR( cdr ) ;
    }
}
 
Example 8
Source File: ReplyMessage_1_0.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void read(org.omg.CORBA.portable.InputStream istream) {
    super.read(istream);
    this.service_contexts
        = new ServiceContexts((org.omg.CORBA_2_3.portable.InputStream) istream);
    this.request_id = istream.read_ulong();
    this.reply_status = istream.read_long();
    isValidReplyStatus(this.reply_status); // raises exception on error

    // The code below reads the reply body in some cases
    // SYSTEM_EXCEPTION & LOCATION_FORWARD
    if (this.reply_status == SYSTEM_EXCEPTION) {

        String reposId = istream.read_string();
        this.exClassName = ORBUtility.classNameOf(reposId);
        this.minorCode = istream.read_long();
        int status = istream.read_long();

        switch (status) {
        case CompletionStatus._COMPLETED_YES:
            this.completionStatus = CompletionStatus.COMPLETED_YES;
            break;
        case CompletionStatus._COMPLETED_NO:
            this.completionStatus = CompletionStatus.COMPLETED_NO;
            break;
        case CompletionStatus._COMPLETED_MAYBE:
            this.completionStatus = CompletionStatus.COMPLETED_MAYBE;
            break;
        default:
            throw wrapper.badCompletionStatusInReply(
                CompletionStatus.COMPLETED_MAYBE, new Integer(status) );
        }

    } else if (this.reply_status == USER_EXCEPTION) {
        // do nothing. The client stub will read the exception from body.
    } else if (this.reply_status == LOCATION_FORWARD) {
        CDRInputStream cdr = (CDRInputStream) istream;
        this.ior = IORFactories.makeIOR( cdr ) ;
    }
}
 
Example 9
Source File: IDLJavaSerializationOutputStream.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public final void write_Object(org.omg.CORBA.Object value) {
    if (value == null) {
        IOR nullIOR = IORFactories.makeIOR(orb);
        nullIOR.write(parent);
        return;
    }
    // IDL to Java formal 01-06-06 1.21.4.2
    if (value instanceof org.omg.CORBA.LocalObject) {
        throw wrapper.writeLocalObject(CompletionStatus.COMPLETED_MAYBE);
    }
    IOR ior = ORBUtility.connectAndGetIOR(orb, value);
    ior.write(parent);
    return;
}
 
Example 10
Source File: IDLJavaSerializationOutputStream.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public final void write_Object(org.omg.CORBA.Object value) {
    if (value == null) {
        IOR nullIOR = IORFactories.makeIOR(orb);
        nullIOR.write(parent);
        return;
    }
    // IDL to Java formal 01-06-06 1.21.4.2
    if (value instanceof org.omg.CORBA.LocalObject) {
        throw wrapper.writeLocalObject(CompletionStatus.COMPLETED_MAYBE);
    }
    IOR ior = ORBUtility.connectAndGetIOR(orb, value);
    ior.write(parent);
    return;
}
 
Example 11
Source File: ORBImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Convert an object ref to a string.
 * @param obj The object to stringify.
 * @return A stringified object reference.
 */
public synchronized String object_to_string(org.omg.CORBA.Object obj)
{
    checkShutdownState();

    // Handle the null objref case
    if (obj == null) {
        IOR nullIOR = IORFactories.makeIOR( this ) ;
        return nullIOR.stringify();
    }

    IOR ior = null ;

    try {
        ior = ORBUtility.connectAndGetIOR( this, obj ) ;
    } catch (BAD_PARAM bp) {
        // Throw MARSHAL instead if this is a LOCAL_OBJECT_NOT_ALLOWED error.
        if (bp.minor == ORBUtilSystemException.LOCAL_OBJECT_NOT_ALLOWED) {
            throw omgWrapper.notAnObjectImpl( bp ) ;
        } else
            // Not a local object problem: just rethrow the exception.
            // Do not wrap and log this, since it was already logged at its
            // point of origin.
            throw bp ;
    }

    return ior.stringify() ;
}
 
Example 12
Source File: ORBImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Convert an object ref to a string.
 * @param obj The object to stringify.
 * @return A stringified object reference.
 */
public synchronized String object_to_string(org.omg.CORBA.Object obj)
{
    checkShutdownState();

    // Handle the null objref case
    if (obj == null) {
        IOR nullIOR = IORFactories.makeIOR( this ) ;
        return nullIOR.stringify();
    }

    IOR ior = null ;

    try {
        ior = ORBUtility.connectAndGetIOR( this, obj ) ;
    } catch (BAD_PARAM bp) {
        // Throw MARSHAL instead if this is a LOCAL_OBJECT_NOT_ALLOWED error.
        if (bp.minor == ORBUtilSystemException.LOCAL_OBJECT_NOT_ALLOWED) {
            throw omgWrapper.notAnObjectImpl( bp ) ;
        } else
            // Not a local object problem: just rethrow the exception.
            // Do not wrap and log this, since it was already logged at its
            // point of origin.
            throw bp ;
    }

    return ior.stringify() ;
}
 
Example 13
Source File: ORBImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Convert an object ref to a string.
 * @param obj The object to stringify.
 * @return A stringified object reference.
 */
public synchronized String object_to_string(org.omg.CORBA.Object obj)
{
    checkShutdownState();

    // Handle the null objref case
    if (obj == null) {
        IOR nullIOR = IORFactories.makeIOR( this ) ;
        return nullIOR.stringify();
    }

    IOR ior = null ;

    try {
        ior = ORBUtility.connectAndGetIOR( this, obj ) ;
    } catch (BAD_PARAM bp) {
        // Throw MARSHAL instead if this is a LOCAL_OBJECT_NOT_ALLOWED error.
        if (bp.minor == ORBUtilSystemException.LOCAL_OBJECT_NOT_ALLOWED) {
            throw omgWrapper.notAnObjectImpl( bp ) ;
        } else
            // Not a local object problem: just rethrow the exception.
            // Do not wrap and log this, since it was already logged at its
            // point of origin.
            throw bp ;
    }

    return ior.stringify() ;
}
 
Example 14
Source File: ReplyMessage_1_0.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void read(org.omg.CORBA.portable.InputStream istream) {
    super.read(istream);
    this.service_contexts
        = new ServiceContexts((org.omg.CORBA_2_3.portable.InputStream) istream);
    this.request_id = istream.read_ulong();
    this.reply_status = istream.read_long();
    isValidReplyStatus(this.reply_status); // raises exception on error

    // The code below reads the reply body in some cases
    // SYSTEM_EXCEPTION & LOCATION_FORWARD
    if (this.reply_status == SYSTEM_EXCEPTION) {

        String reposId = istream.read_string();
        this.exClassName = ORBUtility.classNameOf(reposId);
        this.minorCode = istream.read_long();
        int status = istream.read_long();

        switch (status) {
        case CompletionStatus._COMPLETED_YES:
            this.completionStatus = CompletionStatus.COMPLETED_YES;
            break;
        case CompletionStatus._COMPLETED_NO:
            this.completionStatus = CompletionStatus.COMPLETED_NO;
            break;
        case CompletionStatus._COMPLETED_MAYBE:
            this.completionStatus = CompletionStatus.COMPLETED_MAYBE;
            break;
        default:
            throw wrapper.badCompletionStatusInReply(
                CompletionStatus.COMPLETED_MAYBE, new Integer(status) );
        }

    } else if (this.reply_status == USER_EXCEPTION) {
        // do nothing. The client stub will read the exception from body.
    } else if (this.reply_status == LOCATION_FORWARD) {
        CDRInputStream cdr = (CDRInputStream) istream;
        this.ior = IORFactories.makeIOR( cdr ) ;
    }
}
 
Example 15
Source File: ORBImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Convert an object ref to a string.
 * @param obj The object to stringify.
 * @return A stringified object reference.
 */
public synchronized String object_to_string(org.omg.CORBA.Object obj)
{
    checkShutdownState();

    // Handle the null objref case
    if (obj == null) {
        IOR nullIOR = IORFactories.makeIOR( this ) ;
        return nullIOR.stringify();
    }

    IOR ior = null ;

    try {
        ior = ORBUtility.connectAndGetIOR( this, obj ) ;
    } catch (BAD_PARAM bp) {
        // Throw MARSHAL instead if this is a LOCAL_OBJECT_NOT_ALLOWED error.
        if (bp.minor == ORBUtilSystemException.LOCAL_OBJECT_NOT_ALLOWED) {
            throw omgWrapper.notAnObjectImpl( bp ) ;
        } else
            // Not a local object problem: just rethrow the exception.
            // Do not wrap and log this, since it was already logged at its
            // point of origin.
            throw bp ;
    }

    return ior.stringify() ;
}
 
Example 16
Source File: LocateReplyMessage_1_0.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public void read(org.omg.CORBA.portable.InputStream istream) {
    super.read(istream);
    this.request_id = istream.read_ulong();
    this.locate_status = istream.read_long();
    isValidReplyStatus(this.locate_status); // raises exception on error

    // The code below reads the reply body if status is OBJECT_FORWARD
    if (this.locate_status == OBJECT_FORWARD) {
        CDRInputStream cdr = (CDRInputStream) istream;
        this.ior = IORFactories.makeIOR( cdr ) ;
    }
}
 
Example 17
Source File: LocateReplyMessage_1_2.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public void read(org.omg.CORBA.portable.InputStream istream) {
    super.read(istream);
    this.request_id = istream.read_ulong();
    this.reply_status = istream.read_long();
    isValidReplyStatus(this.reply_status); // raises exception on error

    // GIOP 1.2 LocateReply message bodies are not aligned on
    // 8 byte boundaries.

    // The code below reads the reply body in some cases
    // LOC_SYSTEM_EXCEPTION & OBJECT_FORWARD & OBJECT_FORWARD_PERM &
    // LOC_NEEDS_ADDRESSING_MODE
    if (this.reply_status == LOC_SYSTEM_EXCEPTION) {

        String reposId = istream.read_string();
        this.exClassName = ORBUtility.classNameOf(reposId);
        this.minorCode = istream.read_long();
        int status = istream.read_long();

        switch (status) {
        case CompletionStatus._COMPLETED_YES:
            this.completionStatus = CompletionStatus.COMPLETED_YES;
            break;
        case CompletionStatus._COMPLETED_NO:
            this.completionStatus = CompletionStatus.COMPLETED_NO;
            break;
        case CompletionStatus._COMPLETED_MAYBE:
            this.completionStatus = CompletionStatus.COMPLETED_MAYBE;
            break;
        default:
            throw wrapper.badCompletionStatusInLocateReply(
                CompletionStatus.COMPLETED_MAYBE, new Integer(status) );
        }
    } else if ( (this.reply_status == OBJECT_FORWARD) ||
            (this.reply_status == OBJECT_FORWARD_PERM) ){
        CDRInputStream cdr = (CDRInputStream) istream;
        this.ior = IORFactories.makeIOR( cdr ) ;
    }  else if (this.reply_status == LOC_NEEDS_ADDRESSING_MODE) {
        // read GIOP::AddressingDisposition from body and resend the
        // original request using the requested addressing mode. The
        // resending is transparent to the caller.
        this.addrDisposition = AddressingDispositionHelper.read(istream);
    }
}
 
Example 18
Source File: CDRInputStream_1_0.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public org.omg.CORBA.Object read_Object(Class clz)
{
    // In any case, we must first read the IOR.
    IOR ior = IORFactories.makeIOR(parent) ;
    if (ior.isNil())
        return null ;

    PresentationManager.StubFactoryFactory sff = ORB.getStubFactoryFactory() ;
    String codeBase = ior.getProfile().getCodebase() ;
    PresentationManager.StubFactory stubFactory = null ;

    if (clz == null) {
        RepositoryId rid = RepositoryId.cache.getId( ior.getTypeId() ) ;
        String className = rid.getClassName() ;
        boolean isIDLInterface = rid.isIDLType() ;

        if (className == null || className.equals( "" ))
            stubFactory = null ;
        else
            try {
                stubFactory = sff.createStubFactory( className,
                    isIDLInterface, codeBase, (Class)null,
                    (ClassLoader)null );
            } catch (Exception exc) {
                // Could not create stubFactory, so use null.
                // XXX stubFactory handling is still too complex:
                // Can we resolve the stubFactory question once in
                // a single place?
                stubFactory = null ;
            }
    } else if (StubAdapter.isStubClass( clz )) {
        stubFactory = PresentationDefaults.makeStaticStubFactory(
            clz ) ;
    } else {
        // clz is an interface class
        boolean isIDL = IDLEntity.class.isAssignableFrom( clz ) ;

        stubFactory = sff.createStubFactory( clz.getName(),
            isIDL, codeBase, clz, clz.getClassLoader() ) ;
    }

    return internalIORToObject( ior, stubFactory, orb ) ;
}
 
Example 19
Source File: CDRInputStream_1_0.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public org.omg.CORBA.Object read_Object(Class clz)
{
    // In any case, we must first read the IOR.
    IOR ior = IORFactories.makeIOR(parent) ;
    if (ior.isNil())
        return null ;

    PresentationManager.StubFactoryFactory sff = ORB.getStubFactoryFactory() ;
    String codeBase = ior.getProfile().getCodebase() ;
    PresentationManager.StubFactory stubFactory = null ;

    if (clz == null) {
        RepositoryId rid = RepositoryId.cache.getId( ior.getTypeId() ) ;
        String className = rid.getClassName() ;
        boolean isIDLInterface = rid.isIDLType() ;

        if (className == null || className.equals( "" ))
            stubFactory = null ;
        else
            try {
                stubFactory = sff.createStubFactory( className,
                    isIDLInterface, codeBase, (Class)null,
                    (ClassLoader)null );
            } catch (Exception exc) {
                // Could not create stubFactory, so use null.
                // XXX stubFactory handling is still too complex:
                // Can we resolve the stubFactory question once in
                // a single place?
                stubFactory = null ;
            }
    } else if (StubAdapter.isStubClass( clz )) {
        stubFactory = PresentationDefaults.makeStaticStubFactory(
            clz ) ;
    } else {
        // clz is an interface class
        boolean isIDL = IDLEntity.class.isAssignableFrom( clz ) ;

        stubFactory = sff.createStubFactory( clz.getName(),
            isIDL, codeBase, clz, clz.getClassLoader() ) ;
    }

    return internalIORToObject( ior, stubFactory, orb ) ;
}
 
Example 20
Source File: LocateReplyMessage_1_2.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public void read(org.omg.CORBA.portable.InputStream istream) {
    super.read(istream);
    this.request_id = istream.read_ulong();
    this.reply_status = istream.read_long();
    isValidReplyStatus(this.reply_status); // raises exception on error

    // GIOP 1.2 LocateReply message bodies are not aligned on
    // 8 byte boundaries.

    // The code below reads the reply body in some cases
    // LOC_SYSTEM_EXCEPTION & OBJECT_FORWARD & OBJECT_FORWARD_PERM &
    // LOC_NEEDS_ADDRESSING_MODE
    if (this.reply_status == LOC_SYSTEM_EXCEPTION) {

        String reposId = istream.read_string();
        this.exClassName = ORBUtility.classNameOf(reposId);
        this.minorCode = istream.read_long();
        int status = istream.read_long();

        switch (status) {
        case CompletionStatus._COMPLETED_YES:
            this.completionStatus = CompletionStatus.COMPLETED_YES;
            break;
        case CompletionStatus._COMPLETED_NO:
            this.completionStatus = CompletionStatus.COMPLETED_NO;
            break;
        case CompletionStatus._COMPLETED_MAYBE:
            this.completionStatus = CompletionStatus.COMPLETED_MAYBE;
            break;
        default:
            throw wrapper.badCompletionStatusInLocateReply(
                CompletionStatus.COMPLETED_MAYBE, new Integer(status) );
        }
    } else if ( (this.reply_status == OBJECT_FORWARD) ||
            (this.reply_status == OBJECT_FORWARD_PERM) ){
        CDRInputStream cdr = (CDRInputStream) istream;
        this.ior = IORFactories.makeIOR( cdr ) ;
    }  else if (this.reply_status == LOC_NEEDS_ADDRESSING_MODE) {
        // read GIOP::AddressingDisposition from body and resend the
        // original request using the requested addressing mode. The
        // resending is transparent to the caller.
        this.addrDisposition = AddressingDispositionHelper.read(istream);
    }
}