Skip to content

Package: Strategy

Strategy

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2015 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * jfaltermeier - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.changebroker.internal;
15:
16: import java.util.Set;
17:
18: import org.eclipse.emf.common.notify.Notification;
19: import org.eclipse.emf.ecp.changebroker.spi.ChangeObserver;
20:
21: /**
22: * A Strategy is a registry/ruleset which allows to identify if a notification is relevant for an
23: * {@link ChangeObserver}.
24: *
25: * @author jfaltermeier
26: *
27: */
28: public interface Strategy {
29:
30:         /**
31:          * Returns the {@link ChangeObserver observers} which should get notified.
32:          *
33:          * @param notification the notification
34:          * @return the observers
35:          */
36:         Set<ChangeObserver> getObservers(Notification notification);
37:
38:         /**
39:          * Returns all observers managed by this strategy.
40:          *
41:          * @return all observers
42:          */
43:         Set<ChangeObserver> getAllObservers();
44:
45:         /**
46:          * Deregisters and observer.
47:          *
48:          * @param observer the observer
49:          */
50:         void deregister(ChangeObserver observer);
51:
52: }