org.cyclades.nyxlet.script_engine
Class Main

java.lang.Object
  extended by org.cyclades.engine.api.Nyxlet
      extended by org.cyclades.engine.nyxlet.templates.stroma.STROMANyxlet
          extended by org.cyclades.nyxlet.script_engine.Main

public class Main
extends org.cyclades.engine.nyxlet.templates.stroma.STROMANyxlet

Please note that most if not all of your functionality will be added to this Nyxlet via ActionHandlers. The ActionHandler classes will be maintained in a package below this one called "actionhandler". You will most likely look to modifying *this* class when one of the following is desired: 1.) You need to centralize logic or resources here for all ActionHandlers to access 2.) You need to initialize items global to ActionHandlers 3.) Something custom etc...


Field Summary
 
Fields inherited from class org.cyclades.engine.nyxlet.templates.stroma.STROMANyxlet
ACTION_HANDLERS, actionHandlers, DEFAULT_LOGGING_DELEGATE, EXTERNAL_PROPERTIES, LOG_WRITERS, LOGGING_DELEGATES, SUPPLEMENTAL_PROPERTIES
 
Fields inherited from class org.cyclades.engine.api.Nyxlet
logger, SERVICE_AGENT
 
Constructor Summary
Main()
           
 
Method Summary
 boolean isHealthy()
          This method will be called in order to evaluate the health of the Nyxlet.
 
Methods inherited from class org.cyclades.engine.nyxlet.templates.stroma.STROMANyxlet
auth, destroy, destroyActionHandlers, getExternalProperties, getLoggingDelegate, getLogWriter, init, listActionHandlers, loadActionHandlers, loadActionHandlers, loadExternalProperties, loadExternalPropertiesDefault, logDebug, logError, logInfo, logNotify, logStackTrace, logStackTrace, logWarn, process, processInternal, shouldLog, shouldLog
 
Methods inherited from class org.cyclades.engine.api.Nyxlet
getAttribute, getBuildProperties, getEngineContext, getHealth, getLogger, getName, getRRDString, getRRDURIParameterMap, getServiceAgentAttribute, handleError, isActive, isRRDMatch, process, setActive, setAttribute, setBuildProperties, setHealth, setName, setRRDString, valueOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Main

public Main()
     throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

isHealthy

public boolean isHealthy()
                  throws org.cyclades.engine.exception.CycladesException
This method will be called in order to evaluate the health of the Nyxlet. An example implementation could be as the following: - ping a database to see if it is up, and/or under too much load - if the load is deemed to heavy for the system, or if it is down, one can return "false" to flag an unhealthy Nyxlet. Folks could monitor this state via the Cyclades "health" action and take external action on the issue. - if a developer wishes to "inactivate" this nyxlet, simply call "setActive(false)" prior to returning. Please remember to include a way to "activate" this Nyxlet again. For example, when the Cyclades "health" action is called again, and the Nyxlet is deemed healthy, call "setActive(true)" prior to returning. (The Nyxlet will return the error-code "3" indicating Nyxlet inactivity when it is in the inactive state). This mechanism is in place to help aid in fault detection, and try to avoid failure. It is up to the Nyxlet designers to provide the right algorithm for the intended behavior. The implementation below is simply an example of what can be done.

Overrides:
isHealthy in class org.cyclades.engine.nyxlet.templates.stroma.STROMANyxlet
Returns:
true if healthy, false otherwise
Throws:
org.cyclades.engine.exception.CycladesException