public final <T> ServiceRegistration<?> registerService(Class<T> iface, T instance,
	    Dictionary<String, String> dictionary) {
	logger.info(
		"Register service '{}' for interface '{}' (context='" + context.getBundle().getSymbolicName() + "').",
		instance.getClass().getName(), iface.getName());
	ServiceRegistration<?> serviceRegistration = context.registerService(iface, instance, dictionary);
	serviceRegistrations.add(serviceRegistration);
	return serviceRegistration;
    }
public final < T > ServiceRegistration < ? > registerService ( Class < T > iface , T instance , Dictionary < String , String > dictionary ) { logger . info ( "Register service '{}' for interface '{}' (context='" + context . getBundle ( ) . getSymbolicName ( ) + "')." , instance . getClass ( ) . getName ( ) , iface . getName ( ) ) ; ServiceRegistration < ? > serviceRegistration = context . registerService ( iface , instance , dictionary ) ; serviceRegistrations . add ( serviceRegistration ) ; return serviceRegistration ; }
This method should be used to register services. Services registered with
this method auto de-registered during bundle stop.

@param iface
is the interface of the service to be used for later retrieval.
@param instance
is an instance of the object to be registered as service for
interface iface.
@param dictionary
is a {@link Dictionary} of settings to be added to the service
registration.
@param <T>
is the service interface.
@return A {@link ServiceRegistration} is returned of the newly registered
service.