cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eoghan Glynn (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CXF-342) Servlet transport should be independent of the JAX-WS frontend
Date Thu, 18 Jan 2007 18:20:29 GMT

    [ 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

        

Mime
View raw message