Permalink
Browse files

buglabs-osgi: ManagedRunnable interface API fix and refactoring.

  • Loading branch information...
1 parent 2495733 commit 2bd7797992db5d10ae3f69f68580e9ceddf48253 @kgilmer kgilmer committed Jul 28, 2011
@@ -41,7 +41,7 @@ public DashApplication(BundleContext context) {
}
@Override
- public void run(Map<Object, Object> services) {
+ public void run(Map<String, Object> services) {
LogManager.logInfo("BUGwebAdminServiceTracker: start");
service = (ISewingService) services.get(ISewingService.class.getName());
@@ -88,7 +88,7 @@ public void start(BundleContext ctx) throws Exception {
serviceTracker = ServiceTrackerUtil.openServiceTracker(context, new ServiceTrackerUtil.ManagedInlineRunnable() {
@Override
- public void run(Map<Object, Object> services) {
+ public void run(Map<String, Object> services) {
display = (IModuleDisplay) services.get(IModuleDisplay.class.getName());
networking = (INetworking) services.get(INetworking.class.getName());
// Warning, this method will be called from within the same thread as the OSGi framework. Long running operations should be avoided here.
@@ -302,7 +302,7 @@ public void buttonEvent(ButtonEvent event) {
}
@Override
- public void run(Map<Object, Object> services) {
+ public void run(Map<String, Object> services) {
this.httpService = (HttpService) services.get(HttpService.class.getName());
try {
@@ -188,7 +188,7 @@ public void serviceChanged(ServiceEvent event) {
/* (non-Javadoc)
* @see com.buglabs.util.osgi.ServiceTrackerUtil.ManagedRunnable#run(java.util.Map)
*/
- public void run(Map<Object, Object> services) {
+ public void run(Map<String, Object> services) {
httpService = (HttpService) services.get(HttpService.class.getName());
try {
@@ -109,7 +109,7 @@ public void stop(BundleContext bundleContext) throws Exception {
}
@Override
- public void run(Map<Object, Object> services) {
+ public void run(Map<String, Object> services) {
// Determine if object state is valid
if (servlets != null) {
log.log(LogService.LOG_ERROR
@@ -29,6 +29,7 @@
import java.util.Arrays;
import java.util.Dictionary;
+import java.util.HashMap;
import java.util.Hashtable;
import java.util.Map;
@@ -104,7 +105,7 @@ public ServiceTrackerUtil(BundleContext context, ManagedRunnable runnable, int s
this.bc = context;
this.runnable = runnable;
this.serviceCount = serviceCount;
- this.serviceMap = new Hashtable<String, Object>();
+ this.serviceMap = new HashMap<String, Object>();
this.runCalled = false;
this.shutdownCalled = false;
@@ -78,7 +78,7 @@ public void stop(BundleContext context) throws Exception {
}
@Override
- public void run(Map<Object, Object> services) {
+ public void run(Map<String, Object> services) {
httpService = (HttpService) services.get(HttpService.class.getName());
sewingRegistration = context.registerService(ISewingService.class.getName(), new SewingServiceImpl(httpService), null);
}

0 comments on commit 2bd7797

Please sign in to comment.