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

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


    private String destinationName = "foo.bar";
    private SynchronizedBoolean started;
   
   
    protected void setUp() throws Exception{
        started = new SynchronizedBoolean(false);
        ActiveMQConnectionFactory fac = new ActiveMQConnectionFactory("vm://localhost");
        connection = fac.createConnection();
        session = connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
        destination = session.createTopic(destinationName);
        connection.start();
View Full Code Here


    private Thread thread; //need to change this - and use a thread pool
    private PacketListener sendListener;
    private VmTransportChannel clientSide;

    public VmTransportChannel() {
        closed = new SynchronizedBoolean(false);
        started = new SynchronizedBoolean(false);
    }
View Full Code Here


    public CompositeTransportChannel(WireFormat wireFormat) {
        super(wireFormat);
        this.uris = Collections.synchronizedList(new ArrayList());
        closed = new SynchronizedBoolean(false);
        started = new SynchronizedBoolean(false);
    }
View Full Code Here

     * @param wireFormat
     */
    protected TcpTransportChannel(WireFormat wireFormat) {
        super(wireFormat);
        this.wireFormatLoader = new WireFormatLoader(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

     * @param channelName
     * @throws JMSException
     */
    public MulticastDiscoveryAgent(String channelName) throws JMSException {
        this.channelName = channelName;
        this.started = new SynchronizedBoolean(false);
        this.services = new ConcurrentHashMap();
        this.keepAliveMap = new ConcurrentHashMap();
        this.idGen = new IdGenerator();
        this.localId = idGen.generateId();
        this.keepAliveTimeout = DEFAULT_KEEP_ALIVE_TIMEOUT;
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

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

    this.consumerNumberGenerator = new SynchronizedInt(0);
    this.sessions = new CopyOnWriteArrayList();
    this.messageDispatchers = new CopyOnWriteArrayList();
    this.connectionConsumers = new CopyOnWriteArrayList();
    this.connectionMetaData = new ActiveMQConnectionMetaData();
    this.started = new SynchronizedBoolean(false);
    this.startTime = System.currentTimeMillis();
    this.prefetchPolicy = new ActiveMQPrefetchPolicy();
    this.memoryManager = new MemoryBoundedObjectManager(clientID,
        DEFAULT_CONNECTION_MEMORY_LIMIT);
    this.boundedQueueManager = new MemoryBoundedQueueManager(memoryManager);
View Full Code Here

    public void testClose() {
        /** @todo: Insert test code here. Use assertEquals(), for example. */
        final MemoryBoundedQueue queue = getQueueManager().getMemoryBoundedQueue(QUEUE_NAME);
        getMemoryManager().setValueLimit(TEST_ENQUEUE_SIZE);
        final SynchronizedBoolean success = new SynchronizedBoolean(false);
        final MemoryBoundedQueue q1 = getQueueManager().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 = getQueueManager().getMemoryBoundedQueue(QUEUE_NAME);
        assertTrue(queue != q2);
    }
View Full Code Here

     */
    public TransientTopicBoundedMessageManager(MemoryBoundedQueueManager mgr) {
        this.queueManager = mgr;
        this.containers = new ConcurrentHashMap();
        this.filterFactory = new FilterFactoryImpl();
        this.started = new SynchronizedBoolean(false);
    }
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.