
Classes | |
| class | JSONComponentCallback |
| class | LRUMap< U, V > |
Public Member Functions | |
| JSONRPCBridge | getJSONBridge () |
| WOResponse | handleRequest (WORequest request) |
| JSONRequestHandler () | |
| void | registerService (String name, Object serviceObject) |
Static Public Member Functions | |
| static String | _jsonUrl (WOContext context, String requestHandlerKey, String componentNameAndInstance, String queryString) |
| static String | jsonUrl (WOContext context, String requestHandlerKey, String componentName, String componentInstance, String queryString) |
| static String | jsonUrl (WOContext context, String componentName, String instance, String queryString) |
| static String | jsonUrl (WOContext context, String requestHandlerKey, String queryString) |
| static String | jsonUrl (WOContext context, String queryString) |
| static JSONRequestHandler | register () |
| static void | registerClass (String name, Class clazz) throws Exception |
| static void | registerClass (Class clazz) throws Exception |
| static void | registerSerializer (Serializer serializer) throws Exception |
Static Public Attributes | |
| static final String | RequestHandlerKey = "json" |
Protected Member Functions | |
| JSONRPCBridge | createBridgeForComponent (JSONComponent component, String componentName, String componentInstance, Map< String, JSONRPCBridge > componentBridges) throws Exception |
Static Protected Member Functions | |
| static String | componentNameAndInstance (String componentName, String componentInstance) |
Private Attributes | |
| JSONRPCBridge | _sharedBridge |
Creates a new JSONRequestHandler.
| static String _jsonUrl | ( | WOContext | context, | |
| String | requestHandlerKey, | |||
| String | componentNameAndInstance, | |||
| String | queryString | |||
| ) | [static] |
Returns a URL pointing to the JSON request handler.
| context | the current WOContext | |
| requestHandlerKey | if you registered a custom JSON request handler key | |
| componentNameAndInstance | the name/instance identifier of the component to lookup (or null for the shared bridge) | |
| queryString | the query string to append |
| static String componentNameAndInstance | ( | String | componentName, | |
| String | componentInstance | |||
| ) | [static, protected] |
| JSONRPCBridge createBridgeForComponent | ( | JSONComponent | component, | |
| String | componentName, | |||
| String | componentInstance, | |||
| Map< String, JSONRPCBridge > | componentBridges | |||
| ) | throws Exception [protected] |
| JSONRPCBridge getJSONBridge | ( | ) |
Returns the shared JSON Bridge for this request handler.
| WOResponse handleRequest | ( | WORequest | request | ) |
| static String jsonUrl | ( | WOContext | context, | |
| String | requestHandlerKey, | |||
| String | componentName, | |||
| String | componentInstance, | |||
| String | queryString | |||
| ) | [static] |
Returns a URL pointing to the JSON request handler.
| context | the current WOContext | |
| requestHandlerKey | if you registered a custom JSON request handler key | |
| componentName | 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 append |
| static String jsonUrl | ( | WOContext | context, | |
| String | componentName, | |||
| String | instance, | |||
| String | queryString | |||
| ) | [static] |
Returns a URL pointing to the JSON request handler for a JSON component.
| context | the current WOContext | |
| componentName | the name of the component to lookup | |
| instance | the instance identifier (any value) to create a unique instance (or null for a session-global) | |
| queryString | the query string to append |
Returns a URL pointing to the JSON request handler. This variant should be used for the shared web service endpoint.
| context | the current WOContext | |
| requestHandlerKey | if you registered a custom JSON request handler key | |
| queryString | the query string to append |
Returns a URL pointing to the JSON request handler. This variant should be used for the shared web service endpoint.
| context | the current WOContext | |
| queryString | the query string to append |
| static JSONRequestHandler register | ( | ) | [static] |
Registers the JSONRequestHandler with your application using the default key.
| static void registerClass | ( | String | name, | |
| Class | clazz | |||
| ) | throws Exception [static] |
Registers all of the methods of the given class to be available for services to call (see JSONRPCBridge).
| name | the namespace to register the methods under | |
| clazz | the class to register |
| Exception | if the registration fails |
| static void registerClass | ( | Class | clazz | ) | throws Exception [static] |
Registers all of the methods of the given class to be available for services to call (see JSONRPCBridge).
| clazz | the class to register |
| Exception | if the registration fails |
| static void registerSerializer | ( | Serializer | serializer | ) | throws Exception [static] |
Registers a custom serializer into the global JSON serializers (see JSONRPCBridge).
| serializer | the serializer to register |
| Exception | if the registration fails |
| void registerService | ( | String | name, | |
| Object | serviceObject | |||
| ) |
Registers the given object in the shared JSON bridge. The shared JSON bridge is used for stateless JSON services. As an example, if you call registerService("myExampleService", new ExampleService()) you can then call json.myExampleService.someMethodInExampleService from your Javascript. The same instance is shared across all of your service users, so you should not store any state in this class.
| name | the name to register the object as | |
| serviceObject | the instance to register |
JSONRPCBridge _sharedBridge [private] |
final String RequestHandlerKey = "json" [static] |
1.5.8