org.apache.wink.osgi
Class WinkRequestProcessor

java.lang.Object
  extended by 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 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.


Constructor Summary
WinkRequestProcessor()
           
 
Method Summary
protected  void activate(org.osgi.service.component.ComponentContext context)
           
 void bindComponent(Object component)
           
 void bindComponentClass(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, Object resource)
          Dispatches the request and fills the response (even with an error message using the spcified root resource instance.
 void unbindComponent(Object component)
           
 void unbindComponentClass(Class componentClass)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WinkRequestProcessor

public WinkRequestProcessor()
Method Detail

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 request
response - AS or mock response
Throws:
javax.servlet.ServletException

handleRequest

public void handleRequest(javax.servlet.http.HttpServletRequest request,
                          javax.servlet.http.HttpServletResponse response,
                          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 request
response - AS or mock response
resource - 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(Object component)
Parameters:
component - The new JAX-RS component (root resource or provider) to bind.

unbindComponent

public void unbindComponent(Object component)
Parameters:
component - The new JAX-RS component (root resource or provider) to bind.

bindComponentClass

public void bindComponentClass(Class componentClass)
Parameters:
componentClass - The new JAX-RS component class (root resource or provider) to bind.

unbindComponentClass

public void unbindComponentClass(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.