/** * Registers an {@code Instantiator} with the data serialization framework. */ public static void register(Instantiator instantiator, boolean distribute) { // [sumedh] Skip the checkForThread() check if the instantiation has not // to be distributed. This allows instantiations from ServerConnection // thread in client security plugins, for example. This is particularly // useful for native clients that do not send a REGISTER_INSTANTIATORS // message rather rely on server side registration, so each server can // do the registration with distribute set to false. if (!distribute || checkForThread()) { _register(instantiator, distribute); } }
/** * Creates a new {@code Instantiator} with the given class and id and * {@linkplain #register(Instantiator, boolean) registers} it with the data serialization * framework. * * @throws IllegalArgumentException The instantiator cannot be created * @throws IllegalStateException The instantiator cannot be registered */ public static void register(Class instantiatorClass, Class instantiatedClass, int id, boolean distribute) { if (checkForThread()) { Instantiator inst = newInstance(instantiatorClass, instantiatedClass, id); _register(inst, distribute); } }
/** * Creates a new {@code Instantiator} with the given class and id and * {@linkplain #register(Instantiator, boolean) registers} it with the data serialization * framework. * * This method is only called when server connection and CacheClientUpdaterThread * * @throws IllegalArgumentException The instantiator cannot be created * @throws IllegalStateException The instantiator cannot be registered */ public static void register(Class instantiatorClass, Class instantiatedClass, int id, boolean distribute, EventID eventId, ClientProxyMembershipID context) { Instantiator inst = newInstance(instantiatorClass, instantiatedClass, id); // This method is only called when server connection and CacheClientUpdaterThread inst.setEventId(eventId); inst.setContext(context); _register(inst, distribute); }