org.geotools.arcsde.session
Class Command<R>

Object
  extended by Command<R>
Direct Known Subclasses:
Commands.CloseStateCommand, Commands.CloseStreamCommand, Commands.CreateAndExecuteQueryCommand, Commands.CreateSeRegistrationCommand, Commands.CreateSeStateCommand, Commands.CreateSeTableCommand, Commands.CreateVersionStateCommand, Commands.DescribeTableCommand, Commands.GetVersionCommand, GatherCoverageMetadataCommand

public abstract class Command<R>
extends Object

Runnable used to interact with an ArcSDEConnection.

Instances of this class can be sent to Session#issue(Command) in order to be executed. A Command has exclusive access to the connection for the duration of its execute method. This facility is used to prevent a series of complicated locks and try/catch/finally code.

Author:
Jody Garnett
Module:

Constructor Summary
Command()
           
 
Method Summary
abstract  R execute(ISession session, SeConnection connection)
          Executed to operate on an SeConnection, a Command is scheduled for execution on a Session.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Command

public Command()
Method Detail

execute

public abstract R execute(ISession session,
                          SeConnection connection)
                   throws SeException,
                          IOException
Executed to operate on an SeConnection, a Command is scheduled for execution on a Session.

Please keep in mind that a Command should be short in duration; you are sharing this SeConnection with other threads.

Parameters:
session - the Session the command is being executed inside
connection - the session's connection, used to interact with ArcSDE
Returns:
the result of the command execution, or null if the command is not meant to return anything (a command meant to return something should fail if not able to)
Throws:
SeException
IOException


Copyright © 1996-2010 Geotools. All Rights Reserved.