Package org.apache.ojb.broker.metadata

Examples of org.apache.ojb.broker.metadata.MetadataException


            return (PersistentField) ClassHelper.newInstance(persistentFieldClassName, METHOD_PARAMETER_TYPES, args);
           
        }
        catch (Exception ex)
        {
            throw new MetadataException("Error creating PersistentField: " +
                    attributeType.getName() + ", " + attributeName, ex);
        }
    }
View Full Code Here


                    fld.setAccessible(true);
                }
            }
            catch (NoSuchFieldException e)
            {
                throw new MetadataException("Can't find member '"
                        + fieldName + "' in class " + (fld != null ? fld.getDeclaringClass() : rootObjectType), e);
            }
            result.add(fld);
        }
        return result;
View Full Code Here

            {
                value = ClassHelper.newInstance(cld.getBaseClass());
            }
            catch (Exception e)
            {
                throw new MetadataException(e);
            }
            putToFieldCache(obj, value);
        }

        copyObjectToObject(obj, value);
View Full Code Here

            }
            this.applicationCache = (ObjectCacheInternal) temp;
        }
        catch(Exception e)
        {
            throw new MetadataException("Can't setup application cache. Specified application cache was '"
                    + applicationCacheName + "', copy strategy was '" + copyStrategyName + "'", e);
        }
        if(log.isEnabledFor(Logger.INFO))
        {
            ToStringBuilder buf = new ToStringBuilder(this);
View Full Code Here

    {
        _collectionProxyConstructor = retrieveCollectionProxyConstructor(collectionProxyClass, Collection.class, "CollectionProxyClass");
        // we also require the class to be a subclass of ManageableCollection
        if (!ManageableCollection.class.isAssignableFrom(collectionProxyClass))
        {
            throw new MetadataException("Illegal class "+collectionProxyClass.getName()+
                                        " specified for CollectionProxyClass. Must be a concrete subclass of "+
                                        ManageableCollection.class.getName());
        }
    }
View Full Code Here

            //          (instead of all active class-mappings).
            final Object key = mm.getCurrentProfileKey();
            if (key == null)
            {
                // mkalen:  Unsupported: using proxies with per-thread metadata changes without profile keys.
                throw new MetadataException("Trying to create a Collection proxy with per-thread metadata changes enabled, but no profile key.");
            }
            setProfileKey(key);
        }
        setBrokerKey(brokerKey);
        setCollectionClass(collClass);
View Full Code Here

     */
    public static void setIndirectionHandlerClass(Class indirectionHandlerClass)
    {
        if (indirectionHandlerClass == null)
        {
            throw new MetadataException("No IndirectionHandlerClass specified.");
        }
        if (indirectionHandlerClass.isInterface() ||
            Modifier.isAbstract(indirectionHandlerClass.getModifiers()) ||
            !IndirectionHandler.class.isAssignableFrom(indirectionHandlerClass))
        {
            throw new MetadataException("Illegal class "+indirectionHandlerClass.getName()+" specified for IndirectionHandlerClass. Must be a concrete subclass of "+IndirectionHandler.class.getName());
        }

        Class[] paramType = {PBKey.class, Identity.class};

        try
        {
            _indirectionHandlerConstructor = indirectionHandlerClass.getConstructor(paramType);
        }
        catch (NoSuchMethodException ex)
        {
            throw new MetadataException("The class "+indirectionHandlerClass.getName()+" specified for IndirectionHandlerClass"+
                                        " is required to have a public constructor with signature ("+
                                        PBKey.class.getName()+", "+Identity.class.getName()+").");
        }
    }
View Full Code Here

     */
    private static Constructor retrieveCollectionProxyConstructor(Class proxyClass, Class baseType, String typeDesc)
    {
        if (proxyClass == null)
        {
            throw new MetadataException("No "+typeDesc+" specified.");
        }
        if (proxyClass.isInterface() ||
            Modifier.isAbstract(proxyClass.getModifiers()) ||
            !baseType.isAssignableFrom(proxyClass))
        {
            throw new MetadataException("Illegal class "+proxyClass.getName()+" specified for "+typeDesc+". Must be a concrete subclass of "+baseType.getName());
        }

        Class[] paramType = {PBKey.class, Class.class, Query.class};

        try
        {
            return proxyClass.getConstructor(paramType);
        }
        catch (NoSuchMethodException ex)
        {
            throw new MetadataException("The class "+proxyClass.getName()+" specified for "+
                                        typeDesc+" is required to have a public constructor with signature ("+
                                        PBKey.class.getName()+", "+Class.class.getName()+", "+Query.class.getName()+").");
        }
    }
View Full Code Here

            // [tomdz] There seems to be no use of this setting ?
            //properties.put("valid", "false");
        }
        catch (Exception ex)
        {
            throw new MetadataException("An error happend while loading the properties file '"+filename+"'", ex);
        }
    }
View Full Code Here

            {
                throw (MetadataException)ex;
            }
            else
            {
                throw new MetadataException(ex);
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.ojb.broker.metadata.MetadataException

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.