Visit Platform at http://www.platform.com

Platform Symphony 5.1 Java API Reference

com.platform.symphony.symexec
Class ExecutionSession

java.lang.Object
  extended by com.platform.symphony.symexec.ExecutionSession

public class ExecutionSession
extends java.lang.Object

Acts as a conduit for commands sent to the middleware.
This object can be used to send commands that will be executed and managed on the grid by Symphony.

All ExecutionSession objects require a connection to Symphony. You can create your own Connection to any Binary Execution Application and pass it to the appropriate constructor, or use the implicit Connection 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).


Field Summary
static java.lang.String DEFAULT_SYMEXEC_APP
          The default application name to be used by clients wishing to connect to the default instance of the Binary Execution Application.
static java.lang.String DEFAULT_SYMEXEC_PASSWORD
          The default password for clients wishing to connect to the default instance of the Binary Execution Application.
static java.lang.String DEFAULT_SYMEXEC_USERNAME
          The default username for clients wishing to connect to the default instance of the Binary Execution Application.
static java.lang.String 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.
static java.lang.String UNDETACHABLE_SYMEXEC_SESSION
          Executable session of this type will be aborted when the session's object is destructed or Symphony client process is terminated.
 
Constructor Summary
ExecutionSession()
          Default constructor for a new ExecutionSession.
ExecutionSession(Connection connection)
          Constructor to create a new ExecutionSession using a connection that already exists.
ExecutionSession(ExecutionSessionContext context)
          Constructor to create a new ExecutionSession using the default connection and a context.
ExecutionSession(ExecutionSessionContext context, Connection connection)
          Constructor to create a new ExecutionSession using a connection that already exists and a context.
ExecutionSession(java.lang.String sessionId)
          Constructor to attach to an existing ExecutionSession using the default connection.
ExecutionSession(java.lang.String sessionId, Connection connection)
          Constructor to attach to an existing ExecutionSession using a connection that already exists.
 
Method Summary
 void close()
          Closes the ExecutionSession object.
 void detach()
          Detaches the ExecutionSession object from the Connection.
 ExecutionEnumItems fetchTaskStatus()
          Waits for the completion of the next available result from the session.
 ExecutionEnumItems fetchTaskStatus(long countMax)
          Waits for the completion of the next countMax results from the session.
 ExecutionEnumItems fetchTaskStatus(long countMax, int timeoutInSeconds)
          Waits for the completion of the next countMax results from the session for up to timeoutInSeconds seconds.
 java.lang.String getId()
          Returns the identifier of the ExecutionSession.
 java.lang.String sendTaskCmd(java.lang.String command)
          Sends a command.
 java.lang.String sendTaskCmd(java.lang.String command, ExecutionCommandContext context)
          Sends a command.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SYMEXEC_APP

public static java.lang.String 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.


DEFAULT_SYMEXEC_USERNAME

public static java.lang.String 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.


DEFAULT_SYMEXEC_PASSWORD

public static java.lang.String 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.


DETACHABLE_SYMEXEC_SESSION

public static java.lang.String 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.


UNDETACHABLE_SYMEXEC_SESSION

public static java.lang.String UNDETACHABLE_SYMEXEC_SESSION
Executable session of this type will be aborted when the session's object is destructed or Symphony client process is terminated.

Constructor Detail

ExecutionSession

public ExecutionSession()
                 throws SoamException
Default constructor for a new ExecutionSession. This will establish a session with the default Binary Execution Application.

Throws:
SoamException

ExecutionSession

public ExecutionSession(Connection connection)
                 throws SoamException
Constructor to create a new ExecutionSession using a connection that already exists.

Parameters:
connection - A connection to a specific Binary Execution Application.
Throws:
SoamException
See Also:
Connection

ExecutionSession

public ExecutionSession(ExecutionSessionContext context)
                 throws SoamException
Constructor to create a new ExecutionSession using the default connection and a context.

Parameters:
context - A context that will take effect at the session level for this ExecutionSession.
Throws:
SoamException
See Also:
ExecutionSessionContext

ExecutionSession

public ExecutionSession(ExecutionSessionContext context,
                        Connection connection)
                 throws SoamException
Constructor to create a new ExecutionSession using a connection that already exists and a context.

Parameters:
context - A context that will take effect at the session level for this ExecutionSession.
connection - A connection to a specific Binary Execution Application.
Throws:
SoamException
See Also:
ExecutionSessionContext, Connection

ExecutionSession

public ExecutionSession(java.lang.String sessionId)
                 throws SoamException
Constructor to attach to an existing ExecutionSession using the default connection.

Parameters:
sessionId - The identifier of the session to be attached.
Throws:
SoamException

ExecutionSession

public ExecutionSession(java.lang.String sessionId,
                        Connection connection)
                 throws SoamException
Constructor to attach to an existing ExecutionSession using a connection that already exists.

Parameters:
sessionId - The identifier of the session to be attached.
connection - A connection to a specific Binary Execution Application.
Throws:
SoamException
Method Detail

getId

public java.lang.String getId()
                       throws SoamException
Returns the identifier of the ExecutionSession.

Returns:
The identifier of the session.
Throws:
SoamException

sendTaskCmd

public java.lang.String sendTaskCmd(java.lang.String command)
                             throws 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.
Returns:
The identifier associated with this submission.
Throws:
SoamException

sendTaskCmd

public java.lang.String sendTaskCmd(java.lang.String command,
                                    ExecutionCommandContext context)
                             throws SoamException
Sends a command.
This methods sends a command to the grid with an associated ExecutionCommandContext. The ExecutionCommandContext 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.
Returns:
The identifier associated with this submission.
Throws:
SoamException
See Also:
ExecutionCommandContext

fetchTaskStatus

public ExecutionEnumItems fetchTaskStatus()
                                   throws SoamException
Waits for the completion of the next available result from the session.

Returns:
A vector of ExecutionStatus objects (containing the results).
Throws:
SoamException

fetchTaskStatus

public ExecutionEnumItems fetchTaskStatus(long countMax)
                                   throws SoamException
Waits for the completion of the next countMax results from the session.

Parameters:
countMax - Number of results to wait for.
Returns:
A vector of ExecutionStatus objects (containing the results).
Throws:
SoamException

fetchTaskStatus

public ExecutionEnumItems fetchTaskStatus(long countMax,
                                          int timeoutInSeconds)
                                   throws SoamException
Waits for the completion of the next countMax results from the session for up to timeoutInSeconds seconds.

Parameters:
countMax - Number of results to wait for.
timeoutInSeconds - Maximum time to wait, in seconds, for the next countMax results.
Returns:
A vector of ExecutionStatus objects (containing the results).
Throws:
SoamException

close

public void close()
           throws 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.

Throws:
SoamException

detach

public void detach()
            throws SoamException
Detaches the ExecutionSession object from the Connection. Once this method is called, 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..

Throws:
SoamException

Version 5.1
Date Modified: -DREL_DATE=Apr 28 2011
Platform Computing. Accelerating Intelligence(TM).
Copyright (C) 2001-2009 Platform Computing Corporation. All rights reserved.