|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--gov.sns.tools.messaging.MessageCenter
MessageCenter provides an interface to the messaging system with lots of convenience methods for easy access to messaging features.
| Nested Class Summary | |
class |
MessageCenter.MessageCenterException
Generic class for all MessageCenter related exceptions |
class |
MessageCenter.NullSourceException
Exception when an attempt is made to register a null source |
class |
MessageCenter.NullTargetException
Exception when an attempt is made to register a null source |
class |
MessageCenter.UnimplementedProtocolException
Exception when an attempt is made to register a target for a protocol not implemented by its class. |
| Constructor Summary | |
MessageCenter()
Creates new MessageCenter |
|
MessageCenter(int threadPoolSize)
Create a new MessageCenter with given thread pool size |
|
MessageCenter(java.lang.String newName)
Create a new MessageCenter with given name |
|
MessageCenter(java.lang.String newName,
int newThreadPoolSize)
Create a new MessageCenter with given name and thread pool size |
|
| Method Summary | |
static MessageCenter |
defaultCenter()
default message center instance |
java.lang.Object |
getProxy(java.lang.Object source,
java.lang.Class protocol)
get the proxy for the specified source and protocol |
java.lang.String |
name()
get the name of the MessageCenter instance |
static MessageCenter |
newCenter()
Create a new MessageCenter |
static MessageCenter |
newCenter(int newThreadPoolSize)
Create a new MessageCenter |
static MessageCenter |
newCenter(java.lang.String newName)
Create a new MessageCenter |
static MessageCenter |
newCenter(java.lang.String newName,
int newThreadPoolSize)
Create a new MessageCenter |
java.lang.Object |
registerSource(java.lang.Object source,
java.lang.Class protocol)
register the specified source to be associated with the specified event protocol defaults to synchronous messaging |
java.lang.Object |
registerSource(java.lang.Object source,
java.lang.Class protocol,
boolean isSynchronous)
register the specified source to be associated with the specified event protocol and using synchronous (true) or asynchronous messaging (false) |
void |
registerTarget(java.lang.Object target,
java.lang.Class protocol)
register target for messages from any source which posts to the interface |
void |
registerTarget(java.lang.Object target,
java.lang.Object source,
java.lang.Class protocol)
register target for messages from the source and for the specified interface |
void |
removeSource(java.lang.Object source,
java.lang.Class protocol)
Remove source registration which means the proxy for the source/protocol pair is no longer able to broadcast messages. |
void |
removeTarget(java.lang.Object target,
java.lang.Class protocol)
Removes the target from listening for the specified protocol. |
void |
removeTarget(java.lang.Object target,
java.util.Collection sources,
java.lang.Class protocol)
Unregister the target from listening to the specified protocol from the specified collection of sources. |
void |
removeTarget(java.lang.Object target,
java.lang.Object source,
java.lang.Class protocol)
remove target from listening to specified source with specified protocol |
void |
removeTargetFromAllSources(java.lang.Object target,
java.lang.Class protocol)
Remove the target from every source that broadcasts the specified protocol |
java.lang.String |
toString()
Override toString() to return a description of the message center. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public MessageCenter()
public MessageCenter(java.lang.String newName)
newName - The name of this Message Center.public MessageCenter(int threadPoolSize)
threadPoolSize - The thread pool size of this message center
public MessageCenter(java.lang.String newName,
int newThreadPoolSize)
newName - The name of this message centernewThreadPoolSize - The thread pool size of this message center| Method Detail |
public static MessageCenter defaultCenter()
public static MessageCenter newCenter()
public static MessageCenter newCenter(java.lang.String newName)
newName - the name to assign this message center
public static MessageCenter newCenter(int newThreadPoolSize)
newThreadPoolSize - The thread pool size of this message center
public static MessageCenter newCenter(java.lang.String newName,
int newThreadPoolSize)
newName - The name of this message centernewThreadPoolSize - The thread pool size of this message center
public void registerTarget(java.lang.Object target,
java.lang.Object source,
java.lang.Class protocol)
target - The target to receive messagessource - The source from which we wish to receive messagesprotocol - The protocol identifying the message type to receive
public void registerTarget(java.lang.Object target,
java.lang.Class protocol)
target - The target to receive messagesprotocol - The protocol identifying the message type to receive
public void removeTarget(java.lang.Object target,
java.lang.Object source,
java.lang.Class protocol)
target - The target receiving messagessource - The source from which we are receiving messagesprotocol - The protocol identifying the message type being received
public void removeTargetFromAllSources(java.lang.Object target,
java.lang.Class protocol)
target - The target receiving messagesprotocol - The protocol identifying the message type being received
public void removeTarget(java.lang.Object target,
java.util.Collection sources,
java.lang.Class protocol)
target - The target receiving messagessources - The sources from which we are receiving messagesprotocol - The protocol identifying the message type being received
public void removeTarget(java.lang.Object target,
java.lang.Class protocol)
target - The target receiving messagesprotocol - The protocol identifying the message type being received
public java.lang.Object registerSource(java.lang.Object source,
java.lang.Class protocol)
source - The source of the messageprotocol - The type and interface of the messages the source will send
public java.lang.Object registerSource(java.lang.Object source,
java.lang.Class protocol,
boolean isSynchronous)
source - The source of the messageprotocol - The type and interface of the messages the source will sendisSynchronous - true to enable synchronous messaging and false for asynchronous messaging
public void removeSource(java.lang.Object source,
java.lang.Class protocol)
source - The source of messagesprotocol - The interface/type of messages
public java.lang.Object getProxy(java.lang.Object source,
java.lang.Class protocol)
source - The source on behalf of which messages will be broadcastprotocol - The interface/type of message implemented by the proxy
public java.lang.String name()
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||