public synchronized void addReplicatedServiceListener(final IPublishedServiceDirectoryListener listener) {
listeners.add(listener);
PublishedServiceDescriptor[] buf = new PublishedServiceDescriptor[services.values().size()];
services.values().toArray(buf);
final PublishedServiceDirectoryChangeEvent event = new PublishedServiceDirectoryChangeEvent(this, PublishedServiceDirectoryChangeEvent.ADDED, buf);
SafeRunner.run(new ISafeRunnable() {
public void run() throws Exception {
listener.publishedServiceDirectoryChanged(event);
}