Examples of QueueKey


Examples of org.mule.util.queue.objectstore.QueueKey

        QueuePersistenceObjectStore<Serializable> store = getObjectStore();

        String id = UUID.getUUID();
        File storeFile = createAndPopulateStoreFile(id, TEST_MESSAGE);

        QueueKey key = new QueueKey(QUEUE_NAME, id);
        store.remove(key);

        assertFalse(storeFile.exists());
    }
View Full Code Here

Examples of org.mule.util.queue.objectstore.QueueKey

    @Test
    public void testMonitoredWrapper() throws Exception
    {
        QueuePersistenceObjectStore<Serializable> store = getObjectStore();
        String id = UUID.getUUID();
        QueueKey key = new QueueKey(QUEUE_NAME, id);
        MuleMessage msg = new DefaultMuleMessage("Hello", mockMuleContext);
        MuleEvent event = new DefaultMuleEvent(msg, MessageExchangePattern.ONE_WAY, (FlowConstruct) null);

        ListableObjectStore<Serializable> monitored = new MonitoredObjectStoreWrapper(store);
        monitored.store(key, event);
View Full Code Here

Examples of org.mule.util.queue.objectstore.QueueKey

                id = id.substring(beginIndex, length);

                String queue = id.substring(0, id.indexOf(File.separator));
                id = id.substring(queue.length() + 1);

                keys.add(new QueueKey(queue, id));
            }
        }
    }
View Full Code Here

Examples of org.mule.util.queue.objectstore.QueueKey

        return deserialize(file);
    }

    protected File createStoreFile(Serializable key) throws ObjectStoreException
    {
        QueueKey queueKey = (QueueKey) key;

        String filename = queueKey.id + FILE_EXTENSION;
        String path = queueKey.queueName + File.separator + filename;

        try
View Full Code Here

Examples of org.mule.util.queue.objectstore.QueueKey

    private void removeUnhealthyFiles() throws ObjectStoreException
    {
        List<Serializable> keys = allKeys();
        for (Serializable key : keys)
        {
            QueueKey qkey = (QueueKey) key;
            String fileName = storeDirectory + File.separator + qkey.queueName + File.separator + qkey.id
                              + FILE_EXTENSION;
            File file = new File(fileName);
            if (file.length() == 0)
            {
View Full Code Here

Examples of org.mule.util.queue.objectstore.QueueKey

    }

    @Override
    public boolean contains(Serializable key) throws ObjectStoreException
    {
        return getStore().contains(new QueueKey(partitionName, key));
    }
View Full Code Here

Examples of org.mule.util.queue.objectstore.QueueKey

    @Override
    public void store(Serializable key, T value) throws ObjectStoreException
    {
        // This required because QueuePersistenceObject store will NOT complain in
        // cases where object already exists!
        QueueKey qKey = new QueueKey(partitionName, key);
        synchronized (this)
        {
            if (getStore().contains(qKey))
            {
                throw new ObjectAlreadyExistsException();
View Full Code Here

Examples of org.mule.util.queue.objectstore.QueueKey

    }

    @Override
    public T retrieve(Serializable key) throws ObjectStoreException
    {
        return getStore().retrieve(new QueueKey(partitionName, key));
    }
View Full Code Here

Examples of org.mule.util.queue.objectstore.QueueKey

    }

    @Override
    public T remove(Serializable key) throws ObjectStoreException
    {
        return getStore().remove(new QueueKey(partitionName, key));
    }
View Full Code Here

Examples of org.mule.util.queue.objectstore.QueueKey

        // TODO this is NOT efficient!
        List<Serializable> results = new ArrayList<Serializable>();
        List<Serializable> keys = getStore().allKeys();
        for (Serializable key : keys)
        {
            QueueKey qKey = (QueueKey) key;
            if (qKey.queueName.equals(partitionName))
            {
                results.add(qKey.id);
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.