Package com.hazelcast.console
Class ConsoleApp
java.lang.Object
com.hazelcast.console.ConsoleApp
- All Implemented Interfaces:
ItemListener<Object>,EntryListener<Object,,Object> EntryAddedListener<Object,,Object> EntryEvictedListener<Object,,Object> EntryExpiredListener<Object,,Object> EntryRemovedListener<Object,,Object> EntryUpdatedListener<Object,,Object> MapClearedListener,MapEvictedListener,MapListener,MessageListener<Object>,EventListener
public class ConsoleApp
extends Object
implements EntryListener<Object,Object>, ItemListener<Object>, MessageListener<Object>
Special thanks to Alexandre Vasseur for providing this very nice test application.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static ConsoleAppcreate()voidentryAdded(EntryEvent<Object, Object> event) Invoked upon addition of an entry.voidentryEvicted(EntryEvent<Object, Object> event) Invoked upon eviction of an entry.voidentryExpired(EntryEvent<Object, Object> event) Invoked upon expiration of an entry.voidentryRemoved(EntryEvent<Object, Object> event) Invoked upon removal of an entry.voidentryUpdated(EntryEvent<Object, Object> event) Invoked upon update of an entry.getList()getMap()getQueue()getSet()getTopic()protected voidhandleAddListener(String[] args) protected voidhandleClear(String[] args) voidhandleCommand(String inputCommand) Handles a command.protected voidhandleContains(String[] args) protected voidhandleDestroy(String[] args) protected voidprotected voidprotected voidhandleIterator(String[] args) protected voidhandleListAdd(String[] args) protected voidhandleListAddMany(String[] args) protected voidhandleListContains(String[] args) protected voidhandleListRemove(String[] args) protected voidhandleListSet(String[] args) protected voidhandleLock(String[] args) protected voidhandleMapDelete(String[] args) protected voidprotected voidhandleMapEvict(String[] args) protected voidhandleMapGet(String[] args) protected voidhandleMapGetAsync(String[] args) protected voidhandleMapGetMany(String[] args) protected voidhandleMapGetMapEntry(String[] args) protected voidprotected voidprotected voidprotected voidhandleMapLock(String[] args) protected voidhandleMapPut(String[] args) protected voidhandleMapPutAsync(String[] args) protected voidhandleMapPutIfAbsent(String[] args) protected voidhandleMapPutMany(String[] args) protected voidhandleMapRemove(String[] args) protected voidhandleMapRemoveMany(String[] args) protected voidhandleMapReplace(String[] args) protected voidhandleMapTryLock(String[] args) protected voidhandleMapUnlock(String[] args) protected voidprotected voidprotected voidhandleMultiMapGet(String[] args) protected voidprotected voidhandleMultiMapLock(String[] args) protected voidhandleMultiMapPut(String[] args) protected voidhandleMultiMapRemove(String[] args) protected voidhandleMultiMapTryLock(String[] args) protected voidhandleMultiMapUnlock(String[] args) protected voidprotected voidprotected voidprotected voidhandleQOffer(String[] args) protected voidhandleQOfferMany(String[] args) protected voidprotected voidhandleQPoll(String[] args) protected voidhandleQPollMany(String[] args) protected voidprotected voidhandleRemoveListener(String[] args) protected voidhandleSetAdd(String[] args) protected voidhandleSetAddMany(String[] args) protected voidhandleSetRemove(String[] args) protected voidhandleSetRemoveMany(String[] args) protected voidprotected voidhandleSize(String[] args) protected voidhandleTopicPublish(String[] args) protected booleanvoidInvoked when an item is added.voiditemRemoved(ItemEvent itemEvent) Invoked when an item is removed.static voidStarts the test application.voidmapCleared(MapEvent event) Invoked when all entries are removed byIMap.clear().voidmapEvicted(MapEvent event) Invoked when all entries are evicted byIMap.evictAll().voidInvoked when a message is received for the topic.voidvoidvoidstart()voidstop()
-
Constructor Details
-
ConsoleApp
-
-
Method Details
-
getQueue
-
getTopic
-
getMap
-
getMultiMap
-
getAtomicNumber
-
getSet
-
getList
-
stop
public void stop() -
start
- Throws:
Exception
-
handleCommand
Handles a command. -
handleShutdown
protected void handleShutdown() -
handleExit
protected void handleExit() -
handlePartitions
protected void handlePartitions() -
handleInstances
protected void handleInstances() -
handleListContains
-
handleListRemove
-
handleListAdd
-
handleListSet
-
handleListAddMany
-
handleMapPut
-
handleMapPutAsync
-
handleMapPutIfAbsent
-
handleMapReplace
-
handleMapGet
-
handleMapGetAsync
-
handleMapGetMapEntry
-
handleMapRemove
-
handleMapDelete
-
handleMapEvict
-
handleMapPutMany
-
handleMapGetMany
-
handleMapRemoveMany
-
handleMapLock
-
handleMapTryLock
-
handleMapUnlock
-
handleMapLocalKeys
protected void handleMapLocalKeys() -
handleMapLocalSize
protected void handleMapLocalSize() -
handleMapKeys
protected void handleMapKeys() -
handleMapEntries
protected void handleMapEntries() -
handleMapValues
protected void handleMapValues() -
handleMultiMapPut
-
handleMultiMapGet
-
handleMultiMapRemove
-
handleMultiMapKeys
protected void handleMultiMapKeys() -
handleMultiMapEntries
protected void handleMultiMapEntries() -
handleMultiMapValues
protected void handleMultiMapValues() -
handleMultiMapLock
-
handleMultiMapTryLock
-
handleMultiMapUnlock
-
handleLock
-
handleAddListener
-
handleRemoveListener
-
handleSetAdd
-
handleSetRemove
-
handleSetAddMany
-
handleSetRemoveMany
-
handleIterator
-
handleContains
-
handleSize
-
handleClear
-
handleDestroy
-
handleQOffer
-
handleQTake
protected void handleQTake() -
handleQPoll
-
handleTopicPublish
-
handleQOfferMany
-
handleQPollMany
-
handleQPeek
protected void handleQPeek() -
handleQCapacity
protected void handleQCapacity() -
entryAdded
Description copied from interface:EntryAddedListenerInvoked upon addition of an entry.- Specified by:
entryAddedin interfaceEntryAddedListener<Object,Object> - Parameters:
event- the event invoked when an entry is added
-
entryRemoved
Description copied from interface:EntryRemovedListenerInvoked upon removal of an entry.- Specified by:
entryRemovedin interfaceEntryRemovedListener<Object,Object> - Parameters:
event- the event invoked when an entry is removed
-
entryUpdated
Description copied from interface:EntryUpdatedListenerInvoked upon update of an entry.- Specified by:
entryUpdatedin interfaceEntryUpdatedListener<Object,Object> - Parameters:
event- the event invoked when an entry is updated
-
entryEvicted
Description copied from interface:EntryEvictedListenerInvoked upon eviction of an entry.- Specified by:
entryEvictedin interfaceEntryEvictedListener<Object,Object> - Parameters:
event- the event invoked when an entry is evicted
-
entryExpired
Description copied from interface:EntryExpiredListenerInvoked upon expiration of an entry.- Specified by:
entryExpiredin interfaceEntryExpiredListener<Object,Object> - Parameters:
event- the event invoked when an entry is expired.
-
mapEvicted
Description copied from interface:MapEvictedListenerInvoked when all entries are evicted byIMap.evictAll().- Specified by:
mapEvictedin interfaceMapEvictedListener- Parameters:
event- the map event invoked when all entries are evicted byIMap.evictAll()
-
mapCleared
Description copied from interface:MapClearedListenerInvoked when all entries are removed byIMap.clear().When a listener is registered as local-only then it will be invoked if and only if the
clear()method is called on the same instance where the listener was registered to.- Specified by:
mapClearedin interfaceMapClearedListener- Parameters:
event- the map event invoked when all entries are removed byIMap.clear()
-
itemAdded
Description copied from interface:ItemListenerInvoked when an item is added.- Specified by:
itemAddedin interfaceItemListener<Object>- Parameters:
itemEvent- the added item
-
itemRemoved
Description copied from interface:ItemListenerInvoked when an item is removed.- Specified by:
itemRemovedin interfaceItemListener<Object>- Parameters:
itemEvent- the removed item.
-
onMessage
Description copied from interface:MessageListenerInvoked when a message is received for the topic. Note that the topic guarantees message ordering. Therefore, there is only one thread invoking onMessage. The user should not keep the thread busy, but preferably should dispatch it via an Executor. This will increase the performance of the topic.- Specified by:
onMessagein interfaceMessageListener<Object>- Parameters:
msg- the message that is received for the topic
-
println
-
print
-
isRunning
protected boolean isRunning() -
create
-
main
Starts the test application.It loads the Hazelcast member configuration using the resolution logic as described in
Hazelcast.newHazelcastInstance().- Throws:
Exception- in case of any exceptional case
-