Package org.apache.wicket.request.resource.caching

Examples of org.apache.wicket.request.resource.caching.IStaticCacheableResource


          final IResource resource = reference.getResource();

          // is resource supposed to be cached?
          if (resource instanceof IStaticCacheableResource)
          {
            final IStaticCacheableResource cacheable = (IStaticCacheableResource)resource;
           
            // is caching enabled?
            if(cacheable.isCachingEnabled())
            {
              // apply caching scheme to resource url
              final ResourceUrl resourceUrl = new ResourceUrl(token, parameters);
              getCachingStrategy().decorateUrl(resourceUrl, cacheable);
              token = resourceUrl.getFileName();
View Full Code Here


    ResourceResponse data = newResourceResponse(attributes);

    // is resource supposed to be cached?
    if (this instanceof IStaticCacheableResource)
    {
      final IStaticCacheableResource cacheable = (IStaticCacheableResource)this;

      // is caching enabled?
      if (cacheable.isCachingEnabled())
      {
        // apply caching strategy to response
        getCachingStrategy().decorateResponse(data, cacheable);
      }
    }
View Full Code Here

          final IResource resource = reference.getResource();

          // is resource supposed to be cached?
          if (resource instanceof IStaticCacheableResource)
          {
            final IStaticCacheableResource cacheable = (IStaticCacheableResource)resource;
           
            // is caching enabled?
            if(cacheable.isCachingEnabled())
            {
              // apply caching scheme to resource url
              final ResourceUrl resourceUrl = new ResourceUrl(token, parameters);
              getCachingStrategy().decorateUrl(resourceUrl, cacheable);
              token = resourceUrl.getFileName();
View Full Code Here

    {
      final IResource resource = resourceReference.getResource();

      if (resource instanceof IStaticCacheableResource)
      {
        final IStaticCacheableResource cacheable = (IStaticCacheableResource)resource;
       
        if(cacheable.isCachingEnabled())
        {
          final ResourceUrl cacheUrl = new ResourceUrl(filename, parameters);
 
          getCachingStrategy().decorateUrl(cacheUrl, cacheable);
 
View Full Code Here

      // TODO is calling getResource() a potential performance bottleneck?
      final IResource resource = resourceReference.getResource();

      if (resource instanceof IStaticCacheableResource)
      {
        final IStaticCacheableResource cacheable = (IStaticCacheableResource)resource;
        final ResourceUrl cacheUrl = new ResourceUrl(filename, parameters);

        getCachingStrategy().decorateUrl(cacheUrl, cacheable);

        if (Strings.isEmpty(cacheUrl.getFileName()))
View Full Code Here

          // apply caching if required
          if (resource instanceof IStaticCacheableResource)
          {
            // add caching related information to filename + query parameters
            final IStaticCacheableResource cacheable = (IStaticCacheableResource)resource;
            final ResourceUrl resourceUrl = new ResourceUrl(token, parameters);
            getCachingStrategy().decorateUrl(resourceUrl, cacheable);
            token = resourceUrl.getFileName();

            if (Strings.isEmpty(token))
View Full Code Here

   *
   */
  @Test
  public void versionStringInResourceFilename()
  {
    final IStaticCacheableResource resource = new IStaticCacheableResource()
    {
      private static final long serialVersionUID = 1L;

      @Override
      public Serializable getCacheKey()
View Full Code Here

   * @throws Exception
   */
  @Test
  public void urlForResourceReference() throws Exception
  {
    final IStaticCacheableResource resource = mock(IStaticCacheableResource.class);
    ResourceReference reference = new ResourceReference("dummy")
    {
      @Override
      public IResource getResource()
      {
View Full Code Here

   * @throws Exception
   */
  @Test
  public void urlForStaticResource() throws Exception
  {
    IStaticCacheableResource resource = mock(IStaticCacheableResource.class);
    ResourceRequestHandler handler = new ResourceRequestHandler(resource, new PageParameters());
    CharSequence url = requestCycle.urlFor(handler);
    assertEquals(RESOURCE_URL, url);
  }
View Full Code Here

          final IResource resource = reference.getResource();

          // is resource supposed to be cached?
          if (resource instanceof IStaticCacheableResource)
          {
            final IStaticCacheableResource cacheable = (IStaticCacheableResource)resource;
           
            // is caching enabled?
            if(cacheable.isCachingEnabled())
            {
              // apply caching scheme to resource url
              final ResourceUrl resourceUrl = new ResourceUrl(token, parameters);
              getCachingStrategy().decorateUrl(resourceUrl, cacheable);
              token = resourceUrl.getFileName();
View Full Code Here

TOP

Related Classes of org.apache.wicket.request.resource.caching.IStaticCacheableResource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.