- set the initial bundle start level
There is a method for each command which is named '_'+method. The methods are
invoked by a CommandInterpreter's execute method.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FrameworkCommandProvider
public FrameworkCommandProvider(org.eclipse.osgi.framework.internal.core.OSGi osgi)
- Constructor.
initialize must be called after creating this object.
- Parameters:
osgi
- The current instance of OSGi
intialize
public FrameworkCommandProvider intialize()
- Intialize this CommandProvider.
Registers this object as a CommandProvider with the highest ranking possible.
Adds this object as a SynchronousBundleListener.
- Returns:
- this
getHelp
public java.lang.String getHelp()
- Answer a string (may be as many lines as you like) with help
texts that explain the command. This getHelp() method uses the
ConsoleMsg class to obtain the correct NLS data to display to the user.
- Specified by:
getHelp
in interface CommandProvider
- Returns:
- The help string
_exit
public void _exit(CommandInterpreter intp)
throws java.lang.Exception
- Handle the exit command. Exit immediately (System.exit)
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_launch
public void _launch(CommandInterpreter intp)
throws java.lang.Exception
- Handle the launch command. Start the OSGi framework.
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_shutdown
public void _shutdown(CommandInterpreter intp)
throws java.lang.Exception
- Handle the shutdown command. Shutdown the OSGi framework.
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_sta
public void _sta(CommandInterpreter intp)
throws java.lang.Exception
- Handle the start command's abbreviation. Invoke _start()
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_start
public void _start(CommandInterpreter intp)
throws java.lang.Exception
- Handle the start command. Start the specified bundle(s).
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_sto
public void _sto(CommandInterpreter intp)
throws java.lang.Exception
- Handle the stop command's abbreviation. Invoke _stop()
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_stop
public void _stop(CommandInterpreter intp)
throws java.lang.Exception
- Handle the stop command. Stop the specified bundle(s).
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_i
public void _i(CommandInterpreter intp)
throws java.lang.Exception
- Handle the install command's abbreviation. Invoke _install()
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_install
public void _install(CommandInterpreter intp)
throws java.lang.Exception
- Handle the install command. Install and optionally start bundle from the given URL\r\n"
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_up
public void _up(CommandInterpreter intp)
throws java.lang.Exception
- Handle the update command's abbreviation. Invoke _update()
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_update
public void _update(CommandInterpreter intp)
throws java.lang.Exception
- Handle the update command. Update the specified bundle(s).
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_un
public void _un(CommandInterpreter intp)
throws java.lang.Exception
- Handle the uninstall command's abbreviation. Invoke _uninstall()
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_uninstall
public void _uninstall(CommandInterpreter intp)
throws java.lang.Exception
- Handle the uninstall command. Uninstall the specified bundle(s).
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_s
public void _s(CommandInterpreter intp)
throws java.lang.Exception
- Handle the status command's abbreviation. Invoke _status()
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_status
public void _status(CommandInterpreter intp)
throws java.lang.Exception
- Handle the status command. Display installed bundles and registered services.
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_se
public void _se(CommandInterpreter intp)
throws java.lang.Exception
- Handle the services command's abbreviation. Invoke _services()
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_services
public void _services(CommandInterpreter intp)
throws java.lang.Exception
- Handle the services command. Display registered service details.
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_p
public void _p(CommandInterpreter intp)
throws java.lang.Exception
- Handle the packages command's abbreviation. Invoke _packages()
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_packages
public void _packages(CommandInterpreter intp)
throws java.lang.Exception
- Handle the packages command. Display imported/exported package details.
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_bundles
public void _bundles(CommandInterpreter intp)
throws java.lang.Exception
- Handle the bundles command. Display details for all installed bundles.
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_b
public void _b(CommandInterpreter intp)
throws java.lang.Exception
- Handle the bundle command's abbreviation. Invoke _bundle()
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_bundle
public void _bundle(CommandInterpreter intp)
throws java.lang.Exception
- Handle the bundle command. Display details for the specified bundle(s).
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_l
public void _l(CommandInterpreter intp)
throws java.lang.Exception
- Handle the log command's abbreviation. Invoke _log()
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_log
public void _log(CommandInterpreter intp)
throws java.lang.Exception
- Handle the log command. Display log entries.
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_gc
public void _gc(CommandInterpreter intp)
throws java.lang.Exception
- Handle the gc command. Perform a garbage collection.
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_init
public void _init(CommandInterpreter intp)
throws java.lang.Exception
- Handle the init command. Uninstall all bundles.
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_close
public void _close(CommandInterpreter intp)
throws java.lang.Exception
- Handle the close command. Shutdown and exit.
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_r
public void _r(CommandInterpreter intp)
throws java.lang.Exception
- Handle the refresh command's abbreviation. Invoke _refresh()
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_refresh
public void _refresh(CommandInterpreter intp)
throws java.lang.Exception
- Handle the refresh command. Refresh the packages of the specified bundles.
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_exec
public void _exec(CommandInterpreter intp)
throws java.lang.Exception
- Executes the given system command in a separate system process
and waits for it to finish.
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_fork
public void _fork(CommandInterpreter intp)
throws java.lang.Exception
- Executes the given system command in a separate system process. It does
not wait for a result.
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_h
public void _h(CommandInterpreter intp)
throws java.lang.Exception
- Handle the headers command's abbreviation. Invoke _headers()
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_headers
public void _headers(CommandInterpreter intp)
throws java.lang.Exception
- Handle the headers command. Display headers for the specified bundle(s).
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_pr
public void _pr(CommandInterpreter intp)
throws java.lang.Exception
- Handles the props command's abbreviation. Invokes _props()
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_props
public void _props(CommandInterpreter intp)
throws java.lang.Exception
- Handles the _props command. Prints the system properties sorted.
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_setp
public void _setp(CommandInterpreter intp)
throws java.lang.Exception
- Handles the setprop command's abbreviation. Invokes _setprop()
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_setprop
public void _setprop(CommandInterpreter intp)
throws java.lang.Exception
- Handles the setprop command. Sets the CDS property in the given argument.
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_ss
public void _ss(CommandInterpreter intp)
throws java.lang.Exception
- Prints the short version of the status.
For the long version use "status".
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_t
public void _t(CommandInterpreter intp)
throws java.lang.Exception
- Handles the threads command abbreviation. Invokes _threads().
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_threads
public void _threads(CommandInterpreter intp)
throws java.lang.Exception
- Prints the information about the currently running threads
in the embedded system.
- Parameters:
intp
- A CommandInterpreter object containing the command
and it's arguments.
- Throws:
java.lang.Exception
_sl
public void _sl(CommandInterpreter intp)
throws java.lang.Exception
- Handles the sl (startlevel) command.
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_setfwsl
public void _setfwsl(CommandInterpreter intp)
throws java.lang.Exception
- Handles the setfwsl (set framework startlevel) command.
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_setbsl
public void _setbsl(CommandInterpreter intp)
throws java.lang.Exception
- Handles the setbsl (set bundle startlevel) command.
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_setibsl
public void _setibsl(CommandInterpreter intp)
throws java.lang.Exception
- Handles the setibsl (set initial bundle startlevel) command.
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_requiredBundles
public void _requiredBundles(CommandInterpreter intp)
_classSpaces
public void _classSpaces(CommandInterpreter intp)
_profilelog
public void _profilelog(CommandInterpreter intp)
throws java.lang.Exception
- Handles the profilelog command.
- Parameters:
intp
- A CommandInterpreter object containing the command and it's arguments.
- Throws:
java.lang.Exception
_getPackages
public void _getPackages(CommandInterpreter intp)
isStartLevelSvcPresent
protected boolean isStartLevelSvcPresent(CommandInterpreter intp)
- Checks for the presence of the StartLevel Service. Outputs a message if it is not present.
- Parameters:
intp
- The CommandInterpreter object to be used to write to the console
- Returns:
- true or false if service is present or not
getBundleFromToken
protected org.eclipse.osgi.framework.internal.core.AbstractBundle getBundleFromToken(CommandInterpreter intp,
java.lang.String token,
boolean error)
- Given a number or a token representing a bundle symbolic name or bundle location,
retrieve the Bundle object with that id. The bundle symbolic name token is parsed as
symbolicname[@version]
- Parameters:
intp
- The CommandInterpretertoken
- A string containing a potential bundle iterror
- A boolean indicating whether or not to output a message
- Returns:
- The requested Bundle object
getStartLevelFromToken
protected int getStartLevelFromToken(CommandInterpreter intp,
java.lang.String value)
- Given a string containing a startlevel value, validate it and convert it to an int
- Parameters:
intp
- A CommandInterpreter object used for printing out error messagesvalue
- A string containing a potential startlevel
- Returns:
- The start level or an int <0 if it was invalid
getStateName
protected java.lang.String getStateName(Bundle bundle)
- Given a state value, return the string describing that state.
- Parameters:
state
- An int containing a state value
- Returns:
- A String describing the state
getThreadGroups
protected java.lang.ThreadGroup[] getThreadGroups()
- Answers all thread groups in the system.
- Returns:
- An array of all thread groups.
getTopThreadGroup
protected java.lang.ThreadGroup getTopThreadGroup()
- Answers the top level group of the current thread.
It is the 'system' or 'main' thread group under
which all 'user' thread groups are allocated.
- Returns:
- The parent of all user thread groups.
simpleClassName
public java.lang.String simpleClassName(java.lang.Object o)
- Returns the simple class name of an object.
- Parameters:
o
- The object for which a class name is requested
- Returns:
- The simple class name.
_getprop
public void _getprop(CommandInterpreter ci)
throws java.lang.Exception
- Throws:
java.lang.Exception
bundleChanged
public void bundleChanged(BundleEvent event)
- This is used to track lazily activated bundles.
- Specified by:
bundleChanged
in interface BundleListener
- Parameters:
event
- The BundleEvent
.