Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package com.liferay.osgi.service.tracker.collections;
import com.liferay.osgi.service.tracker.collections.internal.DefaultServiceTrackerCustomizer;
import com.liferay.osgi.service.tracker.collections.internal.map.MultiValueServiceTrackerBucketFactory;
import com.liferay.osgi.service.tracker.collections.internal.map.ServiceTrackerMapImpl;
import com.liferay.osgi.service.tracker.collections.internal.map.SingleValueServiceTrackerBucketFactory;
import com.liferay.osgi.service.tracker.collections.map.PropertyServiceReferenceMapper;
import com.liferay.osgi.service.tracker.collections.map.ServiceReferenceMapper;
import com.liferay.osgi.service.tracker.collections.map.ServiceTrackerBucketFactory;
import com.liferay.osgi.service.tracker.collections.map.ServiceTrackerMap;
import com.liferay.osgi.service.tracker.collections.map.ServiceTrackerMapListener;
import java.util.Comparator;
import java.util.List;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.util.tracker.ServiceTrackerCustomizer;
/**
* @author Carlos Sierra Andrés
*/
public class ServiceTrackerMapBuilder {
public interface Collector {
public ServiceTrackerMap build();
public Collector newCollector(
ServiceTrackerMapListener serviceTrackerMapListener);
}
public interface Mapper {
public Collector collect(
ServiceTrackerBucketFactory serviceTrackerBucketFactory);
public Collector> collectMultiValue();
public Collector> collectMultiValue(
Comparator> comparator);
public Collector collectSingleValue();
public Collector collectSingleValue(
Comparator> comparator);
}
public interface Selector {
public Mapper map(
ServiceReferenceMapper serviceReferenceMapper);
public Mapper map(String propertyKey);
public Selector newSelector(
ServiceTrackerCustomizer serviceTrackerCustomizer);
public Selector newSelector(String filterString);
}
public interface SelectorFactory {
public static Selector newSelector(
BundleContext bundleContext, Class clazz) {
return new SelectorImpl<>(bundleContext, clazz, null, null);
}
public static Selector newSelector(
BundleContext bundleContext, Class clazz, String filterString) {
return new SelectorImpl<>(bundleContext, clazz, filterString, null);
}
public static Selector