org.apache.karaf.shell.console
Class Main

java.lang.Object
  extended by org.apache.karaf.shell.console.Main

public class Main
extends java.lang.Object


Constructor Summary
Main()
           
 
Method Summary
protected  void addCommand(Command cmd, org.apache.felix.service.command.Function function, org.apache.felix.gogo.runtime.CommandProcessorImpl commandProcessor)
           
protected  Console createConsole(org.apache.felix.gogo.runtime.CommandProcessorImpl commandProcessor, java.io.InputStream in, java.io.PrintStream out, java.io.PrintStream err, jline.Terminal terminal)
          Allow sub classes of main to change the Console implementation used.
 java.lang.String getApplication()
           
 java.lang.String getDiscoveryResource()
          Sub classes can override so that their registered commands do not conflict with the default shell implementation.
 java.lang.String getUser()
           
 boolean isMultiScopeMode()
          Returns whether or not we are in multi-scope mode.
static void main(java.lang.String[] args)
           
 void run(org.apache.felix.service.command.CommandSession parent, java.lang.String[] args)
          Use this method when the shell is being executed as a command of another shell.
 void run(java.lang.String[] args)
          Use this method when the shell is being executed as a top level shell.
 void setApplication(java.lang.String application)
           
 void setUser(java.lang.String user)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Main

public Main()
Method Detail

main

public static void main(java.lang.String[] args)
                 throws Exception
Throws:
Exception

run

public void run(java.lang.String[] args)
         throws Exception
Use this method when the shell is being executed as a top level shell.

Parameters:
args -
Throws:
Exception

run

public void run(org.apache.felix.service.command.CommandSession parent,
                java.lang.String[] args)
         throws Exception
Use this method when the shell is being executed as a command of another shell.

Parameters:
parent -
args -
Throws:
Exception

createConsole

protected Console createConsole(org.apache.felix.gogo.runtime.CommandProcessorImpl commandProcessor,
                                java.io.InputStream in,
                                java.io.PrintStream out,
                                java.io.PrintStream err,
                                jline.Terminal terminal)
                         throws Exception
Allow sub classes of main to change the Console implementation used.

Parameters:
commandProcessor -
in -
out -
err -
terminal -
Returns:
Throws:
Exception

getDiscoveryResource

public java.lang.String getDiscoveryResource()
Sub classes can override so that their registered commands do not conflict with the default shell implementation.

Returns:

addCommand

protected void addCommand(Command cmd,
                          org.apache.felix.service.command.Function function,
                          org.apache.felix.gogo.runtime.CommandProcessorImpl commandProcessor)

getApplication

public java.lang.String getApplication()

setApplication

public void setApplication(java.lang.String application)

getUser

public java.lang.String getUser()

setUser

public void setUser(java.lang.String user)

isMultiScopeMode

public boolean isMultiScopeMode()
Returns whether or not we are in multi-scope mode. The default mode is multi-scoped where we prefix commands by their scope. If we are in single scoped mode then we don't use scope prefixes when registering or tab completing commands.



Copyright © 2007-2011 Apache Software Foundation. All Rights Reserved.