Examples of ObjectExistsException


Examples of net.sf.archimede.model.ObjectExistsException

        } catch (PathNotFoundException e) {
            throw new RuntimeException(e);
        } catch (LockException e) {
            throw new ObjectLockedException(storedFile);
        } catch (ItemExistsException e) {
            throw new ObjectExistsException(storedFile);
        } catch (RepositoryException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

Examples of net.sf.archimede.model.ObjectExistsException

            log.info("Folder : " + folder.getName() + "[" + folder.getId() + "] has been marked for removal.");
                       
        } catch (LockException e) {
      throw new ObjectLockedException(folder);
    } catch (ItemExistsException e) {
      throw new ObjectExistsException(folder);
    } catch (RepositoryException e) {
      throw new RuntimeException(e);
    }
    }
View Full Code Here

Examples of net.sf.archimede.model.ObjectExistsException

        } catch (PathNotFoundException e) {
            throw new RuntimeException(e);
        } catch (LockException e) {
            throw new ObjectLockedException(folder);
        } catch (ItemExistsException e) {
            throw new ObjectExistsException(folder);
        } catch (RepositoryException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

Examples of net.sf.ehcache.ObjectExistsException

    /**
     * Allows BeanHandler to add disk store location to the configuration.
     */
    public final void addDiskStore(DiskStoreConfiguration diskStoreConfigurationParameter) throws ObjectExistsException {
        if (diskStoreConfiguration != null) {
            throw new ObjectExistsException("The Disk Store has already been configured");
        }
        diskStoreConfiguration = diskStoreConfigurationParameter;
    }
View Full Code Here

Examples of net.sf.ehcache.ObjectExistsException

    /**
     * Allows BeanHandler to add a default configuration to the configuration.
     */
    public final void addDefaultCache(CacheConfiguration defaultCacheConfiguration) throws ObjectExistsException {
        if (this.defaultCacheConfiguration != null) {
            throw new ObjectExistsException("The Default Cache has already been configured");
        }
        this.defaultCacheConfiguration = defaultCacheConfiguration;
    }
View Full Code Here

Examples of net.sf.ehcache.ObjectExistsException

    /**
     * Allows BeanHandler to add Cache Configurations to the configuration.
     */
    public final void addCache(CacheConfiguration cacheConfiguration) throws ObjectExistsException {
        if (cacheConfigurations.get(cacheConfiguration.name) != null) {
            throw new ObjectExistsException("Cannot create cache: " + cacheConfiguration.name
                    + " with the same name as an existing one.");
        }
        if (cacheConfiguration.name.equalsIgnoreCase(net.sf.ehcache.Cache.DEFAULT_CACHE_NAME)) {
            throw new ObjectExistsException("The Default Cache has already been configured");
        }

        cacheConfigurations.put(cacheConfiguration.name, cacheConfiguration);
    }
View Full Code Here

Examples of org.apache.jcs.access.exception.ObjectExistsException

    public void putSafe( Object key, Object value )
        throws CacheException
    {
        if ( cacheControl.get( ( Serializable ) key ) != null )
        {
            throw new ObjectExistsException( "Object exists for key " + key );
        }
        else
        {
            put( key, value );
        }
View Full Code Here

Examples of org.apache.jcs.access.exception.ObjectExistsException

    public void putSafe( Object key, Object value )
        throws CacheException
    {
        if ( this.cacheControl.get( (Serializable) key ) != null )
        {
            throw new ObjectExistsException( "putSafe failed.  Object exists in the cache for key [" + key
                + "].  Remove first or use a non-safe put to override the value." );
        }
        put( key, value );
    }
View Full Code Here

Examples of org.apache.openjpa.util.ObjectExistsException

            // ACT_RUN
            PersistenceCapable pc;
            if (sm != null) {
                if (sm.isDetached())
                    throw new ObjectExistsException(_loc.get
                        ("persist-detached", Exceptions.toString(obj))).
                        setFailedObject(obj);

                if (!sm.isEmbedded()) {
                    sm.persist();
                    _cache.persist(sm);
                    if ((action & OpCallbacks.ACT_CASCADE) != 0)
                        sm.cascadePersist(call);
                    return sm;
                }

                // an embedded field; notify the owner that the value has
                // changed by becoming independently persistent
                sm.getOwner().dirty(sm.getOwnerMetaData().
                    getFieldMetaData().getIndex());
                _cache.persist(sm);
                pc = sm.getPersistenceCapable();
            } else {
                pc = assertPersistenceCapable(obj);
                if (pc.pcIsDetached() == Boolean.TRUE)
                    throw new ObjectExistsException(_loc.get
                        ("persist-detached", Exceptions.toString(obj))).
                        setFailedObject(obj);
            }

            ClassMetaData meta = _conf.getMetaDataRepositoryInstance().
                getMetaData(obj.getClass(), _loader, true);
            fireLifecycleEvent(obj, null, meta, LifecycleEvent.BEFORE_PERSIST);

            // create id for instance
            if (id == null) {
                if (meta.getIdentityType() == ClassMetaData.ID_APPLICATION)
                    id = ApplicationIds.create(pc, meta);
                else if (meta.getIdentityType() == ClassMetaData.ID_UNKNOWN)
                    throw new UserException(_loc.get("meta-unknownid", meta));
                else
                    id = StateManagerId.newInstance(this);
            }

            // make sure we don't already have the instance cached
            StateManagerImpl other = getStateManagerImplById(id, false);
            if (other != null && !other.isDeleted() && !other.isNew())
                throw new ObjectExistsException(_loc.get("cache-exists",
                    obj.getClass().getName(), id)).setFailedObject(obj);

            // if had embedded sm, null it
            if (sm != null)
                pc.pcReplaceStateManager(null);
View Full Code Here

Examples of org.apache.openjpa.util.ObjectExistsException

        switch (errorType) {
        case StoreException.LOCK:
            storeEx = new LockException(failed);
            break;
        case StoreException.OBJECT_EXISTS:
            storeEx = new ObjectExistsException(msg);
            break;
        case StoreException.OBJECT_NOT_FOUND:
            storeEx = new ObjectNotFoundException(failed);
            break;
        case StoreException.OPTIMISTIC:
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.