|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--solar.service.BaseService | +--solar.service.rpc.SolarRpcService
An implementation of RPC service and it requires a dispatch service.
Nested Class Summary | |
(package private) class |
SolarRpcService.RpcWorker
A worker thread to handle one RPC request. |
Field Summary | |
protected DispatchService |
_dispatch
Dependent dispatch service. |
protected static org.apache.log4j.Logger |
_log
Logging facility. |
protected ServiceManager |
_manager
The service manager. |
protected static RpcAck |
_rpcAck
The reusable RPC acknowledge object. |
protected java.lang.String |
_rpcName
The name of this RPC service. |
protected java.lang.String |
_transportName
The name of transport service used. |
Fields inherited from class solar.service.BaseService |
_inited, _name |
Constructor Summary | |
SolarRpcService()
|
Method Summary | |
private void |
dohandleReply(ReplyEvent evt)
|
private void |
doHandleRequest(RequestEvent evt,
Address source)
|
void |
handleDispatchUnit(DispatchUnit dunit)
Handle the data unit delivered by dispatch service. |
java.lang.Object |
handleRequest(Request req)
Processing a request. |
void |
init()
Initiate the service, do not try to init dependent services here. |
void |
initDependents()
Initialize dependent services here. |
java.lang.Object |
invoke(Address dest,
java.lang.String handler,
Request req)
Send the request to remote party and wait for the result. |
java.lang.Object |
invoke(Address dest,
java.lang.String handler,
Request req,
long timeout)
Send the request and wait for the result for a fixed period. |
Methods inherited from class solar.service.BaseService |
assertInited, getDependentService, getName, getServiceManager, handleEvent, handleEvent, hasInited, init, setInited, setName, setServiceManager, start, stop |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface solar.service.Service |
getName, getServiceManager, hasInited, setName, setServiceManager, start, stop |
Methods inherited from interface solar.api.EventHandler |
handleEvent |
Field Detail |
protected static org.apache.log4j.Logger _log
protected DispatchService _dispatch
protected ServiceManager _manager
protected java.lang.String _rpcName
protected static final RpcAck _rpcAck
protected java.lang.String _transportName
Constructor Detail |
public SolarRpcService()
Method Detail |
public void init() throws ServiceException
Service
init
in interface Service
init
in class BaseService
ServiceException
public void initDependents() throws ServiceException
Service
initDependents
in interface Service
initDependents
in class BaseService
ServiceException
public void handleDispatchUnit(DispatchUnit dunit) throws java.lang.Exception
Service
handleDispatchUnit
in interface Service
handleDispatchUnit
in class BaseService
java.lang.Exception
public java.lang.Object handleRequest(Request req) throws java.lang.Exception
RequestHandler
handleRequest
in interface RequestHandler
handleRequest
in class BaseService
java.lang.Exception
private void dohandleReply(ReplyEvent evt)
private void doHandleRequest(RequestEvent evt, Address source)
public java.lang.Object invoke(Address dest, java.lang.String handler, Request req) throws RpcException
RpcService
invoke
in interface RpcService
RpcException
public java.lang.Object invoke(Address dest, java.lang.String handler, Request req, long timeout) throws RpcException
RpcService
invoke
in interface RpcService
RpcException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |