You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 9, 2018. It is now read-only.
fhuberts edited this page Apr 25, 2013
·
4 revisions
This page describes how to access the program arguments, a.k.a. the command line arguments.
Preconditions
You use Declarative Service (DS)
You use the bnd DS annotations
Notes
The functionality to set the program arguments in the bnd editor on the Run tab is included in the 2.1.0 release
Code
/*
* Command line arguments
*/
private static final String LAUNCHER_ARGUMENTS = "launcher.arguments";
private String[] args = null;
/*
* The bnd launcher provides access to the command line arguments via the
* Launcher object. This object is also registered under Object.
*/
@Reference
protected void setDone(@SuppressWarnings("unused") Object done, Map<String, Object> parameters) {
args = (String[]) parameters.get(LAUNCHER_ARGUMENTS);
}