IBM WebSphere Application ServerTM
Release 8

com.ibm.websphere.management.cmdframework.provider
Class CommandResultImpl

java.lang.Object
  extended by com.ibm.websphere.management.cmdframework.provider.CommandResultImpl
All Implemented Interfaces:
CommandResult, java.io.Serializable
Direct Known Subclasses:
TaskCommandResultImpl

public class CommandResultImpl
extends java.lang.Object
implements CommandResult

Provide a basic implementation for CommandResult.

See Also:
Serialized Form

Constructor Summary
CommandResultImpl()
           
 
Method Summary
 void addWarnings(java.lang.String msg)
          Adds a localized warning message.
 java.lang.Throwable getException()
          Gets the exception if the command execution failed.
 java.util.Collection getMessages()
          Gets warning messages if there is any.
 java.lang.Object getResult()
          Gets the result of the command execution if the execution is successful.
 boolean isSuccessful()
          Returns if the last command execution is successful or not.
 void reset()
          This method should be called first to fill in the execution result.
 void setException(java.lang.Throwable thisThrowable)
          Sets the exception for result if any exception is thrown.
 void setResult(java.lang.Object obj)
          Adds an object command execution result.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CommandResultImpl

public CommandResultImpl()
Method Detail

reset

public void reset()
This method should be called first to fill in the execution result.


isSuccessful

public boolean isSuccessful()
Description copied from interface: CommandResult
Returns if the last command execution is successful or not.

Specified by:
isSuccessful in interface CommandResult
Returns:
true if command is executed successfully; false otherwise.

getMessages

public java.util.Collection getMessages()
Description copied from interface: CommandResult
Gets warning messages if there is any.

Specified by:
getMessages in interface CommandResult
Returns:
a collection of messages.

getException

public java.lang.Throwable getException()
Description copied from interface: CommandResult
Gets the exception if the command execution failed. This returns null if the command is executed successfully.

Specified by:
getException in interface CommandResult
Returns:
the exception thrown during the command execution.

getResult

public java.lang.Object getResult()
Description copied from interface: CommandResult
Gets the result of the command execution if the execution is successful. This method returns null if the command execution failed.

Specified by:
getResult in interface CommandResult
Returns:
the result of the command execution.

setException

public void setException(java.lang.Throwable thisThrowable)
Sets the exception for result if any exception is thrown.


addWarnings

public void addWarnings(java.lang.String msg)
Adds a localized warning message.


setResult

public void setResult(java.lang.Object obj)
Adds an object command execution result. In most of cases, there should only be one object, but there might be multiple objects too.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

IBM WebSphere Application ServerTM
Release 8