org.apache.felix.connect.felix.framework

## Class ServiceRegistry

- java.lang.Object
- - org.apache.felix.connect.felix.framework.ServiceRegistry

    public class ServiceRegistry
    extends Object

### Nested Class Summary

Nested Classes
`static interface` `ServiceRegistry.ServiceRegistryCallbacks`

### Constructor Summary

Constructors
Constructor and Description
`ServiceRegistry(ServiceRegistry.ServiceRegistryCallbacks callbacks)`

### Method Summary

Methods
`<S> Set<org.osgi.framework.ServiceReference<S>>` `getHooks(Class<S> hookClass)`
`org.osgi.framework.ServiceReference[]` `getRegisteredServices(org.osgi.framework.Bundle bundle)`
`<S> S` `getService(org.osgi.framework.Bundle bundle, org.osgi.framework.ServiceReference<S> ref)`
`Collection<org.osgi.framework.ServiceReference<?>>` `getServiceReferences(String className, SimpleFilter filter)`
`org.osgi.framework.ServiceReference[]` `getServicesInUse(org.osgi.framework.Bundle bundle)`
`org.osgi.framework.Bundle[]` `getUsingBundles(org.osgi.framework.ServiceReference ref)`
`org.osgi.framework.ServiceRegistration` `registerService(org.osgi.framework.Bundle bundle, String[] classNames, Object svcObj, Dictionary dict)`
`boolean` `ungetService(org.osgi.framework.Bundle bundle, org.osgi.framework.ServiceReference ref)`
`void` `ungetServices(org.osgi.framework.Bundle bundle)` This is a utility method to release all services being used by the specified bundle.
`void` `unregisterService(org.osgi.framework.Bundle bundle, org.apache.felix.connect.felix.framework.ServiceRegistrationImpl reg)`
`void` `unregisterServices(org.osgi.framework.Bundle bundle)` This method retrieves all services registrations for the specified bundle and invokes `ServiceRegistration.unregister()` on each one.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ServiceRegistry

    public ServiceRegistry(ServiceRegistry.ServiceRegistryCallbacks callbacks)

### Method Detail

#### getRegisteredServices

    public org.osgi.framework.ServiceReference[] getRegisteredServices(org.osgi.framework.Bundle bundle)

#### registerService

    public org.osgi.framework.ServiceRegistration registerService(org.osgi.framework.Bundle bundle,
                                                         String[] classNames,
                                                         Object svcObj,
                                                         Dictionary dict)

#### unregisterService

    public void unregisterService(org.osgi.framework.Bundle bundle,
                         org.apache.felix.connect.felix.framework.ServiceRegistrationImpl reg)

#### unregisterServices

    public void unregisterServices(org.osgi.framework.Bundle bundle)

This method retrieves all services registrations for the specified bundle and invokes `ServiceRegistration.unregister()` on each one. This method is only called be the framework to clean up after a stopped bundle.

Parameters:
  `bundle` - the bundle whose services should be unregistered.

#### getServiceReferences

    public Collection<org.osgi.framework.ServiceReference<?>> getServiceReferences(String className,
                                                                          SimpleFilter filter)

#### getServicesInUse

    public org.osgi.framework.ServiceReference[] getServicesInUse(org.osgi.framework.Bundle bundle)

#### getService

    public <S> S getService(org.osgi.framework.Bundle bundle,
                   org.osgi.framework.ServiceReference<S> ref)

#### ungetService

    public boolean ungetService(org.osgi.framework.Bundle bundle,
                       org.osgi.framework.ServiceReference ref)

#### ungetServices

    public void ungetServices(org.osgi.framework.Bundle bundle)

This is a utility method to release all services being used by the specified bundle.

Parameters:
  `bundle` - the bundle whose services are to be released.

#### getUsingBundles

    public org.osgi.framework.Bundle[] getUsingBundles(org.osgi.framework.ServiceReference ref)

#### getHooks

    public <S> Set<org.osgi.framework.ServiceReference<S>> getHooks(Class<S> hookClass)