|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.zasysdev.zamae.ObjectMessenger
public final class ObjectMessenger
This class provides all messaging facilities for inter-object communication in Prosciutto
| Field Summary | |
|---|---|
static java.lang.String |
K_ZA_UI_ATTR_MESSAGE_EVENT_OFFFOCUS
Message event: indicates when this message should be attended |
static int |
K_ZA_UI_ATTR_MESSAGE_EVENT_OFFFOCUS_INT
Message event: indicates when this message should be attended |
static java.lang.String |
K_ZA_UI_ATTR_MESSAGE_EVENT_ON_APP_START
Message event: indicates when this message should be attended |
static int |
K_ZA_UI_ATTR_MESSAGE_EVENT_ON_APP_START_INT
Message event: indicates when this message should be attended |
static java.lang.String |
K_ZA_UI_ATTR_MESSAGE_EVENT_ON_ASKING_FOR_DELETION
Message event: indicates when this message should be attended |
static int |
K_ZA_UI_ATTR_MESSAGE_EVENT_ON_ASKING_FOR_DELETION_INT
Message event: indicates when this message should be attended |
static java.lang.String |
K_ZA_UI_ATTR_MESSAGE_EVENT_ON_RESET_APP
Message event: indicates when this message should be attended |
static int |
K_ZA_UI_ATTR_MESSAGE_EVENT_ON_RESET_APP_INT
Message event: indicates when this message should be attended |
static java.lang.String |
K_ZA_UI_ATTR_MESSAGE_EVENT_ONAPP_EXIT
Message event: indicates when this message should be attended |
static int |
K_ZA_UI_ATTR_MESSAGE_EVENT_ONAPP_EXIT_INT
Message event: indicates when this message should be attended |
static java.lang.String |
K_ZA_UI_ATTR_MESSAGE_EVENT_ONEACH_REPAINT
Message event: indicates when this message should be attended |
static int |
K_ZA_UI_ATTR_MESSAGE_EVENT_ONEACH_REPAINT_INT
Message event: indicates when this message should be attended |
static java.lang.String |
K_ZA_UI_ATTR_MESSAGE_EVENT_ONFOCUS
Message event: indicates when this message should be attended |
static int |
K_ZA_UI_ATTR_MESSAGE_EVENT_ONFOCUS_INT
Message event: indicates when this message should be attended |
static java.lang.String |
K_ZA_UI_ATTR_MESSAGE_EVENT_ONHIDE
Message event: indicates when this message should be attended (onhide) |
static int |
K_ZA_UI_ATTR_MESSAGE_EVENT_ONHIDE_INT
Message event: indicates when this message should be attended |
static java.lang.String |
K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_DOWN
Message event: indicates when this message should be attended |
static int |
K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_DOWN_INT
Message event: indicates when this message should be attended |
static java.lang.String |
K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_FIRE
Message event: indicates when this message should be attended |
static int |
K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_FIRE_INT
Message event: indicates when this message should be attended |
static java.lang.String |
K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_LEFT
Message event: indicates when this message should be attended |
static int |
K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_LEFT_INT
Message event: indicates when this message should be attended |
static java.lang.String |
K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_RIGHT
Message event: indicates when this message should be attended |
static int |
K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_RIGHT_INT
Message event: indicates when this message should be attended |
static java.lang.String |
K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_UP
Message event: indicates when this message should be attended |
static int |
K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_UP_INT
Message event: indicates when this message should be attended |
static java.lang.String |
K_ZA_UI_ATTR_MESSAGE_EVENT_ONSHOW
Message event: indicates when this message should be attended (onshow) |
static java.lang.String |
K_ZA_UI_ATTR_MESSAGE_EVENT_ONSHOW_COMING_FROM_FORM
Message event: indicates when this message should be attended |
static int |
K_ZA_UI_ATTR_MESSAGE_EVENT_ONSHOW_COMING_FROM_FORM_INT
Message event: indicates when this message should be attended |
static int |
K_ZA_UI_ATTR_MESSAGE_EVENT_ONSHOW_INT
Message event: indicates when this message should be attended |
static java.lang.String |
K_ZA_UI_ATTR_MESSAGE_EVENT_PROCESS_IMMEDIATELY
Message event: indicates when this message should be attended |
static int |
K_ZA_UI_ATTR_MESSAGE_EVENT_PROCESS_IMMEDIATELY_INT
Message event: indicates when this message should be attended |
static java.lang.String |
K_ZA_UI_ATTR_MESSAGE_MOD_DISCARD
Message modifier: discard this message upon processing |
static int |
K_ZA_UI_ATTR_MESSAGE_MOD_DISCARD_INT
Message modifier: keep this message (don't delete from inbox) upon processing |
static java.lang.String |
K_ZA_UI_ATTR_MESSAGE_MOD_KEEP
Message modifier: keep this message (don't delete from inbox) upon processing |
static int |
K_ZA_UI_ATTR_MESSAGE_MOD_KEEP_INT
Message modifier: discard this message upon processing |
static java.lang.String |
K_ZA_UI_ATTR_MESSAGE_TYPE_ACTION
Message type: requires the destination object to perform an action |
static int |
K_ZA_UI_ATTR_MESSAGE_TYPE_ACTION_INT
Message type: requires the destination object to perform an action |
static java.lang.String |
K_ZA_UI_ATTR_MESSAGE_TYPE_INFO
Message type: informational |
static int |
K_ZA_UI_ATTR_MESSAGE_TYPE_INFO_INT
Message type: informational |
static int |
K_ZA_UI_ATTR_MESSAGEINBOX_ARRAY_QTY
Quantity of attributes that each message object has (don't modify) |
static int |
K_ZA_UI_ATTR_MESSAGEINBOX_DESTINATION_TYPE_IDX
Index of attribute for message object |
static int |
K_ZA_UI_ATTR_MESSAGEINBOX_DESTINATION_UID_IDX
Index of attribute for message object |
static int |
K_ZA_UI_ATTR_MESSAGEINBOX_EVENT_IDX
Index of attribute for message object |
static int |
K_ZA_UI_ATTR_MESSAGEINBOX_ITEM_TYPE_IDX
Index of attribute for message object |
static int |
K_ZA_UI_ATTR_MESSAGEINBOX_ITEM_UID_IDX
Index of attribute for message object |
static int |
K_ZA_UI_ATTR_MESSAGEINBOX_MESSAGE_IDX
Index of attribute for message object |
static int |
K_ZA_UI_ATTR_MESSAGEINBOX_MSG_MODIFIERS_IDX
Index of attribute for message object |
static int |
K_ZA_UI_ATTR_MESSAGEINBOX_MSG_TYPE_IDX
Index of attribute for message object |
static int |
K_ZA_UI_ATTR_MESSAGEINBOX_ORIGIN_TYPE_IDX
Index of attribute for message object |
static int |
K_ZA_UI_ATTR_MESSAGEINBOX_ORIGIN_UID_IDX
Index of attribute for message object |
static int |
K_ZA_UI_MAX_MESSAGEINBOX_QTY
This sets the amount of inbox queues. |
static java.lang.String |
K_ZA_UI_MESSAGEINBOX_ARRAY
Element: MessageInbox array |
static int |
K_ZA_UI_MESSAGEINBOX_ARRAY_INT
Element: MessageInbox array |
static int |
K_ZA_UI_MESSAGEINBOX_DELETEMARK_INT
All messages are marked for deletion with this value |
| Constructor Summary | |
|---|---|
ObjectMessenger(TemporalView a_tmpViewObject)
creator method |
|
| Method Summary | |
|---|---|
void |
addElementDefinition()
call this method always after the creation of a message. |
void |
addMessageListener(int iAction,
ObjectMessenger_callbacks listener)
for each event/action, the possible destination objects will implement a MessageListener interface. |
void |
addMessageToInbox(int a_msginbox_dest_uid,
int a_msginbox_dest_type,
int a_msginbox_orig_uid,
int a_msginbox_orig_type,
int a_msginbox_event,
java.lang.String a_msginbox_message,
int a_msginbox_msg_type,
int a_msginbox_msg_modifiers)
Similar to the creation of a message, this is a shortcut that will directly insert a message at the top of the Inbox stack |
void |
allocate(int a_iMaxMessagesPerMsgInbox)
allocates memory to hold an amount of messages during the application lifecycle |
void |
createMessageDefinition(java.lang.String a_msginbox_dest_uid,
java.lang.String a_msginbox_dest_type,
java.lang.String a_msginbox_orig_uid,
java.lang.String a_msginbox_orig_type,
java.lang.String a_msginbox_event,
java.lang.String a_msginbox_message,
java.lang.String a_msginbox_msg_type,
java.lang.String a_msginbox_msg_modifiers)
This allows for creating a message and putting it in the last available position in the Inbox |
void |
endMessageInboxDefinition()
always call this method after finishing the creation of a series of messages |
int |
getMessageAttributeValueByIndex(int a_msginbox_msg_Idx,
int a_msginbox_msg_attridx)
returns the value of a given message attribute given the message index |
int |
getMessageAttributeValueByMsgUID(int a_msginbox_msg_uid,
int a_msginbox_msg_attridx)
returns the value of a given message attribute given the message UID. |
int |
getMessageIndexFromInboxByDestinationUID(int a_msg_destination_uid)
retrieves the first message index found, given the desintation object UID |
int |
getMessageIndexFromInboxByMsgUID(int a_msginbox_msg_uid)
gets the message index given its UID |
int |
getMessageIndexFromInboxWhere(int a_msginbox_dest_uid,
int a_msginbox_dest_type,
int a_msginbox_orig_uid,
int a_msginbox_orig_type,
int a_msginbox_event,
java.lang.String a_msginbox_message,
int a_msginbox_msg_type,
int a_msginbox_msg_modifiers,
int a_iMsgStartingIndex,
boolean a_bLookForSimilarIDs)
this is sort of a SQL WHERE clause to find messages matching certain criteria of equalness for each of the message attributes. |
void |
markMessageForDeletion(int a_msginbox_msg_index)
marks a message for deletion |
void |
processMessage(int iMsgIndex)
given an index to an existing message in the Inbox, process it. |
void |
processMessagesOnEvent(int a_iEvent,
int a_iItemUID,
int a_iItemType,
int a_iComingFromFormID)
processes all messages that match the specified event |
void |
rearrangeMessageInbox()
after manipulation and processing of messages, call this method in order to clean it and leave the inbox in an ordered fashion, so searches are faster next time the processing occurs. |
void |
removeAllMessagesWithThisType(java.lang.String a_strMsgType)
removes all messages that match the criteria type = a_strMsgType |
void |
removeMessageFromInbox(int a_msginbox_msg_uid)
removes a given message from the inbox, given its UID |
void |
removeMessageFromInboxByIndex(int a_msginbox_msg_index)
given a message index, remove it from the Inbox queue. |
void |
removeMessageListener(int iAction,
ObjectMessenger_callbacks listener)
Removes a message listener from the given action |
void |
removeMessagesMarkedForDeletionFromInbox()
all messages that are processed and do have the modifier MOD_DISCARD will be marked for deletion after they are processed. |
void |
reset()
removes all messages from the inbox and reinitializes all variables. |
void |
startMessageInboxDefinition()
always call this method before creating any series of messages |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int K_ZA_UI_MAX_MESSAGEINBOX_QTY
public static final java.lang.String K_ZA_UI_MESSAGEINBOX_ARRAY
public static final int K_ZA_UI_MESSAGEINBOX_ARRAY_INT
public static final int K_ZA_UI_MESSAGEINBOX_DELETEMARK_INT
public static final int K_ZA_UI_ATTR_MESSAGEINBOX_ARRAY_QTY
public static final java.lang.String K_ZA_UI_ATTR_MESSAGE_TYPE_INFO
public static final java.lang.String K_ZA_UI_ATTR_MESSAGE_TYPE_ACTION
public static final int K_ZA_UI_ATTR_MESSAGE_TYPE_INFO_INT
public static final int K_ZA_UI_ATTR_MESSAGE_TYPE_ACTION_INT
public static final java.lang.String K_ZA_UI_ATTR_MESSAGE_MOD_DISCARD
public static final java.lang.String K_ZA_UI_ATTR_MESSAGE_MOD_KEEP
public static final int K_ZA_UI_ATTR_MESSAGE_MOD_DISCARD_INT
public static final int K_ZA_UI_ATTR_MESSAGE_MOD_KEEP_INT
public static final java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ONSHOW
public static final java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ONHIDE
public static final java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ONFOCUS
public static final java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_OFFFOCUS
public static final java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_UP
public static final java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_DOWN
public static final java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_LEFT
public static final java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_RIGHT
public static final java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_FIRE
public static final java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ONEACH_REPAINT
public static final java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ONAPP_EXIT
public static final java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ONSHOW_COMING_FROM_FORM
public static final java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ON_ASKING_FOR_DELETION
public static final java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_PROCESS_IMMEDIATELY
public static final java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ON_RESET_APP
public static final java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ON_APP_START
public static final int K_ZA_UI_ATTR_MESSAGE_EVENT_ONSHOW_INT
public static final int K_ZA_UI_ATTR_MESSAGE_EVENT_ONHIDE_INT
public static final int K_ZA_UI_ATTR_MESSAGE_EVENT_ONFOCUS_INT
public static final int K_ZA_UI_ATTR_MESSAGE_EVENT_OFFFOCUS_INT
public static final int K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_UP_INT
public static final int K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_DOWN_INT
public static final int K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_LEFT_INT
public static final int K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_RIGHT_INT
public static final int K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_FIRE_INT
public static final int K_ZA_UI_ATTR_MESSAGE_EVENT_ONEACH_REPAINT_INT
public static final int K_ZA_UI_ATTR_MESSAGE_EVENT_ONAPP_EXIT_INT
public static final int K_ZA_UI_ATTR_MESSAGE_EVENT_ONSHOW_COMING_FROM_FORM_INT
public static final int K_ZA_UI_ATTR_MESSAGE_EVENT_ON_ASKING_FOR_DELETION_INT
public static final int K_ZA_UI_ATTR_MESSAGE_EVENT_PROCESS_IMMEDIATELY_INT
public static final int K_ZA_UI_ATTR_MESSAGE_EVENT_ON_RESET_APP_INT
public static final int K_ZA_UI_ATTR_MESSAGE_EVENT_ON_APP_START_INT
public static final int K_ZA_UI_ATTR_MESSAGEINBOX_ITEM_TYPE_IDX
public static final int K_ZA_UI_ATTR_MESSAGEINBOX_ITEM_UID_IDX
public static final int K_ZA_UI_ATTR_MESSAGEINBOX_DESTINATION_UID_IDX
public static final int K_ZA_UI_ATTR_MESSAGEINBOX_DESTINATION_TYPE_IDX
public static final int K_ZA_UI_ATTR_MESSAGEINBOX_ORIGIN_UID_IDX
public static final int K_ZA_UI_ATTR_MESSAGEINBOX_ORIGIN_TYPE_IDX
public static final int K_ZA_UI_ATTR_MESSAGEINBOX_EVENT_IDX
public static final int K_ZA_UI_ATTR_MESSAGEINBOX_MESSAGE_IDX
public static final int K_ZA_UI_ATTR_MESSAGEINBOX_MSG_TYPE_IDX
public static final int K_ZA_UI_ATTR_MESSAGEINBOX_MSG_MODIFIERS_IDX
| Constructor Detail |
|---|
public ObjectMessenger(TemporalView a_tmpViewObject)
a_tmpViewObject - holds which temporal_view object to use in order for the ObjectMessenger factory to build each message as needed| Method Detail |
|---|
public void allocate(int a_iMaxMessagesPerMsgInbox)
a_iMaxMessagesPerMsgInbox - the maximum amount of messages our inbox will holdpublic void reset()
public void addMessageListener(int iAction,
ObjectMessenger_callbacks listener)
iAction - Action on which the specific object wants to hear aboutlistener - object that implements the MessageListener interface (such interfaces methods will be called by the ObjectMessenger class when required)
public void removeMessageListener(int iAction,
ObjectMessenger_callbacks listener)
iAction - code on which the message is sentlistener - listener instance to remove
public void createMessageDefinition(java.lang.String a_msginbox_dest_uid,
java.lang.String a_msginbox_dest_type,
java.lang.String a_msginbox_orig_uid,
java.lang.String a_msginbox_orig_type,
java.lang.String a_msginbox_event,
java.lang.String a_msginbox_message,
java.lang.String a_msginbox_msg_type,
java.lang.String a_msginbox_msg_modifiers)
a_msginbox_dest_uid - The destination object UIDa_msginbox_dest_type - The destination object typea_msginbox_orig_uid - The originating object UIDa_msginbox_orig_type - The originating object typea_msginbox_event - the event on which this message should be read by the destination objecta_msginbox_message - the message (payload) itself. Something that has meaning for the destination object.a_msginbox_msg_type - Message type. Informational / Actiona_msginbox_msg_modifiers - public void addElementDefinition()
public void addMessageToInbox(int a_msginbox_dest_uid,
int a_msginbox_dest_type,
int a_msginbox_orig_uid,
int a_msginbox_orig_type,
int a_msginbox_event,
java.lang.String a_msginbox_message,
int a_msginbox_msg_type,
int a_msginbox_msg_modifiers)
a_msginbox_dest_uid - a_msginbox_dest_type - a_msginbox_orig_uid - a_msginbox_orig_type - a_msginbox_event - a_msginbox_message - a_msginbox_msg_type - a_msginbox_msg_modifiers - createMessageDefinitionpublic void removeMessageFromInbox(int a_msginbox_msg_uid)
a_msginbox_msg_uid - the message's UID to be deleted from the inboxpublic void removeMessagesMarkedForDeletionFromInbox()
public void removeAllMessagesWithThisType(java.lang.String a_strMsgType)
a_strMsgType - The type of message you want deletedpublic void markMessageForDeletion(int a_msginbox_msg_index)
a_msginbox_msg_index - the index of the message in the message inbox that needs be deletedpublic void removeMessageFromInboxByIndex(int a_msginbox_msg_index)
a_msginbox_msg_index - index of the message to be removed
public int getMessageAttributeValueByIndex(int a_msginbox_msg_Idx,
int a_msginbox_msg_attridx)
a_msginbox_msg_Idx - the starting message index in the inboxa_msginbox_msg_attridx - the message attribute index
getMessageAttributeValueByMsgUID
public int getMessageAttributeValueByMsgUID(int a_msginbox_msg_uid,
int a_msginbox_msg_attridx)
a_msginbox_msg_uid - the message UID in the inboxa_msginbox_msg_attridx - the message attribute index
getMessageAttributeValueByIndexpublic int getMessageIndexFromInboxByMsgUID(int a_msginbox_msg_uid)
a_msginbox_msg_uid - the message uid
public int getMessageIndexFromInboxByDestinationUID(int a_msg_destination_uid)
a_msg_destination_uid - the desintation object UID
public int getMessageIndexFromInboxWhere(int a_msginbox_dest_uid,
int a_msginbox_dest_type,
int a_msginbox_orig_uid,
int a_msginbox_orig_type,
int a_msginbox_event,
java.lang.String a_msginbox_message,
int a_msginbox_msg_type,
int a_msginbox_msg_modifiers,
int a_iMsgStartingIndex,
boolean a_bLookForSimilarIDs)
a_msginbox_dest_uid - the destination UID to find.
Pass -1 to not include this attribute in the search.a_msginbox_dest_type - the destination type to find.
Pass -1 to not include this attribute in the search.a_msginbox_orig_uid - the origin UID to find.
Pass -1 to not include this attribute in the search.a_msginbox_orig_type - the origin type to find.
Pass -1 to not include this attribute in the search.a_msginbox_event - the event to find.
Pass -1 to not include this attribute in the search.a_msginbox_message - the message to find. Shall match 100%.
Pass -1 to not include this attribute in the search.a_msginbox_msg_type - the message type to find.
Pass -1 to not include this attribute in the search.a_msginbox_msg_modifiers - a_iMsgStartingIndex -
public void rearrangeMessageInbox()
public void processMessage(int iMsgIndex)
iMsgIndex - index of the message to be processed
public void processMessagesOnEvent(int a_iEvent,
int a_iItemUID,
int a_iItemType,
int a_iComingFromFormID)
a_iEvent - the event that should be in the messages to be processeda_iItemUID - the object ID that triggered this processa_iItemType - the object type of the object that triggered this processa_iComingFromFormID - if applicable, the ID of the form that triggered this processpublic void startMessageInboxDefinition()
public void endMessageInboxDefinition()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||