[prev in list] [next in list] [prev in thread] [next in thread]
List: xmlrpc-user
Subject: Re: access persistent objects across servlets
From: Daniel Noll <daniel () nuix ! com ! au>
Date: 2006-10-30 23:27:12
Message-ID: 45468A50.2050303 () nuix ! com ! au
[Download RAW message or body]
Perry Nguyen wrote:
> I have what is necessary documented for Spring on my blog
> http://www.hanhuy.com/pfn/ws-xmlrpc-and-spring
This is basically the solution I've come to (I had asked basically the
exact same question on the list only a week earlier and got the same
advice to make a custom RequestProcessorFactoryFactory.
Mine looks like this (it's hard to indent here because some of the class
names are reaaaally long. :-))
public class CustomRequestProcessorFactoryFactory
extends
RequestProcessorFactoryFactory.StatelessProcessorFactoryFactory {
private Map<Class, Object> mappings = new HashMap<Class, Object>();
public void addMapping(Class clazz, Object object) {
mappings.put(clazz, object);
}
public RequestProcessorFactory getRequestProcessorFactory(
final Class aClass) throws XmlRpcException {
return new RequestProcessorFactory() {
public Object getRequestProcessor(XmlRpcRequest xmlRpcRequest) {
return mappings.get(aClass);
}
};
}
}
It's a little laborious still because you have to then double-map any
given URL (String -> Class, Class -> Object)... but a little convenience
wrapper would solve that I suppose. :-)
Although I'm getting some runtime error running version 3.0 which
prevents me from testing it, :-/ it should work in theory.
Daniel
--
Daniel Noll
Nuix Pty Ltd
Suite 79, 89 Jones St, Ultimo NSW 2007, Australia Ph: +61 2 9280 0699
Web: http://www.nuix.com.au/ Fax: +61 2 9212 6902
This message is intended only for the named recipient. If you are not
the intended recipient you are notified that disclosing, copying,
distributing or taking any action in reliance on the contents of this
message or attachment is strictly prohibited.
---------------------------------------------------------------------
To unsubscribe, e-mail: xmlrpc-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: xmlrpc-dev-help@ws.apache.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic