2121
2222import org .osgi .framework .BundleContext ;
2323import org .osgi .framework .Constants ;
24- import org .osgi .framework .Filter ;
2524import org .osgi .framework .ServiceReference ;
2625import org .osgi .util .tracker .ServiceTracker ;
2726
@@ -33,10 +32,10 @@ public final class DispatcherTracker
3332 private final ServletConfig config ;
3433 private HttpServlet dispatcher ;
3534
36- public DispatcherTracker (BundleContext context , String filter , ServletConfig config )
35+ public DispatcherTracker (BundleContext context , ServletConfig config )
3736 throws Exception
3837 {
39- super (context , createFilter (context , filter ), null );
38+ super (context , context . createFilter (DEFAULT_FILTER ), null );
4039 this .config = config ;
4140 }
4241
@@ -94,14 +93,4 @@ private void initDispatcher()
9493 log ("Failed to initialize dispatcher" , e );
9594 }
9695 }
97-
98- private static Filter createFilter (BundleContext context , String filter )
99- throws Exception
100- {
101- StringBuffer str = new StringBuffer ();
102- str .append ("(&(" ).append (Constants .OBJECTCLASS ).append ("=" );
103- str .append (HttpServlet .class .getName ()).append (")" );
104- str .append (filter != null ? filter : DEFAULT_FILTER ).append (")" );
105- return context .createFilter (str .toString ());
106- }
10796}
0 commit comments