org.overlord.sramp.shell.api
Class SimpleShellContext

java.lang.Object
  extended by org.overlord.sramp.shell.api.SimpleShellContext
All Implemented Interfaces:
ShellContext

public class SimpleShellContext
extends Object
implements ShellContext

A simple implementation of ShellContext. This implementation does not implement any of the event handling. The purpose of this class is to provide a very simple implementation of the shell context in case users wish to execute shell commands from outside the interactive shell runtime environment. In other words, it's useful when utilizing the shell command as a standalone Java app.

Author:
eric.wittmann@redhat.com

Constructor Summary
SimpleShellContext()
          Constructor.
 
Method Summary
 void addHandler(ShellContextEventHandler handler)
          Adds an event handler to the shell context.
 Object getVariable(QName name)
          Gets a variable from the context.
 void removeHandler(ShellContextEventHandler handler)
          Removes an event handler from the shell context.
 Object removeVariable(QName name)
          Removes a variable from the context.
 void setVariable(QName name, Object object)
          Sets a variable in the context.
 void setVariable(QName name, Object object, ShellContextVariableLifecycleHandler lifecycleHandler)
          Sets a variable in the context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleShellContext

public SimpleShellContext()
Constructor.

Method Detail

setVariable

public void setVariable(QName name,
                        Object object)
Description copied from interface: ShellContext
Sets a variable in the context.

Specified by:
setVariable in interface ShellContext
See Also:
org.overlord.sramp.shell.api.shell.ShellContext#setVariable(javax.xml.namespace.QName, java.lang.Object)

setVariable

public void setVariable(QName name,
                        Object object,
                        ShellContextVariableLifecycleHandler lifecycleHandler)
Description copied from interface: ShellContext
Sets a variable in the context.

Specified by:
setVariable in interface ShellContext
See Also:
org.overlord.sramp.shell.api.shell.ShellContext#setVariable(javax.xml.namespace.QName, java.lang.Object, org.overlord.sramp.shell.api.shell.ShellContextVariableLifecycleHandler)

getVariable

public Object getVariable(QName name)
Description copied from interface: ShellContext
Gets a variable from the context.

Specified by:
getVariable in interface ShellContext
See Also:
org.overlord.sramp.shell.api.shell.ShellContext#getVariable(javax.xml.namespace.QName)

removeVariable

public Object removeVariable(QName name)
Description copied from interface: ShellContext
Removes a variable from the context. Returns the object that was removed.

Specified by:
removeVariable in interface ShellContext
See Also:
org.overlord.sramp.shell.api.shell.ShellContext#removeVariable(javax.xml.namespace.QName)

addHandler

public void addHandler(ShellContextEventHandler handler)
Description copied from interface: ShellContext
Adds an event handler to the shell context.

Specified by:
addHandler in interface ShellContext
See Also:
ShellContext.addHandler(org.overlord.sramp.shell.api.ShellContextEventHandler)

removeHandler

public void removeHandler(ShellContextEventHandler handler)
Description copied from interface: ShellContext
Removes an event handler from the shell context.

Specified by:
removeHandler in interface ShellContext
See Also:
ShellContext.removeHandler(org.overlord.sramp.shell.api.ShellContextEventHandler)


Copyright © 2011-2013 JBoss, a division of Red Hat. All Rights Reserved.