use of org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.policy.action.BgpActionPolicy in project bgpcep by opendaylight.
the class ActionsRegistryImpl method registerBgpActionPolicy.
public AbstractRegistration registerBgpActionPolicy(final Class<? extends ChildOf<BgpActions>> bgpActionPolicyClass, final BgpActionPolicy bgpActionPolicy) {
synchronized (this.bgpActions) {
final BgpActionPolicy prev = this.bgpActions.putIfAbsent(bgpActionPolicyClass, bgpActionPolicy);
Preconditions.checkState(prev == null, "Action Policy %s already registered %s", bgpActionPolicyClass, prev);
return new AbstractRegistration() {
@Override
protected void removeRegistration() {
synchronized (ActionsRegistryImpl.this.bgpActions) {
ActionsRegistryImpl.this.bgpActions.remove(bgpActionPolicyClass);
}
}
};
}
}
Aggregations