Package EDU.oswego.cs.dl.util.concurrent

Examples of EDU.oswego.cs.dl.util.concurrent.SynchronizedBoolean


     * @param queue
     */
    public TransientTopicBoundedMessageContainer(BrokerClient client, BoundedPacketQueue queue) {
        this.client = client;
        this.queue = queue;
        this.started = new SynchronizedBoolean(false);
        this.subscriptions = new CopyOnWriteArrayList();
        this.log = LogFactory.getLog("TransientTopicBoundedMessageContainer for client: " + client);
    }
View Full Code Here


public class CircularQueueTest extends TestCase {



    public void testStoppping() throws Exception {
        SynchronizedBoolean stopping = new SynchronizedBoolean(false);
        CircularQueue queue = new CircularQueue(10, stopping);
        for (int i = 0; i < 10; i++) {
            queue.returnObject(new Object());
        }
        stopping.set(true);
        int i=0;

        queue.drain();
    }
View Full Code Here

    public void testClose() {
        /** @todo: Insert test code here. Use assertEquals(), for example. */
        final MemoryBoundedQueue queue = queueManager.getMemoryBoundedQueue(QUEUE_NAME);
        queueManager.setValueLimit(TEST_ENQUEUE_SIZE);
        final SynchronizedBoolean success = new SynchronizedBoolean(false);
        final MemoryBoundedQueue q1 = queueManager.getMemoryBoundedQueue(QUEUE_NAME);
        assertTrue(queue == q1);
        Thread t = new Thread(new Runnable() {
            public void run() {
                try {
                    Thread.sleep(250);
                    queue.dequeue();
                }
                catch (Exception e) {
                    e.printStackTrace();
                }
                synchronized (success) {
                    success.set(true);
                    success.notify();
                }
            }
        });
        t.start();
        queue.close();
        try {
            synchronized (success) {
                if (!success.get()) {
                    success.wait(2000);
                }
            }
        }
        catch (Throwable e) {
            e.printStackTrace();
        }
        assertTrue(success.get());
      
        MemoryBoundedQueue q2 = queueManager.getMemoryBoundedQueue(QUEUE_NAME);
        assertTrue(queue != q2);
    }
View Full Code Here

    protected URI bindAddress;
    private SynchronizedBoolean started;

    public MulticastTransportServerChannel(WireFormat wireFormat, URI bindAddr) {
        this.bindAddress = bindAddr;
        started = new SynchronizedBoolean(false);
        log.info("ServerChannel at: " + bindAddress);
    }
View Full Code Here


    public CompositeTransportChannel(WireFormat wireFormat, URI[] uris) {
        this.wireFormat = wireFormat;
        this.uris = uris;
        closed = new SynchronizedBoolean(false);
        started = new SynchronizedBoolean(false);
    }
View Full Code Here

        this.producerIdGenerator = new IdGenerator();
        this.consumerIdGenerator = new IdGenerator();
        this.transactionIdGenerator = new IdGenerator();
        this.temporaryDestinationGenerator = new IdGenerator();
        this.packetIdGenerator = new IdGenerator();
        this.closed = new SynchronizedBoolean(false);
        this.startTransaction = new SynchronizedBoolean(false);
        this.sessionId = connection.generateSessionId();
        this.startTime = System.currentTimeMillis();
        this.deliveredMessages = new LinkedList();
        this.inboundMessages = new LinkedList();
        this.deliveryMutex = new Object();
View Full Code Here

    /**
     * Default Constructor of BrokerClientImpl
     */
    public BrokerClientImpl() {
        this.packetIdGenerator = new IdGenerator();
        this.closed = new SynchronizedBoolean(false);
        this.activeConsumers = new HashSet();
        this.consumers = new CopyOnWriteArrayList();
        this.producers = new CopyOnWriteArrayList();
        this.transactions = new CopyOnWriteArrayList();
        this.xatransactions = new CopyOnWriteArrayList();
View Full Code Here

        this.wireFormat = wireFormat;
        this.channel = channel;
        this.executor = executor;
        this.localAddress = channel.getLocalAddress();

        closed = new SynchronizedBoolean(false);
        started = new SynchronizedBoolean(false);
        outboundLock = new Object();
        if (useAsyncSend) {
            executor = new PooledExecutor(new BoundedBuffer(1000), 1);
        }
    }
View Full Code Here

     * @throws JMSException
     */
    public TcpTransportServerChannel(WireFormat wireFormat, URI bindAddr) throws JMSException {
        this.wireFormat = wireFormat;
        this.bindAddressURI = bindAddr.toString();
        closed = new SynchronizedBoolean(false);
        started = new SynchronizedBoolean(false);
        try {
            serverSocket = createServerSocket(bindAddr);
            log.info("Listening for connections at: " + bindAddr);
        }
        catch (Exception se) {
View Full Code Here

    }

    public TcpTransportServerChannel(WireFormat wireFormat, ServerSocket serverSocket) {
        this.wireFormat = wireFormat;
        this.serverSocket = serverSocket;
        closed = new SynchronizedBoolean(false);
        started = new SynchronizedBoolean(false);
        this.bindAddressURI = serverSocket.getInetAddress().toString();
        log.info("Listening for connections at: " + bindAddressURI);
    }
View Full Code Here

TOP

Related Classes of EDU.oswego.cs.dl.util.concurrent.SynchronizedBoolean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.