org.apache.felix.ipojo.extender.internal

## Class AbstractService

- java.lang.Object
- - org.apache.felix.ipojo.extender.internal.AbstractService

All Implemented Interfaces:
  Lifecycle

Direct Known Subclasses:
  AbstractDeclaration, AbstractQueueService

    public abstract class AbstractService
    extends java.lang.Object
    implements Lifecycle

Common code wrapping an OSGi service.

### Field Summary

Fields
`protected org.osgi.framework.BundleContext` `m_bundleContext` The bundle context.

### Constructor Summary

Constructors
`protected` `AbstractService(org.osgi.framework.BundleContext bundleContext, java.lang.Class<?> type)` Constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`protected org.osgi.framework.BundleContext` `getBundleContext()`
`protected org.osgi.framework.ServiceRegistration<?>` `getRegistration()`
`protected java.util.Dictionary<java.lang.String,?>` `getServiceProperties()`
`boolean` `isRegistered()` Is this service registered or not ?
`protected org.osgi.framework.ServiceRegistration<?>` `registerService()`
`void` `start()` On start, registers the service.
`void` `stop()` On stop, un-registers the service.

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

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

### Field Detail

#### m_bundleContext

    protected final org.osgi.framework.BundleContext m_bundleContext

The bundle context. To let sub-classes retrieve the used bundle context, this member is protected.

### Constructor Detail

#### AbstractService

    protected AbstractService(org.osgi.framework.BundleContext bundleContext,
                              java.lang.Class<?> type)

Constructor. This constructor checks that the current class and the service specification are compatible.

Parameters:
  `bundleContext` - the bundle context
  `type` - the specification

### Method Detail

#### start

    public void start()

On start, registers the service.

Specified by:
  `start` in interface `Lifecycle`

#### registerService

    protected org.osgi.framework.ServiceRegistration<?> registerService()

#### stop

    public void stop()

On stop, un-registers the service.

Specified by:
  `stop` in interface `Lifecycle`

#### getServiceProperties

    protected java.util.Dictionary<java.lang.String,?> getServiceProperties()

Returns:
  the service properties, null by default.

#### getBundleContext

    protected org.osgi.framework.BundleContext getBundleContext()

#### getRegistration

    protected org.osgi.framework.ServiceRegistration<?> getRegistration()

#### isRegistered

    public boolean isRegistered()

Is this service registered or not ?