@Override protected String readAnnotation(ObjectStreamClass desc) throws IOException, ClassNotFoundException { String annotation = super.readAnnotation(desc); _context.putAnnotation(desc, annotation); return annotation; }
public void readExternal(AnnotatedObjectInputStream in) throws IOException, ClassNotFoundException { if (in.readByte() != SERIAL_VERSION) throw new UnmarshalException("Requested version does not match local version. Please make sure you are using the same version on both ends."); LRMIRemoteClassLoaderIdentifier remoteClassLoaderId = RemoteClassLoaderContext.get(); LRMIRemoteClassLoaderIdentifier previousIdentifier = null; if (remoteClassLoaderId != null) previousIdentifier = LRMIConnection.setRemoteClassLoaderIdentifier(remoteClassLoaderId); result = (T) in.readUnshared(); exception = (Exception) in.readUnshared(); if (remoteClassLoaderId != null) LRMIConnection.setRemoteClassLoaderIdentifier(previousIdentifier); }
@Override protected Class resolveClass(ObjectStreamClass classDesc) throws IOException, ClassNotFoundException { return resolveClass(classDesc, true, null); }
byte version = in.readByte(); if (version != SERIAL_VERSION) throw new UnmarshalException("Requested version [" + version + "] does not match local version [" + SERIAL_VERSION + "]. Please make sure you are using the same version on both ends, service version is " + PlatformVersion.getOfficialVersion()); final byte flags = in.readByte(); _requestObj = in.readObject(); } else { lrmiId = in.readLong(); objectId = in.readLong(); methodOrderId = in.readInt(); remoteClassLoaderId = in.readLong(); if ((flags & BitMap.IS_LIVENESS_PRIORITY) != 0) operationPriority = OperationPriority.LIVENESS;
/** * Reads and returns a class annotation string value (possibly <code>null</code>) that was * written by a corresponding <code>AnnotatedObjectOutputStream</code> implementation. * * <p><code>AnnotatedObjectInputStream</code> implements this method to just read the annotation * value from this stream using {@link ObjectInputStream#readUnshared readUnshared}, and if * <code>readUnshared</code> returns a non-<code>null</code> value that is not a * <code>String</code>, an {@link InvalidObjectException} is thrown. * * <p>A subclass can override this method to read the annotation from a different location. * * @return the class annotation string value read (possibly <code>null</code>) * @throws IOException if an I/O exception occurs reading the annotation * @throws ClassNotFoundException if a <code>ClassNotFoundException</code> occurs reading the * annotation **/ protected String readAnnotation(ObjectStreamClass desc) throws IOException, ClassNotFoundException { try { return (String) readUnshared(); } catch (ClassCastException e) { InvalidObjectException ioe = new InvalidObjectException("Annotation is not String or null"); ioe.initCause(e); throw ioe; } }
cl = super.resolveProxyClass(interfaceNames);
/** * Overrides the super method and tries to get the class descriptor from a local map. If not * found read from the stream and save to local map. * * @return class descriptor */ @Override protected ObjectStreamClass readClassDescriptor() throws IOException, ClassNotFoundException { ObjectStreamClass cl = null; int index = readInt(); if (index != -1) cl = _context.getObjectStreamClass(index); if (cl == null) { if (_logger.isLoggable(Level.FINEST)) { Long classLoaderKey = ClassLoaderCache.getCache().getClassLoaderKey(ClassLoaderHelper.getContextClassLoader()); logFinest("Received new incoming ObjectStreamClass with key " + index + ", context class loader key " + classLoaderKey + ", reading it from stream"); } cl = super.readClassDescriptor(); if (index != -1) _context.addObjectStreamClass(index, cl); } return cl; }
if (containsAnnotation) annotation = _context.getAnnotation(classDesc); resolvedClass = super.resolveClass(classDesc, !containsAnnotation, annotation);
throws IOException, ClassNotFoundException { if (readAnnotation) { codebase = readAnnotation(classDesc);