Package org.qi4j.api.common

Examples of org.qi4j.api.common.ConstructionException


            {
                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


            {
                throw (InvalidCompositeException) targetException;
            }
            String message = "Could not instantiate \n    " + constructor.getDeclaringClass() + "\nusing constructor:\n    " + constructor
                .toGenericString();
            throw new ConstructionException( message, targetException );
        }
        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

    }

    public Object newInstance( InjectionContext injectionContext )
    {
        // Try all bound constructors, in order
        ConstructionException exception = null;
        for( ConstructorModel constructorModel : boundConstructors )
        {
            try
            {
                return constructorModel.newInstance( injectionContext );
View Full Code Here

        {
            throw new EntityCompositeAlreadyExistsException( identity );
        }
        catch( EntityStoreException e )
        {
            throw new ConstructionException( "Could not create new entity in store", e );
        }
    }
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

            Constraint<?, ?> constraint = new CompositeConstraintInstance( compositeConstraintsInstance );
            return new ConstraintInstance( constraint, annotation );
        }
        catch( Exception e )
        {
            throw new ConstructionException( "Could not instantiate constraint implementation", e );
        }
    }
View Full Code Here

            Constraint<?, ?> constraint = constraintClass.newInstance();
            return new ConstraintInstance( constraint, annotation );
        }
        catch( Exception e )
        {
            throw new ConstructionException( "Could not instantiate constraint implementation", e );
        }
    }
View Full Code Here

        {
            return valueSerialization().deserialize( modelModule.model().valueType(), serializedState );
        }
        catch( ValueSerializationException ex )
        {
            throw new ConstructionException( "Could not create value from serialized state", ex );
        }
    }
View Full Code Here

        if( objectFactory == null )
        {
            return null;
        }

        ConstructionException exception = null;
        Object obj = null;

        try
        {
            obj = objectFactory.newObject( aClass );
View Full Code Here

        {
            return null;
        }

        Object obj = null;
        ConstructionException exception = null;

        try
        {
            obj = compositeBuilderFactory.newTransient( aClass );
        }
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.