use of org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.policy.condition.ConditionsAugPolicy in project bgpcep by opendaylight.
the class ConditionsRegistryImpl method registerConditionPolicy.
AbstractRegistration registerConditionPolicy(final Class<? extends Augmentation<Conditions>> conditionPolicyClass, final ConditionsAugPolicy conditionPolicy) {
synchronized (this.conditionsRegistry) {
final ConditionsAugPolicy prev = this.conditionsRegistry.putIfAbsent(conditionPolicyClass, conditionPolicy);
Preconditions.checkState(prev == null, "Condition Policy %s already registered %s", conditionPolicyClass, prev);
return new AbstractRegistration() {
@Override
protected void removeRegistration() {
synchronized (ConditionsRegistryImpl.this.conditionsRegistry) {
ConditionsRegistryImpl.this.conditionsRegistry.remove(conditionPolicyClass);
}
}
};
}
}
Aggregations