public void registerClasses(@Nonnull final Class<K> keyClass, @Nonnull final Class<V> valueClass) {
        try {
            final JAXBContext jaxbContext = JAXBContext.newInstance(keyClass, valueClass);
            marshaller = jaxbContext.createMarshaller();
            unmarshaller = jaxbContext.createUnmarshaller();
            this.keyClass = keyClass;
            this.valueClass = valueClass;
        } catch (JAXBException e) {
            throw new IllegalArgumentException("Unable to create a cache using classes " + keyClass + " and " + valueClass, e);
        }
    }
The cache will store (in serialized form) entries of which the keys are instances of the provided keyClass
argument. The values are correspondingly instances of the provided valueClass argument.

When this method is invoked more than once, the definitions provided by the last invocation will be used.

@param keyClass The class of instances used as keys.
@param valueClass The class of instances used as values.
@throws IllegalArgumentException when keyClass and/or valueClass cannot be used to serialize and deserialize instances.
xmppserver/src/main/java/org/jivesoftware/util/cache/SerializingCache.java