/** * Creates a new tracker for the given class. init() must be called before * the ClassTracker begins tracking. * @param className name of the class to track */ public ClassTracker(String className){ setTrackedClassName(className); }
private void construct(BundleContext context, String className, String filter, ServiceTrackerCustomizer customizer) throws IllegalArgumentException{ myContext = context; setTrackedClassName(className); myFilter = filter; myCustomizer = customizer; if(init()){ return; } String filterMsg = (filter == null || filter.isEmpty()) ? "" : ", Filter: " + filter; String custMsg = customizer == null ? "" : ", Customizer: " + customizer; throw new IllegalArgumentException( "Unable to initialize ServiceTracker from given arguments." + " BundleContext: " + context + ", ClassName: " + className + filterMsg + custMsg + "."); }