Search in sources :

Example 1 with BundleContextAware

use of org.apache.karaf.shell.console.BundleContextAware in project karaf by apache.

the class BlueprintCommand method createNewAction.

public Action createNewAction() {
    Action action = (Action) blueprintContainer.getComponentInstance(actionId);
    if (action instanceof BlueprintContainerAware) {
        ((BlueprintContainerAware) action).setBlueprintContainer(blueprintContainer);
    }
    if (action instanceof BundleContextAware) {
        BundleContext context = (BundleContext) blueprintContainer.getComponentInstance("blueprintBundleContext");
        ((BundleContextAware) action).setBundleContext(context);
    }
    return action;
}
Also used : Action(org.apache.felix.gogo.commands.Action) BundleContextAware(org.apache.karaf.shell.console.BundleContextAware) BlueprintContainerAware(org.apache.karaf.shell.console.BlueprintContainerAware) BundleContext(org.osgi.framework.BundleContext)

Aggregations

Action (org.apache.felix.gogo.commands.Action)1 BlueprintContainerAware (org.apache.karaf.shell.console.BlueprintContainerAware)1 BundleContextAware (org.apache.karaf.shell.console.BundleContextAware)1 BundleContext (org.osgi.framework.BundleContext)1