You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Eoghan Glynn (JIRA)" <ji...@apache.org> on 2007/01/02 15:35:27 UTC

[jira] Created: (CXF-342) Servlet transport should be independent of the JAX-WS frontend

Servlet transport should be independent of the JAX-WS frontend
--------------------------------------------------------------

                 Key: CXF-342
                 URL: http://issues.apache.org/jira/browse/CXF-342
             Project: CXF
          Issue Type: Improvement
          Components: Transports
            Reporter: Eoghan Glynn


The servlet transport is implemented as part of the JAX-WS frontend, but the only real dependency on JAX-WS is the hardcoding of the instantiation of org.apache.cxf.jaxws.EndpointImpl and the Endpoint.publish() call. 

This should be done via reflection instead, with  the class to instantiate and the publish method configured in the cxf-servlet.xml.

That way the servlet transport could be used with any front-end (as opposed to be being limited to JAX-WS) and the code could be moved out of the rt-frontend-jaxws module and into the rt-transpots-http module.

-- 
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] Commented: (CXF-342) Servlet transport should be independent of the JAX-WS frontend

Posted by "Eoghan Glynn (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-342?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12465833 ] 

Eoghan Glynn commented on CXF-342:
----------------------------------

"How does using reflection change the fact that it's JAX-WS only or open it up to other frontends?"

Using reflection allows an arbitrary class to be instantiated and called out to in order to the do the publishing.

Obviously I wasn't suggesting something like the following code be put *directly* into the CXFServlet:

   javax.xml.ws.Endpoint.class.getMethod("publish", String.class).invoke(Class.forName("org.apache.cxf.jaxws.EndpointImpl").newInstance(), address);

Clearly that code is just as JAX-WS specific as before.

To use reflection to acheive anthing here, we'd reflect on an instance of a class name (configured in the cxf-servlet.xml) that implements some generic interface, e.g.

public interface EndpointPublisher {
    void publish(Object arg);
}

In JAX-WS frontend we'd implement:

public class EndpointPublisherImpl implements EndpointPublisher {
    public void public(Object arg) {
         new EndpointImpl.publish((String(arg));
    }
}

In other front-ends, alternative EndpointPublisher impls could be provided.

In the cxf-servlet.xml, we configure something like:

<endpoint publisher="org.apache.cxf.jaxws.endpoint.EndpointPublisherImpl" pusblishArg="myAddress">

And finally in the CXFServlet.buildEndpoint() code:

  String publisher = el.getAttribute("publisher");
  String publishArg = el.getAttribute("publishArg");
  org.apache.cxf.endpoint.EndpointPublisher.class.getMethod("publish", String.class).invoke(Class.forName(publisher).newInstance(), publishArg);

Or something to that effect.

> Servlet transport should be independent of the JAX-WS frontend
> --------------------------------------------------------------
>
>                 Key: CXF-342
>                 URL: https://issues.apache.org/jira/browse/CXF-342
>             Project: CXF
>          Issue Type: Improvement
>          Components: Transports
>            Reporter: Eoghan Glynn
>         Assigned To: willem Jiang
>
> The servlet transport is implemented as part of the JAX-WS frontend, but the only real dependency on JAX-WS is the hardcoding of the instantiation of org.apache.cxf.jaxws.EndpointImpl and the Endpoint.publish() call. 
> This should be done via reflection instead, with  the class to instantiate and the publish method configured in the cxf-servlet.xml.
> That way the servlet transport could be used with any front-end (as opposed to be being limited to JAX-WS) and the code could be moved out of the rt-frontend-jaxws module and into the rt-transpots-http module.

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

        

[jira] Commented: (CXF-342) Servlet transport should be independent of the JAX-WS frontend

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-342?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12465809 ] 

Daniel Kulp commented on CXF-342:
---------------------------------

How does using reflection change the fact that it's JAX-WS only or open it up to other frontends?

The fact is that Endpoint.publish(...) is JAX-WS specific.   Whether it's called via reflection or directly doesn't change the fact that its JAX-WS specific and belongs in the JAX-WS layer.

To move this out of JAX-WS, the "endpoint publishing" stuff needs to be abstracted out into an interface that the frontends can implement and the servlet would have to load all of those found on the classpath (spring loading like everything else).    The <endpoint> tag in the cxf-servlet.xml file would need to be extended somehow to provide implementation details as to which frontend will handle it.   Better would be to make it based on the namespace or something.  

Exmaple:
<endpoints .....>
     <jaxws:endpoint  name="Foo" interface="FooImpl" ..../>
     <javascript:endpoint name="JSFoo"  script="WEB-INF/sripts/JSFoo.js"/>
     <pojo:endpoint ...../>
</endpoints>



> Servlet transport should be independent of the JAX-WS frontend
> --------------------------------------------------------------
>
>                 Key: CXF-342
>                 URL: https://issues.apache.org/jira/browse/CXF-342
>             Project: CXF
>          Issue Type: Improvement
>          Components: Transports
>            Reporter: Eoghan Glynn
>         Assigned To: willem Jiang
>
> The servlet transport is implemented as part of the JAX-WS frontend, but the only real dependency on JAX-WS is the hardcoding of the instantiation of org.apache.cxf.jaxws.EndpointImpl and the Endpoint.publish() call. 
> This should be done via reflection instead, with  the class to instantiate and the publish method configured in the cxf-servlet.xml.
> That way the servlet transport could be used with any front-end (as opposed to be being limited to JAX-WS) and the code could be moved out of the rt-frontend-jaxws module and into the rt-transpots-http module.

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

        

[jira] Resolved: (CXF-342) Servlet transport should be independent of the JAX-WS frontend

Posted by "willem Jiang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-342?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

willem Jiang resolved CXF-342.
------------------------------

    Resolution: Fixed

> Servlet transport should be independent of the JAX-WS frontend
> --------------------------------------------------------------
>
>                 Key: CXF-342
>                 URL: https://issues.apache.org/jira/browse/CXF-342
>             Project: CXF
>          Issue Type: Improvement
>          Components: Transports
>            Reporter: Eoghan Glynn
>         Assigned To: willem Jiang
>
> The servlet transport is implemented as part of the JAX-WS frontend, but the only real dependency on JAX-WS is the hardcoding of the instantiation of org.apache.cxf.jaxws.EndpointImpl and the Endpoint.publish() call. 
> This should be done via reflection instead, with  the class to instantiate and the publish method configured in the cxf-servlet.xml.
> That way the servlet transport could be used with any front-end (as opposed to be being limited to JAX-WS) and the code could be moved out of the rt-frontend-jaxws module and into the rt-transpots-http module.

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


[jira] Assigned: (CXF-342) Servlet transport should be independent of the JAX-WS frontend

Posted by "willem Jiang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-342?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

willem Jiang reassigned CXF-342:
--------------------------------

    Assignee: willem Jiang

> Servlet transport should be independent of the JAX-WS frontend
> --------------------------------------------------------------
>
>                 Key: CXF-342
>                 URL: https://issues.apache.org/jira/browse/CXF-342
>             Project: CXF
>          Issue Type: Improvement
>          Components: Transports
>            Reporter: Eoghan Glynn
>         Assigned To: willem Jiang
>
> The servlet transport is implemented as part of the JAX-WS frontend, but the only real dependency on JAX-WS is the hardcoding of the instantiation of org.apache.cxf.jaxws.EndpointImpl and the Endpoint.publish() call. 
> This should be done via reflection instead, with  the class to instantiate and the publish method configured in the cxf-servlet.xml.
> That way the servlet transport could be used with any front-end (as opposed to be being limited to JAX-WS) and the code could be moved out of the rt-frontend-jaxws module and into the rt-transpots-http module.

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