COSMOS ${releaseVersion} data-collection Project
Internal API Specification

org.eclipse.cosmos.dc.tptp.gla.components.source.internal
Class GLAController

java.lang.Object
  extended by org.eclipse.cosmos.dc.tptp.gla.components.source.internal.GLAController
All Implemented Interfaces:
java.lang.Runnable

public class GLAController
extends java.lang.Object
implements java.lang.Runnable

Controller manages a set of Context objects by setting the configurations and then starting each context.


Constructor Summary
GLAController(org.w3c.dom.Element binding)
          Constructor for Controller.
 
Method Summary
 java.lang.String getComponentConfigPath()
          Get the name of the file containing the configurations for the components of the contexts.
 java.lang.String getContextConfigPath()
          Get the name of the file containing the configurations for the contexts
 org.eclipse.hyades.logging.adapter.IContext[] getContexts()
          Get the set of Context objects
 short getLoggingLevel()
          Get the logging level of the Adapter object.
 org.eclipse.hyades.logging.adapter.IOutputter getLogOutputter()
          Get the custom Outputter that the internal logging context is using.
 org.eclipse.hyades.logging.adapter.impl.Status[] getStatus()
          Get the status of the contexts
 void hardStop()
          This stop method will still cause the contexts to be stopped but will not call the context listener methods when flushing the components.
 boolean isRunning()
          Returns whether the Controller is running.
 void log(java.lang.String logRecord)
          Log the string message to standard error since the logging outputter(s) associated with the AdapterSensor logger will never be started.
 void prepareAdapter(boolean validating)
          Prepare the adapter for execution.
 void prepareConfiguration(boolean validating)
          Prepare the adapter configuration for execution.
 void run()
          run provides the basic loop for a Controller thread.
 void setComponentConfigPath(java.lang.String config)
          Set the name of the file containing the configurations for the components of the contexts.
 void setContextConfigPath(java.lang.String config)
          Set the name of the file containing the configurations for the contexts.
 void setLoggingLevel(short newLevel)
          Sets the loggingLevel of the Adapter object.
 void setLogOutputter(org.eclipse.hyades.logging.adapter.IOutputter logOutputter)
          Sets the custom Outputter for the internal logging context to use.
 void start()
          Start running the controller which means starting up each of the contexts.
 void stop()
          Stop the controller which means stopping all of the contexts if they are still running.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GLAController

public GLAController(org.w3c.dom.Element binding)
Constructor for Controller.

Method Detail

isRunning

public boolean isRunning()
Returns whether the Controller is running.

Returns:
true if Controller is running, false otherwise

start

public void start()
Start running the controller which means starting up each of the contexts.


stop

public void stop()
Stop the controller which means stopping all of the contexts if they are still running.


hardStop

public void hardStop()
This stop method will still cause the contexts to be stopped but will not call the context listener methods when flushing the components.


getContexts

public org.eclipse.hyades.logging.adapter.IContext[] getContexts()
Get the set of Context objects

Returns:
the set of Context objects

setContextConfigPath

public void setContextConfigPath(java.lang.String config)
Set the name of the file containing the configurations for the contexts.

Parameters:
config - - name of the context configuation file

getContextConfigPath

public java.lang.String getContextConfigPath()
Get the name of the file containing the configurations for the contexts

Returns:
the contextConfigurationFile

setComponentConfigPath

public void setComponentConfigPath(java.lang.String config)
Set the name of the file containing the configurations for the components of the contexts.

Parameters:
config - - name of the component configuation file

getComponentConfigPath

public java.lang.String getComponentConfigPath()
Get the name of the file containing the configurations for the components of the contexts.

Returns:
the componentConfigurationFile

prepareAdapter

public void prepareAdapter(boolean validating)
                    throws org.eclipse.hyades.logging.adapter.AdapterException
Prepare the adapter for execution. This involves reading and validating the adapter configuration file(s), getting the context listeners from eclipse, starting the internal logging context, and initializing the contexts.

Parameters:
validating - boolean flag to indicate this method is called as part of adapter validation
Throws:
org.eclipse.hyades.logging.adapter.AdapterException

prepareConfiguration

public void prepareConfiguration(boolean validating)
                          throws org.eclipse.hyades.logging.adapter.AdapterException
Prepare the adapter configuration for execution. This involves starting the internal logging context, and initializing the contexts.

Parameters:
validating - boolean flag to indicate this method is called as part of adapter validation
Throws:
org.eclipse.hyades.logging.adapter.AdapterException

run

public void run()
run provides the basic loop for a Controller thread. It starts the Controller thread and then monitors it.

Specified by:
run in interface java.lang.Runnable

log

public void log(java.lang.String logRecord)
Log the string message to standard error since the logging outputter(s) associated with the AdapterSensor logger will never be started.

Parameters:
logRecord - The string message to be logged to standard error.

getStatus

public org.eclipse.hyades.logging.adapter.impl.Status[] getStatus()
Get the status of the contexts

Returns:
the array of Status objects representing the status of the contexts

getLogOutputter

public org.eclipse.hyades.logging.adapter.IOutputter getLogOutputter()
Get the custom Outputter that the internal logging context is using.

Returns:
Returns the custom Outputter that the internal logging context is using.

setLogOutputter

public void setLogOutputter(org.eclipse.hyades.logging.adapter.IOutputter logOutputter)
Sets the custom Outputter for the internal logging context to use.

Parameters:
logOutputter - The custom Outputter for the internal logging context.

setLoggingLevel

public void setLoggingLevel(short newLevel)
Sets the loggingLevel of the Adapter object. This value will override all values in the adapter configuration. The logging level value specified will take effect the next time the Adapter is started. If this method is not called or is called with a value of -1, the logging levels specified in the adapter configuration will be used.

Parameters:
newLevel - The level of logging that the Adapter will use during execution

getLoggingLevel

public short getLoggingLevel()
Get the logging level of the Adapter object.

Returns:
the level of logging the Adapter is currently using

COSMOS ${releaseVersion} data-collection Project
Internal API Specification