Skip to content

Commit 345ca6d

Browse files
committed
[ignore] code formatting cleanup
1 parent 98102b2 commit 345ca6d

File tree

1 file changed

+48
-49
lines changed

1 file changed

+48
-49
lines changed

src/org/exist/storage/NotificationService.java

Lines changed: 48 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -36,67 +36,66 @@
3636
* Global notification service for document updates. Other classes
3737
* can subscribe to this service to be notified of document modifications,
3838
* removals or additions.
39-
*
40-
* @author wolf
4139
*
40+
* @author wolf
4241
*/
4342
@ThreadSafe
4443
public class NotificationService implements BrokerPoolService {
4544

46-
private static final long serialVersionUID = -3629584664969740903L;
47-
private static final Logger LOG = LogManager.getLogger(NotificationService.class);
45+
private static final long serialVersionUID = -3629584664969740903L;
46+
private static final Logger LOG = LogManager.getLogger(NotificationService.class);
4847

49-
private final Map<UpdateListener, Object> listeners = new IdentityHashMap<>();
50-
51-
public NotificationService() {
52-
super();
53-
}
54-
55-
/**
56-
* Subscribe an {@link UpdateListener} to receive notifications.
57-
*
58-
* @param listener
59-
*/
60-
public synchronized void subscribe(final UpdateListener listener) {
61-
listeners.put(listener, new Object());
62-
}
63-
64-
/**
65-
* Unsubscribe an {@link UpdateListener}.
66-
*
67-
* @param listener
68-
*/
69-
public synchronized void unsubscribe(final UpdateListener listener) {
70-
final Object i = listeners.remove(listener);
71-
if (i == null) {
72-
throw new RuntimeException(hashCode() + " listener not found: " + listener.hashCode());
73-
}
48+
private final Map<UpdateListener, Object> listeners = new IdentityHashMap<>();
49+
50+
public NotificationService() {
51+
super();
52+
}
53+
54+
/**
55+
* Subscribe an {@link UpdateListener} to receive notifications.
56+
*
57+
* @param listener
58+
*/
59+
public synchronized void subscribe(final UpdateListener listener) {
60+
listeners.put(listener, new Object());
61+
}
62+
63+
/**
64+
* Unsubscribe an {@link UpdateListener}.
65+
*
66+
* @param listener
67+
*/
68+
public synchronized void unsubscribe(final UpdateListener listener) {
69+
final Object i = listeners.remove(listener);
70+
if (i == null) {
71+
throw new RuntimeException(hashCode() + " listener not found: " + listener.hashCode());
72+
}
7473
listener.unsubscribe();
7574
}
7675

77-
/**
78-
* Notify all subscribers that a document has been updated/removed or
79-
* a new document has been added.
80-
*
81-
* @param document
82-
* @param event
83-
*/
84-
public synchronized void notifyUpdate(final DocumentImpl document, final int event) {
85-
listeners.keySet().forEach(listener -> listener.documentUpdated(document, event));
86-
}
76+
/**
77+
* Notify all subscribers that a document has been updated/removed or
78+
* a new document has been added.
79+
*
80+
* @param document
81+
* @param event
82+
*/
83+
public synchronized void notifyUpdate(final DocumentImpl document, final int event) {
84+
listeners.keySet().forEach(listener -> listener.documentUpdated(document, event));
85+
}
8786

8887
/**
89-
* Notify all subscribers that a node has been moved. Nodes may be moved during a
88+
* Notify all subscribers that a node has been moved. Nodes may be moved during a
9089
* defragmentation run.
91-
*/
92-
public synchronized void notifyMove(final NodeId oldNodeId, final IStoredNode newNode) {
93-
listeners.keySet().forEach(listener -> listener.nodeMoved(oldNodeId, newNode));
94-
}
90+
*/
91+
public synchronized void notifyMove(final NodeId oldNodeId, final IStoredNode newNode) {
92+
listeners.keySet().forEach(listener -> listener.nodeMoved(oldNodeId, newNode));
93+
}
9594

9695
public synchronized void debug() {
97-
if (LOG.isDebugEnabled()) {
98-
LOG.debug("Registered UpdateListeners:");
99-
}
100-
listeners.keySet().forEach(UpdateListener::debug);
101-
}
96+
if (LOG.isDebugEnabled()) {
97+
LOG.debug("Registered UpdateListeners:");
98+
}
99+
listeners.keySet().forEach(UpdateListener::debug);
100+
}
102101
}

0 commit comments

Comments
 (0)