Mercurial > hg > blitz_condensed
comparison src/org/dancres/blitz/notify/SendTask.java @ 0:3dc0c5604566
Initial checkin of blitz 2.0 fcs - no installer yet.
author | Dan Creswell <dan.creswell@gmail.com> |
---|---|
date | Sat, 21 Mar 2009 11:00:06 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:3dc0c5604566 |
---|---|
1 package org.dancres.blitz.notify; | |
2 | |
3 import java.io.IOException; | |
4 | |
5 import java.util.logging.*; | |
6 | |
7 import net.jini.space.JavaSpace; | |
8 | |
9 import org.dancres.blitz.task.Task; | |
10 | |
11 import org.dancres.blitz.disk.DiskTxn; | |
12 | |
13 import org.dancres.blitz.mangler.MangledEntry; | |
14 | |
15 /** | |
16 <p> RemoteEvent dispatch occurs here. The generator is locked during | |
17 generation of the RemoteEvent and any logging that may be required. </p> | |
18 | |
19 <p> If we fail to deliver the event to the client we take some special | |
20 action. First we "taint" the generator to prevent further events being | |
21 processed/dispatched, then we schedule a cleanup task to remove the | |
22 registration associated with the generator. </p> | |
23 */ | |
24 class SendTask implements Task { | |
25 private EventGenerator theGenerator; | |
26 private JavaSpace theSource; | |
27 private DispatchTask theTask; | |
28 | |
29 SendTask(JavaSpace aSource, DispatchTask aTask, | |
30 EventGenerator aGenerator) { | |
31 | |
32 theSource = aSource; | |
33 theGenerator = aGenerator; | |
34 theTask = aTask; | |
35 } | |
36 | |
37 public void run() { | |
38 theGenerator.ping(theTask.getEvent(), theSource); | |
39 theTask.dispatched(); | |
40 } | |
41 } |