On Thu, Jun 19, 2008 at 2:38 AM, Michael Clark <[EMAIL PROTECTED]>wrote:
> > We really need to do some work to make it easier to register custom > serializers - currently it is a little "all or nothing" as if you need a > different precedence to override an existing serializer, you need to > re-register all serializers. This part of the bridge API could be > improved to make it easier to override an existing serializer. > > Michael said this a few months back and I have developed a simple fix for this problem, by adding a few new constructors to JSONRPCBridge. The main constructor is now JSONBridge(List<Serializer> serializers), the argument being the serializers that will be used. You can opt not to use this by using the JSONRPCBridge(final String serializersFilename). The argument is a the name of a file which has the names of the serializer classes to add, one serializer per line. This obviously assumes that a default constructor for the class to create it. If a serializer needs its own arguments upon creation, then you will have to programmatically create it instead. If this file is not found, then the default serializers (as are currently occurs) will be used. Finally, a default constructor exists. This looks for "serializers.txt" to find the serializers in. If they are not found, then the serializers will be the default ones. So if you don't have a serializers file and you call the old constructor, it will work just as you expect. I shall start adding to svn some new serializers that people have mailed to us previously. Hopefully this makes everyone happy! Cheers, Will
_______________________________________________ Jabsorb-dev mailing list [email protected] http://lists.jabsorb.org/mailman/listinfo/jabsorb-dev
