Package org.mule.api.store

Examples of org.mule.api.store.ObjectStoreException


            FileOutputStream out = new FileOutputStream(outputFile);
            SerializationUtils.serialize(value, out);
        }
        catch (SerializationException se)
        {
            throw new ObjectStoreException(se);
        }
        catch (FileNotFoundException fnfe)
        {
            throw new ObjectStoreException(fnfe);
        }
    }
View Full Code Here


        catch (MuleRuntimeException mre)
        {
            // FileUtils throws a MuleRuntimeException if something goes wrong when creating the
            // path. To fully conform to the ObjectStore contract we cannot just let it bubble
            // through but rather catch it and re-throw as ObjectStoreException
            throw new ObjectStoreException(mre);
        }
    }
View Full Code Here

            FileInputStream in = new FileInputStream(file);
            return (T)SerializationUtils.deserialize(in, muleContext);
        }
        catch (SerializationException se)
        {
            throw new ObjectStoreException(se);
        }
        catch (FileNotFoundException fnfe)
        {
            throw new ObjectStoreException(fnfe);
        }
    }
View Full Code Here

        {
            if (!file.delete())
            {
                Message message =
                    CoreMessages.createStaticMessage("Deleting " + file.getAbsolutePath() + " failed");
                throw new ObjectStoreException(message);
            }
        }
        else
        {
            throw new ObjectDoesNotExistException();
View Full Code Here

    @Override
    protected void doStore(Serializable key, T value) throws ObjectStoreException
    {
        if (value == null)
        {
            throw new ObjectStoreException(CoreMessages.objectIsNull("value"));
        }

        map.put(key, value);
    }
View Full Code Here

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

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

            buf.append(id).append("=").append(item.toString()).append(IOUtils.LINE_SEPARATOR);
            output.write(buf.toString().getBytes());
        }
        catch (IOException iox)
        {
            throw new ObjectStoreException(iox);
        }
    }
View Full Code Here

        @Override
        public boolean contains(Serializable key) throws ObjectStoreException
        {
            if (key == null)
            {
                throw new ObjectStoreException();
            }
            boolean containsKey;
            synchronized (this)
            {
                // avoiding deadlock with the latch (locks if the element was already added to map, see definition of
View Full Code Here

        public void store(Serializable key, String value) throws ObjectStoreException
        {
            boolean wasAdded;
            if (key == null)
            {
                throw new ObjectStoreException();
            }
            synchronized (map) // map is shared
            {
                wasAdded = map.containsKey(key);
                map.put(key, value);
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.