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 StringJSON_BRIDGE_KEYThe 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 voidclearBridge(HttpSession session)Remove theJSONRPCBridgefrom the sessionorg.jabsorb.JSONRPCBridgegetBridge(HttpSession session)Get theJSONRPCBridgefrom the sessionObjectprocessCall(CharArrayWriter cdata, org.jabsorb.JSONRPCBridge json_bridge, HttpServletRequest request)Process a JSON RPC callvoidregisterObject(HttpSession session, String key, Object value)Register an object with theJSONRPCBridgein a given sessionvoidregisterObjectGlobal(String key, Object value)Register an object with theJSONRPCBridgeglobally-
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:JsonRpcServiceProcess a JSON RPC call- Specified by:
processCallin interfaceJsonRpcService- Parameters:
cdata- the JSON datajson_bridge- theJSONRPCBridgeobjectrequest- the request- Returns:
- the return object of the JSON RPC call
-
registerObjectGlobal
public void registerObjectGlobal(String key, Object value)
Description copied from interface:JsonRpcServiceRegister an object with theJSONRPCBridgeglobally- Specified by:
registerObjectGlobalin 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:JsonRpcServiceRegister an object with theJSONRPCBridgein a given session- Specified by:
registerObjectin 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:JsonRpcServiceGet theJSONRPCBridgefrom the session- Specified by:
getBridgein interfaceJsonRpcService- Parameters:
session- the session- Returns:
- the
JSONRPCBridgeinstance
-
clearBridge
public void clearBridge(HttpSession session)
Description copied from interface:JsonRpcServiceRemove theJSONRPCBridgefrom the session- Specified by:
clearBridgein interfaceJsonRpcService- Parameters:
session- the session
-
-