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

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


        this.acknowledgeMode = theAcknowledgeMode;
        this.consumers = new CopyOnWriteArrayList();
        this.producers = new CopyOnWriteArrayList();
        this.transactionIdGenerator = new IdGenerator();
        this.temporaryDestinationGenerator = new IdGenerator();
        this.closed = new SynchronizedBoolean(false);
        this.startTransaction = new SynchronizedBoolean(false);
        this.sessionId = connection.generateSessionId();
        this.startTime = System.currentTimeMillis();
        this.deliveredMessages = new DefaultQueueList();
        this.messageExecutor = new ActiveMQSessionExecutor(this, connection.getMemoryBoundedQueue("Session("
                + sessionId + ")"));
View Full Code Here


        this.containers = new ConcurrentHashMap();
        this.destinationMap = new DestinationMap();
        this.destinations = new ConcurrentHashMap();
        this.subscriptions = new ConcurrentHashMap();
        this.filterFactory = new FilterFactoryImpl();
        this.started = new SynchronizedBoolean(false);
        this.doingGarbageCollection = new SynchronizedBoolean(false);
        this.threadPool = new PooledExecutor();
        this.threadPool.setThreadFactory(new TransientQueueThreadFactory());
        this.inactiveTimeout = DEFAULT_INACTIVE_TIMEOUT;
        this.garbageCoolectionCapacityLimit = DEFAULT_GARBAGE_COLLECTION_CAPACITY_LIMIT;
    }
View Full Code Here

        this.containers = new ConcurrentHashMap();
        this.subscriptions = new ConcurrentHashMap();
        this.destinationMap = new DestinationMap();
        this.destinations = new ConcurrentHashMap();
        this.filterFactory = new FilterFactoryImpl();
        this.started = new SynchronizedBoolean(false);
    }
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.closed = new SynchronizedBoolean(false);
        this.started = new SynchronizedBoolean(false);
        this.startTime = System.currentTimeMillis();
        this.prefetchPolicy = new ActiveMQPrefetchPolicy();
        this.boundedQueueManager = new MemoryBoundedQueueManager(clientID, DEFAULT_CONNECTION_MEMORY_LIMIT);
        this.boundedQueueManager.addCapacityEventListener(this);
        boolean transactional = this instanceof XAConnection;
View Full Code Here

    public TransientTopicBoundedMessageContainer(MessageContainerManager manager, BrokerClient client,
            BoundedActiveMQMessageQueue queue) {
        this.manager = manager;
        this.client = client;
        this.queue = queue;
        this.started = new SynchronizedBoolean(false);
        this.subscriptions = new CopyOnWriteArrayList();
        this.log = LogFactory.getLog("TransientTopicBoundedMessageContainer:- " + client);
    }
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

     * @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

    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 Session session;
    private SynchronizedBoolean started;
   
   
    protected void setUp() throws Exception{
        started = new SynchronizedBoolean(false);
        fac = new ActiveMQConnectionFactory("vm://localhost");
        connection = fac.createConnection();
        session = connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
        connection.start();
    }
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.