From xmlrpc-user-return-2000-apmail-ws-xmlrpc-user-archive=ws.apache.org@ws.apache.org Tue Aug 22 09:42:21 2006 Return-Path: Delivered-To: apmail-ws-xmlrpc-user-archive@www.apache.org Received: (qmail 10099 invoked from network); 22 Aug 2006 09:42:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 22 Aug 2006 09:42:21 -0000 Received: (qmail 43378 invoked by uid 500); 22 Aug 2006 09:42:20 -0000 Delivered-To: apmail-ws-xmlrpc-user-archive@ws.apache.org Received: (qmail 43368 invoked by uid 500); 22 Aug 2006 09:42:20 -0000 Mailing-List: contact xmlrpc-user-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: xmlrpc-user@ws.apache.org List-Id: Delivered-To: mailing list xmlrpc-user@ws.apache.org Received: (qmail 43359 invoked by uid 99); 22 Aug 2006 09:42:20 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Aug 2006 02:42:20 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of lists@nabble.com designates 72.21.53.35 as permitted sender) Received: from [72.21.53.35] (HELO talk.nabble.com) (72.21.53.35) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Aug 2006 02:42:19 -0700 Received: from [72.21.53.38] (helo=jubjub.nabble.com) by talk.nabble.com with esmtp (Exim 4.50) id 1GFSli-00015j-RF for xmlrpc-user@ws.apache.org; Tue, 22 Aug 2006 02:41:59 -0700 Message-ID: <5922360.post@talk.nabble.com> Date: Tue, 22 Aug 2006 02:41:58 -0700 (PDT) From: Jimisola Laursen To: xmlrpc-user@ws.apache.org Subject: RE: HandlerMapping problem (3.0b1 to 3.0rc1) In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit References: <5603572.post@talk.nabble.com> <44CFC7AF.9040006@gmail.com> <5603818.post@talk.nabble.com> <5916882.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Please note that I actually haven't had time to test the code below yet because I am still working on the protocol between server and client, but I believe that this is the way to do it. E.g.: public class MyProcessorFactoryFactory extends StatelessProcessorFactoryFactory { private DataSource dataSource; public AgentRPCProcessorFactoryFactory(DataSource dataSource) { super(); this.dataSource = dataSource; } protected Object getRequestProcessor(Class pClass) throws XmlRpcException { Object result = super.getRequestProcessor(pClass); // initialize request processors if (result instanceof MyRPCImpl) // I use a Proxy solution { AgentRPCImpl agentRPCImpl = (AgentRPCImpl) result; agentRPCImpl.init(this.dataSource); } return result; } } Bellekens, P.A.E. wrote: > > Hi Jmisola, > > Thanks for your reply! > But I must say that I still do not completely understand these > constructs. > > If I instantiate my HandlerMapping as follows: > > PropertyHandlerMapping dhm = new PropertyHandlerMapping(); > dhm.addHandler("Box", XMLRpcMethodForwarder.class); > dhm.setRequestProcessorFactoryFactory(new > MyRequestProcessorFactoryFactory()); > > with the factory extension (just like described in the API): > > public class MyRequestProcessorFactoryFactory extends > RequestSpecificProcessorFactoryFactory { > > protected Object getRequestProcessor(Class pClass, XmlRpcRequest > pRequest) { > Object result = null; > System.out.println("test1"); > try { > result = super.getRequestProcessor(pClass, pRequest); > System.out.println(pClass+" - "+pRequest); > } catch (XmlRpcException e) { > // TODO Auto-generated catch block > e.printStackTrace(); > } > // Configure the object here > //... > return result; > } > > What does this help me? > First of all when I compile this code and fire some client requests, the > printout "test1" is never shown while the API doc says: > > "A new instance is created and initialized for any request" > > And secondly, what can I configure here? The "getRequestProcessor" > method returns an object, not much you can do with that... > > Can somebody maybe explain how I can feed the class with a parameter? > > Greetz > p. > > > -----Original Message----- > From: Jimisola Laursen [mailto:lists@jimisola.com] > Sent: dinsdag 22 augustus 2006 1:23 > To: xmlrpc-user@ws.apache.org > Subject: Re: HandlerMapping problem (3.0b1 to 3.0rc1) > > > Hi! > > Have a look at the different RequestProcessorFactory (sub)classes: > > http://ws.apache.org/xmlrpc/apidocs/org/apache/xmlrpc/server/RequestProc > essorFactoryFactory.html > > Regards, > Jimisola > > -- > View this message in context: > http://www.nabble.com/From-DynamicHandlerMapping-to-----%283.0b1-to-3.0r > c1%29-tf2036402.html#a5916882 > Sent from the Apache Xml-RPC - User forum at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: xmlrpc-user-unsubscribe@ws.apache.org > For additional commands, e-mail: xmlrpc-user-help@ws.apache.org > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: xmlrpc-user-unsubscribe@ws.apache.org > For additional commands, e-mail: xmlrpc-user-help@ws.apache.org > > > -- View this message in context: http://www.nabble.com/From-DynamicHandlerMapping-to-----%283.0b1-to-3.0rc1%29-tf2036402.html#a5922360 Sent from the Apache Xml-RPC - User forum at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: xmlrpc-user-unsubscribe@ws.apache.org For additional commands, e-mail: xmlrpc-user-help@ws.apache.org