/** * Get current TypeMarshallingContext object * @return The current thread's TypeMarshallingContext. */ public static TypeMarshallingContext getTypeMarshallingContext() { TypeMarshallingContext context = contexts.get(); if (context == null) { context = new TypeMarshallingContext(); TypeMarshallingContext.setTypeMarshallingContext(context); } return context; }
/** * * Destroy static thread local storage. * Call ONLY on shutdown. */ public static void releaseThreadLocalObjects() { clearThreadLocalObjects(); contexts = null; marshallers = null; }
public Object createShell(Object encodedObject, Class desiredClass) { Object shell = null; Class cls; String type = TypeMarshallingContext.getType(encodedObject); if (type != null) { TypeMarshallingContext context = TypeMarshallingContext.getTypeMarshallingContext(); cls = ClassUtil.createClass(type, context.getClassLoader()); } else { cls = desiredClass; } shell = ClassUtil.createDefaultInstance(cls, null); return shell; }
/** * Clear all object reference information so that the instance * can be used to deserialize another data structure. * * Reset should be called before reading a top level object, * such as a new header or a new body. */ public void reset() { TypeMarshallingContext marshallingContext = TypeMarshallingContext.getTypeMarshallingContext(); marshallingContext.reset(); }
/** * A utility method which returns the Class from the given Class name * using the current type context's class loader. * * @param className the class name. * @return a Class object for the named class. */ public static Class getClassFromClassName(String className) { TypeMarshallingContext typeContext = TypeMarshallingContext.getTypeMarshallingContext(); return ClassUtil.createClass(className, typeContext.getClassLoader()); }
protected Object decodeArray(Object shellArray, Collection collection, Class arrayElementClass) { Object[] array = collection.toArray(); TypeMarshallingContext.getTypeMarshallingContext().getKnownObjects().put(array, shellArray); return decodeArray(shellArray, array, arrayElementClass); }
public static void createThreadLocals() { // allocate static thread local objects FlexContext.createThreadLocalObjects(); SerializationContext.createThreadLocalObjects(); TypeMarshallingContext.createThreadLocalObjects(); }
private void destroyThreadLocals() { // clear static member variables for shutdown MBeanServerLocatorFactory.clear(); // If available, invoke the MessageBroker.releaseThreadLocalObjects() method: Method releaseThreadLocalObjMethod = ReflectionUtils.findMethod(MessageBroker.class, "releaseThreadLocalObjects"); if (releaseThreadLocalObjMethod != null) { ReflectionUtils.invokeMethod(releaseThreadLocalObjMethod, null); } FlexContext.releaseThreadLocalObjects(); SerializationContext.releaseThreadLocalObjects(); TypeMarshallingContext.releaseThreadLocalObjects(); }
currentMatch.convertedSuppliedTypes = new Class[desiredParamTypes.length]; TypeMarshaller marshaller = TypeMarshallingContext.getTypeMarshaller();
public static boolean isTypedObject(Object encodedObject) { boolean typed = false; if (encodedObject instanceof ASObject) { typed = TypeMarshallingContext.getType(encodedObject) != null; } return typed; }
protected Object decodeArray(Object shellArray, Collection collection, Class arrayElementClass) { Object[] array = collection.toArray(); TypeMarshallingContext.getTypeMarshallingContext().getKnownObjects().put(array, shellArray); return decodeArray(shellArray, array, arrayElementClass); }
/** * Clear all object reference information so that the instance * can be used to deserialize another data structure. * * Reset should be called before reading a top level object, * such as a new header or a new body. */ public void reset() { nestObjectLevel = 0; nestCollectionLevel = 0; TypeMarshallingContext marshallingContext = TypeMarshallingContext.getTypeMarshallingContext(); marshallingContext.reset(); }
/** * A utility method which returns the Class from the given Class name * using the current type context's class loader. * * @param className the class name. * @return a Class object for the named class. */ public static Class getClassFromClassName(String className) { TypeMarshallingContext typeContext = TypeMarshallingContext.getTypeMarshallingContext(); return ClassUtil.createClass(className, typeContext.getClassLoader()); }
private void initThreadLocals() { // allocate static thread local objects // If available, invoke the MessageBroker.createThreadLocalObjects() method: Method createThreadLocalObjMethod = ReflectionUtils.findMethod(MessageBroker.class, "createThreadLocalObjects"); if (createThreadLocalObjMethod != null) { ReflectionUtils.invokeMethod(createThreadLocalObjMethod, null); } FlexContext.createThreadLocalObjects(); SerializationContext.createThreadLocalObjects(); TypeMarshallingContext.createThreadLocalObjects(); PropertyProxyRegistry.getRegistry(); }
protected static void destroyThreadLocals() { // clear static member variables Log.clear(); MBeanServerLocatorFactory.clear(); // Destroy static thread local objects FlexContext.releaseThreadLocalObjects(); SerializationContext.releaseThreadLocalObjects(); TypeMarshallingContext.releaseThreadLocalObjects(); }
currentMatch.convertedSuppliedTypes = new Class[desiredParamTypes.length]; TypeMarshaller marshaller = TypeMarshallingContext.getTypeMarshaller();
public static boolean isTypedObject(Object encodedObject) { boolean typed = false; if (encodedObject instanceof ASObject) { typed = TypeMarshallingContext.getType((ASObject)encodedObject) != null; } return typed; }
protected Object decodeArray(Object shellArray, Collection collection, Class arrayElementClass) { Object[] array = collection.toArray(); TypeMarshallingContext.getTypeMarshallingContext().getKnownObjects().put(array, shellArray); return decodeArray(shellArray, array, arrayElementClass); }
public Object createShell(Object encodedObject, Class desiredClass) { Object shell = null; Class cls; String type = TypeMarshallingContext.getType(encodedObject); if (type != null) { TypeMarshallingContext context = TypeMarshallingContext.getTypeMarshallingContext(); cls = ClassUtil.createClass(type, context.getClassLoader()); } else { cls = desiredClass; } shell = ClassUtil.createDefaultInstance(cls, null); return shell; }
/** * Clear all object reference information so that the instance * can be used to deserialize another data structure. * * Reset should be called before reading a top level object, * such as a new header or a new body. */ public void reset() { nestObjectLevel = 0; nestCollectionLevel = 0; TypeMarshallingContext marshallingContext = TypeMarshallingContext.getTypeMarshallingContext(); marshallingContext.reset(); }