|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--solar.service.BaseService | +--solar.service.pubsub.ClientPubSubService
The PACK service that runs at the client side.
Field Summary | |
protected DispatchService |
_dispatch
|
protected EndPointManager |
_epman
|
protected static org.apache.log4j.Logger |
_log
Logging facility. |
protected java.lang.String |
_pubsubName
|
protected RpcService |
_rpc
|
protected Address |
_server
|
protected Address |
_transportAddress
|
protected java.lang.String |
_transportName
|
Fields inherited from class solar.service.BaseService |
_inited, _manager, _name |
Fields inherited from interface solar.service.rpc.RpcConstants |
RPC_BLOCK, RPC_HANDLER, RPC_REPLY, RPC_REQUEST, RPC_TIMEOUT |
Constructor Summary | |
ClientPubSubService()
|
Method Summary | |
void |
addPublisher(Id pubId,
Publisher publisher)
Register a publisher with the service. |
void |
addSubscriber(Id subId,
Subscriber subscriber)
Register a subscriber with the service. |
private void |
assertNotRegistered(Id id)
|
private void |
assertRegistered(Id id)
|
private java.lang.Object |
callRpc(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. |
private Guid |
makeGuid(Id id)
|
void |
publish(Id pubId,
Event evt)
Publish an event to all subscribers. |
void |
subscribe(Id pubId,
Id subId,
java.lang.Object extra)
Make a subscription to a publisher. |
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 |
Methods inherited from interface solar.service.Service |
getName, getServiceManager, handleDispatchUnit, hasInited, setName, setServiceManager, start, stop |
Field Detail |
protected static org.apache.log4j.Logger _log
protected Address _server
protected java.lang.String _pubsubName
protected java.lang.String _transportName
protected Address _transportAddress
protected RpcService _rpc
protected DispatchService _dispatch
protected EndPointManager _epman
Constructor Detail |
public ClientPubSubService()
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 java.lang.Object handleRequest(Request request) throws java.lang.Exception
RequestHandler
handleRequest
in interface RequestHandler
handleRequest
in class BaseService
java.lang.Exception
public void handleEvent(Event evt) throws java.lang.Exception
EventHandler
handleEvent
in interface EventHandler
handleEvent
in class BaseService
java.lang.Exception
public void addPublisher(Id pubId, Publisher publisher) throws PubSubException
PubSubService
addPublisher
in interface PubSubService
PubSubException
public void addSubscriber(Id subId, Subscriber subscriber) throws PubSubException
PubSubService
addSubscriber
in interface PubSubService
PubSubException
public void subscribe(Id pubId, Id subId, java.lang.Object extra) throws PubSubException
PubSubService
subscribe
in interface PubSubService
PubSubException
public void publish(Id pubId, Event evt) throws PubSubException
PubSubService
publish
in interface PubSubService
PubSubException
private Guid makeGuid(Id id)
private void assertRegistered(Id id) throws PubSubException
PubSubException
private void assertNotRegistered(Id id) throws PubSubException
PubSubException
private java.lang.Object callRpc(Request request) throws RpcException
RpcException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |