org.glassfish.jersey.process.internal
Class HierarchicalRequestProcessor

java.lang.Object
  extended by org.glassfish.jersey.process.internal.HierarchicalRequestProcessor
All Implemented Interfaces:
RequestProcessor

public class HierarchicalRequestProcessor
extends java.lang.Object
implements RequestProcessor

A composite hierarchical request processor.

When invoked, the supplied request is continuously transformed by the nested acceptor hierarchy using a depth-first transformation strategy until a request-to-response inflector is found on a leaf stage node, in which case the hierarchical stage transformation is terminated and a continuation with the transformed request on the left side and the inflector on the right side is returned.

Author:
Marek Potociar (marek.potociar at oracle.com)

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.glassfish.jersey.process.internal.RequestProcessor
RequestProcessor.AcceptingContext
 
Constructor Summary
HierarchicalRequestProcessor(TreeAcceptor rootStage)
          Construct a hierarchical request processor.
 
Method Summary
 Pair<Request,com.google.common.base.Optional<Inflector<Request,Response>>> apply(Request request)
          Traverse through the nested request stages and apply request transformations until a terminal stage providing a request-to-response inflector is reached.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HierarchicalRequestProcessor

public HierarchicalRequestProcessor(TreeAcceptor rootStage)
Construct a hierarchical request processor.

Parameters:
rootStage - head of the nested stage hierarchy to be applied.
Method Detail

apply

public Pair<Request,com.google.common.base.Optional<Inflector<Request,Response>>> apply(Request request)
Traverse through the nested request stages and apply request transformations until a terminal stage providing a request-to-response inflector is reached. If the terminal stage does not provide an inflector, the inflector returned on the right side of the continuation will be absent.

This implementation applies the nested acceptor hierarchy using a depth-first transformation strategy until a request-to-response inflector is found on a leaf stage node, in which case the hierarchical stage transformation is terminated and a continuation with the transformed request on the left side and the inflector on the right side is returned.

Specified by:
apply in interface RequestProcessor
Parameters:
request - request data to be transformed
Returns:
continuation with the transformed request on the left side and the (optional) request-to-response inflector on the right side.


Copyright © 2007-2012 Oracle Corporation. All Rights Reserved. Use is subject to license terms.