/** * Returns all the data serializers in this vm. This method, unlike {@link #getSerializers()}, * does not force loading of the data serializers which were not loaded in the vm earlier. * * @return Array of {@link SerializerAttributesHolder} */ public static SerializerAttributesHolder[] getSerializersForDistribution() { final int size = idsToSerializers.size() + dsClassesToHolders.size(); Collection<SerializerAttributesHolder> coll = new ArrayList<>(size); for (Object v : idsToSerializers.values()) { if (v instanceof InitMarker) { v = ((Marker) v).getSerializer(); } if (v instanceof DataSerializer) { DataSerializer s = (DataSerializer) v; coll.add(new SerializerAttributesHolder(s.getClass().getName(), (EventID) s.getEventId(), (ClientProxyMembershipID) s.getContext(), s.getId())); } } for (final Entry<String, SerializerAttributesHolder> stringSerializerAttributesHolderEntry : dsClassesToHolders .entrySet()) { SerializerAttributesHolder v = stringSerializerAttributesHolderEntry.getValue(); coll.add(v); } return coll.toArray(new SerializerAttributesHolder[coll.size()]); }
/** * Marks a {@code DataSerializer} className for registration with the data serialization framework * if and when it is needed. Does not necessarily load the classes into this VM. * * @param className Name of the DataSerializer class. * @param distribute If true, distribute this data serializer. * @param eventId Event id * @param proxyId proxy id * @see DataSerializer#register(Class) */ public static void register(String className, boolean distribute, EventID eventId, ClientProxyMembershipID proxyId, int id) { register(className, distribute, new SerializerAttributesHolder(className, eventId, proxyId, id)); }
/** * Marks a {@code DataSerializer} className for registration with the data serialization * framework. Does not necessarily load the classes into this VM. * * @param distribute If true, distribute this data serializer. * @see DataSerializer#register(Class) */ public static void register(String className, boolean distribute) { register(className, distribute, new SerializerAttributesHolder()); }