org.ow2.jonas.ws.jaxws.http.servlet
Class ServletRequestAdapter

java.lang.Object
  extended by org.ow2.jonas.ws.jaxws.http.servlet.ServletRequestAdapter
All Implemented Interfaces:
IWSRequest

public class ServletRequestAdapter
extends Object
implements IWSRequest

Wraps an HttpServletRequest.

Author:
Guillaume Sauthier

Constructor Summary
ServletRequestAdapter(HttpServletRequest request)
          Construct a new IWSRequest from an HttpServletRequest.
 
Method Summary
<T> T
getAttribute(Class<T> type)
          Returns an object of the corresponding interface, or null if none was found
 String getContentType()
           
 String getHeader(String name)
           
 InputStream getInputStream()
           
 String getParameter(String parameter)
           
 String getRemoteAddr()
           
 StringBuffer getRequestURL()
           
<T> T
setAttribute(Class<T> type, T value)
          Permits to use the IWSRequest interface as a storage place.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServletRequestAdapter

public ServletRequestAdapter(HttpServletRequest request)
Construct a new IWSRequest from an HttpServletRequest.

Parameters:
request - wrapped request
Method Detail

getAttribute

public <T> T getAttribute(Class<T> type)
Description copied from interface: IWSRequest
Returns an object of the corresponding interface, or null if none was found

Specified by:
getAttribute in interface IWSRequest
Type Parameters:
T - interface of the object
Parameters:
type - expected interface type used as a key
Returns:
an object of the corresponding interface, or null if none was found

getContentType

public String getContentType()
Specified by:
getContentType in interface IWSRequest
Returns:
the MIME Content-Type header.

getInputStream

public InputStream getInputStream()
                           throws IOException
Specified by:
getInputStream in interface IWSRequest
Returns:
the InputStream with the web service request message's content.
Throws:
IOException - when InputStream cannot be returned.

getRemoteAddr

public String getRemoteAddr()
Specified by:
getRemoteAddr in interface IWSRequest

getHeader

public String getHeader(String name)
Specified by:
getHeader in interface IWSRequest

getParameter

public String getParameter(String parameter)

setAttribute

public <T> T setAttribute(Class<T> type,
                          T value)
Description copied from interface: IWSRequest
Permits to use the IWSRequest interface as a storage place.

Specified by:
setAttribute in interface IWSRequest
Type Parameters:
T - interface of the object
Parameters:
type - key
value - the object to be stored
Returns:
the old value if any was set before, or null.

getRequestURL

public StringBuffer getRequestURL()


Copyright © 2010 OW2 Consortium. All Rights Reserved.