|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
K
- type of keys used to identify registry itemsV
- type of values stored in the registrypublic interface CommunicationHelper<K extends java.io.Serializable,V extends java.io.Serializable>
Interface defines generic facade for network communication protocol used by distributed registry. The protocol is fairly simple and all sending of all notifications are performed using corresponding methods of the interface.
It is assumed that this interface is responsible not only for sending protocol notifications, but also for receiving them. Received notifications are later forwared for further processing to list of registeredRegistryEventProcessor
s.
RegistryEventProcessor
Field Summary | |
---|---|
static byte |
COMMAND_ITEM_INVALID
Command indicates that item is invalidated |
static byte |
COMMAND_ITEM_REGISTERED
Command indicates that item is registered |
static byte |
COMMAND_ITEM_REQUEST
Command indicates that information about items for key is requested |
static byte |
COMMAND_ITEM_UNREGISTERED
Command indicates that item is unregistered |
Method Summary | |
---|---|
void |
addRegistryEventProcessor(RegistryEventProcessor<K,V> aListener)
Adds listener to list of registered RegistryEventProcessors which performs further processing of obtained external notifications |
void |
close()
Used to close helper after usage at the end of lifecycle. |
java.lang.String |
getDefaultMessageSignature()
|
void |
init()
Method used for initialization of communication helper. |
void |
removeRegistryEventProcessor(RegistryEventProcessor<K,V> aListener)
Removes listener from list of registered RegistryEventProcessors which performs further processing of obtained external notifications |
void |
sendItemInvalidNotification(K aItemKey,
V aItemInfo)
Sends network notification about invalid item. |
void |
sendItemRegisteredNotification(K aItemKey,
V aItemInfo)
Sends network notification about item registered. |
void |
sendItemsRequestNotification(K aItemKey,
long aTimeout)
Sends network notification about requesting items for given key. |
void |
sendItemUnRegisteredNotification(K aItemKey,
V aItemInfo)
Sends network notification about item unregistration. |
void |
setDefaultMessageSignature(java.lang.String aValue)
|
Field Detail |
---|
static final byte COMMAND_ITEM_REGISTERED
static final byte COMMAND_ITEM_INVALID
static final byte COMMAND_ITEM_UNREGISTERED
static final byte COMMAND_ITEM_REQUEST
Method Detail |
---|
void init() throws java.io.IOException
java.io.IOException
void close()
void sendItemsRequestNotification(K aItemKey, long aTimeout)
ConsumingRegistry
to obtain information about available items.
This method may block execution of calling thread after issuing notification
for specified amount of time to let responses be collected.
aItemKey
- key of itemaTimeout
- timeout(in ms) used for discovering itemsvoid sendItemInvalidNotification(K aItemKey, V aItemInfo)
ConsumingRegistry
.
aItemKey
- key of the itemaItemInfo
- item invalidatedvoid sendItemRegisteredNotification(K aItemKey, V aItemInfo)
ProvidingRegistry
.
aItemKey
- key of registered itemaItemInfo
- the item registeredvoid sendItemUnRegisteredNotification(K aItemKey, V aItemInfo)
ProvidingRegistry
.
aItemKey
- key of unregistered itemaItemInfo
- the item unregisteredvoid removeRegistryEventProcessor(RegistryEventProcessor<K,V> aListener)
aListener
- processor to be removedvoid addRegistryEventProcessor(RegistryEventProcessor<K,V> aListener)
aListener
- processor to be addedvoid setDefaultMessageSignature(java.lang.String aValue)
java.lang.String getDefaultMessageSignature()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |