org.apache.tapestry5.internal.services.assets
Class StackAssetRequestHandler

java.lang.Object
  extended by org.apache.tapestry5.internal.services.assets.StackAssetRequestHandler
All Implemented Interfaces:
AssetRequestHandler, InvalidationListener

public class StackAssetRequestHandler
extends Object
implements AssetRequestHandler, InvalidationListener


Constructor Summary
StackAssetRequestHandler(StreamableResourceSource streamableResourceSource, JavaScriptStackSource javascriptStackSource, LocalizationSetter localizationSetter, ResponseCompressionAnalyzer compressionAnalyzer, ResourceStreamer resourceStreamer, ResourceMinimizer resourceMinimizer, OperationTracker tracker, boolean minificationEnabled, ResourceChangeTracker resourceChangeTracker)
           
 
Method Summary
 boolean handleAssetRequest(Request request, Response response, String extraPath)
          Given a request targeted (via the handler id) to the specific handler, process the request.
 void listenToInvalidations(ResourceChangeTracker resourceChangeTracker)
           
 void objectWasInvalidated()
          Notified by the ResourceChangeTracker when (any) resource files change; the internal caches are cleared.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StackAssetRequestHandler

public StackAssetRequestHandler(StreamableResourceSource streamableResourceSource,
                                JavaScriptStackSource javascriptStackSource,
                                LocalizationSetter localizationSetter,
                                ResponseCompressionAnalyzer compressionAnalyzer,
                                ResourceStreamer resourceStreamer,
                                ResourceMinimizer resourceMinimizer,
                                OperationTracker tracker,
                                @Symbol(value="tapestry.enable-minification")
                                boolean minificationEnabled,
                                ResourceChangeTracker resourceChangeTracker)
Method Detail

listenToInvalidations

@PostInjection
public void listenToInvalidations(ResourceChangeTracker resourceChangeTracker)

handleAssetRequest

public boolean handleAssetRequest(Request request,
                                  Response response,
                                  String extraPath)
                           throws IOException
Description copied from interface: AssetRequestHandler
Given a request targeted (via the handler id) to the specific handler, process the request. The handler is responsible for processing the request, sending back either a bytestream (via Response.getOutputStream(String)) or an error response (via Response.sendError(int, String)). It is the handler's responsibility to allow for client-side caching (possibly sending an HttpServletResponse.SC_NOT_MODIFIED response).

The handler should return true if it provided a response. If the handler returns false, this indicates that the extra path did not identify a known asset (virtual or otherwise) and the AssetDispatcher service should send a HttpServletResponse.SC_NOT_FOUND response.

Specified by:
handleAssetRequest in interface AssetRequestHandler
Parameters:
request - incoming asset request
response - used to send a response to client
extraPath - additional path to identify the specific asset
Returns:
true if request handler, false if asset not found
Throws:
IOException

objectWasInvalidated

public void objectWasInvalidated()
Notified by the ResourceChangeTracker when (any) resource files change; the internal caches are cleared.

Specified by:
objectWasInvalidated in interface InvalidationListener


Copyright © 2003-2012 The Apache Software Foundation.