mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
ACE-2816 "Ensure that Behaviour Bindings are Removed on Event Subsystem Stop"
Fix up policy component class behaviour listeners for removal of behaviour git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@85600 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -34,5 +34,7 @@ package org.alfresco.repo.policy;
|
|||||||
* @param binding the binding
|
* @param binding the binding
|
||||||
* @param behaviour the behaviour attached to the binding
|
* @param behaviour the behaviour attached to the binding
|
||||||
*/
|
*/
|
||||||
public void addition(B binding, Behaviour behaviour);
|
void addition(B binding, Behaviour behaviour);
|
||||||
|
|
||||||
|
void removal(B binding, Behaviour behaviour);
|
||||||
}
|
}
|
||||||
|
@@ -95,8 +95,12 @@ import java.util.Map;
|
|||||||
{
|
{
|
||||||
existing.remove(behaviourDefinition);
|
existing.remove(behaviourDefinition);
|
||||||
size--;
|
size--;
|
||||||
}
|
|
||||||
|
|
||||||
|
for (BehaviourChangeObserver<B> listener : observers)
|
||||||
|
{
|
||||||
|
listener.removal(binding, behaviourDefinition.getBehaviour());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -89,6 +89,12 @@ import org.apache.commons.logging.LogFactory;
|
|||||||
clearCache("aggregate delegate", singleCache, binding);
|
clearCache("aggregate delegate", singleCache, binding);
|
||||||
clearCache("delegate collection", listCache, binding);
|
clearCache("delegate collection", listCache, binding);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void removal(B binding, Behaviour behaviour)
|
||||||
|
{
|
||||||
|
clearCache("aggregate delegate", singleCache, binding);
|
||||||
|
clearCache("delegate collection", listCache, binding);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -77,6 +77,33 @@ import org.alfresco.util.LockHelper;
|
|||||||
listener.addition(binding, behaviour);
|
listener.addition(binding, behaviour);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void removal(B binding, Behaviour behaviour)
|
||||||
|
{
|
||||||
|
for (BehaviourChangeObserver<B> listener : observers)
|
||||||
|
{
|
||||||
|
listener.removal(binding, behaviour);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this.classMap.addChangeObserver(new BehaviourChangeObserver<B>()
|
||||||
|
{
|
||||||
|
public void addition(B binding, Behaviour behaviour)
|
||||||
|
{
|
||||||
|
for (BehaviourChangeObserver<B> listener : observers)
|
||||||
|
{
|
||||||
|
listener.addition(binding, behaviour);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removal(B binding, Behaviour behaviour)
|
||||||
|
{
|
||||||
|
for (BehaviourChangeObserver<B> listener : observers)
|
||||||
|
{
|
||||||
|
listener.removal(binding, behaviour);
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Observe service binding changes and propagate to our own observers
|
// Observe service binding changes and propagate to our own observers
|
||||||
@@ -90,6 +117,14 @@ import org.alfresco.util.LockHelper;
|
|||||||
listener.addition(null, behaviour);
|
listener.addition(null, behaviour);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void removal(ServiceBehaviourBinding binding, Behaviour behaviour)
|
||||||
|
{
|
||||||
|
for (BehaviourChangeObserver<B> listener : observers)
|
||||||
|
{
|
||||||
|
listener.removal(null, behaviour);
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Setup state
|
// Setup state
|
||||||
|
Reference in New Issue
Block a user