Java Code Examples for org.osgi.framework.Filter#toString()

The following examples show how to use org.osgi.framework.Filter#toString() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ServiceTracker.java    From concierge with Eclipse Public License 1.0 3 votes vote down vote up
/**
 * Create a {@code ServiceTracker} on the specified {@code Filter} object.
 * 
 * <p>
 * Services which match the specified {@code Filter} object will be tracked
 * by this {@code ServiceTracker}.
 * 
 * @param context The {@code BundleContext} against which the tracking is
 *        done.
 * @param filter The {@code Filter} to select the services to be tracked.
 * @param customizer The customizer object to call when services are added,
 *        modified, or removed in this {@code ServiceTracker}. If customizer
 *        is null, then this {@code ServiceTracker} will be used as the
 *        {@code ServiceTrackerCustomizer} and this {@code ServiceTracker}
 *        will call the {@code ServiceTrackerCustomizer} methods on itself.
 * @since 1.1
 */
public ServiceTracker(final BundleContext context, final Filter filter, final ServiceTrackerCustomizer<S, T> customizer) {
	this.context = context;
	this.trackReference = null;
	this.trackClass = null;
	this.listenerFilter = filter.toString();
	this.filter = filter;
	this.customizer = (customizer == null) ? this : customizer;
	if ((context == null) || (filter == null)) {
		/*
		 * we throw a NPE here to be consistent with the other constructors
		 */
		throw new NullPointerException();
	}
}
 
Example 2
Source File: ServiceTracker.java    From knopflerfish.org with BSD 3-Clause "New" or "Revised" License 3 votes vote down vote up
/**
 * Create a {@code ServiceTracker} on the specified {@code Filter} object.
 * 
 * <p>
 * Services which match the specified {@code Filter} object will be tracked
 * by this {@code ServiceTracker}.
 * 
 * @param context The {@code BundleContext} against which the tracking is
 *        done.
 * @param filter The {@code Filter} to select the services to be tracked.
 * @param customizer The customizer object to call when services are added,
 *        modified, or removed in this {@code ServiceTracker}. If customizer
 *        is null, then this {@code ServiceTracker} will be used as the
 *        {@code ServiceTrackerCustomizer} and this {@code ServiceTracker}
 *        will call the {@code ServiceTrackerCustomizer} methods on itself.
 * @since 1.1
 */
public ServiceTracker(final BundleContext context, final Filter filter, final ServiceTrackerCustomizer<S, T> customizer) {
	this.context = context;
	this.trackReference = null;
	this.trackClass = null;
	this.listenerFilter = filter.toString();
	this.filter = filter;
	this.customizer = (customizer == null) ? this : customizer;
	if ((context == null) || (filter == null)) {
		/*
		 * we throw a NPE here to be consistent with the other constructors
		 */
		throw new NullPointerException();
	}
}
 
Example 3
Source File: CoordinationPermission.java    From knopflerfish.org with BSD 3-Clause "New" or "Revised" License 2 votes vote down vote up
/**
 * Package private constructor used by CoordinationPermissionCollection.
 * 
 * @param filter name filter
 * @param mask action mask
 */
CoordinationPermission(Filter filter, int mask) {
	super((filter == null) ? "*" : filter.toString());
	setTransients(filter, mask);
	this.bundle = null;
}
 
Example 4
Source File: SubsystemPermission.java    From knopflerfish.org with BSD 3-Clause "New" or "Revised" License 2 votes vote down vote up
/**
 * Package private constructor used by SubsystemPermissionCollection.
 * 
 * @param filter name filter or {@code null} for wildcard.
 * @param mask action mask
 */
SubsystemPermission(Filter filter, int mask) {
	super((filter == null) ? "*" : filter.toString());
	setTransients(filter, mask);
	this.subsystem = null;
}