|
SmartFrog 3.10.000 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.smartfrog.sfcore.common.ConfigurationDescriptor
public class ConfigurationDescriptor
Creating a Configuration Descriptor with options
| Nested Class Summary | |
|---|---|
static class |
ConfigurationDescriptor.Action
an enumeration of our options |
static class |
ConfigurationDescriptor.Result
class acting as an enumeration for results |
static class |
ConfigurationDescriptor.SF1Options
Special Options for SF1 Language |
| Field Summary | |
|---|---|
java.lang.Throwable |
resultException
Result exception for action |
java.lang.Object |
resultObject
Result Object return by EXEC action |
| Constructor Summary | |
|---|---|
ConfigurationDescriptor()
empty constructor for people who know what they are doing |
|
ConfigurationDescriptor(java.lang.String deploymentURL)
Creates a Configuration Descriptor using a deployment URL |
|
ConfigurationDescriptor(java.lang.String name,
java.lang.String url)
|
|
ConfigurationDescriptor(java.lang.String name,
java.lang.String url,
int actionType,
java.lang.String host,
java.lang.String subProcess)
|
|
ConfigurationDescriptor(java.lang.String name,
java.lang.String url,
int actionType,
java.lang.String deployReference,
java.lang.String host,
java.lang.String subProcess)
Creates Configuration Descriptor |
|
| Method Summary | |
|---|---|
java.lang.Object |
execute(ProcessCompound targetProcess)
Performs the nominated action |
int |
getActionType()
Gets action type |
Context |
getContext()
Get Context |
java.lang.Object |
getContextAttribute(java.lang.Object name)
Get Context Attribute |
Reference |
getDeployReference()
Gets defined use for final resolve of a configuration |
java.lang.String |
getHost()
host for action. |
java.lang.String |
getName()
get the name of this component |
java.lang.Object |
getOption(java.lang.Object name)
Gets the value from option hashtable |
java.util.Hashtable |
getOptions()
get option hashtable. |
java.lang.String |
getResultMessage()
Parses resultMessage and resultException and generates one message. |
java.lang.String |
getResultObjectName()
get the name of resultObject only if it is a Prim. |
int |
getResultType()
Gets result type |
java.lang.String |
getSubProcess()
subProcess where to apply action. |
java.lang.String |
getUrl()
Get resource to use during action. |
static java.lang.String |
parseExceptionStackTrace(java.lang.Throwable thr,
java.lang.String lineSeparator)
Generates a String for the StackTrace using lineSeparator |
void |
setActionType(int type)
set the action type. |
void |
setActionType(java.lang.String type)
Sets action type. |
void |
setContext(Context context)
Set Context |
Context |
setContextAttribute(java.lang.Object name,
java.lang.Object value)
Set Context attributes |
void |
setDeployReference(java.lang.String reference)
Sets reference use for final resolve of a configuration By default is will use 'sfConfig'. |
void |
setHost(java.lang.String host)
host where to apply action. |
void |
setName(java.lang.String name)
set the name of this component |
void |
setOption(java.lang.Object name,
java.lang.Object value)
Adds the name to option hashtable |
void |
setOptions(java.util.Hashtable options)
option table |
void |
setResult(int type,
java.lang.String message,
java.lang.Throwable thr)
To set all attributes for any result |
void |
setSubProcess(java.lang.String subProcess)
set subProcess where to apply action. |
void |
setSuccessfulResult()
Sets result as SUCCESSFULL |
void |
setUrl(java.lang.String url)
Set resource to use during action. |
java.lang.String |
statusString()
Gets status message using ', ' as separator |
java.lang.String |
statusString(java.lang.String separator)
Gets status message |
java.lang.String |
toString()
To String |
java.lang.String |
toString(java.lang.String separator)
To String |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public java.lang.Object resultObject
public java.lang.Throwable resultException
| Constructor Detail |
|---|
public ConfigurationDescriptor(java.lang.String deploymentURL)
throws SmartFrogInitException
deploymentURL - Format: 'name:ACTION:url:sfConfig:HOST:PROCESS'
- name: name where to apply ACTION
ex. foo
ex. "HOST localhost:foo"
ex. 'HOST localhost:foo'
- ACTION: possible actions: DEPLOY, TERMINATE, DETACH, DETaTERM, PING, PARSE, DIAGNOSTICS, UPDATE
- url: description used by ACTION
ex. /home/sf/foo.sf
ex. "c:\sf\foo.sf"
ex. "c:\My documents\foo.sf"
ex. 'c:\My documents\foo.sf'
- target: component description name to use with action. It can be empty
ex: foo
ex: "first:foo"
ex: 'first:foo'
note: sfConfig cannot be use with DEPLOY!
- HOST: host name or IP where to apply ACTION. When empty it assumes localhost.
ex: localhost
ex: 127.0.0.1
- PROCESS: process namewhere to apply ACTION. When empty it assumes rootProcess
ex1: Deploy a description in local daemon
counterEx:DEPLOY:org/smartfrog/examples/counter/example.sf::localhost:
ex2. Terminate local sfDaemon
rootProcess:TERMINATE:::localhost:
ex3: Deploy "counterToSucceed" from counter/example2.sf
counterEx3:DEPLOY:org/smartfrog/examples/counter/example2.sf:"testLevel1:counterToSucceed":localhost:
SmartFrogInitException - failure in some part of the processConfigurationDescriptor.Action
public ConfigurationDescriptor(java.lang.String name,
java.lang.String url)
name - application/component nameurl - resource to use during action. Usually a sf description
public ConfigurationDescriptor(java.lang.String name,
java.lang.String url,
int actionType,
java.lang.String host,
java.lang.String subProcess)
throws SmartFrogInitException
name - application/component nameurl - resource to use during action. Usually a sf descriptionactionType - @see Action inner class for valid typeshost - host were to apply action. Can be null and then no rootProcess is used.subProcess - subProcess were to apply action. Can be null.
SmartFrogInitExceptionpublic ConfigurationDescriptor()
public ConfigurationDescriptor(java.lang.String name,
java.lang.String url,
int actionType,
java.lang.String deployReference,
java.lang.String host,
java.lang.String subProcess)
throws SmartFrogInitException,
SmartFrogResolutionException
name - application/component nameurl - resource to use during action. Usually a sf descriptionactionType - @see Action inner class for valid typesdeployReference - reference used for final resolve of a configurationhost - host were to apply action. Can be null and then no rootProcess is used.subProcess - subProcess were to apply action. Can be null.
SmartFrogInitException - when a parameter is wrongly defined
SmartFrogResolutionException| Method Detail |
|---|
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toString(java.lang.String separator)
separator - the separator to be used
public java.lang.String statusString()
public java.lang.String statusString(java.lang.String separator)
separator - the separator to be used
public static java.lang.String parseExceptionStackTrace(java.lang.Throwable thr,
java.lang.String lineSeparator)
thr - ExceptionlineSeparator - the line separartor to be used in the message
public Reference getDeployReference()
Reference
public void setDeployReference(java.lang.String reference)
throws SmartFrogResolutionException
reference -
SmartFrogResolutionException - failure in resolvingReferencepublic int getActionType()
public void setResult(int type,
java.lang.String message,
java.lang.Throwable thr)
type - Type of resultmessage - result messagethr - result exception if it existedinner classpublic void setSuccessfulResult()
public void setActionType(int type)
throws SmartFrogInitException
action attribute
to an instance of the action which is needed to do the actual execution.
type - action type
SmartFrogInitException - if the type is not valid
public void setActionType(java.lang.String type)
throws SmartFrogInitException
type - action type
SmartFrogInitException - if the type is not validinner class for valid typespublic int getResultType()
public java.lang.String getResultMessage()
public java.lang.Object execute(ProcessCompound targetProcess)
throws SmartFrogException,
java.rmi.RemoteException
targetProcess - optional target process; set to null to
hand off process lookup to the ConfigurationAction subclass.
It keeps a reference to the result object in resultObject.
SmartFrogException - if smartfrog is unhappy
java.rmi.RemoteException - if the network is unhappypublic java.lang.String getName()
public java.lang.String getResultObjectName()
public void setName(java.lang.String name)
name - component namepublic java.lang.String getUrl()
public void setUrl(java.lang.String url)
url - resource urlpublic java.lang.String getHost()
public void setHost(java.lang.String host)
host - hostnamepublic java.lang.String getSubProcess()
public void setSubProcess(java.lang.String subProcess)
subProcess - subProcess namepublic java.util.Hashtable getOptions()
public void setOptions(java.util.Hashtable options)
options - option hashtable
public void setOption(java.lang.Object name,
java.lang.Object value)
name - Object namevalue - valuepublic java.lang.Object getOption(java.lang.Object name)
name - Objct name
public Context getContext()
public void setContext(Context context)
context - Context
public Context setContextAttribute(java.lang.Object name,
java.lang.Object value)
name - attribute namevalue - attribute value
public java.lang.Object getContextAttribute(java.lang.Object name)
name - attribute name
|
SmartFrog CORE 3.10.000 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||