Я хочу остановить автоматический запуск проекта OSGI Equinox. Я хочу, чтобы он запускался при ручном запуске, как start 2
Как я могу это сделать
Один из файлов активации подписчика
public class Activator implements BundleActivator {
ServiceReference serviceReference;
public void start(BundleContext bundleContext) throws Exception {
serviceReference = bundleContext.getServiceReference(PizzaHutPublisher.class.getName());
PizzaHutPublisherImpl pizzaHutPublisher = (PizzaHutPublisherImpl)bundleContext.getService(serviceReference);
AddFood addNewPizza = new AddFood(pizzaHutPublisher.getPizzaList());
pizzaHutPublisher.setPizzaList((addNewPizza.addPizza()));
}
public void stop(BundleContext bundleContext) throws Exception {
bundleContext.ungetService(serviceReference);
}
}
Выше подписчика Файл MANIFEST.MF
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: PizzaHutAddFood
Bundle-SymbolicName: PizzaHutAddFood
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: pizzahutaddfood.Activator
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Automatic-Module-Name: PizzaHutAddFood
Import-Package: org.osgi.framework;version="1.3.0",
pizzahutclientpublisher
Bundle-ActivationPolicy: lazy
Export-Package: pizzahutaddfood;uses:="org.osgi.framework"
Комплект издателя
public class Activator implements BundleActivator {
ServiceRegistration publisherServiceRegistration;
public void start(BundleContext bundleContext) throws Exception {
System.out.println("Pizza Hut Publisher Started");
PizzaHutPublisher clientPublisher = new PizzaHutPublisherImpl();
publisherServiceRegistration = bundleContext.registerService(PizzaHutPublisher.class.getName(), clientPublisher, null);
}
public void stop(BundleContext bundleContext) throws Exception {
System.out.println("Pizza Hut Publisher Stoped");
publisherServiceRegistration.unregister();
}
}
Издатель MANIFESTER.MF file
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: PizzaHutPublisher
Bundle-SymbolicName: PizzaHutPublisher
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: pizzahutclientpublisher.Activator
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Automatic-Module-Name: PizzaHutPublisher
Import-Package: org.osgi.framework;version="1.3.0"
Bundle-ActivationPolicy: lazy
Export-Package: pizzahutclientpublisher