public class ClifAppFacade
extends java.util.Observable
implements java.util.Observer
Modifier and Type | Field and Description |
---|---|
protected org.objectweb.fractal.api.Component |
clifApp |
protected org.objectweb.fractal.api.control.ContentController |
clifAppCc |
protected java.lang.String |
clifAppDefinition |
protected java.lang.String |
clifAppName |
protected java.util.Map<java.lang.String,org.objectweb.fractal.api.Component> |
components
clif application components indexed by their name (storage, supervisor, analyzer)
|
protected java.io.Serializable |
currentTestId |
protected org.objectweb.fractal.api.Component |
storage |
protected org.objectweb.fractal.api.control.BindingController |
storageBc |
protected org.objectweb.fractal.api.Component |
supervisor |
protected org.objectweb.fractal.api.control.BindingController |
supervisorBc |
Constructor and Description |
---|
ClifAppFacade(org.objectweb.fractal.api.Component clifApp,
java.lang.String name)
Constructor for ClifAppFacade.
|
ClifAppFacade(java.lang.String testName,
java.lang.String appDefinition)
Create new ClifAppFacade with all components of a ClifApplication :
supervisor, storage...
|
Modifier and Type | Method and Description |
---|---|
void |
changeParameter(java.lang.String bladeId,
java.lang.String name,
java.lang.String text) |
int |
collect(java.lang.String[] selBladesId,
CollectListener listener)
Collect selected blades if global state is completed or stopped
|
void |
deploy(java.util.Map<java.lang.String,ClifDeployDefinition> definitions,
ClifRegistry registry)
Asynchronously deploys blades among CLIF servers according to the given definitions.
|
org.objectweb.fractal.api.Component |
getClifApp()
Get clifApp component
|
org.objectweb.fractal.api.Component |
getComponentByName(java.lang.String name)
Get a component of the clifApplication by his Fractal name
|
java.util.Map<java.lang.String,java.io.Serializable> |
getCurrentParameters(java.lang.String id) |
java.lang.String |
getCurrentTestId()
Retrieves current test identifier.
|
BladeState |
getGlobalState(java.lang.String[] selBladesId)
Get global state for these blades.
|
BladeState |
getState(java.lang.String id)
Get the state of a blade
|
java.lang.String[] |
getStatLabels(java.lang.String bladeId)
Retrieve the ActionStat of a specific host.
|
long[] |
getStats(java.lang.String bladeId)
Retrieve the ActionStat of a specific host.
|
void |
init(java.lang.String testId)
Init selected blades if global state is deployed
|
int |
join(java.lang.String[] selBladesId)
Join selected blades if global state is running
|
int |
resume(java.lang.String[] selBladesId)
Resume selected blades if global state is suspended
|
int |
start(java.lang.String[] selBladesId)
Start selected blades if global state is initialized
|
void |
startMonitoring(java.lang.String[] bladesId,
long period)
Start the monitoring of ActionStat of a specific host.
|
int |
stop(java.lang.String[] selBladesId)
Stop selected blades if global state is not stopped/completed/aborted
|
int |
suspend(java.lang.String[] selBladesId)
Suspend selected blades if global state is running
|
void |
syncDeploy(java.util.Map<java.lang.String,ClifDeployDefinition> definitions,
ClifRegistry registry)
Synchronous version of deploy method (returns when deployment is complete).
|
void |
update(java.util.Observable supervisor,
java.lang.Object observation) |
int |
waitForState(java.lang.String[] selBladesId,
BladeState state)
Waits until this state is reached
|
protected java.lang.String clifAppDefinition
protected java.lang.String clifAppName
protected java.io.Serializable currentTestId
protected org.objectweb.fractal.api.Component clifApp
protected org.objectweb.fractal.api.Component storage
protected org.objectweb.fractal.api.Component supervisor
protected java.util.Map<java.lang.String,org.objectweb.fractal.api.Component> components
protected org.objectweb.fractal.api.control.BindingController storageBc
protected org.objectweb.fractal.api.control.BindingController supervisorBc
protected org.objectweb.fractal.api.control.ContentController clifAppCc
public ClifAppFacade(java.lang.String testName, java.lang.String appDefinition)
testName
- the name in the Registry to be associated with the
resulting Clif Application.appDefinition
- fully-qualified Fractal ADL definition file of the
CLIF application to instantiate.java.lang.Error
public ClifAppFacade(org.objectweb.fractal.api.Component clifApp, java.lang.String name)
clifApp
- the existing Clif application componentpublic org.objectweb.fractal.api.Component getComponentByName(java.lang.String name)
name
- the name of the component to findpublic org.objectweb.fractal.api.Component getClifApp()
public void deploy(java.util.Map<java.lang.String,ClifDeployDefinition> definitions, ClifRegistry registry) throws ClifException
getClifApp()
from one deployment to another whenever you need to get the
reference to the CLIF application component.
Old blades that may have been previously deployed by this supervisor are removed,
unless a new CLIF application is instantiated or previous blades became unreachable.
DeployObservation objects will be send to Observers to inform about deployment
success or failure. BladeObservation objects are also sent to notify blades state changes.definitions
- a Map containing test plan definitions, indexed by blades identifiersregistry
- the CLIF registry to be used for getting CLIF servers referencesClifException
- when the CLIF code server could not be started,
or when the test plan definition is nullDeployDefinition
,
DeployObservation
,
BladeObservation
,
syncDeploy(Map, ClifRegistry)
public void syncDeploy(java.util.Map<java.lang.String,ClifDeployDefinition> definitions, ClifRegistry registry) throws ClifException
definitions
- a Map containing test plan definitions, indexed by blades identifiersregistry
- the CLIF registry to be used for getting CLIF servers referencesClifException
deploy(Map, ClifRegistry)
,
DeployDefinition
,
DeployObservation
public void init(java.lang.String testId) throws ClifException
testId
- selected blades idsClifException
public int start(java.lang.String[] selBladesId)
selBladesId
- selected blades idspublic int stop(java.lang.String[] selBladesId)
selBladesId
- selected blades idspublic int suspend(java.lang.String[] selBladesId)
selBladesId
- selected blades idspublic int resume(java.lang.String[] selBladesId)
selBladesId
- selected blades idspublic int join(java.lang.String[] selBladesId)
selBladesId
- selected blades idspublic int collect(java.lang.String[] selBladesId, CollectListener listener)
selBladesId
- selected blades idspublic BladeState getGlobalState(java.lang.String[] selBladesId)
selBladesId
- the blades idspublic BladeState getState(java.lang.String id)
id
- the bladeId testedpublic int waitForState(java.lang.String[] selBladesId, BladeState state)
selBladesId
- state
- public long[] getStats(java.lang.String bladeId)
bladeId
- The blade identifier to get the statistical data frompublic java.lang.String[] getStatLabels(java.lang.String bladeId)
bladeId
- The blade identifier to get the statistics labels frompublic void startMonitoring(java.lang.String[] bladesId, long period)
bladesId
- The blade identifier to get the statistical data from (if null, get data for all blade)period
- The monitoring periodpublic java.util.Map<java.lang.String,java.io.Serializable> getCurrentParameters(java.lang.String id)
public java.lang.String getCurrentTestId()
public void changeParameter(java.lang.String bladeId, java.lang.String name, java.lang.String text) throws ClifException
ClifException
public void update(java.util.Observable supervisor, java.lang.Object observation)
update
in interface java.util.Observer