/** * Marks a particular type as being marshallable or not being not marshallable. * * @param type Class to mark as serializable or non-serializable * @param isMarshallable Whether the type can be marshalled or not. */ public void markMarshallable(Class<?> type, boolean isMarshallable) { MarshallingType marshallType = typeHints.get(type); if (marshallableUpdateRequired(isMarshallable, marshallType)) { boolean replaced = typeHints.replace(type, marshallType, new MarshallingType( Boolean.valueOf(isMarshallable), marshallType.sizePredictor)); if (replaced && trace) { log.tracef("Replacing '%s' type to be marshallable=%b", type.getName(), isMarshallable); } } else if (marshallType == null) { if (trace) { log.tracef("Cache '%s' type to be marshallable=%b", type.getName(), isMarshallable); } typeHints.put(type, new MarshallingType( Boolean.valueOf(isMarshallable), new AdaptiveBufferSizePredictor())); } }