public class JSONRequestHandler extends WORequestHandler
| Properties | |
er.ajax.json.globalBacktrackCacheSize | the maximum number of global components that can be in the session (defaults to backtrack cache size) |
er.ajax.json.backtrackCacheSize | the maximum number of non-global components that can be in the session (defaults to backtrack cache size) |
| Modifier and Type | Class and Description |
|---|---|
protected static class |
JSONRequestHandler.JSONComponentCallback |
protected static class |
JSONRequestHandler.LRUMap<U,V> |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
RequestHandlerKey |
DidHandleRequestNotification| Constructor and Description |
|---|
JSONRequestHandler()
Creates a new JSONRequestHandler.
|
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
_jsonUrl(WOContext context,
java.lang.String requestHandlerKey,
java.lang.String componentNameAndInstance,
java.lang.String queryString)
Returns a URL pointing to the JSON request handler.
|
protected static java.lang.String |
componentNameAndInstance(java.lang.String componentName,
java.lang.String componentInstance) |
protected org.jabsorb.JSONRPCBridge |
createBridgeForComponent(JSONComponent component,
java.lang.String componentName,
java.lang.String componentInstance,
java.util.Map<java.lang.String,org.jabsorb.JSONRPCBridge> componentBridges) |
org.jabsorb.JSONRPCBridge |
getJSONBridge()
Returns the shared JSON Bridge for this request handler.
|
WOResponse |
handleRequest(WORequest request) |
static java.lang.String |
jsonUrl(WOContext context,
java.lang.String queryString)
Returns a URL pointing to the JSON request handler.
|
static java.lang.String |
jsonUrl(WOContext context,
java.lang.String requestHandlerKey,
java.lang.String queryString)
Returns a URL pointing to the JSON request handler.
|
static java.lang.String |
jsonUrl(WOContext context,
java.lang.String componentName,
java.lang.String instance,
java.lang.String queryString)
Returns a URL pointing to the JSON request handler for a JSON component.
|
static java.lang.String |
jsonUrl(WOContext context,
java.lang.String requestHandlerKey,
java.lang.String componentName,
java.lang.String componentInstance,
java.lang.String queryString)
Returns a URL pointing to the JSON request handler.
|
static JSONRequestHandler |
register()
Registers the JSONRequestHandler with your application using the default key.
|
static void |
registerClass(java.lang.Class clazz)
Registers all of the methods of the given class to be available for services to call (see JSONRPCBridge).
|
static void |
registerClass(java.lang.String name,
java.lang.Class clazz)
Registers all of the methods of the given class to be available for services to call (see JSONRPCBridge).
|
static void |
registerSerializer(org.jabsorb.serializer.Serializer serializer)
Registers a custom serializer into the global JSON serializers (see JSONRPCBridge).
|
void |
registerService(java.lang.String name,
java.lang.Object serviceObject)
Registers the given object in the shared JSON bridge.
|
toStringpublic static final java.lang.String RequestHandlerKey
public static JSONRequestHandler register()
public org.jabsorb.JSONRPCBridge getJSONBridge()
public static void registerSerializer(org.jabsorb.serializer.Serializer serializer)
throws java.lang.Exception
serializer - the serializer to registerjava.lang.Exception - if the registration failspublic static void registerClass(java.lang.Class clazz)
throws java.lang.Exception
clazz - the class to registerjava.lang.Exception - if the registration failspublic static void registerClass(java.lang.String name,
java.lang.Class clazz)
throws java.lang.Exception
name - the namespace to register the methods underclazz - the class to registerjava.lang.Exception - if the registration failspublic void registerService(java.lang.String name,
java.lang.Object serviceObject)
name - the name to register the object asserviceObject - the instance to registerpublic static java.lang.String jsonUrl(WOContext context, java.lang.String queryString)
context - the current WOContextqueryString - the query string to appendpublic static java.lang.String jsonUrl(WOContext context, java.lang.String requestHandlerKey, java.lang.String queryString)
context - the current WOContextrequestHandlerKey - if you registered a custom JSON request handler keyqueryString - the query string to appendpublic static java.lang.String jsonUrl(WOContext context, java.lang.String componentName, java.lang.String instance, java.lang.String queryString)
context - the current WOContextcomponentName - the name of the component to lookupinstance - the instance identifier (any value) to create a unique instance (or null for a session-global)queryString - the query string to appendpublic static java.lang.String jsonUrl(WOContext context, java.lang.String requestHandlerKey, java.lang.String componentName, java.lang.String componentInstance, java.lang.String queryString)
context - the current WOContextrequestHandlerKey - if you registered a custom JSON request handler keycomponentName - the name of the component to lookup (or null for the shared bridge)componentInstance - the instance identifier (any value) to create a unique instance (or null for a session-global)queryString - the query string to appendpublic static java.lang.String _jsonUrl(WOContext context, java.lang.String requestHandlerKey, java.lang.String componentNameAndInstance, java.lang.String queryString)
context - the current WOContextrequestHandlerKey - if you registered a custom JSON request handler keycomponentNameAndInstance - the name/instance identifier of the component to lookup (or null for the shared bridge)queryString - the query string to appendpublic WOResponse handleRequest(WORequest request)
handleRequest in class WORequestHandlerprotected static java.lang.String componentNameAndInstance(java.lang.String componentName,
java.lang.String componentInstance)
protected org.jabsorb.JSONRPCBridge createBridgeForComponent(JSONComponent component, java.lang.String componentName, java.lang.String componentInstance, java.util.Map<java.lang.String,org.jabsorb.JSONRPCBridge> componentBridges) throws java.lang.Exception
java.lang.ExceptionCopyright © 2002 – 2022 Project Wonder.