Package org.apache.wicket.util.time

Examples of org.apache.wicket.util.time.Duration


  @Override
  public IModificationWatcher getResourceWatcher(boolean start)
  {
    if (resourceWatcher == null && start)
    {
      final Duration pollFrequency = getResourcePollFrequency();
      if (pollFrequency != null)
      {
        resourceWatcher = new ModificationWatcher(pollFrequency);
      }
    }
View Full Code Here


      if (attributes.isAllowDefault())
      {
        attributesJson.put("ad", true);
      }

      Duration requestTimeout = attributes.getRequestTimeout();
      if (requestTimeout != null)
      {
        attributesJson.put("rt", requestTimeout.getMilliseconds());
      }

      boolean wicketAjaxResponse = attributes.isWicketAjaxResponse();
      if (wicketAjaxResponse == false)
      {
View Full Code Here

    private static final long serialVersionUID = 1L;

    @Override
    protected PageAccessSynchronizer createInstance()
    {
      final Duration timeout;
      if (Application.exists())
      {
        timeout = Application.get().getRequestCycleSettings().getTimeout();
      }
      else
View Full Code Here

  {
    Response response = attributes.getResponse();

    if (response instanceof WebResponse)
    {
      Duration duration = data.getCacheDuration();
      WebResponse webResponse = (WebResponse)response;
      if (duration.compareTo(Duration.NONE) > 0)
      {
        webResponse.enableCaching(duration, data.getCacheScope());
      }
      else
      {
View Full Code Here

     * @see IResourceSettings#setDefaultCacheDuration(org.apache.wicket.util.time.Duration)
     * @see IResourceSettings#getDefaultCacheDuration()
     */
    public Duration getCacheDuration()
    {
      Duration duration = cacheDuration;
      if (duration == null && Application.exists())
      {
        duration = Application.get().getResourceSettings().getDefaultCacheDuration();
      }

View Full Code Here

      else if (AjaxRequestAttributes.EventPropagation.STOP_IMMEDIATE.equals(attributes.getEventPropagation()))
      {
        attributesJson.put(AjaxAttributeName.EVENT_PROPAGATION.jsonName(), "stopImmediate");
      }

      Duration requestTimeout = attributes.getRequestTimeout();
      if (requestTimeout != null)
      {
        attributesJson.put(AjaxAttributeName.REQUEST_TIMEOUT.jsonName(),
          requestTimeout.getMilliseconds());
      }

      boolean wicketAjaxResponse = attributes.isWicketAjaxResponse();
      if (wicketAjaxResponse == false)
      {
View Full Code Here

    private static final long serialVersionUID = 1L;

    @Override
    protected PageAccessSynchronizer createInstance()
    {
      final Duration timeout;
      if (Application.exists())
      {
        timeout = Application.get().getRequestCycleSettings().getTimeout();
      }
      else
View Full Code Here

   */
  public IModificationWatcher getResourceWatcher(boolean start)
  {
    if (resourceWatcher == null && start)
    {
      final Duration pollFrequency = getResourcePollFrequency();
      if (pollFrequency != null)
      {
        resourceWatcher = new ModificationWatcher(pollFrequency);
      }
    }
View Full Code Here

  }

  @Test
  public void testDecorateResponse() throws Exception
  {
    Duration defaultDuration = Duration.minutes(60);

    // setup RequestCycle
    BaseWicketTester tester = new BaseWicketTester();
    RequestCycle requestCycle = ThreadContext.getRequestCycle();
    Application.get().getResourceSettings().setDefaultCacheDuration(defaultDuration);
View Full Code Here

  }

  @Test
  public void testDecorateResponse() throws Exception
  {
    Duration defaultDuration = Duration.minutes(60);

    // setup RequestCycle
    BaseWicketTester tester = new BaseWicketTester();
    RequestCycle requestCycle = ThreadContext.getRequestCycle();
    Application.get().getResourceSettings().setDefaultCacheDuration(defaultDuration);
View Full Code Here

TOP

Related Classes of org.apache.wicket.util.time.Duration

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.