| Changes to /trunk/osgi/HelloWorldSpec/service/src/com/extensiblejava/hello/service/impl/HelloServiceImpl.java |
r0 vs. r12
Edit
|
r12
|
| /trunk/osgi/HelloWorldSpec/service/src/com/extensiblejava/hello/service/impl/HelloServiceImpl.java | /trunk/osgi/HelloWorldSpec/service/src/com/extensiblejava/hello/service/impl/HelloServiceImpl.java r12 | ||
| Properties | |||
| svn:executable | |||
| Contents | |||
| 1 | package com.extensiblejava.hello.service.impl; | ||
| 2 | |||
| 3 | import java.util.Properties; | ||
| 4 | import com.extensiblejava.hello.service.HelloService; | ||
| 5 | import org.osgi.framework.BundleActivator; | ||
| 6 | import org.osgi.framework.BundleContext; | ||
| 7 | import org.osgi.framework.ServiceListener; | ||
| 8 | import org.osgi.framework.ServiceEvent; | ||
| 9 | import org.osgi.framework.ServiceRegistration; | ||
| 10 | |||
| 11 | public class HelloServiceImpl implements HelloService, BundleActivator { | ||
| 12 | |||
| 13 | private ServiceRegistration registration; | ||
| 14 | |||
| 15 | public void start(BundleContext context) { | ||
| 16 | Properties props = new Properties(); | ||
| 17 | props.put("Language", "English"); | ||
| 18 | registration = context.registerService(HelloService.class.getName(), this, props); | ||
| 19 | } | ||
| 20 | |||
| 21 | public void stop(BundleContext context) { | ||
| 22 | |||
| 23 | } | ||
| 24 | |||
| 25 | public String sayHello() { | ||
| 26 | return "Hello World!! "; | ||
| 27 | } | ||
| 28 | |||
| 29 | public String sayGoodbye() { | ||
| 30 | return "Goodbye World!!"; | ||
| 31 | } | ||
| 32 | } | ||