|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--solar.service.BaseService
|
+--solar.service.rmtobj.SolarRemoteObjectService
This RemoteObjectService uses a softstate protocol to monitoring remote object and uses RPC service to invoke request. Current implementation only allows one monitor for a single remote object.
| Nested Class Summary | |
(package private) class |
SolarRemoteObjectService.PingTask
The task periodically notifies remote monitors about local objects. |
| Field Summary | |
protected Cache |
_cache
|
protected DispatchService |
_dispatch
|
protected long |
_interval
|
protected java.util.Hashtable |
_local
|
protected org.apache.log4j.Logger |
_log
|
protected java.util.Hashtable |
_registered
|
protected java.util.Hashtable |
_remote
|
protected java.lang.String |
_rmtobjName
|
protected RpcService |
_rpc
|
protected java.util.Timer |
_timer
|
protected Address |
_transportAddress
|
protected java.lang.String |
_transportName
|
| Fields inherited from class solar.service.BaseService |
_inited, _manager, _name |
| Fields inherited from interface solar.service.rmtobj.RemoteObjectConstants |
RMTOBJ_ADDRESS, RMTOBJ_CAPACITY, RMTOBJ_IDS, RMTOBJ_INTERVAL, RMTOBJ_TTL |
| Fields inherited from interface solar.service.rpc.RpcConstants |
RPC_BLOCK, RPC_HANDLER, RPC_REPLY, RPC_REQUEST, RPC_TIMEOUT |
| Constructor Summary | |
SolarRemoteObjectService()
|
|
| Method Summary | |
private java.lang.Object |
callRpc(Address address,
Request request)
|
void |
handleEvent(Event evt)
Processing an event. |
java.lang.Object |
handleRequest(Request request)
Processing a request. |
void |
init()
Initiate the service, do not try to init dependent services here. |
void |
initDependents()
Initialize dependent services here. |
void |
notifyObjectExpired(CachedObject co)
Notify when an object has expired from the cache. |
void |
register(Id id)
Register a local object for remote monitoring. |
void |
register(Id id,
RequestHandler handler)
Register a local object for remote monitoring. |
void |
register(RemoteObject rmtobj,
RemoteObjectListener listener)
Register a remote object to monitor. |
java.lang.Object |
request(RemoteObject rmtobj,
Request req)
Invoke a request on the remote object. |
void |
unregister(Id id)
Unregister a local object. |
void |
unregister(RemoteObject rmtobj)
Unregister a remote object. |
| Methods inherited from class solar.service.BaseService |
assertInited, getDependentService, getName, getServiceManager, handleDispatchUnit, 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 |
| Field Detail |
protected org.apache.log4j.Logger _log
protected java.lang.String _rmtobjName
protected java.lang.String _transportName
protected Address _transportAddress
protected RpcService _rpc
protected DispatchService _dispatch
protected Cache _cache
protected long _interval
protected java.util.Timer _timer
protected java.util.Hashtable _local
protected java.util.Hashtable _remote
protected java.util.Hashtable _registered
| Constructor Detail |
public SolarRemoteObjectService()
| Method Detail |
public void init()
throws ServiceException
Service
init in interface Serviceinit in class BaseServiceServiceException
public void initDependents()
throws ServiceException
Service
initDependents in interface ServiceinitDependents in class BaseServiceServiceException
public java.lang.Object handleRequest(Request request)
throws java.lang.Exception
RequestHandler
handleRequest in interface RequestHandlerhandleRequest in class BaseServicejava.lang.Exception
public void handleEvent(Event evt)
throws java.lang.Exception
EventHandler
handleEvent in interface EventHandlerhandleEvent in class BaseServicejava.lang.Exceptionpublic void notifyObjectExpired(CachedObject co)
Cache.CacheListener
notifyObjectExpired in interface Cache.CacheListener
public void register(RemoteObject rmtobj,
RemoteObjectListener listener)
throws RemoteObjectException
RemoteObjectService
register in interface RemoteObjectServiceRemoteObjectException
public void unregister(RemoteObject rmtobj)
throws RemoteObjectException
RemoteObjectService
unregister in interface RemoteObjectServiceRemoteObjectException
public void register(Id id,
RequestHandler handler)
RemoteObjectService
register in interface RemoteObjectServicepublic void register(Id id)
RemoteObjectService
register in interface RemoteObjectServicepublic void unregister(Id id)
RemoteObjectService
unregister in interface RemoteObjectService
public java.lang.Object request(RemoteObject rmtobj,
Request req)
throws RemoteObjectException
RemoteObjectService
request in interface RemoteObjectServiceRemoteObjectException
private java.lang.Object callRpc(Address address,
Request request)
throws RpcException
RpcException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||