org.apache.wink.osgi
Class WinkRequestProcessor
java.lang.Object
org.apache.wink.osgi.WinkRequestProcessor
@Reference(name="component",
referenceInterface=java.lang.Object.class,
target="(javax.ws.rs=true)",
cardinality=OPTIONAL_MULTIPLE,
policy=DYNAMIC)
@Service(value=WinkRequestProcessor.class)
public class WinkRequestProcessor
- extends java.lang.Object
This component listens to registrations of services of type java.lang.Object
with the property javax.ws.rs
set to true and registers them with the
Wink RequestProcessor. Root resources and providers that are not exposed as such a service
can be registered by invoking the bindComponent method.
Alternatively Jax-RS resources can be registered by their class. This supports
having root-resources with a per request life cycle. The method to use is
bindComponentClass
.
Method Summary |
protected void |
activate(org.osgi.service.component.ComponentContext context)
|
void |
bindComponent(java.lang.Object component)
|
void |
bindComponentClass(java.lang.Class componentClass)
|
protected void |
deactivate(org.osgi.service.component.ComponentContext context)
|
void |
handleRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Dispatches the request and fills the response (even with an error
message. |
void |
handleRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.Object resource)
Dispatches the request and fills the response (even with an error
message using the spcified root resource instance. |
void |
unbindComponent(java.lang.Object component)
|
void |
unbindComponentClass(java.lang.Class componentClass)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WinkRequestProcessor
public WinkRequestProcessor()
handleRequest
public void handleRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException
- Dispatches the request and fills the response (even with an error
message.
- Parameters:
request
- AS or mock requestresponse
- AS or mock response
- Throws:
javax.servlet.ServletException
handleRequest
public void handleRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.Object resource)
throws javax.servlet.ServletException
- Dispatches the request and fills the response (even with an error
message using the spcified root resource instance. Note that any
- Parameters:
request
- AS or mock requestresponse
- AS or mock responseresource
- the root resource instance to be used
- Throws:
javax.servlet.ServletException
activate
protected void activate(org.osgi.service.component.ComponentContext context)
deactivate
protected void deactivate(org.osgi.service.component.ComponentContext context)
bindComponent
public void bindComponent(java.lang.Object component)
- Parameters:
component
- The new JAX-RS component (root resource or provider) to bind.
unbindComponent
public void unbindComponent(java.lang.Object component)
- Parameters:
component
- The new JAX-RS component (root resource or provider) to bind.
bindComponentClass
public void bindComponentClass(java.lang.Class componentClass)
- Parameters:
componentClass
- The new JAX-RS component class (root resource or provider) to bind.
unbindComponentClass
public void unbindComponentClass(java.lang.Class componentClass)
- Parameters:
componentClass
- The new JAX-RS component class (root resource or provider) to bind.
Copyright © 2009-2013 The Apache Software Foundation. All Rights Reserved.