Package org.mule.api.store

Examples of org.mule.api.store.ObjectStoreException


    @Test(expected = MessagingException.class)
    @SuppressWarnings("unchecked")
    public void storeAuthorizationEventOnFailingOS() throws Exception
    {
        ObjectStore<Serializable> failingOS = Mockito.mock(ObjectStore.class);
        Mockito.doThrow(new ObjectStoreException())
            .when(failingOS)
            .store(Mockito.any(Serializable.class), Mockito.any(Serializable.class));
        this.manager.setAccessTokenObjectStore(failingOS);
        this.manager.storeAuthorizationEvent(this.event);
    }
View Full Code Here


    @SuppressWarnings("unchecked")
    public void restoreAuthorizationEventFromFailingObjectStore() throws Exception
    {
        ObjectStore<Serializable> failingOS = Mockito.mock(ObjectStore.class);
        Mockito.when(failingOS.retrieve(Mockito.any(Serializable.class))).thenThrow(
            new ObjectStoreException());
        this.manager.setAccessTokenObjectStore(failingOS);
        this.manager.restoreAuthorizationEvent(eventId);
    }
View Full Code Here

    @Override
    public boolean contains(Serializable key) throws ObjectStoreException
    {
        if (key == null)
        {
            throw new ObjectStoreException(CoreMessages.objectIsNull("id"));
        }

        synchronized (store)
        {
            return store.values().contains(new StoredObject<T>(key, null));
View Full Code Here

    @Override
    public void store(Serializable id, T value) throws ObjectStoreException
    {
        if (id == null)
        {
            throw new ObjectStoreException(CoreMessages.objectIsNull("id"));
        }

        // this block is unfortunately necessary to counter a possible race condition
        // between multiple nonatomic calls to containsObject/storeObject
        StoredObject<T> obj = new StoredObject<T>(id, value);
View Full Code Here

        {
            FileUtils.cleanDirectory(this.partitionDirectory);
        }
        catch (IOException e)
        {
            throw new ObjectStoreException(MessageFactory.createStaticMessage("Could not clear ObjectStore"),
                e);
        }

        if (realKeyToUUIDIndex != null)
        {
View Full Code Here

        }
        catch (Exception e)
        {
            String message = String.format("Could not restore object store data from %1s",
                partitionDirectory.getAbsolutePath());
            throw new ObjectStoreException(CoreMessages.createStaticMessage(message));
        }
    }
View Full Code Here

                throw new MuleRuntimeException(message);
            }
        }
        catch (Exception e)
        {
            throw new ObjectStoreException(e);
        }
    }
View Full Code Here

        {
            return FileUtils.newFile(partitionDirectory, filename);
        }
        catch (MuleRuntimeException mre)
        {
            throw new ObjectStoreException(mre);
        }
    }
View Full Code Here

            }
            return partitionDescriptorFile;
        }
        catch (Exception e)
        {
            throw new ObjectStoreException(e);
        }
    }
View Full Code Here

            ObjectOutputStream objectOutputStream = new ObjectOutputStream(out);
            SerializationUtils.serialize(storeValue, objectOutputStream);
        }
        catch (Exception se)
        {
            throw new ObjectStoreException(se);
        }
        finally
        {
            if (out != null)
            {
View Full Code Here

TOP

Related Classes of org.mule.api.store.ObjectStoreException

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.