cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Liu (JIRA)" <>
Subject [jira] [Commented] (CXF-3472) Cannot override HTTPConduit's handleResponse() method
Date Wed, 11 May 2011 02:33:47 GMT


David Liu commented on CXF-3472:


  Yup, this is the problem. I can extend both HttpConduit and its WrappedOutputStream class,
and also I can override the handleResponse() and handleResponseInternal() method in the sub
  However, the problem is that I cannot access WrappedOutputStream's protected field to construct
my sub class (java does not allow it). please see my code:

public class MyHTTPConduit extends HTTPConduit {

    public MyHTTPConduit(Bus b, EndpointInfo ei) throws IOException {
        super(b, ei);

    public void prepare(Message message) throws IOException {

        WrappedOutputStream wos = (WrappedOutputStream) message.getContent(OutputStream.class);
        MyWrappedOutputStream my = new MyWrappedOutputStream(wos);//compile error
        message.put(OutputStream.class, my);

    protected class MyWrappedOutputStream extends WrappedOutputStream {

        protected MyWrappedOutputStream(WrappedOutputStream wos) {
            //Message m = wos.outMessage;// java access restriction, cannot access protected
outMessage in WrappedOutputStream  
            super(m, c, possibleRetransmit, isChunking, chunkThreshold);

        protected void handleResponse() throws IOException {

        protected void handleResponseInternal() throws IOException {


> Cannot override HTTPConduit's handleResponse() method
> -----------------------------------------------------
>                 Key: CXF-3472
>                 URL:
>             Project: CXF
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.2, 2.4
>            Reporter: David Liu
>            Assignee: Willem Jiang
>   Current, all response message processing of HTTPConduit is in the class WrappedOutputStream,
e.g. handleResponse(), and handleResponseInternal() method, so we cannot extend HTTPConduit
to override both method if we want to add more functions during processing response. because
the class WrappedOutputStream need some input parameter and the its sub-class cannot get these
private properties.
>   My use case is: I have my customized HTTPConduit which needs to override handleResponse()
method to catch its instead of cxf's default logic.
>   Can cxf move both meothd from WrappedOutputStream class to HTTPConduit so that we can
override them? thanks.
> David

This message is automatically generated by JIRA.
For more information on JIRA, see:

View raw message