|
||||||||||
| 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.
One MessageCentre instance will be created per portlet webapp.
The MessageStore used (set in the constructor) will determine the
messaging functionality: if it uses a remote store such as a database, the
messages will be available to all portlet applications, but if it is a local
store, they will only be available to the current portlet application.
Direct 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 MessageStore |
store
|
| 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. |
void |
clearAllOutputMappings(MessageBoxKey key)
Remove any existing output mappings for this key. |
void |
clearInputMapping(MessageBoxKey key)
Remove a message key => message box mapping. |
void |
deleteInput(MessageBoxKey key)
Remove all trace of the specified input message box. |
void |
deleteOutput(MessageBoxKey key)
Remove all trace of the specified output message box. |
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)
|
java.util.Set |
getOutputKeys(java.lang.String portletID)
|
java.util.Set |
getPublicBoxKeys()
|
boolean |
isValid()
|
protected MessageBoxKey |
makeLocalKey(java.lang.String portletID,
java.lang.String name)
|
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. |
void |
setStore(MessageStore store)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected MessageStore store
| Constructor Detail |
public MessageCentreImpl()
| Method Detail |
public void setStore(MessageStore store)
setStore in interface MessageCentre
public void addInputMapping(java.lang.String portletID,
java.lang.String name,
MessageBoxKey source)
addInputMapping in interface MessageCentreportletID - 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 MessageCentrepublic void clearInputMapping(MessageBoxKey key)
clearInputMapping in interface MessageCentrepublic void deleteInput(MessageBoxKey key)
deleteInput in interface MessageCentre
public void addOutputMapping(java.lang.String portletID,
java.lang.String name,
MessageBoxKey target)
addOutputMapping in interface MessageCentreportletID - 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 MessageCentrepublic void clearAllOutputMappings(MessageBoxKey key)
clearAllOutputMappings in interface MessageCentrepublic void deleteOutput(MessageBoxKey key)
deleteOutput in interface MessageCentre
public java.util.Set findOutputTargets(java.lang.String portletID,
java.lang.String name)
findOutputTargets in interface MessageCentrepublic 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 MessageCentrepublic MessageBoxKey findInputSource(MessageBoxKey key)
findInputSource in interface MessageCentrepublic java.lang.Object get(MessageBoxKey boxKey)
get in interface MessageCentre
public void send(java.util.Set targetKeys,
java.lang.Object message)
send in interface MessageCentretargetKeys - Set of MessageBoxKeys to which the message should be sentpublic java.util.Set getInputKeys(java.lang.String portletID)
getInputKeys in interface MessageCentrepublic java.util.Set getOutputKeys(java.lang.String portletID)
getOutputKeys in interface MessageCentrepublic java.util.Set getPublicBoxKeys()
getPublicBoxKeys in interface MessageCentrepublic java.util.Map getBoxes()
getBoxes in interface MessageCentrepublic java.util.Set getAllInputKeys()
getAllInputKeys in interface MessageCentrepublic java.util.Set getAllOutputKeys()
getAllOutputKeys in interface MessageCentrepublic boolean isValid()
isValid in interface MessageCentre
protected MessageBoxKey makeLocalKey(java.lang.String portletID,
java.lang.String name)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||