Skip to content

Commit

Permalink
Further cleanups on client code.
Browse files Browse the repository at this point in the history
  • Loading branch information
jawi committed Nov 18, 2011
1 parent baa809f commit c7cd41e
Show file tree
Hide file tree
Showing 8 changed files with 521 additions and 391 deletions.
25 changes: 18 additions & 7 deletions client/src/main/java/nl/lxtreme/ols/client/Activator.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@


import java.util.*;

import javax.swing.*;

import nl.lxtreme.ols.api.*;
Expand All @@ -35,6 +36,7 @@
import nl.lxtreme.ols.client.osgi.*;
import nl.lxtreme.ols.util.*;
import nl.lxtreme.ols.util.osgi.*;

import org.apache.felix.dm.*;
import org.osgi.framework.*;
import org.osgi.service.prefs.*;
Expand Down Expand Up @@ -68,9 +70,7 @@ public class Activator extends DependencyActivatorBase
// VARIABLES

private BundleWatcher bundleWatcher;

private LogReaderTracker logReaderTracker;
private ComponentProviderTracker menuTracker;

// METHODS

Expand All @@ -82,7 +82,7 @@ public class Activator extends DependencyActivatorBase
private static BundleObserver createComponentProviderBundleObserver()
{
return new BundleServiceObserver( OLS_COMPONENT_PROVIDER_MAGIC_KEY, OLS_COMPONENT_PROVIDER_MAGIC_VALUE,
OLS_COMPONENT_PROVIDER_CLASS_KEY, nl.lxtreme.ols.api.ui.ComponentProvider.class.getName() )
OLS_COMPONENT_PROVIDER_CLASS_KEY, ComponentProvider.class.getName() )
{
@Override
protected Dictionary<?, ?> getServiceProperties( final Bundle aBundle, final Object aService,
Expand Down Expand Up @@ -171,7 +171,6 @@ private static BundleObserver createToolBundleObserver()
@Override
public void destroy( final BundleContext aContext, final DependencyManager aManager ) throws Exception
{
this.menuTracker.close();
this.bundleWatcher.stop();
this.logReaderTracker.close();
}
Expand All @@ -186,9 +185,6 @@ public void init( final BundleContext aContext, final DependencyManager aManager

final ClientController clientController = new ClientController( aContext );

this.menuTracker = new ComponentProviderTracker( aContext, clientController );
this.menuTracker.open( true /* trackAllServices */);

this.logReaderTracker = new LogReaderTracker( aContext );
this.logReaderTracker.open();

Expand Down Expand Up @@ -248,6 +244,21 @@ public void init( final BundleContext aContext, final DependencyManager aManager
.setService( DataAcquisitionService.class ) //
.setRequired( true ) //
) //
.add( createServiceDependency() //
.setService( ComponentProvider.class, "(component.id=Menu)" ) //
.setCallbacks( "addMenu", "removeMenu" ) //
.setRequired( false ) //
) //
.add( createServiceDependency() //
.setService( Device.class ) //
.setCallbacks( "addDevice", "removeDevice" ) //
.setRequired( false ) //
) //
.add( createServiceDependency() //
.setService( Tool.class ) //
.setCallbacks( "addTool", "removeTool" ) //
.setRequired( false ) //
) //
);
}
}
Expand Down
Loading

0 comments on commit c7cd41e

Please sign in to comment.