Package org.restlet.engine
Class CompositeHelper<T extends Restlet>
- java.lang.Object
-
- org.restlet.engine.Helper
-
- org.restlet.engine.RestletHelper<T>
-
- org.restlet.engine.CompositeHelper<T>
-
- Direct Known Subclasses:
ApplicationHelper,ComponentHelper
public abstract class CompositeHelper<T extends Restlet> extends RestletHelper<T>
Chain helper serving as base class for Application and Component helpers.
-
-
Field Summary
Fields Modifier and Type Field Description private FilterfirstInboundFilterThe first inbound filter.private FilterfirstOutboundFilterThe first outbound Filter.private RestletinboundNextThe next Restlet after the inbound chain.private FilterlastInboundFilterThe last inbound filter.private FilterlastOutboundFilterThe last outbound filter.private RestletoutboundNextThe next Restlet after the outbound chain.
-
Constructor Summary
Constructors Constructor Description CompositeHelper(T helped)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddInboundFilter(Filter filter)Adds a new inbound filter to the chain.protected voidaddOutboundFilter(Filter filter)Adds a new outbound filter to the chain.voidclear()Clears the chain.FiltergetFirstInboundFilter()Returns the first inbound filter.FiltergetFirstOutboundFilter()Returns the first outbound filter.protected RestletgetInboundNext()Returns the next Restlet in the inbound chain.protected FiltergetLastInboundFilter()Returns the last inbound filter.protected FiltergetLastOutboundFilter()Returns the last outbound filter.RestletgetOutboundNext()Returns the next Restlet in the outbound chain.voidhandle(Request request, Response response)Handles a call.protected voidsetFirstInboundFilter(Filter firstInboundFilter)Sets the first inbound filter.protected voidsetFirstOutboundFilter(Filter firstOutboundFilter)Sets the first outbound filter.protected voidsetInboundNext(Restlet next)Sets the next Restlet after the inbound chain.protected voidsetLastInboundFilter(Filter last)Sets the last inbound filter.protected voidsetLastOutboundFilter(Filter last)Sets the last outbound filter.protected voidsetOutboundNext(Restlet next)Sets the next Restlet after the outbound chain.-
Methods inherited from class org.restlet.engine.RestletHelper
getAttributes, getContext, getHelped, getHelpedParameters, getLogger, getMetadataService, setHelped, start, stop, update
-
-
-
-
Field Detail
-
firstInboundFilter
private volatile Filter firstInboundFilter
The first inbound filter.
-
firstOutboundFilter
private volatile Filter firstOutboundFilter
The first outbound Filter.
-
inboundNext
private volatile Restlet inboundNext
The next Restlet after the inbound chain.
-
lastInboundFilter
private volatile Filter lastInboundFilter
The last inbound filter.
-
lastOutboundFilter
private volatile Filter lastOutboundFilter
The last outbound filter.
-
outboundNext
private volatile Restlet outboundNext
The next Restlet after the outbound chain.
-
-
Constructor Detail
-
CompositeHelper
public CompositeHelper(T helped)
Constructor.- Parameters:
helped- The helped Restlet.
-
-
Method Detail
-
addInboundFilter
protected void addInboundFilter(Filter filter)
Adds a new inbound filter to the chain.- Parameters:
filter- The inbound filter to add.
-
addOutboundFilter
protected void addOutboundFilter(Filter filter)
Adds a new outbound filter to the chain.- Parameters:
filter- The outbound filter to add.
-
clear
public void clear()
Clears the chain. Sets the first and last filters to null.
-
getFirstInboundFilter
public Filter getFirstInboundFilter()
Returns the first inbound filter.- Returns:
- The first inbound filter.
-
getFirstOutboundFilter
public Filter getFirstOutboundFilter()
Returns the first outbound filter.- Returns:
- The first outbound filter.
-
getInboundNext
protected Restlet getInboundNext()
Returns the next Restlet in the inbound chain.- Returns:
- The next Restlet in the inbound chain.
-
getLastInboundFilter
protected Filter getLastInboundFilter()
Returns the last inbound filter.- Returns:
- the last inbound filter.
-
getLastOutboundFilter
protected Filter getLastOutboundFilter()
Returns the last outbound filter.- Returns:
- the last outbound filter.
-
getOutboundNext
public Restlet getOutboundNext()
Returns the next Restlet in the outbound chain.- Returns:
- The next Restlet in the outbound chain.
-
handle
public void handle(Request request, Response response)
Description copied from class:RestletHelperHandles a call.- Overrides:
handlein classRestletHelper<T extends Restlet>- Parameters:
request- The request to handle.response- The response to update.
-
setFirstInboundFilter
protected void setFirstInboundFilter(Filter firstInboundFilter)
Sets the first inbound filter.- Parameters:
firstInboundFilter- The first inbound filter.
-
setFirstOutboundFilter
protected void setFirstOutboundFilter(Filter firstOutboundFilter)
Sets the first outbound filter.- Parameters:
firstOutboundFilter- The first outbound filter.
-
setInboundNext
protected void setInboundNext(Restlet next)
Sets the next Restlet after the inbound chain.- Parameters:
next- The Restlet to process after the inbound chain.
-
setLastInboundFilter
protected void setLastInboundFilter(Filter last)
Sets the last inbound filter.- Parameters:
last- The last inbound filter.
-
setLastOutboundFilter
protected void setLastOutboundFilter(Filter last)
Sets the last outbound filter.- Parameters:
last- The last outbound filter.
-
setOutboundNext
protected void setOutboundNext(Restlet next)
Sets the next Restlet after the outbound chain.- Parameters:
next- The Restlet to process after the outbound chain.
-
-