When https://issues.jboss.org/browse/ISPN-1413 is implemented, all this should go since we'll have a single classloader for the entire cache manager. The code has changed slightly since we separated cache vs global marshallers (to accomodate per cache class loader), so some of the code I wrote originally might not be needed any more, such as the suggestions both you made.

As far as the user is concerned, I've only seen one person configuring the marshaller instance, and that's where this JIRA has come from, so I don't consider changing this urgent, plus we don't make any guarantees to user-defined marshallers wrt to the use of global vs cache marshaller. To them, it's just a single marshaller used for everything.