jdk/test/javax/management/monitor/ThreadPoolTest.java
author mikejwre
Thu, 03 Dec 2009 12:52:46 -0800
changeset 4400 6f7b7cb74a72
parent 2 90ce3da70b43
child 5506 202f599c92aa
permissions -rw-r--r--
Added tag jdk7-b77 for changeset a9713976af74
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
 * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 * CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
 * @test
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
 * @bug 6222826 6379712
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
 * @summary Test that all monitors will be well started when sharing
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
 * a single thread pool.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 * @author Luis-Miguel Alventosa
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 * @run clean ThreadPoolTest
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 * @run build ThreadPoolTest
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * @run main/othervm/timeout=300 ThreadPoolTest 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * @run main/othervm/timeout=300 ThreadPoolTest 2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * @run main/othervm/timeout=300 ThreadPoolTest 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * @run main/othervm/timeout=300 -Djmx.x.monitor.maximum.pool.size=5 ThreadPoolTest 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * @run main/othervm/timeout=300 -Djmx.x.monitor.maximum.pool.size=5 ThreadPoolTest 2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * @run main/othervm/timeout=300 -Djmx.x.monitor.maximum.pool.size=5 ThreadPoolTest 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * @run main/othervm/timeout=300 -Djmx.x.monitor.maximum.pool.size=-5 ThreadPoolTest 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * @run main/othervm/timeout=300 -Djmx.x.monitor.maximum.pool.size=-5 ThreadPoolTest 2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * @run main/othervm/timeout=300 -Djmx.x.monitor.maximum.pool.size=-5 ThreadPoolTest 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
import java.util.concurrent.atomic.AtomicInteger;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
import javax.management.MBeanServer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
import javax.management.MBeanServerFactory;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
import javax.management.Notification;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
import javax.management.NotificationListener;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
import javax.management.ObjectName;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
import javax.management.monitor.CounterMonitor;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
import javax.management.monitor.GaugeMonitor;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
import javax.management.monitor.Monitor;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
import javax.management.monitor.MonitorNotification;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
import javax.management.monitor.StringMonitor;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
public class ThreadPoolTest {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
    static int maxPoolSize;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
    static int nTasks;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
    private static Waiter waiter;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
    static final long MAX_WAITING_TIME = 10000;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
    // MBean class
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    public class ObservedObject implements ObservedObjectMBean {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
        private boolean called = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
        public Integer getInteger() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
            inform("getInteger()");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
            return 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
        public Double getDouble() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
            inform("getDouble()");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
            return 0.0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
        public String getString() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
            inform("getString()");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
            return "";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
        private void inform(String prop) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
            synchronized(waiter) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
                if (!called) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
                    called = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
                    waiter.count();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
            echo(">>> TASK "+prop+" is called.");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
    // MBean interface
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
    public interface ObservedObjectMBean {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
        public Integer getInteger();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
        public Double getDouble();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
        public String getString();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
     * Run test
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    public int runTest(int monitorType) throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
        ObjectName[] mbeanNames = new ObjectName[nTasks];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
        ObservedObject[] monitored = new ObservedObject[nTasks];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
        ObjectName[] monitorNames = new ObjectName[nTasks];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
        Monitor[] monitor = new Monitor[nTasks];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
        String[] attributes = { "Integer", "Double", "String" };
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
            echo(">>> CREATE MBeanServer");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
            MBeanServer server = MBeanServerFactory.newMBeanServer();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
            String domain = server.getDefaultDomain();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
            for (int i = 0; i < nTasks; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
                mbeanNames[i] =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
                    new ObjectName(":type=ObservedObject,instance=" + (i + 1));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
                monitored[i] = new ObservedObject();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
                echo(">>> CREATE ObservedObject = " + mbeanNames[i].toString());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
                server.registerMBean(monitored[i], mbeanNames[i]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
                switch (monitorType) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
                case 1:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
                    monitorNames[i] = new ObjectName(":type=CounterMonitor," +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
                                                     "instance=" + (i + 1));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
                    monitor[i] = new CounterMonitor();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
                    break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
                case 2:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
                    monitorNames[i] = new ObjectName(":type=GaugeMonitor," +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
                                                     "instance=" + (i + 1));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
                    monitor[i] = new GaugeMonitor();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
                    break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
                case 3:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
                    monitorNames[i] = new ObjectName(":type=StringMonitor," +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
                                                     "instance=" + (i + 1));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
                    monitor[i] = new StringMonitor();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
                    break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
                default:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
                    echo("Unsupported monitor type");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
                    return 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
                echo(">>> CREATE Monitor = " + monitorNames[i].toString());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
                server.registerMBean(monitor[i], monitorNames[i]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
                monitor[i].addObservedObject(mbeanNames[i]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
                monitor[i].setObservedAttribute(attributes[monitorType-1]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
                monitor[i].setGranularityPeriod(50);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
                monitor[i].start();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
            if (!waiter.waiting(MAX_WAITING_TIME)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
                echo("Error, not all "+nTasks+" monitor tasks are called after "
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
                     +MAX_WAITING_TIME);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
                return 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
        } finally {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
            for (int i = 0; i < nTasks; i++)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
                if (monitor[i] != null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
                    monitor[i].stop();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
        echo("All "+nTasks+" monitors are called.");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
        return 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
     * Print message
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
    private static void echo(String message) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
        System.out.println(message);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
     * Standalone entry point.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
     * Run the test and report to stdout.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
    public static void main (String args[]) throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
        Integer size = Integer.getInteger("jmx.x.monitor.maximum.pool.size");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
        if (size == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
            maxPoolSize = 10;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
            echo(">>> MAXIMUM POOL SIZE = 10 [default value]");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
            maxPoolSize = size.intValue() < 1 ? 1 : size.intValue();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
            echo(">>> MAXIMUM POOL SIZE = " + maxPoolSize);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
        nTasks = maxPoolSize + 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
        waiter = new Waiter(nTasks);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
        ThreadPoolTest test = new ThreadPoolTest();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
        int error = test.runTest(Integer.parseInt(args[0]));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
        if (error > 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
            echo(">>> Unhappy Bye, Bye!");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
            throw new IllegalStateException(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
                "Test FAILED: Unexpected Maximum Pool Size Overflow!");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
            echo(">>> Happy Bye, Bye!");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
    private static class Waiter {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
        public Waiter(int waitedNB) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
            this.waitedNB = waitedNB;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
        public void count() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
            synchronized(this) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
                counted++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
                if (counted == waitedNB) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
                    this.notifyAll();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
        public boolean waiting(long timeout) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
            final long startTime = System.currentTimeMillis();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
            long toWait = timeout;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
            synchronized(this) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
                while(counted < waitedNB && toWait > 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
                    try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
                        this.wait(toWait);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
                    } catch (InterruptedException ire) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
                        break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
                    toWait = timeout -
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
                        (System.currentTimeMillis() - startTime);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
            return counted == waitedNB;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
        private int waitedNB;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
        private int counted = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
}