|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectist.palcom.mal.AbstractMediaManager
ist.palcom.mal.CompoundMediaManager
public class CompoundMediaManager
This class implements a media manager that can have other media managers as submanagers, handling the actual communication.
The structure is that of the Composite design pattern - a CompoundMediaManager has the same interface as "ordinary" MediaManagers, and can be used wherever a MediaManager is needed.
Submanagers are added using the add
method.
MediaManager| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class ist.palcom.mal.AbstractMediaManager |
|---|
AbstractMediaManager.DistributorThread |
| Field Summary |
|---|
| Fields inherited from class ist.palcom.mal.AbstractMediaManager |
|---|
distributorThread, PALCOM_URL_PREFIX, scheduler, TIMEOUTS_BEFORE_REMOVAL, WIRE_PROTOCOL_VERSION |
| Constructor Summary | |
|---|---|
CompoundMediaManager(PalcomScheduler scheduler,
java.lang.String defaultProtocol,
MediaManager defaultManager,
PalcomThread errorHandler)
|
|
| Method Summary | |
|---|---|
void |
add(java.lang.String protocol,
MediaManager manager)
Add a manager handling a specific protocol, The protocol is the protocol part of the URLs, such as "datagram" for UDP or "http" for HTTP. |
void |
addErrorHandler(PalcomPriorityThread handler)
Adds the error handler to all registered managers, and cached for further reference |
URL[] |
getDefaultGroupAddresses()
|
URL |
getDefaultUnicastURL()
Returns the URL that the manager listens for messages at by default. |
protected CommunicationThread |
getReceivingThread(URL url)
|
int |
getSendBufferSize()
|
protected CommunicationThread |
getSendingThread(URL url)
|
protected boolean |
isBroadcast(URL url)
|
protected void |
removeReceivingThread(URL url)
Stop receiving at url, and remove the receiving thread. |
boolean |
send(Message message,
java.lang.String senderDeviceID,
Selector senderSelector,
java.lang.String receiverDeviceID,
Selector receiverSelector)
|
void |
sendBroadcast(Message message,
java.lang.String senderDeviceID,
Selector senderSelector)
|
void |
stop()
Stop the manager. |
void |
suggestSendBufferSize(int size)
Used in the same manner as setSendBufferSize. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CompoundMediaManager(PalcomScheduler scheduler,
java.lang.String defaultProtocol,
MediaManager defaultManager,
PalcomThread errorHandler)
| Method Detail |
|---|
public void suggestSendBufferSize(int size)
AbstractMediaManager
suggestSendBufferSize in interface MediaManagersuggestSendBufferSize in class AbstractMediaManagerpublic int getSendBufferSize()
getSendBufferSize in interface MediaManagergetSendBufferSize in class AbstractMediaManager
public boolean send(Message message,
java.lang.String senderDeviceID,
Selector senderSelector,
java.lang.String receiverDeviceID,
Selector receiverSelector)
public void sendBroadcast(Message message,
java.lang.String senderDeviceID,
Selector senderSelector)
public void addErrorHandler(PalcomPriorityThread handler)
public void stop()
AbstractMediaManager
stop in interface MediaManagerstop in class AbstractMediaManager
public void add(java.lang.String protocol,
MediaManager manager)
public URL getDefaultUnicastURL()
AbstractMediaManager
getDefaultUnicastURL in class AbstractMediaManagerprotected CommunicationThread getReceivingThread(URL url)
getReceivingThread in class AbstractMediaManagerprotected void removeReceivingThread(URL url)
AbstractMediaManager
removeReceivingThread in class AbstractMediaManagerprotected CommunicationThread getSendingThread(URL url)
getSendingThread in class AbstractMediaManagerprotected boolean isBroadcast(URL url)
isBroadcast in class AbstractMediaManagerpublic URL[] getDefaultGroupAddresses()
getDefaultGroupAddresses in class AbstractMediaManager
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||