61 |
|
|
62 |
The first three classes are used with HTTP-Kit and the three |
The first three classes are used with HTTP-Kit and the three |
63 |
latter ones with GISP. Obviously, GISP related classes are not a problem |
latter ones with GISP. Obviously, GISP related classes are not a problem |
64 |
as they are obsolete but HTTP-Kit related may be, i.e., classes have to |
as they are obsolete but HTTP-Kit related may be a problem, i.e., classes |
65 |
re-engineer to SEDA compliant classes. |
have to re-engineer to SEDA compliant classes. |
66 |
|
|
67 |
ISSUE: If a software uses SEDA in one component, is it mandatory to use SEDA's |
ISSUE: If a software uses SEDA in one component, is it mandatory to use SEDA's |
68 |
thread-event model in all other components also (i.e. native Java threads |
thread-event model in all other components also (i.e. native Java threads |
274 |
|
|
275 |
// Dispatcher which dispatches all items |
// Dispatcher which dispatches all items |
276 |
// to a target peer. |
// to a target peer. |
277 |
// (Mandatory: sandStorm requires this) |
// (Mandatory: Sandstorm requires this) |
278 |
method dispatch (QueueElementIF item) { |
method dispatch (QueueElementIF item) { |
279 |
//try do dispatch an item |
//try do dispatch an item |
280 |
try { |
try { |
287 |
// General initialization method |
// General initialization method |
288 |
// that handles subscribes this stage |
// that handles subscribes this stage |
289 |
// to listen certain events and messages. |
// to listen certain events and messages. |
290 |
// (Mandatory: sandStorm requires this) |
// (Mandatory: Sandstorm requires this) |
291 |
method init (ConfigDataIF config) { |
method init (ConfigDataIF config) { |
292 |
|
|
293 |
// find our NodeId |
// find our NodeId |
304 |
peer = new SHA1Hash (publicKey); |
peer = new SHA1Hash (publicKey); |
305 |
|
|
306 |
// The *events* which we want to listen. |
// The *events* which we want to listen. |
307 |
// (Mandatory: sandStorm requires this) |
// (Mandatory: Sandstorm requires this) |
308 |
|
|
309 |
array event_types = { |
array event_types = { |
310 |
"seda.sandStorm.api.StagesInitializedSignal", |
"seda.sandStorm.api.StagesInitializedSignal", |
317 |
} |
} |
318 |
|
|
319 |
// The *messages* we want receive through Tapestry. |
// The *messages* we want receive through Tapestry. |
320 |
// (Mandatory: sandStorm requires this) |
// (Mandatory: Sandstorm requires this) |
321 |
|
|
322 |
array message_types = { |
array message_types = { |
323 |
"org.nongnu.storm.p2p.tapestry.StormErrorMsg", |
"org.nongnu.storm.p2p.tapestry.StormErrorMsg", |
346 |
} |
} |
347 |
|
|
348 |
// Handles *all* events which stage is listening. |
// Handles *all* events which stage is listening. |
349 |
// (Mandatory: sandStorm requires this) |
// (Mandatory: Sandstorm requires this) |
350 |
method handleEvents(QueueElementIF array items) |
method handleEvents(QueueElementIF array items) |
351 |
throws EventHandlerException { |
throws EventHandlerException { |
352 |
|
|
356 |
|
|
357 |
// Handles single event for this stage. handleEvents |
// Handles single event for this stage. handleEvents |
358 |
// method gives an item to this method as a parameter. |
// method gives an item to this method as a parameter. |
359 |
// (Mandatory: sandStorm requires this) |
// (Mandatory: Sandstorm requires this) |
360 |
method handleEvent(QueueElementIF item) { |
method handleEvent(QueueElementIF item) { |
361 |
|
|
362 |
if (item instanceof StagesInitializedSignal) { |
if (item instanceof StagesInitializedSignal) { |
456 |
|
|
457 |
// Sandstorm calls this method when it cleanups a stage. |
// Sandstorm calls this method when it cleanups a stage. |
458 |
method destroy() { |
method destroy() { |
459 |
// We do not have to anything here since SandStorm does not use |
// We do not have to anything here since Sandstorm does not use |
460 |
// this method. |
// this method. |
461 |
} |
} |
462 |
} |
} |