Search in sources :

Example 1 with OSGiModuleInfoSnapshot

use of org.opendaylight.mdsal.dom.schema.osgi.OSGiModuleInfoSnapshot in project mdsal by opendaylight.

the class OSGiDOMSchemaService method bindSnapshot.

@Reference(policy = ReferencePolicy.DYNAMIC, policyOption = ReferencePolicyOption.GREEDY)
void bindSnapshot(final OSGiModuleInfoSnapshot newContext) {
    LOG.info("Updating context to generation {}", newContext.getGeneration());
    final ModuleInfoSnapshot snapshot = newContext.getService();
    final EffectiveModelContext ctx = snapshot.getEffectiveModelContext();
    final ModuleInfoSnapshot previous = currentSnapshot.getAndSet(snapshot);
    LOG.debug("Snapshot updated from {} to {}", previous, snapshot);
    listeners.forEach(listener -> notifyListener(ctx, listener));
}
Also used : OSGiModuleInfoSnapshot(org.opendaylight.mdsal.dom.schema.osgi.OSGiModuleInfoSnapshot) ModuleInfoSnapshot(org.opendaylight.mdsal.binding.runtime.api.ModuleInfoSnapshot) EffectiveModelContext(org.opendaylight.yangtools.yang.model.api.EffectiveModelContext) AtomicReference(java.util.concurrent.atomic.AtomicReference) Reference(org.osgi.service.component.annotations.Reference)

Aggregations

AtomicReference (java.util.concurrent.atomic.AtomicReference)1 ModuleInfoSnapshot (org.opendaylight.mdsal.binding.runtime.api.ModuleInfoSnapshot)1 OSGiModuleInfoSnapshot (org.opendaylight.mdsal.dom.schema.osgi.OSGiModuleInfoSnapshot)1 EffectiveModelContext (org.opendaylight.yangtools.yang.model.api.EffectiveModelContext)1 Reference (org.osgi.service.component.annotations.Reference)1