Class TurbineJsonRpcService
- java.lang.Object
-
- org.apache.turbine.services.BaseInitable
-
- org.apache.turbine.services.BaseService
-
- org.apache.turbine.services.TurbineBaseService
-
- org.apache.turbine.services.jsonrpc.TurbineJsonRpcService
-
- All Implemented Interfaces:
Initable
,JsonRpcService
,Service
public class TurbineJsonRpcService extends TurbineBaseService implements JsonRpcService
This is a service that will respond to JSON-RPC calls.- Version:
- $Id$
- Author:
- Scott Eade
-
-
Field Summary
Fields Modifier and Type Field Description static String
JSON_BRIDGE_KEY
The key used to store the bridge in the session.-
Fields inherited from class org.apache.turbine.services.BaseService
configuration, name, serviceBroker
-
Fields inherited from class org.apache.turbine.services.BaseInitable
initableBroker, isInitialized
-
Fields inherited from interface org.apache.turbine.services.jsonrpc.JsonRpcService
SERVICE_NAME
-
Fields inherited from interface org.apache.turbine.services.Service
SERVICE_NAME
-
-
Constructor Summary
Constructors Constructor Description TurbineJsonRpcService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearBridge(HttpSession session)
Remove theJSONRPCBridge
from the sessionorg.jabsorb.JSONRPCBridge
getBridge(HttpSession session)
Get theJSONRPCBridge
from the sessionObject
processCall(CharArrayWriter cdata, org.jabsorb.JSONRPCBridge json_bridge, HttpServletRequest request)
Process a JSON RPC callvoid
registerObject(HttpSession session, String key, Object value)
Register an object with theJSONRPCBridge
in a given sessionvoid
registerObjectGlobal(String key, Object value)
Register an object with theJSONRPCBridge
globally-
Methods inherited from class org.apache.turbine.services.TurbineBaseService
init, init, init, shutdown
-
Methods inherited from class org.apache.turbine.services.BaseService
getConfiguration, getName, getProperties, getServiceBroker, setName, setServiceBroker
-
Methods inherited from class org.apache.turbine.services.BaseInitable
getInit, getInitableBroker, setInit, setInitableBroker
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.turbine.services.Initable
getInit, init, init, setInitableBroker, shutdown
-
Methods inherited from interface org.apache.turbine.services.Service
getConfiguration, getName, getProperties, setName, setServiceBroker
-
-
-
-
Field Detail
-
JSON_BRIDGE_KEY
public static final String JSON_BRIDGE_KEY
The key used to store the bridge in the session.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TurbineJsonRpcService
public TurbineJsonRpcService()
-
-
Method Detail
-
processCall
public Object processCall(CharArrayWriter cdata, org.jabsorb.JSONRPCBridge json_bridge, HttpServletRequest request)
Description copied from interface:JsonRpcService
Process a JSON RPC call- Specified by:
processCall
in interfaceJsonRpcService
- Parameters:
cdata
- the JSON datajson_bridge
- theJSONRPCBridge
objectrequest
- the request- Returns:
- the return object of the JSON RPC call
-
registerObjectGlobal
public void registerObjectGlobal(String key, Object value)
Description copied from interface:JsonRpcService
Register an object with theJSONRPCBridge
globally- Specified by:
registerObjectGlobal
in interfaceJsonRpcService
- Parameters:
key
- the name of the object in the sessionvalue
- the object to register (not null)
-
registerObject
public void registerObject(HttpSession session, String key, Object value)
Description copied from interface:JsonRpcService
Register an object with theJSONRPCBridge
in a given session- Specified by:
registerObject
in interfaceJsonRpcService
- Parameters:
session
- the sessionkey
- the name of the object in the sessionvalue
- the object to register (not null)
-
getBridge
public org.jabsorb.JSONRPCBridge getBridge(HttpSession session)
Description copied from interface:JsonRpcService
Get theJSONRPCBridge
from the session- Specified by:
getBridge
in interfaceJsonRpcService
- Parameters:
session
- the session- Returns:
- the
JSONRPCBridge
instance
-
clearBridge
public void clearBridge(HttpSession session)
Description copied from interface:JsonRpcService
Remove theJSONRPCBridge
from the session- Specified by:
clearBridge
in interfaceJsonRpcService
- Parameters:
session
- the session
-
-