|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmessage.MessageCentreImpl
Storage and retrieval of portlet message mappings, and the messages.
This implementation uses the Portlet session for storage, which restricts
messaging to be between portlets in the same portlet application.
Use of this class is only necessary when you want to modify message
mappings in code; to simply load mappings from preferences, or
send/receive messages, use MessageHelper
.
Field Summary | |
protected java.util.Map |
inputKeyMap
|
protected java.util.Map |
msgBoxes
|
protected java.util.Map |
outputKeyMap
|
Constructor Summary | |
MessageCentreImpl()
|
Method Summary | |
void |
addInputMapping(MessageBoxKey key,
MessageBoxKey source)
|
void |
addInputMapping(java.lang.String portletID,
java.lang.String name,
MessageBoxKey source)
Set a portlet message key => message box mapping. |
void |
addOutputMapping(MessageBoxKey key,
MessageBoxKey target)
|
void |
addOutputMapping(java.lang.String portletID,
java.lang.String name,
MessageBoxKey target)
Add a portlet message key => message box mapping. |
MessageBoxKey |
findInputSource(MessageBoxKey key)
|
MessageBoxKey |
findInputSource(java.lang.String portletID,
java.lang.String name)
Get the key of the source message box for this portletID+name combination. |
java.util.Set |
findOutputTargets(MessageBoxKey key)
|
java.util.Set |
findOutputTargets(java.lang.String portletID,
java.lang.String name)
This will always return a Set which contains at least a key for a message box corresponding to the provided portletID+name (it always outputs to itself as well as any other registered mappings) |
java.lang.Object |
get(MessageBoxKey boxKey)
Get message from this message box. |
java.lang.Object |
get(java.lang.String portletID,
java.lang.String name)
Get message for this portletID+name combination. |
java.util.Set |
getAllInputKeys()
|
java.util.Set |
getAllOutputKeys()
|
java.util.Map |
getBoxes()
|
java.util.Set |
getInputKeys(java.lang.String portletID)
|
protected java.util.Set |
getKeysWithNamespace(java.util.Collection searchKeys,
java.lang.String ns)
|
java.util.Set |
getOutputKeys(java.lang.String portletID)
|
java.util.Set |
getPublicBoxKeys()
|
void |
removeAllOutputMappings(MessageBoxKey key)
|
void |
removeInputMapping(java.lang.String portletID,
java.lang.String name)
Remove a message key => message box mapping. |
void |
send(java.util.Set targetKeys,
java.lang.Object message)
Send message to these message boxes. |
void |
send(java.lang.String portletID,
java.lang.String name,
java.lang.Object message)
Send message to this portletID+name combination. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.Map inputKeyMap
protected java.util.Map outputKeyMap
protected java.util.Map msgBoxes
Constructor Detail |
public MessageCentreImpl()
Method Detail |
public void addInputMapping(java.lang.String portletID, java.lang.String name, MessageBoxKey source)
addInputMapping
in interface MessageCentre
portletID
- ID of the portlet which is receiving the inputname
- (local) name of the portlet input, referred to in the portlet's codesource
- the message box from which the portlet's input will read.public void addInputMapping(MessageBoxKey key, MessageBoxKey source)
addInputMapping
in interface MessageCentre
public void removeInputMapping(java.lang.String portletID, java.lang.String name)
removeInputMapping
in interface MessageCentre
public void addOutputMapping(java.lang.String portletID, java.lang.String name, MessageBoxKey target)
addOutputMapping
in interface MessageCentre
portletID
- ID of the portlet which is sending the outputname
- (local) name of the portlet output, referred to in the portlet's codetarget
- the message box to which the portlet's output will copy its message.public void addOutputMapping(MessageBoxKey key, MessageBoxKey target)
addOutputMapping
in interface MessageCentre
public void removeAllOutputMappings(MessageBoxKey key)
removeAllOutputMappings
in interface MessageCentre
public java.util.Set findOutputTargets(java.lang.String portletID, java.lang.String name)
findOutputTargets
in interface MessageCentre
public java.util.Set findOutputTargets(MessageBoxKey key)
findOutputTargets
in interface MessageCentre
public java.lang.Object get(java.lang.String portletID, java.lang.String name)
get
in interface MessageCentre
public void send(java.lang.String portletID, java.lang.String name, java.lang.Object message)
send
in interface MessageCentre
public MessageBoxKey findInputSource(java.lang.String portletID, java.lang.String name)
findInputSource
in interface MessageCentre
public MessageBoxKey findInputSource(MessageBoxKey key)
findInputSource
in interface MessageCentre
public java.lang.Object get(MessageBoxKey boxKey)
get
in interface MessageCentre
public void send(java.util.Set targetKeys, java.lang.Object message)
send
in interface MessageCentre
targetKeys
- Set of MessageBoxKeys to which the message should be sentpublic java.util.Set getInputKeys(java.lang.String portletID)
getInputKeys
in interface MessageCentre
public java.util.Set getOutputKeys(java.lang.String portletID)
getOutputKeys
in interface MessageCentre
public java.util.Set getPublicBoxKeys()
getPublicBoxKeys
in interface MessageCentre
protected java.util.Set getKeysWithNamespace(java.util.Collection searchKeys, java.lang.String ns)
public java.util.Map getBoxes()
getBoxes
in interface MessageCentre
public java.util.Set getAllInputKeys()
getAllInputKeys
in interface MessageCentre
public java.util.Set getAllOutputKeys()
getAllOutputKeys
in interface MessageCentre
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |