org.ikasan.framework.monitor
Class MonitorJNDINotifier

java.lang.Object
  extended by org.ikasan.framework.monitor.AbstractMonitorListener
      extended by org.ikasan.framework.monitor.MonitorJNDINotifier
All Implemented Interfaces:
MonitorListener

public class MonitorJNDINotifier
extends AbstractMonitorListener

Monitor listener implementation which notifies the JNDI of state changes.

Author:
Ikasan Development Team

Field Summary
protected  Context context
          JNDI context
protected  Status status
          keep a reference to the previous state so we only report changes
protected  String url
          JNDI URL for state object
 
Constructor Summary
MonitorJNDINotifier(String name, Context context, String url)
          Constructor for monitor
 
Method Summary
protected  void bindStatus(Status statusToBind)
          Bind the status object to the JNDI.
protected static ComponentState getComponentState(String state)
          Translate the initiator state on to that required for reporting through the JNDI.
 void notify(String text)
          Notification of a change
 
Methods inherited from class org.ikasan.framework.monitor.AbstractMonitorListener
getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

protected Context context
JNDI context


url

protected String url
JNDI URL for state object


status

protected Status status
keep a reference to the previous state so we only report changes

Constructor Detail

MonitorJNDINotifier

public MonitorJNDINotifier(String name,
                           Context context,
                           String url)
Constructor for monitor

Parameters:
name - The name of the Monitor
context - The context for the JNDI monitor
url - The URI to store the status
Method Detail

notify

public void notify(String text)
Description copied from interface: MonitorListener
Notification of a change

Specified by:
notify in interface MonitorListener
Specified by:
notify in class AbstractMonitorListener
Parameters:
text - The change

getComponentState

protected static ComponentState getComponentState(String state)
Translate the initiator state on to that required for reporting through the JNDI.

Parameters:
state - The state to lookup with
Returns:
componentState

bindStatus

protected void bindStatus(Status statusToBind)
                   throws NamingException
Bind the status object to the JNDI.

Parameters:
statusToBind - The status to bind to JNDI
Throws:
NamingException - Exception if we cannot bind that status


Copyright © 2007-2012 Ikasan. All Rights Reserved.