Apache CXF API

org.apache.cxf.transport.http
Class AbstractHTTPDestination

java.lang.Object
  extended by org.apache.cxf.transport.AbstractObservable
      extended by org.apache.cxf.transport.AbstractDestination
          extended by org.apache.cxf.transport.AbstractMultiplexDestination
              extended by org.apache.cxf.transport.http.AbstractHTTPDestination
All Implemented Interfaces:
Configurable, Destination, DestinationWithEndpoint, MultiplexDestination, Observable, Assertor
Direct Known Subclasses:
JAXWSHttpSpiDestination, JettyHTTPDestination, OsgiDestination, ServletDestination

public abstract class AbstractHTTPDestination
extends AbstractMultiplexDestination
implements Configurable, Assertor

Common base for HTTP Destination implementations.


Nested Class Summary
 class AbstractHTTPDestination.BackChannelConduit
          Backchannel conduit.
 
Nested classes/interfaces inherited from class org.apache.cxf.transport.AbstractDestination
AbstractDestination.AbstractBackChannelConduit
 
Field Summary
protected  Bus bus
           
protected  CertConstraints certConstraints
           
protected  String contextMatchStrategy
           
static String CXF_ASYNC_CONTEXT
           
static String CXF_CONTINUATION_MESSAGE
           
protected  boolean fixedParameterOrder
           
static String HTTP_CONFIG
           
static String HTTP_CONTEXT
           
static String HTTP_REQUEST
           
static String HTTP_RESPONSE
           
protected  boolean isServlet3
           
protected  boolean multiplexWithAddress
           
static String PROTOCOL_HEADERS_CONTENT_TYPE
           
static String REQUEST_REDIRECTED
           
static String RESPONSE_COMMITED
           
static String RESPONSE_HEADERS_COPIED
           
protected  HTTPServerPolicy server
           
 
Fields inherited from class org.apache.cxf.transport.AbstractDestination
endpointInfo, reference
 
Fields inherited from class org.apache.cxf.transport.AbstractObservable
incomingObserver
 
Constructor Summary
AbstractHTTPDestination(Bus b, EndpointInfo ei, boolean dp)
          Constructor
 
Method Summary
 void assertMessage(Message message)
           
 boolean canAssert(QName type)
           
protected  boolean contextMatchOnExact()
           
protected  void copyRequestHeaders(Message message, Map<String,List<String>> headers)
          Copy the request headers into the message.
protected  void copyResponseHeaders(Message message, javax.servlet.http.HttpServletResponse response)
          Copy the response headers into the response.
protected  OutputStream flushHeaders(Message outMessage)
           
protected  OutputStream flushHeaders(Message outMessage, boolean getStream)
           
protected static EndpointInfo getAddressValue(EndpointInfo ei)
           
protected static EndpointInfo getAddressValue(EndpointInfo ei, boolean dp)
           
 EndpointReferenceType getAddressWithId(String id)
          Builds an new endpoint reference using the current target reference as a template.
protected  String getBasePath(String contextPath)
           
 String getBeanName()
          Get the configurable object's Bean name
 String getContextMatchStrategy()
           
 String getId(Map context)
          Obtain id from reference parameters of the ws-a to address Requires the existance of ws-a interceptors on dispatch path to provide access to the ws-a headers
protected  Conduit getInbuiltBackChannel(Message inMessage)
           
 HTTPServerPolicy getServer()
           
 boolean isFixedParameterOrder()
           
 boolean isMultiplexWithAddress()
           
protected  boolean isOneWay(Message message)
           
protected  Message retrieveFromContinuation(javax.servlet.http.HttpServletRequest req)
           
protected  Message retrieveFromServlet3Async(javax.servlet.http.HttpServletRequest req)
           
 void setContextMatchStrategy(String contextMatchStrategy)
           
 void setFixedParameterOrder(boolean fixedParameterOrder)
           
protected  void setHeaders(Message message)
          Cache HTTP headers in message.
 void setMultiplexWithAddress(boolean multiplexWithAddress)
           
 void setServer(HTTPServerPolicy server)
           
protected  void setupContinuation(Message inMessage, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
protected  void setupMessage(Message inMessage, javax.servlet.ServletConfig config, javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
protected  void setupMessage(Message inMessage, javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
protected  void updateResponseHeaders(Message message)
           
 
Methods inherited from class org.apache.cxf.transport.AbstractDestination
getAddress, getBackChannel, getEndpointInfo, shutdown
 
Methods inherited from class org.apache.cxf.transport.AbstractObservable
activate, deactivate, getLogger, getMessageObserver, getTargetReference, getTargetReference, setMessageObserver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.cxf.transport.Destination
getAddress, getBackChannel, getMessageObserver, shutdown
 
Methods inherited from interface org.apache.cxf.transport.Observable
setMessageObserver
 

Field Detail

HTTP_REQUEST

public static final String HTTP_REQUEST
See Also:
Constant Field Values

HTTP_RESPONSE

public static final String HTTP_RESPONSE
See Also:
Constant Field Values

HTTP_CONTEXT

public static final String HTTP_CONTEXT
See Also:
Constant Field Values

HTTP_CONFIG

public static final String HTTP_CONFIG
See Also:
Constant Field Values

PROTOCOL_HEADERS_CONTENT_TYPE

public static final String PROTOCOL_HEADERS_CONTENT_TYPE

RESPONSE_HEADERS_COPIED

public static final String RESPONSE_HEADERS_COPIED
See Also:
Constant Field Values

RESPONSE_COMMITED

public static final String RESPONSE_COMMITED
See Also:
Constant Field Values

REQUEST_REDIRECTED

public static final String REQUEST_REDIRECTED
See Also:
Constant Field Values

CXF_CONTINUATION_MESSAGE

public static final String CXF_CONTINUATION_MESSAGE
See Also:
Constant Field Values

CXF_ASYNC_CONTEXT

public static final String CXF_ASYNC_CONTEXT
See Also:
Constant Field Values

bus

protected final Bus bus

server

protected HTTPServerPolicy server

contextMatchStrategy

protected String contextMatchStrategy

fixedParameterOrder

protected boolean fixedParameterOrder

multiplexWithAddress

protected boolean multiplexWithAddress

certConstraints

protected CertConstraints certConstraints

isServlet3

protected boolean isServlet3
Constructor Detail

AbstractHTTPDestination

public AbstractHTTPDestination(Bus b,
                               EndpointInfo ei,
                               boolean dp)
                        throws IOException
Constructor

Parameters:
b - the associated Bus
ci - the associated conduit initiator
ei - the endpoint info of the destination
dp - true for adding the default port if it is missing
Throws:
IOException
Method Detail

setHeaders

protected void setHeaders(Message message)
Cache HTTP headers in message.

Parameters:
message - the current message

updateResponseHeaders

protected void updateResponseHeaders(Message message)

isOneWay

protected final boolean isOneWay(Message message)
Parameters:
message - the message under consideration
Returns:
true iff the message has been marked as oneway

copyRequestHeaders

protected void copyRequestHeaders(Message message,
                                  Map<String,List<String>> headers)
Copy the request headers into the message.

Parameters:
message - the current message
headers - the current set of headers

copyResponseHeaders

protected void copyResponseHeaders(Message message,
                                   javax.servlet.http.HttpServletResponse response)
Copy the response headers into the response.

Parameters:
message - the current message
headers - the current set of headers

setupMessage

protected void setupMessage(Message inMessage,
                            javax.servlet.ServletContext context,
                            javax.servlet.http.HttpServletRequest req,
                            javax.servlet.http.HttpServletResponse resp)
                     throws IOException
Throws:
IOException

setupMessage

protected void setupMessage(Message inMessage,
                            javax.servlet.ServletConfig config,
                            javax.servlet.ServletContext context,
                            javax.servlet.http.HttpServletRequest req,
                            javax.servlet.http.HttpServletResponse resp)
                     throws IOException
Throws:
IOException

retrieveFromContinuation

protected Message retrieveFromContinuation(javax.servlet.http.HttpServletRequest req)

retrieveFromServlet3Async

protected Message retrieveFromServlet3Async(javax.servlet.http.HttpServletRequest req)

setupContinuation

protected void setupContinuation(Message inMessage,
                                 javax.servlet.http.HttpServletRequest req,
                                 javax.servlet.http.HttpServletResponse resp)

getBasePath

protected String getBasePath(String contextPath)
                      throws IOException
Throws:
IOException

getAddressValue

protected static EndpointInfo getAddressValue(EndpointInfo ei)

getAddressValue

protected static EndpointInfo getAddressValue(EndpointInfo ei,
                                              boolean dp)

getInbuiltBackChannel

protected Conduit getInbuiltBackChannel(Message inMessage)
Specified by:
getInbuiltBackChannel in class AbstractDestination
Parameters:
inMessage - the incoming message
Returns:
the inbuilt backchannel

flushHeaders

protected OutputStream flushHeaders(Message outMessage)
                             throws IOException
Throws:
IOException

flushHeaders

protected OutputStream flushHeaders(Message outMessage,
                                    boolean getStream)
                             throws IOException
Throws:
IOException

contextMatchOnExact

protected boolean contextMatchOnExact()

getBeanName

public String getBeanName()
Description copied from interface: Configurable
Get the configurable object's Bean name

Specified by:
getBeanName in interface Configurable
Returns:
the bean name

getAddressWithId

public EndpointReferenceType getAddressWithId(String id)
Description copied from class: AbstractMultiplexDestination
Builds an new endpoint reference using the current target reference as a template. The supplied id is endcoded using a reference parameter. This requires the ws-a interceptors to propagate the reference parameters on subsequent invokes using the returned reference.

Specified by:
getAddressWithId in interface MultiplexDestination
Overrides:
getAddressWithId in class AbstractMultiplexDestination
Returns:
the new reference with the id encoded as a reference parameter
See Also:
MultiplexDestination.getAddressWithId(java.lang.String)

getId

public String getId(Map context)
Description copied from class: AbstractMultiplexDestination
Obtain id from reference parameters of the ws-a to address Requires the existance of ws-a interceptors on dispatch path to provide access to the ws-a headers

Specified by:
getId in interface MultiplexDestination
Overrides:
getId in class AbstractMultiplexDestination
Parameters:
context - for this invocation. Obtained for example from JAX-WS WebServiceContext.getMessageContext(). The context will either contain the WS-A To content and/or some property that identifies the target address, eg MessageContext.PATH_INFO for the current invocation
Returns:
the id from the reference parameters of the ws-a-to address or null if not found
See Also:
MultiplexDestination.getId(java.util.Map)

getContextMatchStrategy

public String getContextMatchStrategy()

setContextMatchStrategy

public void setContextMatchStrategy(String contextMatchStrategy)

isFixedParameterOrder

public boolean isFixedParameterOrder()

setFixedParameterOrder

public void setFixedParameterOrder(boolean fixedParameterOrder)

isMultiplexWithAddress

public boolean isMultiplexWithAddress()

setMultiplexWithAddress

public void setMultiplexWithAddress(boolean multiplexWithAddress)

getServer

public HTTPServerPolicy getServer()

setServer

public void setServer(HTTPServerPolicy server)

assertMessage

public void assertMessage(Message message)
Specified by:
assertMessage in interface Assertor

canAssert

public boolean canAssert(QName type)
Specified by:
canAssert in interface Assertor

Apache CXF API

Apache CXF