JSONComponent Class Reference

Inherited by ExampleJSONComponent.

Collaboration diagram for JSONComponent:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 JSONComponent (WOContext context)

Static Public Member Functions

static< TextendsJSONComponent > T componentWithName (String componentClassName, WOContext context)
static< TextendsJSONComponent > T componentWithName (Class< T > componentClass, WOContext context)

Protected Member Functions

void _setContext (WOContext context)
void checkAccess ()
WOContext context ()

Package Functions

public< T extends JSONComponent > T componentWithName (Class< T > componentClass)

Private Attributes

WOContext _context


Detailed Description

The base class for JSON "Components". JSONComponents provide a framework for implementing stateful JSON services. If you are providing a JSON service that is only used on a page, you can use AjaxProxy to provide a stateful JSON interface to a page. However, if you would like to provide stateful services to non-page-based clients, AjaxProxy isn't sufficient. By extending JSONComponent, all of your public methods are exposed as RPC calls to your clients that can be accessed by constructing a URL to a JSON Request Handler. For instance, /json/MyComponentName will give you a stateful service endpoint

If a method returns another JSONComponent, the client will be sent a JSONRedirect that contains the URL to communicate with the instance you returned.

THIS API IS STILL EXPERIMENTAL AND SUBJECT TO CHANGE

Author:
mschrag

Constructor & Destructor Documentation

JSONComponent ( WOContext  context  ) 

Constructs a new JSONComponent.

Parameters:
context the context that created the component


Member Function Documentation

void _setContext ( WOContext  context  )  [protected]

Sets the current context.

Parameters:
context the current context.

void checkAccess (  )  [protected]

Called prior to issuing any calls to the component. Throw a SecurityException if the Session user's credentials are insufficient.

static <TextendsJSONComponent> T componentWithName ( String  componentClassName,
WOContext  context 
) [static]

Returns a JSONComponent of the given type.

Parameters:
<T> the JSONComponent type
componentClassName the name of the class to instantiate
context the WOContext to create within
Returns:
an instance of the given JSONComponent

static <TextendsJSONComponent> T componentWithName ( Class< T >  componentClass,
WOContext  context 
) [static]

Returns a JSONComponent of the given type.

Parameters:
<T> the JSONComponent type
componentClass the class to instantiate
context the WOContext to create within
Returns:
an instance of the given JSONComponent

public<T extends JSONComponent> T componentWithName ( Class< T >  componentClass  )  [package]

Returns a JSONComponent of the given type.

Parameters:
<T> the JSONComponent type
componentClass the class to instantiate
Returns:
an instance of the given JSONComponent

WOContext context (  )  [protected]

Returns the current context.

Returns:
the current context.


Member Data Documentation

WOContext _context [private]


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