// Path: org.fipro.oneshot.api/src/org/fipro/oneshot/OneShot.java
// public interface OneShot {
// 
//     void shoot(String target);
// 
// }


import org.fipro.oneshot.OneShot;
import org.osgi.service.component.ComponentFactory;
import org.osgi.service.component.ComponentInstance;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
package org.fipro.oneshot.command;


@Component(
    property= {
        "osgi.command.scope=fipro",
        "osgi.command.function=shoot"},
    service=ShootCommand.class
)
public class ShootCommand {

    private ComponentFactory factory;
    
    @Reference(target = "(component.factory=fipro.oneshot.factory)")
    void setComponentFactory(ComponentFactory factory) {
    	this.factory = factory;
    }

    public void shoot(String target) {
        // create a new service instance
        ComponentInstance instance = this.factory.newInstance(null);
// Path: org.fipro.oneshot.api/src/org/fipro/oneshot/OneShot.java
// public interface OneShot {
// 
//     void shoot(String target);
// 
// }


// Path: org.fipro.oneshot.command/src/org/fipro/oneshot/command/ShootCommand.java
import org.fipro.oneshot.OneShot;
import org.osgi.service.component.ComponentFactory;
import org.osgi.service.component.ComponentInstance;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;

package org.fipro.oneshot.command;


@Component(
    property= {
        "osgi.command.scope=fipro",
        "osgi.command.function=shoot"},
    service=ShootCommand.class
)
public class ShootCommand {

    private ComponentFactory factory;
    
    @Reference(target = "(component.factory=fipro.oneshot.factory)")
    void setComponentFactory(ComponentFactory factory) {
    	this.factory = factory;
    }

    public void shoot(String target) {
        // create a new service instance
        ComponentInstance instance = this.factory.newInstance(null);
        OneShot shooter = (OneShot) instance.getInstance();