Package org.qi4j.api.common

Examples of org.qi4j.api.common.ConstructionException


        {
            throw new EntityCompositeAlreadyExistsException( identity );
        }
        catch( EntityStoreException e )
        {
            throw new ConstructionException( "Could not create new entity in store", e );
        }
    }
View Full Code Here


            if( injectionProvider == null && !optional )
            {
                String message =
                    "[Module "+resolution.module().name()+"] Non-optional @" + rawInjectionClass.getName() + " was not bound in " + injectedClass.getName();
                throw new ConstructionException( message );
            }
        }
        catch( InvalidInjectionException e )
        {
            throw new BindingException( "Could not bind dependency injection", e );
View Full Code Here

            {
                ex = ex.getCause();
            }

            String message = "[Module "+context.module().name()+"] InjectionProvider unable to resolve @" + injectionAnnotation.annotationType().getSimpleName()+" "+injectionType.toString();
            throw new ConstructionException( message, ex );
        }
        if( injectedValue == null && !optional )
        {
            String message = "[Module "+context.module().name()+"] Non-optional @" + injectionAnnotation.annotationType().getSimpleName()+" "+injectionType.toString() + " was null in " + injectedClass.getName();
            throw new ConstructionException( message );
        }
        return getInjectedValue( injectedValue );
    }
View Full Code Here

            injectedFieldsModel.inject( injectionContext, instance );
            injectedMethodsModel.inject( injectionContext, instance );
        }
        catch( Exception e )
        {
            throw new ConstructionException( "Could not instantiate " + objectType.getName(), e );
        }

        if( instance instanceof Initializable )
        {
            try
            {
                ( (Initializable) instance ).initialize();
            }
            catch( InitializationException e )
            {
                throw new ConstructionException( "Unable to initialize " + objectType, e );
            }
        }

        return instance;
    }
View Full Code Here

                handler.setMethod( invocationMethod );
                return handler;
            }
            catch( NoSuchMethodException e )
            {
                throw new ConstructionException( "Could not find modifier method", e );
            }
        }
    }
View Full Code Here

            }
            catch( InitializationException e )
            {
                Class<?> compositeType = compositeInstance.type();
                String message = "Unable to initialize " + mixinClass + " in composite " + compositeType;
                throw new ConstructionException( message, e );
            }
        }
        return mixin;
    }
View Full Code Here

                    instantiationClass = fragmentLoader.loadFragmentClass( fragmentClass );
                    instantiationClasses.put( fragmentClass, instantiationClass );
                }
                catch( ClassNotFoundException e )
                {
                    throw new ConstructionException( "Could not generate mixin subclass " + fragmentClass.getName(), e );
                }
                catch( VerifyError e )
                {
                    throw new ConstructionException( "Could not generate mixin subclass " + fragmentClass.getName(), e );
                }
            }
        }
        return instantiationClass;
    }
View Full Code Here

                    {
                        filter = (AppliesToFilter) appliesToClass.newInstance();
                    }
                    catch( Exception e )
                    {
                        throw new ConstructionException( e );
                    }
                }
                else if( Annotation.class.isAssignableFrom( appliesToClass ) )
                {
                    filter = new AnnotationAppliesToFilter( appliesToClass );
View Full Code Here

            {
                return Composite.class.cast( proxyConstructor.newInstance( invocationHandler ) );
            }
            catch( Exception e )
            {
                throw new ConstructionException( e );
            }
        } else
        {
            try
            {
                Object[] args = new Object[proxyConstructor.getParameterTypes().length];
                Composite composite = Composite.class.cast( proxyConstructor.newInstance( args ) );
                proxyClass.getField( "_instance" ).set( composite, invocationHandler );
                return composite;
            } catch( Exception e )
            {
                throw new ConstructionException( e );
            }
        }
    }
View Full Code Here

        {
            if( e.getTargetException() instanceof InvalidCompositeException )
            {
                throw (InvalidCompositeException) e.getTargetException();
            }
            throw new ConstructionException( "Could not instantiate " + constructor.getDeclaringClass(), e.getTargetException() );
        }
        catch( Throwable e )
        {
            System.err.println( constructor.toGenericString() );
            System.err.println( Arrays.asList( parametersInstance ) );
            throw new ConstructionException( "Could not instantiate " + constructor.getDeclaringClass(), e );
        }
    }
View Full Code Here

TOP

Related Classes of org.qi4j.api.common.ConstructionException

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.