|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--solar.service.BaseService | +--solar.service.multicast.NaiveMulticastService
A naive multicast service does not attempt to build a dissemination tree and simply sends the message directly to every subscriber in best-effort. Notice groupId must be global unique for semantic correctness.
Field Summary | |
protected DirectoryService |
_directory
|
protected java.util.Hashtable |
_groups
|
protected Address |
_laddr
|
protected org.apache.log4j.Logger |
_log
The logger for this multicast service. |
protected java.util.Hashtable |
_members
|
protected RpcService |
_rpc
|
protected TransportService |
_transport
|
Fields inherited from class solar.service.BaseService |
_inited, _manager, _name |
Fields inherited from interface solar.service.multicast.MulticastConstants |
GROUP_ID |
Constructor Summary | |
NaiveMulticastService()
|
Method Summary | |
void |
create(Id groupId)
Create a multicast group. |
void |
destroy(Id groupId)
Destroy a multicast group. |
private void |
doJoin(Id groupId,
MulticastMember member,
boolean local)
|
private void |
doLeave(Id groupId,
MulticastMember member,
boolean local)
|
private void |
doMulticast(Id groupId,
Event evt,
boolean local)
|
private Name |
getNameByGroupId(Id groupId)
|
java.lang.Object |
handleRequest(Request request)
Processing a request. |
void |
initDependents()
Initialize dependent services here. |
void |
join(Id groupId,
MulticastMember member)
Join a multicast group. |
void |
leave(Id groupId,
MulticastMember member)
Leave a multicast group. |
void |
multicast(Id groupId,
Event evt)
Multicast an application-data unit to all group memebers. |
Methods inherited from class solar.service.BaseService |
assertInited, getDependentService, getName, getServiceManager, handleDispatchUnit, handleEvent, handleEvent, hasInited, init, 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, init, setName, setServiceManager, start, stop |
Methods inherited from interface solar.api.EventHandler |
handleEvent |
Field Detail |
protected org.apache.log4j.Logger _log
protected DirectoryService _directory
protected RpcService _rpc
protected TransportService _transport
protected Address _laddr
protected java.util.Hashtable _groups
protected java.util.Hashtable _members
Constructor Detail |
public NaiveMulticastService()
Method Detail |
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 create(Id groupId) throws MulticastException
MulticastService
create
in interface MulticastService
MulticastException
public void destroy(Id groupId) throws MulticastException
MulticastService
destroy
in interface MulticastService
MulticastException
public void join(Id groupId, MulticastMember member) throws MulticastException
MulticastService
join
in interface MulticastService
MulticastException
public void leave(Id groupId, MulticastMember member) throws MulticastException
MulticastService
leave
in interface MulticastService
MulticastException
public void multicast(Id groupId, Event evt) throws MulticastException
MulticastService
multicast
in interface MulticastService
MulticastException
private Name getNameByGroupId(Id groupId)
private void doJoin(Id groupId, MulticastMember member, boolean local) throws MulticastException
MulticastException
private void doLeave(Id groupId, MulticastMember member, boolean local) throws MulticastException
MulticastException
private void doMulticast(Id groupId, Event evt, boolean local) throws MulticastException
MulticastException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |