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

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


    private SynchronizedBoolean started;

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


     * @throws JMSException
     */
    public TcpTransportServerChannel(WireFormat wireFormat, URI bindAddr) throws JMSException {
        super(bindAddr);
        this.wireFormat = wireFormat;
        closed = new SynchronizedBoolean(false);
        started = new SynchronizedBoolean(false);
        try {
            serverSocket = createServerSocket(bindAddr);
            serverSocket.setSoTimeout(2000);
            updatePhysicalUri(bindAddr);
        }
View Full Code Here

    public TcpTransportServerChannel(WireFormat wireFormat, ServerSocket serverSocket) throws JMSException {
        super(serverSocket.getInetAddress().toString());
        this.wireFormat = wireFormat;
        this.serverSocket = serverSocket;
        closed = new SynchronizedBoolean(false);
        started = new SynchronizedBoolean(false);
        InetAddress address = serverSocket.getInetAddress();
        try {
            updatePhysicalUri(new URI("tcp", "", address.getHostName(), 0, "", "", ""));
        }
        catch (URISyntaxException e) {
View Full Code Here

     */
    public TransientQueueBoundedMessageContainer(MemoryBoundedQueueManager queueManager, ActiveMQDestination destination) {
        this.queueManager = queueManager;
        this.destination = destination;
        this.queue = queueManager.getMemoryBoundedQueue("TRANSIENT_QUEUE:-" + destination.getPhysicalName());
        this.started = new SynchronizedBoolean(false);
        this.subscriptions = new DefaultQueueList();
        this.log = LogFactory.getLog("TransientQueueBoundedMessageContainer:- " + destination);
    }
View Full Code Here

    /**
     * Construct basic helpers
     */
    protected TcpTransportChannel(WireFormat wireFormat) {
        this.wireFormat = wireFormat;
        closed = new SynchronizedBoolean(false);
        started = new SynchronizedBoolean(false);
        // there's not much point logging all exceptions, lets just keep a few around
        exceptionsList = new BoundedLinkedQueue(10);
        outboundLock = new Object();
        if (useAsyncSend) {
            executor = new PooledExecutor(new BoundedBuffer(1000), 1);
View Full Code Here

    /**
     * Construct basic helpers
     */
    protected UdpTransportChannel(WireFormat wireFormat) {
        this.wireFormat = wireFormat;
        closed = new SynchronizedBoolean(false);
        started = new SynchronizedBoolean(false);
        lock = new Object();
    }
View Full Code Here

    private SynchronizedBoolean started;

    public UdpTransportServerChannel(URI bindAddr) {
        super(bindAddr);
        started = new SynchronizedBoolean(false);
    }
View Full Code Here

    private SynchronizedBoolean started;

    public VmTransportServerChannel(URI bindAddr) {
        super(bindAddr);
        started = new SynchronizedBoolean(false);
    }
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

    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

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.