1 | /* | |
2 | * Copyright 2006 - 2013 | |
3 | * Stefan Balev <stefan.balev@graphstream-project.org> | |
4 | * Julien Baudry <julien.baudry@graphstream-project.org> | |
5 | * Antoine Dutot <antoine.dutot@graphstream-project.org> | |
6 | * Yoann Pign�� <yoann.pigne@graphstream-project.org> | |
7 | * Guilhelm Savin <guilhelm.savin@graphstream-project.org> | |
8 | * | |
9 | * This file is part of GraphStream <http://graphstream-project.org>. | |
10 | * | |
11 | * GraphStream is a library whose purpose is to handle static or dynamic | |
12 | * graph, create them from scratch, file or any source and display them. | |
13 | * | |
14 | * This program is free software distributed under the terms of two licenses, the | |
15 | * CeCILL-C license that fits European law, and the GNU Lesser General Public | |
16 | * License. You can use, modify and/ or redistribute the software under the terms | |
17 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following | |
18 | * URL <http://www.cecill.info> or under the terms of the GNU LGPL as published by | |
19 | * the Free Software Foundation, either version 3 of the License, or (at your | |
20 | * option) any later version. | |
21 | * | |
22 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY | |
23 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A | |
24 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. | |
25 | * | |
26 | * You should have received a copy of the GNU Lesser General Public License | |
27 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
28 | * | |
29 | * The fact that you are presently reading this means that you have had | |
30 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. | |
31 | */ | |
32 | package org.graphstream.stream.rmi; | |
33 | ||
34 | import java.rmi.Naming; | |
35 | import java.rmi.RemoteException; | |
36 | import java.rmi.server.UnicastRemoteObject; | |
37 | import java.util.concurrent.ConcurrentLinkedQueue; | |
38 | ||
39 | import org.graphstream.stream.AttributeSink; | |
40 | import org.graphstream.stream.ElementSink; | |
41 | import org.graphstream.stream.Sink; | |
42 | import org.graphstream.stream.Source; | |
43 | ||
44 | public class RMISource extends UnicastRemoteObject implements RMIAdapterIn, | |
45 | Source { | |
46 | private static final long serialVersionUID = 6635146473737922832L; | |
47 | ||
48 | ConcurrentLinkedQueue<AttributeSink> attributesListeners; | |
49 | ConcurrentLinkedQueue<ElementSink> elementsListeners; | |
50 | ||
51 | public RMISource() throws RemoteException { | |
52 | super(); | |
53 | | |
54 | attributesListeners = new ConcurrentLinkedQueue<AttributeSink>(); | |
55 | elementsListeners = new ConcurrentLinkedQueue<ElementSink>(); | |
56 | } | |
57 | ||
58 | public RMISource(String name) throws RemoteException { | |
59 | this(); | |
60 |
1
1. |
bind(name); |
61 | } | |
62 | ||
63 | public void bind(String name) { | |
64 | try { | |
65 |
1
1. bind : removed call to java/rmi/Naming::rebind → NO_COVERAGE |
Naming.rebind(String.format("//localhost/%s", name), this); |
66 | } catch (Exception e) { | |
67 |
1
1. bind : removed call to java/lang/Exception::printStackTrace → NO_COVERAGE |
e.printStackTrace(); |
68 | } | |
69 | } | |
70 | ||
71 | public void edgeAdded(String graphId, long timeId, String edgeId, | |
72 | String fromNodeId, String toNodeId, boolean directed) | |
73 | throws RemoteException { | |
74 |
1
1. edgeAdded : negated conditional → NO_COVERAGE |
for (ElementSink gel : elementsListeners) |
75 |
1
1. edgeAdded : removed call to org/graphstream/stream/ElementSink::edgeAdded → NO_COVERAGE |
gel.edgeAdded(graphId, timeId, edgeId, fromNodeId, toNodeId, |
76 | directed); | |
77 | } | |
78 | ||
79 | public void edgeAttributeAdded(String graphId, long timeId, String edgeId, | |
80 | String attribute, Object value) throws RemoteException { | |
81 |
1
1. edgeAttributeAdded : negated conditional → NO_COVERAGE |
for (AttributeSink gal : attributesListeners) |
82 |
1
1. edgeAttributeAdded : removed call to org/graphstream/stream/AttributeSink::edgeAttributeAdded → NO_COVERAGE |
gal.edgeAttributeAdded(graphId, timeId, edgeId, attribute, value); |
83 | } | |
84 | ||
85 | public void edgeAttributeChanged(String graphId, long timeId, | |
86 | String edgeId, String attribute, Object oldValue, Object newValue) | |
87 | throws RemoteException { | |
88 |
1
1. edgeAttributeChanged : negated conditional → NO_COVERAGE |
for (AttributeSink gal : attributesListeners) |
89 |
1
1. edgeAttributeChanged : removed call to org/graphstream/stream/AttributeSink::edgeAttributeChanged → NO_COVERAGE |
gal.edgeAttributeChanged(graphId, timeId, edgeId, attribute, |
90 | oldValue, newValue); | |
91 | } | |
92 | ||
93 | public void edgeAttributeRemoved(String graphId, long timeId, | |
94 | String edgeId, String attribute) throws RemoteException { | |
95 |
1
1. edgeAttributeRemoved : negated conditional → NO_COVERAGE |
for (AttributeSink gal : attributesListeners) |
96 |
1
1. edgeAttributeRemoved : removed call to org/graphstream/stream/AttributeSink::edgeAttributeRemoved → NO_COVERAGE |
gal.edgeAttributeRemoved(graphId, timeId, edgeId, attribute); |
97 | } | |
98 | ||
99 | public void edgeRemoved(String graphId, long timeId, String edgeId) | |
100 | throws RemoteException { | |
101 |
1
1. edgeRemoved : negated conditional → NO_COVERAGE |
for (ElementSink gel : elementsListeners) |
102 |
1
1. edgeRemoved : removed call to org/graphstream/stream/ElementSink::edgeRemoved → NO_COVERAGE |
gel.edgeRemoved(graphId, timeId, edgeId); |
103 | } | |
104 | ||
105 | public void graphAttributeAdded(String graphId, long timeId, | |
106 | String attribute, Object value) throws RemoteException { | |
107 |
1
1. graphAttributeAdded : negated conditional → NO_COVERAGE |
for (AttributeSink gal : attributesListeners) |
108 |
1
1. graphAttributeAdded : removed call to org/graphstream/stream/AttributeSink::graphAttributeAdded → NO_COVERAGE |
gal.graphAttributeAdded(graphId, timeId, attribute, value); |
109 | } | |
110 | ||
111 | public void graphAttributeChanged(String graphId, long timeId, | |
112 | String attribute, Object oldValue, Object newValue) | |
113 | throws RemoteException { | |
114 |
1
1. graphAttributeChanged : negated conditional → NO_COVERAGE |
for (AttributeSink gal : attributesListeners) |
115 |
1
1. graphAttributeChanged : removed call to org/graphstream/stream/AttributeSink::graphAttributeChanged → NO_COVERAGE |
gal.graphAttributeChanged(graphId, timeId, attribute, oldValue, |
116 | newValue); | |
117 | } | |
118 | ||
119 | public void graphAttributeRemoved(String graphId, long timeId, | |
120 | String attribute) throws RemoteException { | |
121 |
1
1. graphAttributeRemoved : negated conditional → NO_COVERAGE |
for (AttributeSink gal : attributesListeners) |
122 |
1
1. graphAttributeRemoved : removed call to org/graphstream/stream/AttributeSink::graphAttributeRemoved → NO_COVERAGE |
gal.graphAttributeRemoved(graphId, timeId, attribute); |
123 | } | |
124 | ||
125 | public void graphCleared(String graphId, long timeId) | |
126 | throws RemoteException { | |
127 |
1
1. graphCleared : negated conditional → NO_COVERAGE |
for (ElementSink gel : elementsListeners) |
128 |
1
1. graphCleared : removed call to org/graphstream/stream/ElementSink::graphCleared → NO_COVERAGE |
gel.graphCleared(graphId, timeId); |
129 | } | |
130 | ||
131 | public void nodeAdded(String graphId, long timeId, String nodeId) | |
132 | throws RemoteException { | |
133 |
1
1. nodeAdded : negated conditional → NO_COVERAGE |
for (ElementSink gel : elementsListeners) |
134 |
1
1. nodeAdded : removed call to org/graphstream/stream/ElementSink::nodeAdded → NO_COVERAGE |
gel.nodeAdded(graphId, timeId, nodeId); |
135 | } | |
136 | ||
137 | public void nodeAttributeAdded(String graphId, long timeId, String nodeId, | |
138 | String attribute, Object value) throws RemoteException { | |
139 |
1
1. nodeAttributeAdded : negated conditional → NO_COVERAGE |
for (AttributeSink gal : attributesListeners) |
140 |
1
1. nodeAttributeAdded : removed call to org/graphstream/stream/AttributeSink::nodeAttributeAdded → NO_COVERAGE |
gal.nodeAttributeAdded(graphId, timeId, nodeId, attribute, value); |
141 | } | |
142 | ||
143 | public void nodeAttributeChanged(String graphId, long timeId, | |
144 | String nodeId, String attribute, Object oldValue, Object newValue) | |
145 | throws RemoteException { | |
146 |
1
1. nodeAttributeChanged : negated conditional → NO_COVERAGE |
for (AttributeSink gal : attributesListeners) |
147 |
1
1. nodeAttributeChanged : removed call to org/graphstream/stream/AttributeSink::nodeAttributeChanged → NO_COVERAGE |
gal.nodeAttributeChanged(graphId, timeId, nodeId, attribute, |
148 | oldValue, newValue); | |
149 | } | |
150 | ||
151 | public void nodeAttributeRemoved(String graphId, long timeId, | |
152 | String nodeId, String attribute) throws RemoteException { | |
153 |
1
1. nodeAttributeRemoved : negated conditional → NO_COVERAGE |
for (AttributeSink gal : attributesListeners) |
154 |
1
1. nodeAttributeRemoved : removed call to org/graphstream/stream/AttributeSink::nodeAttributeRemoved → NO_COVERAGE |
gal.nodeAttributeRemoved(graphId, timeId, nodeId, attribute); |
155 | } | |
156 | ||
157 | public void nodeRemoved(String graphId, long timeId, String nodeId) | |
158 | throws RemoteException { | |
159 |
1
1. nodeRemoved : negated conditional → NO_COVERAGE |
for (ElementSink gel : elementsListeners) |
160 |
1
1. nodeRemoved : removed call to org/graphstream/stream/ElementSink::nodeRemoved → NO_COVERAGE |
gel.nodeRemoved(graphId, timeId, nodeId); |
161 | } | |
162 | ||
163 | public void stepBegins(String graphId, long timeId, double step) | |
164 | throws RemoteException { | |
165 |
1
1. stepBegins : negated conditional → NO_COVERAGE |
for (ElementSink gel : elementsListeners) |
166 |
1
1. stepBegins : removed call to org/graphstream/stream/ElementSink::stepBegins → NO_COVERAGE |
gel.stepBegins(graphId, timeId, step); |
167 | } | |
168 | ||
169 | public void addAttributeSink(AttributeSink listener) { | |
170 | attributesListeners.add(listener); | |
171 | } | |
172 | ||
173 | public void addElementSink(ElementSink listener) { | |
174 | elementsListeners.add(listener); | |
175 | } | |
176 | ||
177 | public void addSink(Sink listener) { | |
178 | attributesListeners.add(listener); | |
179 | elementsListeners.add(listener); | |
180 | } | |
181 | ||
182 | public void removeAttributeSink(AttributeSink listener) { | |
183 | attributesListeners.remove(listener); | |
184 | } | |
185 | ||
186 | public void removeElementSink(ElementSink listener) { | |
187 | elementsListeners.remove(listener); | |
188 | } | |
189 | ||
190 | public void removeSink(Sink listener) { | |
191 | attributesListeners.remove(listener); | |
192 | elementsListeners.remove(listener); | |
193 | } | |
194 | ||
195 | public void clearAttributeSinks() { | |
196 |
1
1. clearAttributeSinks : removed call to java/util/concurrent/ConcurrentLinkedQueue::clear → NO_COVERAGE |
attributesListeners.clear(); |
197 |
1
1. clearAttributeSinks : removed call to java/util/concurrent/ConcurrentLinkedQueue::clear → NO_COVERAGE |
elementsListeners.clear(); |
198 | } | |
199 | ||
200 | public void clearElementSinks() { | |
201 |
1
1. clearElementSinks : removed call to java/util/concurrent/ConcurrentLinkedQueue::clear → NO_COVERAGE |
elementsListeners.clear(); |
202 | } | |
203 | ||
204 | public void clearSinks() { | |
205 |
1
1. clearSinks : removed call to java/util/concurrent/ConcurrentLinkedQueue::clear → NO_COVERAGE |
attributesListeners.clear(); |
206 | } | |
207 | } | |
Mutations | ||
60 |
1.1 |
|
65 |
1.1 |
|
67 |
1.1 |
|
74 |
1.1 |
|
75 |
1.1 |
|
81 |
1.1 |
|
82 |
1.1 |
|
88 |
1.1 |
|
89 |
1.1 |
|
95 |
1.1 |
|
96 |
1.1 |
|
101 |
1.1 |
|
102 |
1.1 |
|
107 |
1.1 |
|
108 |
1.1 |
|
114 |
1.1 |
|
115 |
1.1 |
|
121 |
1.1 |
|
122 |
1.1 |
|
127 |
1.1 |
|
128 |
1.1 |
|
133 |
1.1 |
|
134 |
1.1 |
|
139 |
1.1 |
|
140 |
1.1 |
|
146 |
1.1 |
|
147 |
1.1 |
|
153 |
1.1 |
|
154 |
1.1 |
|
159 |
1.1 |
|
160 |
1.1 |
|
165 |
1.1 |
|
166 |
1.1 |
|
196 |
1.1 |
|
197 |
1.1 |
|
201 |
1.1 |
|
205 |
1.1 |