/** * Objects read and written with repetitive must be immutable (cannot be changed as they are * kept in underlying map, changing them will affect the next repetitiveRead/Write */ public static <T> T readRepetitiveObject(ObjectInput in) throws IOException, ClassNotFoundException { if (in instanceof MarshalInputStream) return (T) ((MarshalInputStream) in).readRepetitiveObject(); return (T) readObject(in); }
@Override public CompressedMarshObjectConvertor allocate( IMemoryAwareResourcePool resourcePool) { return new CompressedMarshObjectConvertor(9, SmartLengthBasedCache.toCacheCallback(resourcePool)); } }
@Override public MarshObjectConvertor allocate( final IMemoryAwareResourcePool resourcePool) { return new MarshObjectConvertor(SmartLengthBasedCache.toCacheCallback(resourcePool)); } }
/** * Shrink string over the wire, should be used for constant number of strings which are * repetitive (i.e space names, class names) */ public static void writeRepetitiveString(ObjectOutput out, String s) throws IOException { if (out instanceof MarshalOutputStream) ((MarshalOutputStream) out).writeRepetitiveObject(s); else writeString(out, s); }
/** * Read strings that were Shrinked using {@link #writeRepetitiveString(ObjectOutput, String)} */ public static String readRepetitiveString(ObjectInput in) throws IOException, ClassNotFoundException { if (in instanceof MarshalInputStream) return (String) ((MarshalInputStream) in).readRepetitiveObject(); return readString(in); }
@Override public MarshObjectConvertor allocate( IMemoryAwareResourcePool resourcePool) { return new ContextClassResolverMarshObjectConvertor(SmartLengthBasedCache.toCacheCallback(resourcePool)); } }
public synchronized Class<?> getClassFromAnnotateInterfaceNameMap(NamesWrapper names) { ClassLoaderContext classLoaderContext = getClassLoaderContext(false); if (classLoaderContext == null) return null; return classLoaderContext.getClassFromAnnotateInterfaceNameMap(names); }
public synchronized int getObjectStreamClassKey(ObjectStreamClass desc) { ClassLoaderContext classLoaderContext = getClassLoaderContext(false); if (classLoaderContext == null) return 0; return classLoaderContext.getObjectStreamClassKey(desc); }
/** * Should only be used for objects that their class is known to SystemJars.DATA_GRID_JAR, * meaning at SystemJars.DATA_GRID_JAR, its dependencies or JDK Objects read and written with * repetitive must be immutable (cannot be changed as they are kept in underlying map, changing * them will affect the next repetitiveRead/Write */ public static void writeRepetitiveObject(ObjectOutput out, Object obj) throws IOException { if (out instanceof MarshalOutputStream) ((MarshalOutputStream) out).writeRepetitiveObject(obj); else writeObject(out, obj); }
@Override protected String readAnnotation(ObjectStreamClass desc) throws IOException, ClassNotFoundException { String annotation = super.readAnnotation(desc); _context.putAnnotation(desc, annotation); return annotation; }
public synchronized boolean containsAnnotation(Class<?> cl) { ClassLoaderContext classLoaderContext = getClassLoaderContext(false); if (classLoaderContext == null) return false; return classLoaderContext.containsAnnotation(cl); }
public synchronized Class<?> getResolvedClass(ObjectStreamClass classDesc) { ClassLoaderContext classLoaderContext = getClassLoaderContext(false); if (classLoaderContext == null) return null; return classLoaderContext.getResolvedClass(classDesc); }
@Override public ContextClassResolverCompressedMarshObjectConvertor allocate( final IMemoryAwareResourcePool resourcePool) { return new ContextClassResolverCompressedMarshObjectConvertor(9, SmartLengthBasedCache.toCacheCallback(resourcePool)); } }
/** * Closes a previously opened key. * * @param keyHandle handle to opened key. */ private static void closeKey(Integer keyHandle) { if (keyHandle == null) return; // Invoke registry operation, get result: Integer result = invokeRegistryMethod(_closeKeyMethod, keyHandle); if (result != ERROR_SUCCESS) throw new WindowsRegistryException("Error. Code=" + result); }
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { _className = IOUtils.readString(in); _uid = IOUtils.readString(in); _operationID = IOUtils.readObject(in); }
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { _className = IOUtils.readString(in); _uid = IOUtils.readString(in); }
/** * * @return */ public static IMemoryAwareResourceFactory<MarshObjectConvertor> getFactory() { if (_factory == null) _factory = new ContextClassResolverMarshObjectConvertorFactory(); return _factory; }
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { _entryPacket = IOUtils.readObject(in); }
/** * @return factory object */ public static IMemoryAwareResourceFactory<CompressedMarshObjectConvertor> getFactory() { if (_factory == null) _factory = new ContextClassResolverCompressedMarshObjectConvertorFactory(); return _factory; }