You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlrpc-auto@ws.apache.org by "Jimisola Laursen (JIRA)" <xm...@ws.apache.org> on 2006/11/13 12:23:37 UTC

[jira] Created: (XMLRPC-125) Ease extending XmlRpcServlet

Ease extending XmlRpcServlet
----------------------------

                 Key: XMLRPC-125
                 URL: http://issues.apache.org/jira/browse/XMLRPC-125
             Project: XML-RPC
          Issue Type: Improvement
          Components: Source
    Affects Versions: 3.1
            Reporter: Jimisola Laursen


Short story:  XmlRpcServlet is not easy to extend since 1) instance variables are private and 2) newPropertyHandlerMapping(URL url) method that often needs to be extended contains logic and potential bug fixes to risk to be missed.

Long story: the long story is that two classes needs to be extended only to be able to change what methods are to be registered in AbstractReflectiveHandlerMapping.registerPublicMethods (this is done by extending isHandlerMethod).

I'd prefer a solution where AbstractReflectiveHandlerMapping nor XmlRpcServlet needs to be extended.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Resolved: (XMLRPC-125) Ease extending XmlRpcServlet

Posted by "Jochen Wiedmann (JIRA)" <xm...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/XMLRPC-125?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jochen Wiedmann resolved XMLRPC-125.
------------------------------------

       Resolution: Won't Fix
    Fix Version/s: 3.1.1
         Assignee: Jochen Wiedmann

As far as I can tell, these are obsolete in the meantime.


> Ease extending XmlRpcServlet
> ----------------------------
>
>                 Key: XMLRPC-125
>                 URL: https://issues.apache.org/jira/browse/XMLRPC-125
>             Project: XML-RPC
>          Issue Type: Improvement
>          Components: Source
>    Affects Versions: 3.1
>            Reporter: Jimisola Laursen
>            Assignee: Jochen Wiedmann
>             Fix For: 3.1.1
>
>         Attachments: XMLRPC-125.diff
>
>
> Short story:  XmlRpcServlet is not easy to extend since 1) instance variables are private and 2) newPropertyHandlerMapping(URL url) method that often needs to be extended contains logic and potential bug fixes to risk to be missed.
> Long story: the long story is that two classes needs to be extended only to be able to change what methods are to be registered in AbstractReflectiveHandlerMapping.registerPublicMethods (this is done by extending isHandlerMethod).
> I'd prefer a solution where AbstractReflectiveHandlerMapping nor XmlRpcServlet needs to be extended.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (XMLRPC-125) Ease extending XmlRpcServlet

Posted by "Jimisola Laursen (JIRA)" <xm...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/XMLRPC-125?page=comments#action_12452490 ] 
            
Jimisola Laursen commented on XMLRPC-125:
-----------------------------------------

Jochen, curious on what you have to say on this issue/improvement...

> Ease extending XmlRpcServlet
> ----------------------------
>
>                 Key: XMLRPC-125
>                 URL: http://issues.apache.org/jira/browse/XMLRPC-125
>             Project: XML-RPC
>          Issue Type: Improvement
>          Components: Source
>    Affects Versions: 3.1
>            Reporter: Jimisola Laursen
>         Attachments: XMLRPC-125.diff
>
>
> Short story:  XmlRpcServlet is not easy to extend since 1) instance variables are private and 2) newPropertyHandlerMapping(URL url) method that often needs to be extended contains logic and potential bug fixes to risk to be missed.
> Long story: the long story is that two classes needs to be extended only to be able to change what methods are to be registered in AbstractReflectiveHandlerMapping.registerPublicMethods (this is done by extending isHandlerMethod).
> I'd prefer a solution where AbstractReflectiveHandlerMapping nor XmlRpcServlet needs to be extended.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (XMLRPC-125) Ease extending XmlRpcServlet

Posted by "Jimisola Laursen (JIRA)" <xm...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/XMLRPC-125?page=all ]

Jimisola Laursen updated XMLRPC-125:
------------------------------------

    Attachment: XMLRPC-125.diff

1) changed instance variables to protected from private

2) added a method newPropertyHandlerMapping() (called A)


    protected PropertyHandlerMapping newPropertyHandlerMapping()
    {
        PropertyHandlerMapping mapping = new PropertyHandlerMapping();
        
        return mapping;
    }

    which is called by newPropertyHandlerMapping(URL url) (called B)

	protected PropertyHandlerMapping newPropertyHandlerMapping(URL url) throws IOException, XmlRpcException {
            PropertyHandlerMapping mapping = newPropertyHandlerMapping();


I don't really like the naming of the methods since they only differ by an argument. I'd prefer if:

  1. A was called newPropertyHandlerMapping(): since it merely creates a new instance
  2. B was called initPropertyHandlerMapping(URL url): since it initiates the mapping instance

but I don't want to break the API.

Don't know if this is the  best of solution. Perhaps a better solution would be to have a Factory class?
The factory class (HandlerMappingFactory) would go hand in hand with newPropertyHandlerMapping and initPropertyHandlerMapping(URL url).

public interface HandlerMappingFactory
{
    protected XmlrRpcHandlerMapping newXmlRpcHandlerMapping(URL url) throws IOException, XmlRpcException;
}

The factory class would be called from

XmlRpcServlet.newXmlRpcHandlerMapping: handlerMappingFactory.newXmlRpcHandlerMapping(url)

The XmlRpcServlet will per default use the PropertyHandlerMappingFactory implementation but this can be set using XmlRpcServlet.setHandlerMappingFactory.

Let me know if you want me to provide a patch for the factory solution.

> Ease extending XmlRpcServlet
> ----------------------------
>
>                 Key: XMLRPC-125
>                 URL: http://issues.apache.org/jira/browse/XMLRPC-125
>             Project: XML-RPC
>          Issue Type: Improvement
>          Components: Source
>    Affects Versions: 3.1
>            Reporter: Jimisola Laursen
>         Attachments: XMLRPC-125.diff
>
>
> Short story:  XmlRpcServlet is not easy to extend since 1) instance variables are private and 2) newPropertyHandlerMapping(URL url) method that often needs to be extended contains logic and potential bug fixes to risk to be missed.
> Long story: the long story is that two classes needs to be extended only to be able to change what methods are to be registered in AbstractReflectiveHandlerMapping.registerPublicMethods (this is done by extending isHandlerMethod).
> I'd prefer a solution where AbstractReflectiveHandlerMapping nor XmlRpcServlet needs to be extended.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira