/** * Pre-registers a few common types that are often proxied to * speed up lookups. */ private static void preRegister() { ThrowableProxy proxy = new ThrowableProxy(); registry.register(MessageException.class, proxy); registry.register(LocalizedException.class, proxy); registry.register(Throwable.class, proxy); MapProxy mapProxy = new MapProxy(); registry.register(ASObject.class, mapProxy); registry.register(HashMap.class, mapProxy); registry.register(AbstractMap.class, mapProxy); registry.register(Map.class, mapProxy); }
/** * Pre-registers a few common types that are often proxied to * speed up lookups. */ private static void preRegister() { ThrowableProxy proxy = new ThrowableProxy(); registry.register(MessageException.class, proxy); registry.register(LocalizedException.class, proxy); registry.register(Throwable.class, proxy); MapProxy mapProxy = new MapProxy(); registry.register(ASObject.class, mapProxy); registry.register(HashMap.class, mapProxy); registry.register(AbstractMap.class, mapProxy); registry.register(Map.class, mapProxy); }
/** * Pre-registers a few common types that are often proxied to * speed up lookups. */ private static void preRegister() { ThrowableProxy proxy = new ThrowableProxy(); registry.register(MessageException.class, proxy); registry.register(LocalizedException.class, proxy); registry.register(Throwable.class, proxy); MapProxy mapProxy = new MapProxy(); registry.register(ASObject.class, mapProxy); registry.register(HashMap.class, mapProxy); registry.register(AbstractMap.class, mapProxy); registry.register(Map.class, mapProxy); }
/** * Registers the given {@link SpringPropertyProxy} with the BlazeDS {@link PropertyProxyRegistry}. * @param proxy the property proxy to register */ protected void registerPropertyProxy(SpringPropertyProxy proxy) { PropertyProxyRegistry.getRegistry().register(proxy.getBeanType(), proxy); }
/** * Returns a PropertyProxy suitable for the given instance and registers * the selected PropertyProxy for the Class of the instance. Note that * the PropertyProxy is not cloned so either the PropertyProxy should be * used as a template else you must first call clone() on the returned * PropertyProxy and then set the instance as the default on the resulting * clone. * * @param instance the type to search for a suitable PropertyProxy. * @return PropertyProxy suitable for the instance type. */ public static PropertyProxy getProxyAndRegister(Object instance) { if (instance instanceof PropertyProxy) return (PropertyProxy)instance; Class c = instance.getClass(); PropertyProxy proxy = getRegistry().getProxyAndRegister(c); if (proxy == null) { proxy = guessProxy(instance); getRegistry().register(c, proxy); } return proxy; }
/** * Returns a PropertyProxy suitable for the given instance and registers * the selected PropertyProxy for the Class of the instance. Note that * the PropertyProxy is not cloned so either the PropertyProxy should be * used as a template else you must first call clone() on the returned * PropertyProxy and then set the instance as the default on the resulting * clone. * * @param instance the type to search for a suitable PropertyProxy. * @return PropertyProxy suitable for the instance type. */ public static PropertyProxy getProxyAndRegister(Object instance) { if (instance instanceof PropertyProxy) return (PropertyProxy)instance; Class c = instance.getClass(); PropertyProxy proxy = getRegistry().getProxyAndRegister(c); if (proxy == null) { proxy = guessProxy(instance); getRegistry().register(c, proxy); } return proxy; }
/** * Returns a PropertyProxy suitable for the given instance and registers * the selected PropertyProxy for the Class of the instance. Note that * the PropertyProxy is not cloned so either the PropertyProxy should be * used as a template else you must first call clone() on the returned * PropertyProxy and then set the instance as the default on the resulting * clone. * * @param instance the type to search for a suitable PropertyProxy. * @return PropertyProxy suitable for the instance type. */ public static PropertyProxy getProxyAndRegister(Object instance) { if (instance instanceof PropertyProxy) return (PropertyProxy)instance; Class c = instance.getClass(); PropertyProxy proxy = getRegistry().getProxyAndRegister(c); if (proxy == null) { proxy = guessProxy(instance); getRegistry().register(c, proxy); } return proxy; }