org.apache.felix.ipojo.extender.internal.linker

## Class DeclarationLinker

- java.lang.Object
- - org.apache.felix.ipojo.extender.internal.linker.DeclarationLinker

All Implemented Interfaces:
  Lifecycle, org.osgi.util.tracker.ServiceTrackerCustomizer

    public class DeclarationLinker
    extends java.lang.Object
    implements org.osgi.util.tracker.ServiceTrackerCustomizer, Lifecycle

The linker is responsible to bind extension declaration to type declaration. It tracks TypeDeclaration, and reifies them as factory.

### Constructor Summary

Constructors
Constructor and Description
`DeclarationLinker(org.osgi.framework.BundleContext bundleContext, QueueService queueService)` Creates the linker.

### Method Summary

All Methods Instance Methods Concrete Methods
`java.lang.Object` `addingService(org.osgi.framework.ServiceReference reference)` A new type declaration was published.
`void` `modifiedService(org.osgi.framework.ServiceReference reference, java.lang.Object service)` Type declaration cannot be modified.
`void` `removedService(org.osgi.framework.ServiceReference reference, java.lang.Object service)` A type declaration service was withdrawn from the service registry.
`void` `start()` When the iPOJO management starts, we look for type declaration.
`void` `stop()` When iPOJO stops, we close the tracker.

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

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

### Constructor Detail

#### DeclarationLinker

    public DeclarationLinker(org.osgi.framework.BundleContext bundleContext,
                             QueueService queueService)

Creates the linker.

Parameters:
  `bundleContext` - the bundle context
  `queueService` - the queue service

### Method Detail

#### start

    public void start()

When the iPOJO management starts, we look for type declaration.

Specified by:
  `start` in interface `Lifecycle`

#### stop

    public void stop()

When iPOJO stops, we close the tracker.

Specified by:
  `stop` in interface `Lifecycle`

#### addingService

    public java.lang.Object addingService(org.osgi.framework.ServiceReference reference)

A new type declaration was published.

Specified by:
  `addingService` in interface `org.osgi.util.tracker.ServiceTrackerCustomizer`
Parameters:
  `reference` - the service reference of the type declaration
Returns:
  the managed type object wrapping the service object.

#### modifiedService

    public void modifiedService(org.osgi.framework.ServiceReference reference,
                                java.lang.Object service)

Type declaration cannot be modified.

Specified by:
  `modifiedService` in interface `org.osgi.util.tracker.ServiceTrackerCustomizer`
Parameters:
  `reference` - the reference
  `service` - the object returned by `addingService(org.osgi.framework.ServiceReference)`

#### removedService

    public void removedService(org.osgi.framework.ServiceReference reference,
                               java.lang.Object service)

A type declaration service was withdrawn from the service registry.

Specified by:
  `removedService` in interface `org.osgi.util.tracker.ServiceTrackerCustomizer`
Parameters:
  `reference` - the leaving reference
  `service` - the object returned by `addingService(org.osgi.framework.ServiceReference)`