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 File: IIOPInputStream.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
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 #2
Source File: IIOPInputStream.java From jdk1.8-source-analysis with Apache License 2.0 | 6 votes |
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 #3
Source File: IIOPInputStream.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
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 #4
Source File: IIOPInputStream.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
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 #5
Source File: IIOPInputStream.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
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 #6
Source File: IIOPInputStream.java From jdk1.8-source-analysis with Apache License 2.0 | 6 votes |
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 #7
Source File: IIOPInputStream.java From JDKSourceCode1.8 with MIT License | 6 votes |
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 #8
Source File: EncapsInputStream.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
/** * 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 #9
Source File: EncapsInputStream.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
/** * 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 #10
Source File: IIOPInputStream.java From JDKSourceCode1.8 with MIT License | 6 votes |
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 File: EncapsInputStream.java From JDKSourceCode1.8 with MIT License | 6 votes |
/** * 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 File: IIOPInputStream.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
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 #13
Source File: EncapsInputStream.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
/** * 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 #14
Source File: EncapsInputStream.java From jdk1.8-source-analysis with Apache License 2.0 | 6 votes |
/** * 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 File: EncapsInputStreamFactory.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
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 #16
Source File: EncapsInputStreamFactory.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
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 #17
Source File: ValueHandlerImpl.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
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 File: ValueHandlerImpl.java From jdk1.8-source-analysis with Apache License 2.0 | 5 votes |
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 #19
Source File: ValueHandlerImpl.java From JDKSourceCode1.8 with MIT License | 5 votes |
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 File: ValueHandlerImpl.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
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 File: ValueHandlerImpl.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
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 #22
Source File: CDRInputObject.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
public final CodeBase getCodeBase() { if (getConnection() == null) return null; else return getConnection().getCodeBase(); }
Example #23
Source File: IIOPInputStream.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
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 #24
Source File: IIOPInputStream.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
/** * This input method uses FullValueDescriptions retrieved from the sender's runtime to * read in the data. This method is capable of throwing out data not applicable to client's fields. * * NOTE : If the local description indicates custom marshaling and the remote type's FVD also * indicates custom marsahling than the local type is used to read the data off the wire. However, * if either says custom while the other does not, a MARSHAL error is thrown. Externalizable is * a form of custom marshaling. * */ private Object skipObjectUsingFVD(String repositoryID, com.sun.org.omg.SendingContext.CodeBase sender) throws IOException, ClassNotFoundException { Enumeration fvdsList = getOrderedDescriptions(repositoryID, sender).elements(); while(fvdsList.hasMoreElements()) { FullValueDescription fvd = (FullValueDescription)fvdsList.nextElement(); String repIDForFVD = vhandler.getClassName(fvd.id); if (!repIDForFVD.equals("java.lang.Object")) { if (fvd.is_custom) { readFormatVersion(); boolean calledDefaultWriteObject = readBoolean(); if (calledDefaultWriteObject) inputClassFields(null, null, null, fvd.members, sender); if (getStreamFormatVersion() == 2) { ((ValueInputStream)getOrbStream()).start_value(); ((ValueInputStream)getOrbStream()).end_value(); } // WARNING: If stream format version is 1 and there's // optional data, we'll get some form of exception down // the line. } else { // Use default marshaling inputClassFields(null, null, null, fvd.members, sender); } } } // end : while(fvdsList.hasMoreElements()) return null; }
Example #25
Source File: IIOPInputStream.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
private void inputClassFields(Object o, 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.isInstance(objectValue)) { throw new IllegalArgumentException(); } bridge.putObject( o, fields[i].getFieldID(), objectValue ) ; // reflective code: fields[i].getField().set( o, objectValue ) ; } catch (IllegalArgumentException e) { ClassCastException exc = new ClassCastException("Assigning instance of class " + objectValue.getClass().getName() + " to field " + currentClassDesc.getName() + '#' + fields[i].getField().getName()); exc.initCause( e ) ; throw exc ; } } // end : for loop } }
Example #26
Source File: IIOPInputStream.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
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; }
Example #27
Source File: CDRInputObject.java From JDKSourceCode1.8 with MIT License | 4 votes |
public final CodeBase getCodeBase() { if (getConnection() == null) return null; else return getConnection().getCodeBase(); }
Example #28
Source File: IIOPInputStream.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
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 #29
Source File: CDRInputStream.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
public CodeBase getCodeBase() { return null; }
Example #30
Source File: IIOPInputStream.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
public final void setSender(CodeBase cb) { cbSender = cb; }