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
-
Method Summary
Modifier and TypeMethodDescriptionprotected static ConsoleApp
create()
void
entryAdded
(EntryEvent<Object, Object> event) Invoked upon addition of an entry.void
entryEvicted
(EntryEvent<Object, Object> event) Invoked upon eviction of an entry.void
entryExpired
(EntryEvent<Object, Object> event) Invoked upon expiration of an entry.void
entryRemoved
(EntryEvent<Object, Object> event) Invoked upon removal of an entry.void
entryUpdated
(EntryEvent<Object, Object> event) Invoked upon update of an entry.getList()
getMap()
getQueue()
getSet()
getTopic()
protected void
handleAddListener
(String[] args) protected void
handleClear
(String[] args) void
handleCommand
(String inputCommand) Handles a command.protected void
handleContains
(String[] args) protected void
handleDestroy
(String[] args) protected void
protected void
protected void
handleIterator
(String[] args) protected void
handleListAdd
(String[] args) protected void
handleListAddMany
(String[] args) protected void
handleListContains
(String[] args) protected void
handleListRemove
(String[] args) protected void
handleListSet
(String[] args) protected void
handleLock
(String[] args) protected void
handleMapDelete
(String[] args) protected void
protected void
handleMapEvict
(String[] args) protected void
handleMapGet
(String[] args) protected void
handleMapGetAsync
(String[] args) protected void
handleMapGetMany
(String[] args) protected void
handleMapGetMapEntry
(String[] args) protected void
protected void
protected void
protected void
handleMapLock
(String[] args) protected void
handleMapPut
(String[] args) protected void
handleMapPutAsync
(String[] args) protected void
handleMapPutIfAbsent
(String[] args) protected void
handleMapPutMany
(String[] args) protected void
handleMapRemove
(String[] args) protected void
handleMapRemoveMany
(String[] args) protected void
handleMapReplace
(String[] args) protected void
handleMapTryLock
(String[] args) protected void
handleMapUnlock
(String[] args) protected void
protected void
protected void
handleMultiMapGet
(String[] args) protected void
protected void
handleMultiMapLock
(String[] args) protected void
handleMultiMapPut
(String[] args) protected void
handleMultiMapRemove
(String[] args) protected void
handleMultiMapTryLock
(String[] args) protected void
handleMultiMapUnlock
(String[] args) protected void
protected void
protected void
protected void
handleQOffer
(String[] args) protected void
handleQOfferMany
(String[] args) protected void
protected void
handleQPoll
(String[] args) protected void
handleQPollMany
(String[] args) protected void
protected void
handleRemoveListener
(String[] args) protected void
handleSetAdd
(String[] args) protected void
handleSetAddMany
(String[] args) protected void
handleSetRemove
(String[] args) protected void
handleSetRemoveMany
(String[] args) protected void
protected void
handleSize
(String[] args) protected void
handleTopicPublish
(String[] args) protected boolean
void
Invoked when an item is added.void
itemRemoved
(ItemEvent itemEvent) Invoked when an item is removed.static void
Starts the test application.void
mapCleared
(MapEvent event) Invoked when all entries are removed byIMap.clear()
.void
mapEvicted
(MapEvent event) Invoked when all entries are evicted byIMap.evictAll()
.void
Invoked when a message is received for the topic.void
void
void
start()
void
stop()
-
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:EntryAddedListener
Invoked upon addition of an entry.- Specified by:
entryAdded
in interfaceEntryAddedListener<Object,
Object> - Parameters:
event
- the event invoked when an entry is added
-
entryRemoved
Description copied from interface:EntryRemovedListener
Invoked upon removal of an entry.- Specified by:
entryRemoved
in interfaceEntryRemovedListener<Object,
Object> - Parameters:
event
- the event invoked when an entry is removed
-
entryUpdated
Description copied from interface:EntryUpdatedListener
Invoked upon update of an entry.- Specified by:
entryUpdated
in interfaceEntryUpdatedListener<Object,
Object> - Parameters:
event
- the event invoked when an entry is updated
-
entryEvicted
Description copied from interface:EntryEvictedListener
Invoked upon eviction of an entry.- Specified by:
entryEvicted
in interfaceEntryEvictedListener<Object,
Object> - Parameters:
event
- the event invoked when an entry is evicted
-
entryExpired
Description copied from interface:EntryExpiredListener
Invoked upon expiration of an entry.- Specified by:
entryExpired
in interfaceEntryExpiredListener<Object,
Object> - Parameters:
event
- the event invoked when an entry is expired.
-
mapEvicted
Description copied from interface:MapEvictedListener
Invoked when all entries are evicted byIMap.evictAll()
.- Specified by:
mapEvicted
in interfaceMapEvictedListener
- Parameters:
event
- the map event invoked when all entries are evicted byIMap.evictAll()
-
mapCleared
Description copied from interface:MapClearedListener
Invoked 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:
mapCleared
in interfaceMapClearedListener
- Parameters:
event
- the map event invoked when all entries are removed byIMap.clear()
-
itemAdded
Description copied from interface:ItemListener
Invoked when an item is added.- Specified by:
itemAdded
in interfaceItemListener<Object>
- Parameters:
itemEvent
- the added item
-
itemRemoved
Description copied from interface:ItemListener
Invoked when an item is removed.- Specified by:
itemRemoved
in interfaceItemListener<Object>
- Parameters:
itemEvent
- the removed item.
-
onMessage
Description copied from interface:MessageListener
Invoked 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:
onMessage
in 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
-