org.sadun.util.watchdog.mbean.action
Class ConnectURLAction

java.lang.Object
  extended byorg.sadun.util.watchdog.mbean.action.ConnectURLAction
All Implemented Interfaces:
ManagedWatchDogMBean.CheckAction

public class ConnectURLAction
extends java.lang.Object
implements ManagedWatchDogMBean.CheckAction

Version:
1.0
Author:
Cristiano Sadun

Field Summary
 java.net.URL url
           
 
Constructor Summary
ConnectURLAction()
           
 
Method Summary
 java.lang.Throwable doCheck(java.lang.Object obj)
          Perform the required check.
 java.lang.String getUrl()
           
 java.lang.String isReady(boolean running)
          Performs a check on whether or not the action is ready, and returns a description of the problem if a problem exist, otherwise null.
 void setUrl(java.lang.String url)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

url

public java.net.URL url
Constructor Detail

ConnectURLAction

public ConnectURLAction()
Method Detail

isReady

public java.lang.String isReady(boolean running)
Description copied from interface: ManagedWatchDogMBean.CheckAction
Performs a check on whether or not the action is ready, and returns a description of the problem if a problem exist, otherwise null.

For actions whose parameters may be checked at runtime, this is the place where to put validation checks for such parameters.

Specified by:
isReady in interface ManagedWatchDogMBean.CheckAction
Parameters:
running - if true, the object using the action is declared as running.
Returns:
null if the action is ready. A description of the problem if it is not.

doCheck

public java.lang.Throwable doCheck(java.lang.Object obj)
                            throws WatchDogException
Description copied from interface: ManagedWatchDogMBean.CheckAction
Perform the required check. This method must return a Throwable object if the check fails, and raise a WatchDogExceptionif the check proves impossible.

In either case, the currently registered listeners will be notified of the failure.

Specified by:
doCheck in interface ManagedWatchDogMBean.CheckAction
Parameters:
obj - the object subject to the check, or null if the check does not depend on any specific object.
Returns:
a Throwable object, if the check fails
Throws:
WatchDogException - if the check is impossible

getUrl

public java.lang.String getUrl()
Returns:
Returns the url.

setUrl

public void setUrl(java.lang.String url)
Parameters:
url - The url to set.