All Downloads are FREE. Search and download functionalities are using the official Maven repository.

domino.java.ServiceProviding Maven / Gradle / Ivy

There is a newer version: 0.3.1
Show newest version
package domino.java;

import java.util.Map;

import org.osgi.framework.ServiceRegistration;

/**
 * Provides convenient methods to provide any object easily in the OSGi service
 * registry.
 * 
 */
public interface ServiceProviding {

	/**
	 * Registers the service under it's own specified type and without service
	 * properties.
	 *
	 * @return The service registration.
	 */
	 ServiceRegistration providesService(S service);

	/**
	 * Registers the service under the specified type and without service
	 * properties.
	 *
	 * @return The service registration.
	 */
	 ServiceRegistration providesService(S service, Class type);

	/**
	 * Registers the service under the specified types and without service
	 * properties.
	 *
	 * @return The service registration.
	 */
	 ServiceRegistration providesService(S service, Class type1, Class type2);

	/**
	 * Registers the service under the specified types and without service
	 * properties.
	 *
	 * @see Util#asMap(Object, Object) to easily create a map in-place.
	 * 
	 * @param service
	 *            The service.
	 * @return The service registration.
	 */
	 ServiceRegistration providesService(
			S service,
			Class type1,
			Class type2,
			Class type3);

	/**
	 * Registers the service under the specified types and without service
	 * properties.
	 *
	 * @see Util#asMap(Object, Object) to easily create a map in-place.
	 * 
	 * @param service
	 *            The service.
	 * @return The service registration.
	 */
	 ServiceRegistration providesService(
			S service,
			Class type1,
			Class type2,
			Class type3,
			Class type4);

	/**
	 * Registers the service under it's own specified type with the given service
	 * properties.
	 *
	 * @see Util#asMap(Object, Object) to easily create a map in-place.
	 * 
	 * @param service
	 *            The service.
	 * @param properties
	 *            The service properties.
	 * @return The service registration.
	 */
	 ServiceRegistration providesService(S service, Map properties);

	/**
	 * Registers the service under the specified type with the given service
	 * properties.
	 *
	 * @see Util#asMap(Object, Object) to easily create a map in-place.
	 * 
	 * @param service
	 *            The service.
	 * @param properties
	 *            The service properties.
	 * @return The service registration.
	 */
	 ServiceRegistration providesService(S service, Class type, Map properties);

	/**
	 * Registers the service under the specified types with the given service
	 * properties.
	 *
	 * @see Util#asMap(Object, Object) to easily create a map in-place.
	 * 
	 * @param service
	 *            The service.
	 * @param properties
	 *            The service properties.
	 * @return The service registration.
	 */
	 ServiceRegistration providesService(
			S service,
			Class type1,
			Class type2,
			Map properties);

	/**
	 * Registers the service under the specified types with the given service
	 * properties.
	 *
	 * @see Util#asMap(Object, Object) to easily create a map in-place.
	 * 
	 * @param service
	 *            The service.
	 * @param properties
	 *            The service properties.
	 * @return The service registration.
	 */
	 ServiceRegistration providesService(S service,
			Class type1,
			Class type2,
			Class type3,
			Map properties);

	/**
	 * Registers the service under the specified types with the given service
	 * properties.
	 *
	 * @see Util#asMap(Object, Object) to easily create a map in-place.
	 * 
	 * @param service
	 *            The service.
	 * @param properties
	 *            The service properties.
	 * @return The service registration.
	 */
	 ServiceRegistration providesService(S service,
			Class type1,
			Class type2,
			Class type3,
			Class type4,
			Map properties);
}