You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rpc-dev@xml.apache.org by Kevin Hester <ke...@ispiri.com> on 2002/09/11 00:33:53 UTC
Automatic support of XML-RPC introspection
Hi,
I recently needed to add introspection support so a user could use one of the
C++ auto glue generation frameworks. I found an OLD set of patches for this,
but they were very out of date. Instead of using these, I kept the same
usage pattern but made a new implementation based on the current 1.2 code
base.
I've implemented this support by making the following changes:
* Create IntrospectiveHandlerMapping - a subclass of HandlerMapping that
allows iteration over the list of handlers.
* Create a new subclass of SystemHandler called IntrospectiveHandler. This
class implements the system.listMethods, system.methodHelp and
system.methodSignature calls. I decided to make a subclass, because I
thought some may not want introspection.
The listMethods/methodHelp functions use the same 'marker' system the old
patches did. i.e. to mark a method as public via XMLRPC, you must declare a
static of the form:
static [final] public boolean <methodName>_public = true;
This is necessary to avoid exposing a zillion of public methods which are not
intended for XMLRPC.
If you wish to provide 'help text' via introspection, you can optionally
define a static string of the form:
static [final] public String <methodName>_help = "This method will make you
rich";
* I've also changed the sample server to use this IntrospectiveHandler
instead of the old SystemHandler.
* I've created a Servlet to automate the dispatching to handlers
Do ya'll want any of these changes? Who should I send the diffs to?
Ispiri is happy to contribute these changes under the Apache license.
Kevin
Re: Automatic support of XML-RPC introspection
Posted by Kevin Hester <ke...@ispiri.com>.
I'm fine with properties, however the _public definitions are handy in one
regard: It is easy to mark methods that should be public inline in your
source file, rather than some sort of external file.
Any other opinions? I'm happy to go either way.
The introspection spec used to be on www.xmlrpc.org, however it seems to be
missing now. Google has a cache though...
Kevin
On Tuesday 10 September 2002 15:45, Ryan Hoegg wrote:
> Hi,
>
> Forgive me for being rather ignorant on introspection, but is there any
> reason we want to require the XML-RPC server programmer to create public
> static fields instead of using properties?
>
> I do not speak for the rest of the list, so I can't answer your question
> about whether we want that.
>
> Cheers,
> Ryan Hoegg
> ISIS Networks
>
> Kevin Hester wrote:
> > The listMethods/methodHelp functions use the same 'marker' system the
> > old patches did. i.e. to mark a method as public via XMLRPC, you must
> > declare a static of the form:
> > static [final] public boolean <methodName>_public = true;
> >This is necessary to avoid exposing a zillion of public methods which are
> > not intended for XMLRPC.
Re: Automatic support of XML-RPC introspection
Posted by Kevin Hester <ke...@ispiri.com>.
I'm fine with properties, however the _public definitions are handy in one
regard: It is easy to mark methods that should be public inline in your
source file, rather than some sort of external file.
Any other opinions? I'm happy to go either way.
The introspection spec used to be on www.xmlrpc.org, however it seems to be
missing now. Google has a cache though...
Kevin
On Tuesday 10 September 2002 15:45, Ryan Hoegg wrote:
> Hi,
>
> Forgive me for being rather ignorant on introspection, but is there any
> reason we want to require the XML-RPC server programmer to create public
> static fields instead of using properties?
>
> I do not speak for the rest of the list, so I can't answer your question
> about whether we want that.
>
> Cheers,
> Ryan Hoegg
> ISIS Networks
>
> Kevin Hester wrote:
> > The listMethods/methodHelp functions use the same 'marker' system the
> > old patches did. i.e. to mark a method as public via XMLRPC, you must
> > declare a static of the form:
> > static [final] public boolean <methodName>_public = true;
> >This is necessary to avoid exposing a zillion of public methods which are
> > not intended for XMLRPC.
Re: Automatic support of XML-RPC introspection
Posted by Ryan Hoegg <rh...@isisnetworks.net>.
Hi,
Forgive me for being rather ignorant on introspection, but is there any
reason we want to require the XML-RPC server programmer to create public
static fields instead of using properties?
I do not speak for the rest of the list, so I can't answer your question
about whether we want that.
Cheers,
Ryan Hoegg
ISIS Networks
Kevin Hester wrote:
> The listMethods/methodHelp functions use the same 'marker' system the old
>patches did. i.e. to mark a method as public via XMLRPC, you must declare a
>static of the form:
> static [final] public boolean <methodName>_public = true;
>This is necessary to avoid exposing a zillion of public methods which are not
>intended for XMLRPC.
>
Re: Automatic support of XML-RPC introspection
Posted by Ryan Hoegg <rh...@isisnetworks.net>.
Hi,
Forgive me for being rather ignorant on introspection, but is there any
reason we want to require the XML-RPC server programmer to create public
static fields instead of using properties?
I do not speak for the rest of the list, so I can't answer your question
about whether we want that.
Cheers,
Ryan Hoegg
ISIS Networks
Kevin Hester wrote:
> The listMethods/methodHelp functions use the same 'marker' system the old
>patches did. i.e. to mark a method as public via XMLRPC, you must declare a
>static of the form:
> static [final] public boolean <methodName>_public = true;
>This is necessary to avoid exposing a zillion of public methods which are not
>intended for XMLRPC.
>