Main Page Class Hierarchy Compound List Compound Members ExecutionSession Class Reference
Acts as a conduit for commands sent to the middleware. More...
Public Methods
ExecutionSession (ConnectionPtr connection=SOAM_NULL_PTR) throw (SoamException) Constructor to create a new ExecutionSession. ExecutionSession (const ExecutionSessionContext &context, ConnectionPtr connection=SOAM_NULL_PTR) throw (SoamException) Constructor to create a new ExecutionSession using a context. ExecutionSession (const char *sessionId, ConnectionPtr connection=SOAM_NULL_PTR) throw (SoamException) Constructor to attach to an existing ExecutionSession. virtual ~ExecutionSession () throw () Destructor. void sendTaskCmd (const char *command, char **cmdId=SOAM_NULL_PTR) throw (SoamException) Sends a command. void sendTaskCmd (const char *command, const ExecutionCommandContext &context, char **cmdId=SOAM_NULL_PTR) throw (SoamException) Sends a command. ExecutionEnumItems * fetchTaskStatus (SoamULong countMax=1, SoamLong timeoutInSeconds=globalConst(TimeoutInfinite)) throw (SoamException) Waits for the completion of the next countMax
results from the session for up totimeoutInSeconds
seconds.const char * getId (void) const throw (SoamException) Returns the identifier of the ExecutionSession. void close (void) throw (SoamException) Closes the ExecutionSession object. Static Public Attributes
const char * DEFAULT_SYMEXEC_APP The default application name to be used by clients wishing to connect to the default instance of the Binary Execution Application.
NOTE: This name may vary depending on the version of Symphony.const char * DEFAULT_SYMEXEC_USERNAME The default username for clients wishing to connect to the default instance of the Binary Execution Application.
NOTE: This username may vary depending on the version of Symphony.const char * DEFAULT_SYMEXEC_PASSWORD The default password for clients wishing to connect to the default instance of the Binary Execution Application.
NOTE: This password may vary depending on the version of Symphony.const char * DETACHABLE_SYMEXEC_SESSION Executable session of this type will remain in open state and all started task will continue to run when the session's object is destructed or Symphony client process is terminated.
.const char * UNDETACHABLE_SYMEXEC_SESSION Executable session of this type will be aborted when the session's object is destructed or Symphony client process is terminated. Detailed Description
Acts as a conduit for commands sent to the middleware.This object can be used to send commands that will be executed and manged on the grid by Symphony.
All ExecutionSession objects require a connection to Symphony. You can create your ownConnection
to any Binary Execution Application and pass it to the appropriate constructor, or use the implicitConnection
to connect to the default Binary Execution Application.NOTE: If any of the methods of this class are called after the main(...) method exits, the client or service process may behave in an undefined manner (for example, hang or terminate abnormally).
Constructor & Destructor Documentation
ExecutionSession ( ConnectionPtr connection = SOAM_NULL_PTR ) throw (SoamException)
Constructor to create a new ExecutionSession.
If the connection parameter is
SOAM_NULL_PTR
, this will establish a session with the default Binary Execution Application using default user name and password.
- See also:
- Connection
- Parameters:
connection A connection to a specific Binary Execution Application.
- Exceptions:
SoamException
ExecutionSession ( const ExecutionSessionContext & context, ConnectionPtr connection = SOAM_NULL_PTR ) throw (SoamException)
Constructor to create a new ExecutionSession using a context.
If the connection parameter is
SOAM_NULL_PTR
, this will establish a session with the default Binary Execution Application using default user name and password.
- Parameters:
context A context that will take effect at the session level for this ExecutionSession. connection A connection to a specific Binary Execution Application.
- See also:
- ExecutionSessionContext , Connection
- Exceptions:
SoamException
ExecutionSession ( const char * sessionId, ConnectionPtr connection = SOAM_NULL_PTR ) throw (SoamException)
Constructor to attach to an existing ExecutionSession.
If the connection parameter is
SOAM_NULL_PTR
, this will establish a session with the default Binary Execution Application using default user name and password.
- Parameters:
sessionId The identifier of the session to be attached. connection A connection to a specific Binary Execution Application.
- Exceptions:
SoamException
virtual ~ExecutionSession ( ) throw () [virtual]
Destructor.
If the session has not been closed, this will detach it. After detaching the ExecutionSession will be left in an "open" state. Any client can re-attach this session to a connection at any time. Once the ExecutionSession has been re-attached the client can proceed to perform any further operation on the session eg. sendTaskCmd(), fetchTaskStatus() etc.
- Exceptions:
SoamException Member Function Documentation
void sendTaskCmd ( const char * command, char ** cmdId = SOAM_NULL_PTR ) throw (SoamException)
Sends a command.
This is the simplest way to send a command to be executed on the grid.
- Parameters:
command The command string to be executed. cmdId If this pointer is not null, a pointer to a null-terminated string, which stores the task identifier associated with this submission, will be set to this parameter. This string must be released with C++ delete operator when it's no longer needed.
- Exceptions:
SoamException
void sendTaskCmd ( const char * command, const ExecutionCommandContext & context, char ** cmdId = SOAM_NULL_PTR ) throw (SoamException)
Sends a command.
This methods sends a command to the grid with an associated
ExecutionCommandContext
. TheExecutionCommandContext
will allow the client to set additional options that will take effect when this specific command is being executed.
- Parameters:
command The command string to be executed. context The context to be associated with the command. cmdId If this pointer is not null, a pointer to a null-terminated string, which stores the task identifier associated with this submission, will be set to this parameter. This string must be released with C++ delete operator when it's no longer needed.
- See also:
- ExecutionCommandContext
- Exceptions:
SoamException
ExecutionEnumItems* fetchTaskStatus ( SoamULong countMax = 1, SoamLong timeoutInSeconds = globalConst(TimeoutInfinite) ) throw (SoamException)
Waits for the completion of the next
countMax
results from the session for up totimeoutInSeconds
seconds.
- Parameters:
countMax Number of results to wait for. timeoutInSeconds Maxinum time to wait, in seconds, for the next countMax
results.
- Returns:
- A vector of ExecutionStatus objects (containing the results).
- Exceptions:
SoamException
const char* getId ( void ) const throw (SoamException)
Returns the identifier of the ExecutionSession.
- Returns:
- The identifier of the session.
- Exceptions:
SoamException
void close ( void ) throw (SoamException)
Closes the ExecutionSession object.
Once this method is called, the ExecutionSession object can no longer be used. Any commands that are in the process of being executed will be terminated and all pending commands will be discarded.
- Exceptions:
SoamException Member Data Documentation
const char* DEFAULT_SYMEXEC_APP [static]
The default application name to be used by clients wishing to connect to the default instance of the Binary Execution Application.
NOTE: This name may vary depending on the version of Symphony.
const char* DEFAULT_SYMEXEC_USERNAME [static]
The default username for clients wishing to connect to the default instance of the Binary Execution Application.
NOTE: This username may vary depending on the version of Symphony.
const char* DEFAULT_SYMEXEC_PASSWORD [static]
The default password for clients wishing to connect to the default instance of the Binary Execution Application.
NOTE: This password may vary depending on the version of Symphony.
const char* DETACHABLE_SYMEXEC_SESSION [static]
Executable session of this type will remain in open state and all started task will continue to run when the session's object is destructed or Symphony client process is terminated.
.
const char* UNDETACHABLE_SYMEXEC_SESSION [static]
Executable session of this type will be aborted when the session's object is destructed or Symphony client process is terminated.
Date Modified: 28 Apr 2011
Platform Support: support@platform.com
Platform Information Development: doc@platform.com
Platform Computing. Accelerating Intelligence(TM).
Copyright © 2001-2009 Platform Computing Corporation. All rights reserved.