Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (C) 2014 Philip Helger (www.helger.com) philip[at]helger[dot]com Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 
 package com.helger.webbasics.ajax;
 
 import java.util.Map;
 
 
Base interface for an Ajax invoker. It has a set of IAjaxExecutor instances that it can invoke.

Author(s):
Philip Helger
 
 public interface IAjaxInvoker
 {
   @Nonnull
 
   @Nonnull
 
   @Nonnull

Returns:
The milliseconds after which an execution is considered long running.
 
Set the milliseconds after which an execution is considered long running.

Parameters:
nLongRunningExecutionLimitTime The milliseconds to use. Value ≤ 0 are considered "no limit"
 
   void setLongRunningExecutionLimitTime (long nLongRunningExecutionLimitTime);
 
   @Nonnull
 
   @Nonnull
 
   @Nullable
   IFactory <? extends IAjaxExecutorgetRegisteredExecutor (@Nullable String sFunctionName);

  
Create an executor associated with the given ajax function. This is a shortcut for getRegisteredExecutor (sFunctionName).create()

Parameters:
sFunctionName The name of the Ajax function to instantiate. May be null.
Returns:
null if no such action exists.
 
   @Nullable
   IAjaxExecutor createExecutor (@Nullable String sFunctionName);
 
   boolean isRegisteredFunction (@Nullable String sFunctionName);

  
Add a handler function that is used as a callback.

Parameters:
aFunction The Ajax function declaration to be invoked. May not be null.
 
   void registerFunction (@Nonnull IAjaxFunctionDeclaration aFunction);

  
Invoke the specified AJAX function.

Parameters:
sFunctionName the alias of the AJAX function to invoke. May not be null.
aAjaxExecutor The executor to be invoked. May not be null.
aRequestScope The request scope to be used for the function.
Returns:
null if this is a void function, the JS string to serialize otherwise.
Throws:
java.lang.Throwable In case something goes wrong
                                @Nonnull IAjaxExecutor aAjaxExecutor,
                                @Nonnull IRequestWebScopeWithoutResponse aRequestScopethrows Throwable;
New to GrepCode? Check out our FAQ X