Mercurial > hg > blitz_condensed
comparison src/org/dancres/blitz/util/QueueStatGenerator.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.util; | |
2 | |
3 import org.dancres.blitz.stats.StatGenerator; | |
4 import org.dancres.blitz.stats.Stat; | |
5 import org.dancres.blitz.stats.TaskQueueStat; | |
6 import EDU.oswego.cs.dl.util.concurrent.BoundedLinkedQueue; | |
7 | |
8 /** | |
9 */ | |
10 public class QueueStatGenerator implements StatGenerator { | |
11 private long theId = StatGenerator.UNSET_ID; | |
12 | |
13 private String _queueName; | |
14 private BoundedLinkedQueue _channel; | |
15 | |
16 public QueueStatGenerator(String aName, BoundedLinkedQueue aQueue) { | |
17 _queueName = aName; | |
18 _channel = aQueue; | |
19 } | |
20 | |
21 public long getId() { | |
22 return theId; | |
23 } | |
24 | |
25 public void setId(long anId) { | |
26 theId = anId; | |
27 } | |
28 | |
29 public Stat generate() { | |
30 return new TaskQueueStat(theId, _queueName, _channel.size()); | |
31 } | |
32 } |