com.googlecode.fascinator.portal
Class BrokerMonitor

java.lang.Object
  extended by com.googlecode.fascinator.portal.BrokerMonitor
All Implemented Interfaces:
GenericListener, Runnable, javax.jms.MessageListener

public class BrokerMonitor
extends Object
implements GenericListener

Monitoring class for the AMQ Broker. Periodically sends updated statistics to the house keeper.

Author:
Greg Pendlebury

Field Summary
static long AMQ_TIMEOUT
          Default timeout for AMQ stats response = 500 milliseconds
static long DEFAULT_TIMEOUT
          Default timeout for callback 'tick' = 10 seconds
static String QUEUE_ID
          Queue string
static String STATS_PREFIX
          Broker queue prefix for stats
 
Constructor Summary
BrokerMonitor()
          Constructor required by ServiceLoader
BrokerMonitor(org.apache.activemq.broker.BrokerService brokerService)
          Constructor.
 
Method Summary
 String getId()
          Return the ID string for this listener.
 void init(JsonSimpleConfig config)
          Initialization method
 void onMessage(javax.jms.Message message)
          Callback function for incoming messages.
 void run()
          Start thread running
 void setPriority(int newPriority)
          Sets the priority level for the thread.
 void start()
          Start the queue
 void stop()
          Stop the Render Queue Consumer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

QUEUE_ID

public static final String QUEUE_ID
Queue string

See Also:
Constant Field Values

STATS_PREFIX

public static final String STATS_PREFIX
Broker queue prefix for stats

See Also:
Constant Field Values

DEFAULT_TIMEOUT

public static final long DEFAULT_TIMEOUT
Default timeout for callback 'tick' = 10 seconds

See Also:
Constant Field Values

AMQ_TIMEOUT

public static final long AMQ_TIMEOUT
Default timeout for AMQ stats response = 500 milliseconds

See Also:
Constant Field Values
Constructor Detail

BrokerMonitor

public BrokerMonitor()
Constructor required by ServiceLoader


BrokerMonitor

public BrokerMonitor(org.apache.activemq.broker.BrokerService brokerService)
              throws Exception
Constructor.

Parameters:
brokerService - AMQ Broker service we're monitoring
Throws:
Exception - If unable to start properly
Method Detail

run

public void run()
Start thread running

Specified by:
run in interface Runnable

init

public void init(JsonSimpleConfig config)
          throws Exception
Initialization method

Specified by:
init in interface GenericListener
Parameters:
config - Configuration to use
Throws:
Exception - if an error occurred

start

public void start()
           throws Exception
Start the queue

Specified by:
start in interface GenericListener
Throws:
Exception - if an error occurred

getId

public String getId()
Return the ID string for this listener.

Specified by:
getId in interface GenericListener

stop

public void stop()
Stop the Render Queue Consumer. Including stopping the storage and indexer

Specified by:
stop in interface GenericListener

onMessage

public void onMessage(javax.jms.Message message)
Callback function for incoming messages.

Specified by:
onMessage in interface javax.jms.MessageListener
Parameters:
message - The incoming message

setPriority

public void setPriority(int newPriority)
Sets the priority level for the thread. Used by the OS.

Specified by:
setPriority in interface GenericListener
Parameters:
newPriority - The priority level to set the thread at


Copyright © 2009-2013. All Rights Reserved.