fixed undesirable zap of feisty meow loading dock.
[feisty_meow.git] / osgi / org.feistymeow.bundle.servicesOSGi / src / org / feistymeow / bundle / serviceosgi / HelloServiceActivator.java
1 package org.feistymeow.bundle.serviceosgi;
2
3 import org.osgi.framework.BundleActivator;
4 import org.osgi.framework.BundleContext;
5 import org.osgi.framework.ServiceRegistration;
6
7 public class HelloServiceActivator implements BundleActivator
8 {
9
10         @SuppressWarnings("rawtypes")
11         ServiceRegistration helloServiceRegistration;
12
13         /*
14          * (non-Javadoc)
15          * 
16          * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
17          */
18         public void start(BundleContext context) throws Exception
19         {
20                 System.out.println("hello-service start");
21
22                 HelloService helloService = new HelloServiceImpl();
23                 helloServiceRegistration = context.registerService(HelloService.class.getName(), helloService, null);
24         }
25
26         /*
27          * (non-Javadoc)
28          * 
29          * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
30          */
31         public void stop(BundleContext context) throws Exception
32         {
33                 helloServiceRegistration.unregister();
34                 System.out.println("hello-service stop");
35         }
36
37 }