com.sun.org.omg.SendingContext.CodeBase Java Examples

The following examples show how to use com.sun.org.omg.SendingContext.CodeBase. 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 Project: jdk1.8-source-analysis   Author: raysonfang   File: EncapsInputStream.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Full constructor with a CodeBase parameter useful for
 * unmarshaling RMI-IIOP valuetypes (technically against the
 * intention of an encapsulation, but necessary due to OMG
 * issue 4795.  Used by ServiceContexts.
 */
public EncapsInputStream(org.omg.CORBA.ORB orb,
                         byte[] data,
                         int size,
                         GIOPVersion version,
                         CodeBase codeBase) {
    super(orb,
          ByteBuffer.wrap(data),
          size,
          false,
          version, Message.CDR_ENC_VERSION,
          BufferManagerFactory.newBufferManagerRead(
                                  BufferManagerFactory.GROW,
                                  Message.CDR_ENC_VERSION,
                                  (ORB)orb));

    this.codeBase = codeBase;

    performORBVersionSpecificInit();
}
 
Example #2
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: IIOPInputStream.java    License: Apache License 2.0 6 votes vote down vote up
private Vector getOrderedDescriptions(String repositoryID,
                                      com.sun.org.omg.SendingContext.CodeBase sender) {
    Vector descs = new Vector();

    if (sender == null) {
        return descs;
    }

    FullValueDescription aFVD = sender.meta(repositoryID);
    while (aFVD != null) {
        descs.insertElementAt(aFVD, 0);
        if ((aFVD.base_value != null) && !kEmptyStr.equals(aFVD.base_value)) {
            aFVD = sender.meta(aFVD.base_value);
        }
        else return descs;
    }

    return descs;
}
 
Example #3
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: IIOPInputStream.java    License: Apache License 2.0 6 votes vote down vote up
private void skipCustomUsingFVD(ValueMember[] fields,
                                com.sun.org.omg.SendingContext.CodeBase sender)
                                throws InvalidClassException, StreamCorruptedException,
                                       ClassNotFoundException, IOException
{
    readFormatVersion();
    boolean calledDefaultWriteObject = readBoolean();

    if (calledDefaultWriteObject)
        throwAwayData(fields, sender);

    if (getStreamFormatVersion() == 2) {

        ((ValueInputStream)getOrbStream()).start_value();
        ((ValueInputStream)getOrbStream()).end_value();
    }
}
 
Example #4
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: IIOPInputStream.java    License: GNU General Public License v2.0 6 votes vote down vote up
private Vector getOrderedDescriptions(String repositoryID,
                                      com.sun.org.omg.SendingContext.CodeBase sender) {
    Vector descs = new Vector();

    if (sender == null) {
        return descs;
    }

    FullValueDescription aFVD = sender.meta(repositoryID);
    while (aFVD != null) {
        descs.insertElementAt(aFVD, 0);
        if ((aFVD.base_value != null) && !kEmptyStr.equals(aFVD.base_value)) {
            aFVD = sender.meta(aFVD.base_value);
        }
        else return descs;
    }

    return descs;
}
 
Example #5
Source Project: TencentKona-8   Author: Tencent   File: EncapsInputStream.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Full constructor with a CodeBase parameter useful for
 * unmarshaling RMI-IIOP valuetypes (technically against the
 * intention of an encapsulation, but necessary due to OMG
 * issue 4795.  Used by ServiceContexts.
 */
public EncapsInputStream(org.omg.CORBA.ORB orb,
                         byte[] data,
                         int size,
                         GIOPVersion version,
                         CodeBase codeBase) {
    super(orb,
          ByteBuffer.wrap(data),
          size,
          false,
          version, Message.CDR_ENC_VERSION,
          BufferManagerFactory.newBufferManagerRead(
                                  BufferManagerFactory.GROW,
                                  Message.CDR_ENC_VERSION,
                                  (ORB)orb));

    this.codeBase = codeBase;

    performORBVersionSpecificInit();
}
 
Example #6
Source Project: TencentKona-8   Author: Tencent   File: IIOPInputStream.java    License: GNU General Public License v2.0 6 votes vote down vote up
private void skipCustomUsingFVD(ValueMember[] fields,
                                com.sun.org.omg.SendingContext.CodeBase sender)
                                throws InvalidClassException, StreamCorruptedException,
                                       ClassNotFoundException, IOException
{
    readFormatVersion();
    boolean calledDefaultWriteObject = readBoolean();

    if (calledDefaultWriteObject)
        throwAwayData(fields, sender);

    if (getStreamFormatVersion() == 2) {

        ((ValueInputStream)getOrbStream()).start_value();
        ((ValueInputStream)getOrbStream()).end_value();
    }
}
 
Example #7
Source Project: jdk8u60   Author: chenghanpeng   File: EncapsInputStream.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Full constructor with a CodeBase parameter useful for
 * unmarshaling RMI-IIOP valuetypes (technically against the
 * intention of an encapsulation, but necessary due to OMG
 * issue 4795.  Used by ServiceContexts.
 */
public EncapsInputStream(org.omg.CORBA.ORB orb,
                         byte[] data,
                         int size,
                         GIOPVersion version,
                         CodeBase codeBase) {
    super(orb,
          ByteBuffer.wrap(data),
          size,
          false,
          version, Message.CDR_ENC_VERSION,
          BufferManagerFactory.newBufferManagerRead(
                                  BufferManagerFactory.GROW,
                                  Message.CDR_ENC_VERSION,
                                  (ORB)orb));

    this.codeBase = codeBase;

    performORBVersionSpecificInit();
}
 
Example #8
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: IIOPInputStream.java    License: GNU General Public License v2.0 6 votes vote down vote up
private void skipCustomUsingFVD(ValueMember[] fields,
                                com.sun.org.omg.SendingContext.CodeBase sender)
                                throws InvalidClassException, StreamCorruptedException,
                                       ClassNotFoundException, IOException
{
    readFormatVersion();
    boolean calledDefaultWriteObject = readBoolean();

    if (calledDefaultWriteObject)
        throwAwayData(fields, sender);

    if (getStreamFormatVersion() == 2) {

        ((ValueInputStream)getOrbStream()).start_value();
        ((ValueInputStream)getOrbStream()).end_value();
    }
}
 
Example #9
Source Project: jdk8u60   Author: chenghanpeng   File: IIOPInputStream.java    License: GNU General Public License v2.0 6 votes vote down vote up
private Vector getOrderedDescriptions(String repositoryID,
                                      com.sun.org.omg.SendingContext.CodeBase sender) {
    Vector descs = new Vector();

    if (sender == null) {
        return descs;
    }

    FullValueDescription aFVD = sender.meta(repositoryID);
    while (aFVD != null) {
        descs.insertElementAt(aFVD, 0);
        if ((aFVD.base_value != null) && !kEmptyStr.equals(aFVD.base_value)) {
            aFVD = sender.meta(aFVD.base_value);
        }
        else return descs;
    }

    return descs;
}
 
Example #10
Source Project: jdk8u60   Author: chenghanpeng   File: IIOPInputStream.java    License: GNU General Public License v2.0 6 votes vote down vote up
private void skipCustomUsingFVD(ValueMember[] fields,
                                com.sun.org.omg.SendingContext.CodeBase sender)
                                throws InvalidClassException, StreamCorruptedException,
                                       ClassNotFoundException, IOException
{
    readFormatVersion();
    boolean calledDefaultWriteObject = readBoolean();

    if (calledDefaultWriteObject)
        throwAwayData(fields, sender);

    if (getStreamFormatVersion() == 2) {

        ((ValueInputStream)getOrbStream()).start_value();
        ((ValueInputStream)getOrbStream()).end_value();
    }
}
 
Example #11
Source Project: JDKSourceCode1.8   Author: wupeixuan   File: EncapsInputStream.java    License: MIT License 6 votes vote down vote up
/**
 * Full constructor with a CodeBase parameter useful for
 * unmarshaling RMI-IIOP valuetypes (technically against the
 * intention of an encapsulation, but necessary due to OMG
 * issue 4795.  Used by ServiceContexts.
 */
public EncapsInputStream(org.omg.CORBA.ORB orb,
                         byte[] data,
                         int size,
                         GIOPVersion version,
                         CodeBase codeBase) {
    super(orb,
          ByteBuffer.wrap(data),
          size,
          false,
          version, Message.CDR_ENC_VERSION,
          BufferManagerFactory.newBufferManagerRead(
                                  BufferManagerFactory.GROW,
                                  Message.CDR_ENC_VERSION,
                                  (ORB)orb));

    this.codeBase = codeBase;

    performORBVersionSpecificInit();
}
 
Example #12
Source Project: JDKSourceCode1.8   Author: wupeixuan   File: IIOPInputStream.java    License: MIT License 6 votes vote down vote up
private Vector getOrderedDescriptions(String repositoryID,
                                      com.sun.org.omg.SendingContext.CodeBase sender) {
    Vector descs = new Vector();

    if (sender == null) {
        return descs;
    }

    FullValueDescription aFVD = sender.meta(repositoryID);
    while (aFVD != null) {
        descs.insertElementAt(aFVD, 0);
        if ((aFVD.base_value != null) && !kEmptyStr.equals(aFVD.base_value)) {
            aFVD = sender.meta(aFVD.base_value);
        }
        else return descs;
    }

    return descs;
}
 
Example #13
Source Project: JDKSourceCode1.8   Author: wupeixuan   File: IIOPInputStream.java    License: MIT License 6 votes vote down vote up
private void skipCustomUsingFVD(ValueMember[] fields,
                                com.sun.org.omg.SendingContext.CodeBase sender)
                                throws InvalidClassException, StreamCorruptedException,
                                       ClassNotFoundException, IOException
{
    readFormatVersion();
    boolean calledDefaultWriteObject = readBoolean();

    if (calledDefaultWriteObject)
        throwAwayData(fields, sender);

    if (getStreamFormatVersion() == 2) {

        ((ValueInputStream)getOrbStream()).start_value();
        ((ValueInputStream)getOrbStream()).end_value();
    }
}
 
Example #14
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: EncapsInputStream.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Full constructor with a CodeBase parameter useful for
 * unmarshaling RMI-IIOP valuetypes (technically against the
 * intention of an encapsulation, but necessary due to OMG
 * issue 4795.  Used by ServiceContexts.
 */
public EncapsInputStream(org.omg.CORBA.ORB orb,
                         byte[] data,
                         int size,
                         GIOPVersion version,
                         CodeBase codeBase) {
    super(orb,
          ByteBuffer.wrap(data),
          size,
          false,
          version, Message.CDR_ENC_VERSION,
          BufferManagerFactory.newBufferManagerRead(
                                  BufferManagerFactory.GROW,
                                  Message.CDR_ENC_VERSION,
                                  (ORB)orb));

    this.codeBase = codeBase;

    performORBVersionSpecificInit();
}
 
Example #15
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: ValueHandlerImpl.java    License: Apache License 2.0 5 votes vote down vote up
private java.io.Serializable readValueInternal(IIOPInputStream bridge,
                                              org.omg.CORBA_2_3.portable.InputStream in,
                                              int offset,
                                              java.lang.Class clazz,
                                              String repositoryID,
                                              com.sun.org.omg.SendingContext.CodeBase sender)
{
    java.io.Serializable result = null;

    if (clazz == null) {
        // clazz == null indicates an FVD situation for a nonexistant class
        if (isArray(repositoryID)){
            read_Array(bridge, in, null, sender, offset);
        } else {
            bridge.simpleSkipObject(repositoryID, sender);
        }
        return result;
    }

    if (clazz.isArray()) {
        result = (java.io.Serializable)read_Array(bridge, in, clazz, sender, offset);
    } else {
        result = (java.io.Serializable)bridge.simpleReadObject(clazz, repositoryID, sender, offset);
    }

    return result;
}
 
Example #16
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: ValueHandlerImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
private java.io.Serializable readValueInternal(IIOPInputStream bridge,
                                              org.omg.CORBA_2_3.portable.InputStream in,
                                              int offset,
                                              java.lang.Class clazz,
                                              String repositoryID,
                                              com.sun.org.omg.SendingContext.CodeBase sender)
{
    java.io.Serializable result = null;

    if (clazz == null) {
        // clazz == null indicates an FVD situation for a nonexistant class
        if (isArray(repositoryID)){
            read_Array(bridge, in, null, sender, offset);
        } else {
            bridge.simpleSkipObject(repositoryID, sender);
        }
        return result;
    }

    if (clazz.isArray()) {
        result = (java.io.Serializable)read_Array(bridge, in, clazz, sender, offset);
    } else {
        result = (java.io.Serializable)bridge.simpleReadObject(clazz, repositoryID, sender, offset);
    }

    return result;
}
 
Example #17
Source Project: TencentKona-8   Author: Tencent   File: ValueHandlerImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
private java.io.Serializable readValueInternal(IIOPInputStream bridge,
                                              org.omg.CORBA_2_3.portable.InputStream in,
                                              int offset,
                                              java.lang.Class clazz,
                                              String repositoryID,
                                              com.sun.org.omg.SendingContext.CodeBase sender)
{
    java.io.Serializable result = null;

    if (clazz == null) {
        // clazz == null indicates an FVD situation for a nonexistant class
        if (isArray(repositoryID)){
            read_Array(bridge, in, null, sender, offset);
        } else {
            bridge.simpleSkipObject(repositoryID, sender);
        }
        return result;
    }

    if (clazz.isArray()) {
        result = (java.io.Serializable)read_Array(bridge, in, clazz, sender, offset);
    } else {
        result = (java.io.Serializable)bridge.simpleReadObject(clazz, repositoryID, sender, offset);
    }

    return result;
}
 
Example #18
Source Project: jdk8u60   Author: chenghanpeng   File: EncapsInputStreamFactory.java    License: GNU General Public License v2.0 5 votes vote down vote up
public static EncapsInputStream newEncapsInputStream(
        final org.omg.CORBA.ORB orb, final byte[] data, final int size,
        final GIOPVersion version, final CodeBase codeBase) {
    return AccessController
            .doPrivileged(new PrivilegedAction<EncapsInputStream>() {
                @Override
                public EncapsInputStream run() {
                    return new EncapsInputStream(orb, data, size, version,
                            codeBase);
                }
            });
}
 
Example #19
Source Project: jdk8u60   Author: chenghanpeng   File: ValueHandlerImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
private java.io.Serializable readValueInternal(IIOPInputStream bridge,
                                              org.omg.CORBA_2_3.portable.InputStream in,
                                              int offset,
                                              java.lang.Class clazz,
                                              String repositoryID,
                                              com.sun.org.omg.SendingContext.CodeBase sender)
{
    java.io.Serializable result = null;

    if (clazz == null) {
        // clazz == null indicates an FVD situation for a nonexistant class
        if (isArray(repositoryID)){
            read_Array(bridge, in, null, sender, offset);
        } else {
            bridge.simpleSkipObject(repositoryID, sender);
        }
        return result;
    }

    if (clazz.isArray()) {
        result = (java.io.Serializable)read_Array(bridge, in, clazz, sender, offset);
    } else {
        result = (java.io.Serializable)bridge.simpleReadObject(clazz, repositoryID, sender, offset);
    }

    return result;
}
 
Example #20
Source Project: JDKSourceCode1.8   Author: wupeixuan   File: ValueHandlerImpl.java    License: MIT License 5 votes vote down vote up
private java.io.Serializable readValueInternal(IIOPInputStream bridge,
                                              org.omg.CORBA_2_3.portable.InputStream in,
                                              int offset,
                                              java.lang.Class clazz,
                                              String repositoryID,
                                              com.sun.org.omg.SendingContext.CodeBase sender)
{
    java.io.Serializable result = null;

    if (clazz == null) {
        // clazz == null indicates an FVD situation for a nonexistant class
        if (isArray(repositoryID)){
            read_Array(bridge, in, null, sender, offset);
        } else {
            bridge.simpleSkipObject(repositoryID, sender);
        }
        return result;
    }

    if (clazz.isArray()) {
        result = (java.io.Serializable)read_Array(bridge, in, clazz, sender, offset);
    } else {
        result = (java.io.Serializable)bridge.simpleReadObject(clazz, repositoryID, sender, offset);
    }

    return result;
}
 
Example #21
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: EncapsInputStreamFactory.java    License: GNU General Public License v2.0 5 votes vote down vote up
public static EncapsInputStream newEncapsInputStream(
        final org.omg.CORBA.ORB orb, final byte[] data, final int size,
        final GIOPVersion version, final CodeBase codeBase) {
    return AccessController
            .doPrivileged(new PrivilegedAction<EncapsInputStream>() {
                @Override
                public EncapsInputStream run() {
                    return new EncapsInputStream(orb, data, size, version,
                            codeBase);
                }
            });
}
 
Example #22
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: SocketOrChannelConnectionImpl.java    License: Apache License 2.0 4 votes vote down vote up
public final CodeBase getCodeBase() {
    return cachedCodeBase;
}
 
Example #23
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: IIOPInputStream.java    License: GNU General Public License v2.0 4 votes vote down vote up
private void inputClassFields(Object o, final Class<?> cl,
                              ObjectStreamField[] fields,
                              com.sun.org.omg.SendingContext.CodeBase sender)
    throws InvalidClassException, StreamCorruptedException,
           ClassNotFoundException, IOException
{

    int primFields = fields.length - currentClassDesc.objFields;

    if (o != null) {
        for (int i = 0; i < primFields; ++i) {
            inputPrimitiveField(o, cl, fields[i]);
        }
    }

    /* Read and set object fields from the input stream. */
    if (currentClassDesc.objFields > 0) {
        for (int i = primFields; i < fields.length; i++) {
            Object objectValue = null;

            try {
                objectValue = inputObjectField(fields[i]);
            } catch(IndirectionException cdrie) {
                // The CDR stream had never seen the given offset before,
                // so check the recursion manager (it will throw an
                // IOException if it doesn't have a reference, either).
                objectValue = activeRecursionMgr.getObject(cdrie.offset);
            }

            if ((o == null) || (fields[i].getField() == null)) {
                continue;
            }

            try {
                Class<?> fieldCl = fields[i].getClazz();
                if ((objectValue != null)
                        && (!fieldCl.isAssignableFrom(
                                objectValue.getClass()))) {
                    throw new IllegalArgumentException("Field mismatch");
                }
                Field declaredClassField = null;
                final String inputStreamFieldName = fields[i].getName();
                try {
                    declaredClassField = getDeclaredField( cl, inputStreamFieldName);
                } catch (PrivilegedActionException paEx) {
                    throw new IllegalArgumentException(
                        (NoSuchFieldException) paEx.getException());
                } catch (SecurityException secEx) {
                    throw new IllegalArgumentException(secEx);
                }  catch (NullPointerException npEx) {
                    continue;
                } catch (NoSuchFieldException e) {
                    continue;
                }

                if (declaredClassField == null) {
                    continue;
                }
                Class<?> declaredFieldClass = declaredClassField.getType();

                // check input field type is a declared field type
                // input field is a subclass of the declared field
                if (!declaredFieldClass.isAssignableFrom(fieldCl)) {
                    throw new IllegalArgumentException(
                            "Field Type mismatch");
                }
                if (objectValue != null && !fieldCl.isInstance(objectValue)) {
                    throw new IllegalArgumentException();
                }
                bridge.putObject( o, fields[i].getFieldID(), objectValue ) ;
                // reflective code: fields[i].getField().set( o, objectValue ) ;
            } catch (IllegalArgumentException iaEx) {
                String objectValueClassName = "null";
                String currentClassDescClassName = "null";
                String fieldName = "null";
                if (objectValue != null) {
                    objectValueClassName = objectValue.getClass().getName();
                }
                if (currentClassDesc != null) {
                    currentClassDescClassName = currentClassDesc.getName();
                }
                if (fields[i] != null && fields[i].getField() != null) {
                    fieldName = fields[i].getField().getName();
                }
                ClassCastException ccEx = new ClassCastException(
                        "Assigning instance of class " + objectValueClassName
                                + " to field " + currentClassDescClassName + '#' + fieldName);
                ccEx.initCause( iaEx ) ;
                throw ccEx ;
            }
        } // end : for loop
        }
    }
 
Example #24
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: CDRInputStream.java    License: Apache License 2.0 4 votes vote down vote up
public CodeBase getCodeBase() {
    return null;
}
 
Example #25
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: CDRInputObject.java    License: Apache License 2.0 4 votes vote down vote up
public final CodeBase getCodeBase() {
    if (getConnection() == null)
        return null;
    else
        return getConnection().getCodeBase();
}
 
Example #26
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: CDRInputStream_1_0.java    License: Apache License 2.0 4 votes vote down vote up
CodeBase getCodeBase() {
    return parent.getCodeBase();
}
 
Example #27
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: IIOPInputStream.java    License: GNU General Public License v2.0 4 votes vote down vote up
private Object inputObjectField(org.omg.CORBA.ValueMember field,
                                com.sun.org.omg.SendingContext.CodeBase sender)
    throws IndirectionException, ClassNotFoundException, IOException,
           StreamCorruptedException {

    Object objectValue = null;
    Class type = null;
    String id = field.id;

    try {
        type = vhandler.getClassFromType(id);
    } catch(ClassNotFoundException cnfe) {
        // Make sure type = null
        type = null;
    }

    String signature = null;
    if (type != null)
        signature = ValueUtility.getSignature(field);

    if (signature != null && (signature.equals("Ljava/lang/Object;") ||
                              signature.equals("Ljava/io/Serializable;") ||
                              signature.equals("Ljava/io/Externalizable;"))) {
        objectValue = javax.rmi.CORBA.Util.readAny(orbStream);
    } else {
        // Decide what method call to make based on the type. If
        // it is a type for which we need to load a stub, convert
        // the type to the correct stub type.
        //
        // NOTE : Since FullValueDescription does not allow us
        // to ask whether something is an interface we do not
        // have the ability to optimize this check.

        int callType = ValueHandlerImpl.kValueType;

        if (!vhandler.isSequence(id)) {

            if (field.type.kind().value() == kRemoteTypeCode.kind().value()) {

                // RMI Object reference...
                callType = ValueHandlerImpl.kRemoteType;

            } else {

                // REVISIT.  If we don't have the local class,
                // we should probably verify that it's an RMI type,
                // query the remote FVD, and use is_abstract.
                // Our FVD seems to get NullPointerExceptions for any
                // non-RMI types.

                // This uses the local class in the same way as
                // inputObjectField(ObjectStreamField) does.  REVISIT
                // inputObjectField(ObjectStreamField)'s loadStubClass
                // logic.  Assumption is that the given type cannot
                // evolve to become a CORBA abstract interface or
                // a RMI abstract interface.

                if (type != null && type.isInterface() &&
                    (vhandler.isAbstractBase(type) ||
                     ObjectStreamClassCorbaExt.isAbstractInterface(type))) {

                    callType = ValueHandlerImpl.kAbstractType;
                }
            }
        }

        // Now that we have used the FVD of the field to determine the proper course
        // of action, it is ok to use the type (Class) from this point forward since
        // the rep. id for this read will also follow on the wire.

        switch (callType) {
            case ValueHandlerImpl.kRemoteType:
                if (type != null)
                    objectValue = Utility.readObjectAndNarrow(orbStream, type);
                else
                    objectValue = orbStream.read_Object();
                break;
            case ValueHandlerImpl.kAbstractType:
                if (type != null)
                    objectValue = Utility.readAbstractAndNarrow(orbStream, type);
                else
                    objectValue = orbStream.read_abstract_interface();
                break;
            case ValueHandlerImpl.kValueType:
                if (type != null)
                    objectValue = orbStream.read_value(type);
                else
                                        objectValue = orbStream.read_value();
                break;
            default:
                // XXX I18N, logging needed.
                throw new StreamCorruptedException("Unknown callType: " + callType);
        }
    }

    return objectValue;
}
 
Example #28
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: IIOPInputStream.java    License: Apache License 2.0 4 votes vote down vote up
public final CodeBase getSender() {
    return cbSender;
}
 
Example #29
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: IIOPInputStream.java    License: Apache License 2.0 4 votes vote down vote up
final synchronized Object simpleReadObject(Class clz,
                              String repositoryID,
                              com.sun.org.omg.SendingContext.CodeBase sender,
                              int offset)
                                     /* throws OptionalDataException, ClassNotFoundException, IOException */
{

    /* Save the current state and get ready to read an object. */
    Object prevObject = currentObject;
    ObjectStreamClass prevClassDesc = currentClassDesc;
    Class prevClass = currentClass;
    byte oldStreamFormatVersion = streamFormatVersion;

    simpleReadDepth++;      // Entering
    Object obj = null;

    /*
     * Check for reset, handle it before reading an object.
     */
    try {
        // d4365188: backward compatability
        if (vhandler.useFullValueDescription(clz, repositoryID)) {
            obj = inputObjectUsingFVD(clz, repositoryID, sender, offset);
        } else {
            obj = inputObject(clz, repositoryID, sender, offset);
        }

        obj = currentClassDesc.readResolve(obj);
    }
    catch(ClassNotFoundException cnfe)
        {
            bridge.throwException( cnfe ) ;
            return null;
        }
    catch(IOException ioe)
        {
            // System.out.println("CLZ = " + clz + "; " + ioe.toString());
            bridge.throwException(ioe) ;
            return null;
        }
    finally {
        simpleReadDepth --;
        currentObject = prevObject;
        currentClassDesc = prevClassDesc;
        currentClass = prevClass;
        streamFormatVersion = oldStreamFormatVersion;
    }


    /* Check for thrown exceptions and re-throw them, clearing them if
     * this is the last recursive call .
     */
    IOException exIOE = abortIOException;
    if (simpleReadDepth == 0)
        abortIOException = null;
    if (exIOE != null){
        bridge.throwException( exIOE ) ;
        return null;
    }


    ClassNotFoundException exCNF = abortClassNotFoundException;
    if (simpleReadDepth == 0)
        abortClassNotFoundException = null;
    if (exCNF != null) {
        bridge.throwException( exCNF ) ;
        return null;
    }

    return obj;
}
 
Example #30
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: IIOPInputStream.java    License: Apache License 2.0 4 votes vote down vote up
public final synchronized  void simpleSkipObject(String repositoryID,
                                   com.sun.org.omg.SendingContext.CodeBase sender)
                                   /* throws OptionalDataException, ClassNotFoundException, IOException */
{

    /* Save the current state and get ready to read an object. */
    Object prevObject = currentObject;
    ObjectStreamClass prevClassDesc = currentClassDesc;
    Class prevClass = currentClass;
    byte oldStreamFormatVersion = streamFormatVersion;

    simpleReadDepth++;      // Entering
    Object obj = null;

    /*
     * Check for reset, handle it before reading an object.
     */
    try {
        skipObjectUsingFVD(repositoryID, sender);
    }
    catch(ClassNotFoundException cnfe)
        {
            bridge.throwException( cnfe ) ;
            return;
        }
    catch(IOException ioe)
        {
            bridge.throwException( ioe ) ;
            return;
        }
    finally {
        simpleReadDepth --;
        streamFormatVersion = oldStreamFormatVersion;
        currentObject = prevObject;
        currentClassDesc = prevClassDesc;
        currentClass = prevClass;
    }


    /* Check for thrown exceptions and re-throw them, clearing them if
     * this is the last recursive call .
     */
    IOException exIOE = abortIOException;
    if (simpleReadDepth == 0)
        abortIOException = null;
    if (exIOE != null){
        bridge.throwException( exIOE ) ;
        return;
    }


    ClassNotFoundException exCNF = abortClassNotFoundException;
    if (simpleReadDepth == 0)
        abortClassNotFoundException = null;
    if (exCNF != null) {
        bridge.throwException( exCNF ) ;
        return;
    }

    return;
}