JSONRequestHandler Class Reference

Inherits com::webobjects::appserver::WORequestHandler.

Collaboration diagram for JSONRequestHandler:

Collaboration graph
[legend]

List of all members.

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


Constructor & Destructor Documentation

Creates a new JSONRequestHandler.


Member Function Documentation

static String _jsonUrl ( WOContext  context,
String  requestHandlerKey,
String  componentNameAndInstance,
String  queryString 
) [static]

Returns a URL pointing to the JSON request handler.

Parameters:
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
Returns:
a JSON request handler URL

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.

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.

Parameters:
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
Returns:
a JSON request handler URL

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.

Parameters:
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 JSON request handler URL

static String jsonUrl ( WOContext  context,
String  requestHandlerKey,
String  queryString 
) [static]

Returns a URL pointing to the JSON request handler. This variant should be used for the shared web service endpoint.

Parameters:
context the current WOContext
requestHandlerKey if you registered a custom JSON request handler key
queryString the query string to append
Returns:
a JSON request handler URL

static String jsonUrl ( WOContext  context,
String  queryString 
) [static]

Returns a URL pointing to the JSON request handler. This variant should be used for the shared web service endpoint.

Parameters:
context the current WOContext
queryString the query string to append
Returns:
a JSON request handler URL

static JSONRequestHandler register (  )  [static]

Registers the JSONRequestHandler with your application using the default key.

Returns:
the request handler instance

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).

Parameters:
name the namespace to register the methods under
clazz the class to register
Exceptions:
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).

Parameters:
clazz the class to register
Exceptions:
Exception if the registration fails

static void registerSerializer ( Serializer  serializer  )  throws Exception [static]

Registers a custom serializer into the global JSON serializers (see JSONRPCBridge).

Parameters:
serializer the serializer to register
Exceptions:
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.

Parameters:
name the name to register the object as
serviceObject the instance to register


Member Data Documentation

final String RequestHandlerKey = "json" [static]


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:42:41 2012 for Project Wonder by  doxygen 1.5.8