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.ConcurrentHashMap; | |
38 | ||
39 | import org.graphstream.stream.Sink; | |
40 | ||
41 | public class RMISink extends UnicastRemoteObject implements RMIAdapterOut, Sink { | |
42 | private static final long serialVersionUID = 23444722897331612L; | |
43 | ||
44 | ConcurrentHashMap<String, RMIAdapterIn> inputs; | |
45 | ||
46 | public RMISink() throws RemoteException { | |
47 | super(); | |
48 | inputs = new ConcurrentHashMap<String, RMIAdapterIn>(); | |
49 | } | |
50 | ||
51 | public RMISink(String name) throws RemoteException { | |
52 | this(); | |
53 |
1
1. |
bind(name); |
54 | } | |
55 | ||
56 | public void bind(String name) { | |
57 | try { | |
58 |
1
1. bind : removed call to java/rmi/Naming::rebind → NO_COVERAGE |
Naming.rebind(String.format("//localhost/%s", name), this); |
59 | } catch (Exception e) { | |
60 |
1
1. bind : removed call to java/lang/Exception::printStackTrace → NO_COVERAGE |
e.printStackTrace(); |
61 | } | |
62 | } | |
63 | ||
64 | public void register(String url) throws RemoteException { | |
65 | try { | |
66 | RMIAdapterIn in = (RMIAdapterIn) Naming.lookup(url); | |
67 | ||
68 |
1
1. register : negated conditional → NO_COVERAGE |
if (in != null) |
69 | inputs.put(url, in); | |
70 | } catch (Exception e) { | |
71 |
1
1. register : removed call to java/lang/Exception::printStackTrace → NO_COVERAGE |
e.printStackTrace(); |
72 | } | |
73 | } | |
74 | ||
75 | public void unregister(String url) throws RemoteException { | |
76 |
1
1. unregister : negated conditional → NO_COVERAGE |
if (inputs.containsKey(url)) |
77 | inputs.remove(url); | |
78 | } | |
79 | ||
80 | public void edgeAttributeAdded(String graphId, long timeId, String edgeId, | |
81 | String attribute, Object value) { | |
82 |
1
1. edgeAttributeAdded : negated conditional → NO_COVERAGE |
for (RMIAdapterIn in : inputs.values()) { |
83 | try { | |
84 |
1
1. edgeAttributeAdded : removed call to org/graphstream/stream/rmi/RMIAdapterIn::edgeAttributeAdded → NO_COVERAGE |
in.edgeAttributeAdded(graphId, timeId, edgeId, attribute, value); |
85 | } catch (Exception e) { | |
86 |
1
1. edgeAttributeAdded : removed call to java/lang/Exception::printStackTrace → NO_COVERAGE |
e.printStackTrace(); |
87 | } | |
88 | } | |
89 | } | |
90 | ||
91 | public void edgeAttributeChanged(String graphId, long timeId, | |
92 | String edgeId, String attribute, Object oldValue, Object newValue) { | |
93 |
1
1. edgeAttributeChanged : negated conditional → NO_COVERAGE |
for (RMIAdapterIn in : inputs.values()) { |
94 | try { | |
95 |
1
1. edgeAttributeChanged : removed call to org/graphstream/stream/rmi/RMIAdapterIn::edgeAttributeChanged → NO_COVERAGE |
in.edgeAttributeChanged(graphId, timeId, edgeId, attribute, |
96 | oldValue, newValue); | |
97 | } catch (Exception e) { | |
98 |
1
1. edgeAttributeChanged : removed call to java/lang/Exception::printStackTrace → NO_COVERAGE |
e.printStackTrace(); |
99 | } | |
100 | } | |
101 | } | |
102 | ||
103 | public void edgeAttributeRemoved(String graphId, long timeId, | |
104 | String edgeId, String attribute) { | |
105 |
1
1. edgeAttributeRemoved : negated conditional → NO_COVERAGE |
for (RMIAdapterIn in : inputs.values()) { |
106 | try { | |
107 |
1
1. edgeAttributeRemoved : removed call to org/graphstream/stream/rmi/RMIAdapterIn::edgeAttributeRemoved → NO_COVERAGE |
in.edgeAttributeRemoved(graphId, timeId, edgeId, attribute); |
108 | } catch (Exception e) { | |
109 |
1
1. edgeAttributeRemoved : removed call to java/lang/Exception::printStackTrace → NO_COVERAGE |
e.printStackTrace(); |
110 | } | |
111 | } | |
112 | } | |
113 | ||
114 | public void graphAttributeAdded(String graphId, long timeId, | |
115 | String attribute, Object value) { | |
116 |
1
1. graphAttributeAdded : negated conditional → NO_COVERAGE |
for (RMIAdapterIn in : inputs.values()) { |
117 | try { | |
118 |
1
1. graphAttributeAdded : removed call to org/graphstream/stream/rmi/RMIAdapterIn::graphAttributeAdded → NO_COVERAGE |
in.graphAttributeAdded(graphId, timeId, attribute, value); |
119 | } catch (Exception e) { | |
120 |
1
1. graphAttributeAdded : removed call to java/lang/Exception::printStackTrace → NO_COVERAGE |
e.printStackTrace(); |
121 | } | |
122 | } | |
123 | } | |
124 | ||
125 | public void graphAttributeChanged(String graphId, long timeId, | |
126 | String attribute, Object oldValue, Object newValue) { | |
127 |
1
1. graphAttributeChanged : negated conditional → NO_COVERAGE |
for (RMIAdapterIn in : inputs.values()) { |
128 | try { | |
129 |
1
1. graphAttributeChanged : removed call to org/graphstream/stream/rmi/RMIAdapterIn::graphAttributeChanged → NO_COVERAGE |
in.graphAttributeChanged(graphId, timeId, attribute, oldValue, |
130 | newValue); | |
131 | } catch (Exception e) { | |
132 |
1
1. graphAttributeChanged : removed call to java/lang/Exception::printStackTrace → NO_COVERAGE |
e.printStackTrace(); |
133 | } | |
134 | } | |
135 | } | |
136 | ||
137 | public void graphAttributeRemoved(String graphId, long timeId, | |
138 | String attribute) { | |
139 |
1
1. graphAttributeRemoved : negated conditional → NO_COVERAGE |
for (RMIAdapterIn in : inputs.values()) { |
140 | try { | |
141 |
1
1. graphAttributeRemoved : removed call to org/graphstream/stream/rmi/RMIAdapterIn::graphAttributeRemoved → NO_COVERAGE |
in.graphAttributeRemoved(graphId, timeId, attribute); |
142 | } catch (Exception e) { | |
143 |
1
1. graphAttributeRemoved : removed call to java/lang/Exception::printStackTrace → NO_COVERAGE |
e.printStackTrace(); |
144 | } | |
145 | } | |
146 | } | |
147 | ||
148 | public void nodeAttributeAdded(String graphId, long timeId, String nodeId, | |
149 | String attribute, Object value) { | |
150 |
1
1. nodeAttributeAdded : negated conditional → NO_COVERAGE |
for (RMIAdapterIn in : inputs.values()) { |
151 | try { | |
152 |
1
1. nodeAttributeAdded : removed call to org/graphstream/stream/rmi/RMIAdapterIn::nodeAttributeAdded → NO_COVERAGE |
in.nodeAttributeAdded(graphId, timeId, nodeId, attribute, value); |
153 | } catch (Exception e) { | |
154 |
1
1. nodeAttributeAdded : removed call to java/lang/Exception::printStackTrace → NO_COVERAGE |
e.printStackTrace(); |
155 | } | |
156 | } | |
157 | } | |
158 | ||
159 | public void nodeAttributeChanged(String graphId, long timeId, | |
160 | String nodeId, String attribute, Object oldValue, Object newValue) { | |
161 |
1
1. nodeAttributeChanged : negated conditional → NO_COVERAGE |
for (RMIAdapterIn in : inputs.values()) { |
162 | try { | |
163 |
1
1. nodeAttributeChanged : removed call to org/graphstream/stream/rmi/RMIAdapterIn::nodeAttributeChanged → NO_COVERAGE |
in.nodeAttributeChanged(graphId, timeId, nodeId, attribute, |
164 | oldValue, newValue); | |
165 | } catch (Exception e) { | |
166 |
1
1. nodeAttributeChanged : removed call to java/lang/Exception::printStackTrace → NO_COVERAGE |
e.printStackTrace(); |
167 | } | |
168 | } | |
169 | } | |
170 | ||
171 | public void nodeAttributeRemoved(String graphId, long timeId, | |
172 | String nodeId, String attribute) { | |
173 |
1
1. nodeAttributeRemoved : negated conditional → NO_COVERAGE |
for (RMIAdapterIn in : inputs.values()) { |
174 | try { | |
175 |
1
1. nodeAttributeRemoved : removed call to org/graphstream/stream/rmi/RMIAdapterIn::nodeAttributeRemoved → NO_COVERAGE |
in.nodeAttributeRemoved(graphId, timeId, nodeId, attribute); |
176 | } catch (Exception e) { | |
177 |
1
1. nodeAttributeRemoved : removed call to java/lang/Exception::printStackTrace → NO_COVERAGE |
e.printStackTrace(); |
178 | } | |
179 | } | |
180 | } | |
181 | ||
182 | public void edgeAdded(String graphId, long timeId, String edgeId, | |
183 | String fromNodeId, String toNodeId, boolean directed) { | |
184 |
1
1. edgeAdded : negated conditional → NO_COVERAGE |
for (RMIAdapterIn in : inputs.values()) { |
185 | try { | |
186 |
1
1. edgeAdded : removed call to org/graphstream/stream/rmi/RMIAdapterIn::edgeAdded → NO_COVERAGE |
in.edgeAdded(graphId, timeId, edgeId, fromNodeId, toNodeId, |
187 | directed); | |
188 | } catch (Exception e) { | |
189 |
1
1. edgeAdded : removed call to java/lang/Exception::printStackTrace → NO_COVERAGE |
e.printStackTrace(); |
190 | } | |
191 | } | |
192 | } | |
193 | ||
194 | public void edgeRemoved(String graphId, long timeId, String edgeId) { | |
195 |
1
1. edgeRemoved : negated conditional → NO_COVERAGE |
for (RMIAdapterIn in : inputs.values()) { |
196 | try { | |
197 |
1
1. edgeRemoved : removed call to org/graphstream/stream/rmi/RMIAdapterIn::edgeRemoved → NO_COVERAGE |
in.edgeRemoved(graphId, timeId, edgeId); |
198 | } catch (Exception e) { | |
199 |
1
1. edgeRemoved : removed call to java/lang/Exception::printStackTrace → NO_COVERAGE |
e.printStackTrace(); |
200 | } | |
201 | } | |
202 | } | |
203 | ||
204 | public void graphCleared(String graphId, long timeId) { | |
205 |
1
1. graphCleared : negated conditional → NO_COVERAGE |
for (RMIAdapterIn in : inputs.values()) { |
206 | try { | |
207 |
1
1. graphCleared : removed call to org/graphstream/stream/rmi/RMIAdapterIn::graphCleared → NO_COVERAGE |
in.graphCleared(graphId, timeId); |
208 | } catch (Exception e) { | |
209 |
1
1. graphCleared : removed call to java/lang/Exception::printStackTrace → NO_COVERAGE |
e.printStackTrace(); |
210 | } | |
211 | } | |
212 | } | |
213 | ||
214 | public void nodeAdded(String graphId, long timeId, String nodeId) { | |
215 |
1
1. nodeAdded : negated conditional → NO_COVERAGE |
for (RMIAdapterIn in : inputs.values()) { |
216 | try { | |
217 |
1
1. nodeAdded : removed call to org/graphstream/stream/rmi/RMIAdapterIn::nodeAdded → NO_COVERAGE |
in.nodeAdded(graphId, timeId, nodeId); |
218 | } catch (Exception e) { | |
219 |
1
1. nodeAdded : removed call to java/lang/Exception::printStackTrace → NO_COVERAGE |
e.printStackTrace(); |
220 | } | |
221 | } | |
222 | } | |
223 | ||
224 | public void nodeRemoved(String graphId, long timeId, String nodeId) { | |
225 |
1
1. nodeRemoved : negated conditional → NO_COVERAGE |
for (RMIAdapterIn in : inputs.values()) { |
226 | try { | |
227 |
1
1. nodeRemoved : removed call to org/graphstream/stream/rmi/RMIAdapterIn::nodeRemoved → NO_COVERAGE |
in.nodeRemoved(graphId, timeId, nodeId); |
228 | } catch (Exception e) { | |
229 |
1
1. nodeRemoved : removed call to java/lang/Exception::printStackTrace → NO_COVERAGE |
e.printStackTrace(); |
230 | } | |
231 | } | |
232 | } | |
233 | ||
234 | public void stepBegins(String graphId, long timeId, double step) { | |
235 |
1
1. stepBegins : negated conditional → NO_COVERAGE |
for (RMIAdapterIn in : inputs.values()) { |
236 | try { | |
237 |
1
1. stepBegins : removed call to org/graphstream/stream/rmi/RMIAdapterIn::stepBegins → NO_COVERAGE |
in.stepBegins(graphId, timeId, step); |
238 | } catch (Exception e) { | |
239 |
1
1. stepBegins : removed call to java/lang/Exception::printStackTrace → NO_COVERAGE |
e.printStackTrace(); |
240 | } | |
241 | } | |
242 | } | |
243 | } | |
Mutations | ||
53 |
1.1 |
|
58 |
1.1 |
|
60 |
1.1 |
|
68 |
1.1 |
|
71 |
1.1 |
|
76 |
1.1 |
|
82 |
1.1 |
|
84 |
1.1 |
|
86 |
1.1 |
|
93 |
1.1 |
|
95 |
1.1 |
|
98 |
1.1 |
|
105 |
1.1 |
|
107 |
1.1 |
|
109 |
1.1 |
|
116 |
1.1 |
|
118 |
1.1 |
|
120 |
1.1 |
|
127 |
1.1 |
|
129 |
1.1 |
|
132 |
1.1 |
|
139 |
1.1 |
|
141 |
1.1 |
|
143 |
1.1 |
|
150 |
1.1 |
|
152 |
1.1 |
|
154 |
1.1 |
|
161 |
1.1 |
|
163 |
1.1 |
|
166 |
1.1 |
|
173 |
1.1 |
|
175 |
1.1 |
|
177 |
1.1 |
|
184 |
1.1 |
|
186 |
1.1 |
|
189 |
1.1 |
|
195 |
1.1 |
|
197 |
1.1 |
|
199 |
1.1 |
|
205 |
1.1 |
|
207 |
1.1 |
|
209 |
1.1 |
|
215 |
1.1 |
|
217 |
1.1 |
|
219 |
1.1 |
|
225 |
1.1 |
|
227 |
1.1 |
|
229 |
1.1 |
|
235 |
1.1 |
|
237 |
1.1 |
|
239 |
1.1 |