|
Knopflerfish OSGi bundle util 4.1.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.knopflerfish.util.framework.ExecutableBundleActivator
public class ExecutableBundleActivator
| Field Summary | |
|---|---|
protected java.lang.String |
baseDirName
|
protected org.osgi.framework.BundleContext |
bc
|
protected boolean |
bProcessExitMeansStopBundle
|
static java.lang.String |
BUNDLE_EXTRACT_FILES
Manifest header (named "Bundle-Extract-Files") identifying a set of resources that should be copied to the OS file system before executing the start or stop executable is run. |
static java.lang.String |
BUNDLE_START_EXECUTABLE
Manifest header (named "Bundle-Start-Executable") identifying a number of hardware environments and the native language code executables that the bundle is carrying for each of these environments. |
static java.lang.String |
BUNDLE_START_EXECUTABLE_ARGS
Manifest header (named "Bundle-Start-Executable-Args") specifying the (space-separated) process arguments to the executable specified by BUNDLE_START_EXECUTABLE. |
static java.lang.String |
BUNDLE_START_EXECUTABLE_EXIT_MEANS_BUNDLESTOP
Manifest header (named "Bundle-Start-Executable-Exit-Means-Bundle-Stop"") specifying of the the process exit of the start executable should stop the bundle too. |
static java.lang.String |
BUNDLE_STOP_EXECUTABLE
Manifest header (named "Bundle-Stop-Executable") identifying a number of hardware environments and the native language code executables that the bundle is carrying for each of these environments. |
static java.lang.String |
BUNDLE_STOP_EXECUTABLE_ARGS
Manifest header (named "Bundle-Start-Executable-Args") specifying the (space-separated) process arguments to the executable specified by BUNDLE_START_EXECUTABLE. |
protected java.lang.Process |
runProcess
|
protected java.io.File |
startFile
|
protected java.lang.String |
startName
|
protected java.io.File |
stopFile
|
protected java.lang.String |
stopName
|
| Constructor Summary | |
|---|---|
ExecutableBundleActivator()
|
|
| Method Summary | |
|---|---|
void |
debug(java.lang.String s)
Method used for debug logging. |
void |
debug(java.lang.String s,
java.lang.Exception e)
Method used for debug logging. |
java.io.File |
getBaseDir()
Get the base directory for extract files to be executed. |
java.lang.String |
getBaseDirName()
|
protected void |
initFiles(java.lang.String startChoices,
java.lang.String stopChoices,
java.lang.String extractNames)
|
void |
initFiles2(java.lang.String startName,
java.lang.String stopName,
java.lang.String extractNames)
|
boolean |
isDebug()
Flag which controls if logging should be done. |
boolean |
isProcessExitMeansStopBundle()
Return true if exit of start process should stop bundle too. |
protected java.lang.Process |
runFile(java.io.File f,
java.lang.String args,
boolean bWaitForExit,
boolean bStopBundle)
Start a new process from a file. |
void |
setBaseDirName(java.lang.String s)
|
void |
setProcessExitMeansStopBundle(boolean b)
Set if exit of start process should stop bundle too. |
void |
start(org.osgi.framework.BundleContext bc)
|
void |
stop(org.osgi.framework.BundleContext bc)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected org.osgi.framework.BundleContext bc
protected java.lang.String startName
protected java.lang.String stopName
protected java.io.File startFile
protected java.io.File stopFile
protected java.lang.Process runProcess
protected boolean bProcessExitMeansStopBundle
protected java.lang.String baseDirName
public static final java.lang.String BUNDLE_START_EXECUTABLE
If a matching executable is found, the executable file will be copied to the OS file system and started in the start() method
public static final java.lang.String BUNDLE_START_EXECUTABLE_ARGS
BUNDLE_START_EXECUTABLE.
public static final java.lang.String BUNDLE_STOP_EXECUTABLE_ARGS
BUNDLE_START_EXECUTABLE.
public static final java.lang.String BUNDLE_STOP_EXECUTABLE
If a matching executable is found, the executable file will be copied to the OS file system and started in the stop() method.
public static final java.lang.String BUNDLE_EXTRACT_FILES
public static final java.lang.String BUNDLE_START_EXECUTABLE_EXIT_MEANS_BUNDLESTOP
| Constructor Detail |
|---|
public ExecutableBundleActivator()
| Method Detail |
|---|
public void start(org.osgi.framework.BundleContext bc)
throws org.osgi.framework.BundleException
start in interface org.osgi.framework.BundleActivatororg.osgi.framework.BundleException
public void stop(org.osgi.framework.BundleContext bc)
throws org.osgi.framework.BundleException
stop in interface org.osgi.framework.BundleActivatororg.osgi.framework.BundleExceptionpublic java.lang.String getBaseDirName()
public void setBaseDirName(java.lang.String s)
public java.io.File getBaseDir()
Override to change. Default is BundleContext.getDataFile(getBaseDirName())
public boolean isProcessExitMeansStopBundle()
BUNDLE_START_EXECUTABLE_EXIT_MEANS_BUNDLESTOP manifest header.
public void setProcessExitMeansStopBundle(boolean b)
public boolean isDebug()
public void debug(java.lang.String s)
public void debug(java.lang.String s,
java.lang.Exception e)
s - message string to loge - exception to log
protected java.lang.Process runFile(java.io.File f,
java.lang.String args,
boolean bWaitForExit,
boolean bStopBundle)
f - file to runargs - space-separated process argumentsbWaitForExit - if true, wait for exit before returningbStopBundle - if true, stop bundle after process has exited.
protected void initFiles(java.lang.String startChoices,
java.lang.String stopChoices,
java.lang.String extractNames)
throws java.io.IOException
java.io.IOException
public void initFiles2(java.lang.String startName,
java.lang.String stopName,
java.lang.String extractNames)
throws java.io.IOException
java.io.IOException
|
Knopflerfish OSGi ${version} | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||