com.hazelcast.console
Class ConsoleApp

java.lang.Object
  extended by com.hazelcast.console.ConsoleApp
All Implemented Interfaces:
EntryListener, ItemListener, MessageListener, EventListener

public class ConsoleApp
extends Object
implements EntryListener, ItemListener, MessageListener

Special thanks to Alexandre Vasseur for providing this very nice test application.

Author:
alex, talip

Constructor Summary
ConsoleApp(HazelcastInstance hazelcast)
           
 
Method Summary
 void entryAdded(EntryEvent event)
          Invoked when an entry is added.
 void entryEvicted(EntryEvent event)
          Invoked when an entry is evicted.
 void entryRemoved(EntryEvent event)
          Invoked when an entry is removed.
 void entryUpdated(EntryEvent event)
          Invoked when an entry is updated.
 IAtomicLong getAtomicNumber()
           
 IList<Object> getList()
           
 IMap<Object,Object> getMap()
           
 MultiMap<Object,Object> getMultiMap()
           
 IQueue<Object> getQueue()
           
 ISet<Object> getSet()
           
 ITopic<Object> getTopic()
           
protected  void handleAddListener(String[] args)
           
protected  void handleClear(String[] args)
           
protected  void handleCommand(String commandInputted)
          Handle a command
protected  void handleContains(String[] args)
           
protected  void handleDestroy(String[] args)
           
protected  void handleHelp(String command)
          Handled the help command
protected  void handleInstances(String[] args)
           
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 handleMapEntries()
           
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 handleMapKeys()
           
protected  void handleMapLocalKeys()
           
protected  void handleMapLocalSize()
           
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 handleMapValues()
           
protected  void handleMultiMapEntries()
           
protected  void handleMultiMapGet(String[] args)
           
protected  void handleMultiMapKeys()
           
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 handleMultiMapValues()
           
protected  void handlePartitions(String[] args)
           
protected  void handleQCapacity(String[] args)
           
protected  void handleQOffer(String[] args)
           
protected  void handleQOfferMany(String[] args)
           
protected  void handleQPeek(String[] args)
           
protected  void handleQPoll(String[] args)
           
protected  void handleQPollMany(String[] args)
           
protected  void handleQTake(String[] args)
           
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 handleSize(String[] args)
           
protected  void handleTopicPublish(String[] args)
           
 void itemAdded(ItemEvent itemEvent)
          Invoked when an item is added.
 void itemRemoved(ItemEvent itemEvent)
          Invoked when an item is removed.
static void main(String[] args)
          Starts the test application.
 void mapCleared(MapEvent event)
          Invoked when all entries are removed by IMap.clear().
 void mapEvicted(MapEvent event)
          Invoked when all entries are evicted by IMap.evictAll().
 void onMessage(Message msg)
          Invoked when a message is received for the added topic.
 void print(Object obj)
           
 void println(Object obj)
           
 void setHazelcast(HazelcastInstance hazelcast)
           
 void start(String[] args)
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConsoleApp

public ConsoleApp(HazelcastInstance hazelcast)
Method Detail

getQueue

public IQueue<Object> getQueue()

getTopic

public ITopic<Object> getTopic()

getMap

public IMap<Object,Object> getMap()

getMultiMap

public MultiMap<Object,Object> getMultiMap()

getAtomicNumber

public IAtomicLong getAtomicNumber()

getSet

public ISet<Object> getSet()

getList

public IList<Object> getList()

setHazelcast

public void setHazelcast(HazelcastInstance hazelcast)

stop

public void stop()

start

public void start(String[] args)
           throws Exception
Throws:
Exception

handleCommand

protected void handleCommand(String commandInputted)
Handle a command

Parameters:
commandInputted -

handlePartitions

protected void handlePartitions(String[] args)

handleInstances

protected void handleInstances(String[] args)

handleListContains

protected void handleListContains(String[] args)

handleListRemove

protected void handleListRemove(String[] args)

handleListAdd

protected void handleListAdd(String[] args)

handleListSet

protected void handleListSet(String[] args)

handleListAddMany

protected void handleListAddMany(String[] args)

handleMapPut

protected void handleMapPut(String[] args)

handleMapPutAsync

protected void handleMapPutAsync(String[] args)

handleMapPutIfAbsent

protected void handleMapPutIfAbsent(String[] args)

handleMapReplace

protected void handleMapReplace(String[] args)

handleMapGet

protected void handleMapGet(String[] args)

handleMapGetAsync

protected void handleMapGetAsync(String[] args)

handleMapGetMapEntry

protected void handleMapGetMapEntry(String[] args)

handleMapRemove

protected void handleMapRemove(String[] args)

handleMapEvict

protected void handleMapEvict(String[] args)

handleMapPutMany

protected void handleMapPutMany(String[] args)

handleMapGetMany

protected void handleMapGetMany(String[] args)

handleMapRemoveMany

protected void handleMapRemoveMany(String[] args)

handleMapLock

protected void handleMapLock(String[] args)

handleMapTryLock

protected void handleMapTryLock(String[] args)

handleMapUnlock

protected void handleMapUnlock(String[] args)

handleMapLocalKeys

protected void handleMapLocalKeys()

handleMapLocalSize

protected void handleMapLocalSize()

handleMapKeys

protected void handleMapKeys()

handleMapEntries

protected void handleMapEntries()

handleMapValues

protected void handleMapValues()

handleMultiMapPut

protected void handleMultiMapPut(String[] args)

handleMultiMapGet

protected void handleMultiMapGet(String[] args)

handleMultiMapRemove

protected void handleMultiMapRemove(String[] args)

handleMultiMapKeys

protected void handleMultiMapKeys()

handleMultiMapEntries

protected void handleMultiMapEntries()

handleMultiMapValues

protected void handleMultiMapValues()

handleMultiMapLock

protected void handleMultiMapLock(String[] args)

handleMultiMapTryLock

protected void handleMultiMapTryLock(String[] args)

handleMultiMapUnlock

protected void handleMultiMapUnlock(String[] args)

handleLock

protected void handleLock(String[] args)

handleAddListener

protected void handleAddListener(String[] args)

handleRemoveListener

protected void handleRemoveListener(String[] args)

handleSetAdd

protected void handleSetAdd(String[] args)

handleSetRemove

protected void handleSetRemove(String[] args)

handleSetAddMany

protected void handleSetAddMany(String[] args)

handleSetRemoveMany

protected void handleSetRemoveMany(String[] args)

handleIterator

protected void handleIterator(String[] args)

handleContains

protected void handleContains(String[] args)

handleSize

protected void handleSize(String[] args)

handleClear

protected void handleClear(String[] args)

handleDestroy

protected void handleDestroy(String[] args)

handleQOffer

protected void handleQOffer(String[] args)

handleQTake

protected void handleQTake(String[] args)

handleQPoll

protected void handleQPoll(String[] args)

handleTopicPublish

protected void handleTopicPublish(String[] args)

handleQOfferMany

protected void handleQOfferMany(String[] args)

handleQPollMany

protected void handleQPollMany(String[] args)

handleQPeek

protected void handleQPeek(String[] args)

handleQCapacity

protected void handleQCapacity(String[] args)

entryAdded

public void entryAdded(EntryEvent event)
Description copied from interface: EntryListener
Invoked when an entry is added.

Specified by:
entryAdded in interface EntryListener
Parameters:
event - the event invoked when an entry is added

entryRemoved

public void entryRemoved(EntryEvent event)
Description copied from interface: EntryListener
Invoked when an entry is removed.

Specified by:
entryRemoved in interface EntryListener
Parameters:
event - the event invoked when an entry is removed

entryUpdated

public void entryUpdated(EntryEvent event)
Description copied from interface: EntryListener
Invoked when an entry is updated.

Specified by:
entryUpdated in interface EntryListener
Parameters:
event - the event invoked when an entry is updated

entryEvicted

public void entryEvicted(EntryEvent event)
Description copied from interface: EntryListener
Invoked when an entry is evicted.

Specified by:
entryEvicted in interface EntryListener
Parameters:
event - the event invoked when an entry is evicted

mapEvicted

public void mapEvicted(MapEvent event)
Description copied from interface: EntryListener
Invoked when all entries are evicted by IMap.evictAll().

Specified by:
mapEvicted in interface EntryListener
Parameters:
event - the map event invoked when all entries are evicted by IMap.evictAll()

mapCleared

public void mapCleared(MapEvent event)
Description copied from interface: EntryListener
Invoked when all entries are removed by IMap.clear().

Specified by:
mapCleared in interface EntryListener
Parameters:
event - the map event invoked when all entries are removed by IMap.clear()

itemAdded

public void itemAdded(ItemEvent itemEvent)
Description copied from interface: ItemListener
Invoked when an item is added.

Specified by:
itemAdded in interface ItemListener
Parameters:
itemEvent - the added item

itemRemoved

public void itemRemoved(ItemEvent itemEvent)
Description copied from interface: ItemListener
Invoked when an item is removed.

Specified by:
itemRemoved in interface ItemListener
Parameters:
itemEvent - the removed item.

onMessage

public void onMessage(Message msg)
Description copied from interface: MessageListener
Invoked when a message is received for the added topic. Note that 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 interface MessageListener
Parameters:
msg - the message that is received for the added topic

handleHelp

protected void handleHelp(String command)
Handled the help command

Parameters:
command -

println

public void println(Object obj)

print

public void print(Object obj)

main

public static void main(String[] args)
                 throws Exception
Starts the test application. Loads the config from classpath hazelcast.xml, if it fails to load, will use default config.

Parameters:
args - none
Throws:
Exception


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.