|
List Info
Thread: From DynamicHandlerMapping to ??? (3.0b1 to 3.0rc1)
|
|
| From DynamicHandlerMapping to ??? (3.0b1
to 3.0rc1) |

|
2006-08-01 21:31:00 |
Hi!
What happend with DynamicHandlerMapping between 3.0b1 and
3.0rc1?
My 3.0b1 code looks like this:
// use reflection for (dynamic) mapping
DynamicHandlerMapping dhm = new
DynamicHandlerMapping(new
TypeConverterFactoryImpl(), true);
//dhm.setInitializationHandler()
// add handler - using full name for use by
dynamic proxy
dhm.addHandler(AgentRPC.class.getName(),
AgentRPCImpl.class);
xmlRpcServer.setHandlerMapping(dhm);
The only class that now implements
AbstractReflectiveHandlerMapping is
PropertyHandlerMapping. I really liked the
DynamicHandlerMapping and would
like to continue to use this solution. Have it been deleted
by mistake or is
done differently with the addition of
RequestProcessorFactoryFactory.RequestProcessorFactory?
I thought that the DynamicHandlerMapping would take an
RequestProcessorFactory as a parameter in the constructor...
Regards,
Jimisola
--
View this message in context: http://www.
nabble.com/From-DynamicHandlerMapping-to-----%283.0b1-to-3.0
rc1%29-tf2036402.html#a5603572
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
|
|
| From DynamicHandlerMapping to ??? (3.0b1
to 3.0rc1) |

|
2006-08-01 21:29:19 |
Jimisola Laursen wrote:
> What happend with DynamicHandlerMapping between 3.0b1
and 3.0rc1?
It's methods have been moved to the PropertyHandlerMapping.
There has
been no point in the distinction after the property mapping
needed to be
able to modify its state later on.
Jochen
------------------------------------------------------------
---------
To unsubscribe, e-mail: xmlrpc-user-unsubscribe ws.apache.org
For additional commands, e-mail: xmlrpc-user-help ws.apache.org
|
|
| From DynamicHandlerMapping to ??? (3.0b1
to 3.0rc1) |

|
2006-08-01 21:46:44 |
Ok. Makes sense.
However, I don't think that the name PropertyHandlerMapping
is feels quite
right anymore due to the addHandler method. At least the
description:
"A handler mapping based on a property file. The
property file contains a
set of properties."
gives the impression that this handler can only be populated
with handler
mappings from a properties file which is not true any
longer.
Regards,
Jimisola
--
View this message in context: http://www.
nabble.com/From-DynamicHandlerMapping-to-----%283.0b1-to-3.0
rc1%29-tf2036402.html#a5603818
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
|
|
| From DynamicHandlerMapping to ??? (3.0b1
to 3.0rc1) |

|
2006-08-02 13:50:51 |
On 8/1/06, Jimisola Laursen <lists jimisola.com> wrote:
> However, I don't think that the name
PropertyHandlerMapping is feels quite
> right anymore due to the addHandler method. At least
the description:
>
> "A handler mapping based on a property file. The
property file contains a
> set of properties."
>
> gives the impression that this handler can only be
populated with handler
> mappings from a properties file which is not true any
longer.
True, but changing all the docs didn't seem to match my
desires ...
--
My wife Mary and I have been married for forty-seven years
and not
once have we had an argument serious enough to consider
divorce;
murder, yes, but divorce, never.
(Jack Benny)
------------------------------------------------------------
---------
To unsubscribe, e-mail: xmlrpc-user-unsubscribe ws.apache.org
For additional commands, e-mail: xmlrpc-user-help ws.apache.org
|
|
| HandlerMapping problem (3.0b1 to 3.0rc1) |

|
2006-08-21 16:24:39 |
Hi All,
I have a problem with the way handlermappings are
established in the new
3.0rc1 version.
Let me first state the setting:
I have class "XMLRpcMethodForwarder" which
defines all the methods which
are available through xml-rpc. To make use of this class you
need to
provide it a parameter 'server' when it starts. However
the dynamic
handler mapping can only add a handler by:
DynamicHandlerMapping dhm = new DynamicHandlerMapping(new
TypeConverterFactoryImpl(), true);
dhm.addHandler("Box",
XMLRpcMethodForwarder.class);
Which gives basically a blank instantiation of
XMLRpcMethodForwarder.class. However, by means of the
setInitializationHandler method I was able to give this
class the
parameter it needs. By adding:
dhm.setInitializationHandler(new
XMLRpcMethodForwarder(server));
I could make sure that when a request came in the
XMLRpcMethodForwarder
was first provided with a server parameter to finish the
call.
But now with 3.0rc1 all this has been removed and we only
have a
PropertyHandlerMapping which does not provide a
setInitializationHandler
method. So now I cannot pass a parameter anymore to the
class handling
the methods...
I thought a workaround might be:
PropertyHandlerMapping phm = new PropertyHandlerMapping();
phm.addHandler("Box", (new
XMLRpcMethodForwarder(server)).getClass());
This code compiles perfectly, but when now a client request
comes in I
get an exception.
Why is the setInitializationHandler method removed, or is
there maybe a
valid workaround? With other words, how can I pass a
parameter to the
class where the rpc methods are defined?
greetz
p.
------------------------------------------------------------
---------
To unsubscribe, e-mail: xmlrpc-user-unsubscribe ws.apache.org
For additional commands, e-mail: xmlrpc-user-help ws.apache.org
|
|
| HandlerMapping problem (3.0b1 to 3.0rc1) |

|
2006-08-21 23:23:15 |
Hi!
Have a look at the different RequestProcessorFactory
(sub)classes:
http://ws.apache
.org/xmlrpc/apidocs/org/apache/xmlrpc/server/RequestProcesso
rFactoryFactory.html
Regards,
Jimisola
--
View this message in context: http://www.
nabble.com/From-DynamicHandlerMapping-to-----%283.0b1-to-3.0
rc1%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
|
|
| HandlerMapping problem (3.0b1 to 3.0rc1) |

|
2006-08-22 09:19:46 |
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-DynamicHandle
rMapping-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
|
|
| HandlerMapping problem (3.0b1 to 3.0rc1) |

|
2006-08-22 09:41:58 |
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-DynamicHandle
rMapping-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.0
rc1%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
|
|
| HandlerMapping problem (3.0b1 to 3.0rc1) |

|
2006-08-22 18:36:47 |
Thanks!
That indeed did the trick!
-----Original Message-----
From: Jimisola Laursen [mailto:lists jimisola.com]
Sent: dinsdag 22 augustus 2006 11:42
To: xmlrpc-user ws.apache.org
Subject: RE: HandlerMapping problem (3.0b1 to 3.0rc1)
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-DynamicHandle
rMapping-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-DynamicHandle
rMapping-to-----%283.0b1-to-3.0r
c1%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
------------------------------------------------------------
---------
To unsubscribe, e-mail: xmlrpc-user-unsubscribe ws.apache.org
For additional commands, e-mail: xmlrpc-user-help ws.apache.org
|
|
[1-9]
|
|