Package org.apache.xbean.recipe

Examples of org.apache.xbean.recipe.ConstructionException


                stateReason = "the service constructor threw an exception. \n" + printException(e);
                throw e;
            }
            Map<String, Object> unsetProperties = objectRecipe.getUnsetProperties();
            if (unsetProperties.size() > 0) {
                throw new ConstructionException("Error creating gbean of class: " + gbeanInfo.getClassName() + ", attempting to set nonexistent properties: " + unsetProperties.keySet());
            }
           
            // write the target variable in a synchronized block so it is available to all threads
            // we do this before calling the setters or start method so the bean can be called back
            // from a setter start method
View Full Code Here


                stateReason = "the service constructor threw an exception. \n" + printException(e);
                throw e;
            }
            Map<String, Object> unsetProperties = objectRecipe.getUnsetProperties();
            if (unsetProperties.size() > 0) {
                throw new ConstructionException("Error creating gbean of class: " + gbeanInfo.getClassName() + ", attempting to set nonexistent properties: " + unsetProperties.keySet());
            }

            // write the target variable in a synchronized block so it is available to all threads
            // we do this before calling the setters or start method so the bean can be called back
            // from a setter start method
View Full Code Here

                return assignment;
            }
            catch ( ComponentLookupException e )
            {
                // simply wrap exception, so it can be unwrapped and rethrown
                throw new ConstructionException( e );
            }
            finally
            {
                setComponentStackProperty( null );
            }
View Full Code Here

                return value;
            }
            catch ( ComponentConfigurationException e )
            {
                // simply wrap exception, so it can be unwrapped and rethrown
                throw new ConstructionException( e );
            }
            finally
            {
                setComponentStackProperty( null );
            }
View Full Code Here

                    }
                }

                return assignment;
            } catch (ComponentLookupException e) {
                throw new ConstructionException("Composition failed of field " + requirement.getFieldName() + " "
                        + "in object of type " + componentDescriptor.getImplementation() + " because the requirement "
                        + requirement + " was missing)", e);
            }
        }
View Full Code Here

                Class parentClass = toClass(caller.getType());

                Object value = converter.fromConfiguration(lookup, child, toClass(expectedType), parentClass, Thread.currentThread().getContextClassLoader(), new DefaultExpressionEvaluator());
                return value;
            } catch (ComponentConfigurationException e) {
                throw new ConstructionException("Unable to convert configuration for property " + child.getName() + " to " + toClass(expectedType).getName());
            }
        }
View Full Code Here

                stateReason = "the service constructor threw an exception. \n" + printException(e);
                throw e;
            }
            Map<String, Object> unsetProperties = objectRecipe.getUnsetProperties();
            if (unsetProperties.size() > 0) {
                throw new ConstructionException("Error creating gbean of class: " + gbeanInfo.getClassName() + ", attempting to set nonexistent properties: " + unsetProperties.keySet());
            }
           
            // write the target variable in a synchronized block so it is available to all threads
            // we do this before calling the setters or start method so the bean can be called back
            // from a setter start method
View Full Code Here

        return referenceName;
    }

    private Object getReference() {
        if (referenceName == null) {
            throw new ConstructionException("Reference name has not been set");
        }
        ExecutionContext context = ExecutionContext.getContext();
        if (!context.containsObject(referenceName)) {
            throw new NoSuchObjectException(referenceName);
        }
View Full Code Here

                if ( requirement.isOptional() )
                {
                    return null;
                }

                throw new ConstructionException("Composition failed of field " + requirement.getFieldName() + " "
                        + "in object of type " + componentDescriptor.getImplementation() + " because the requirement "
                        + requirement + " was missing)", e);
            }
        }
View Full Code Here

                Class parentClass = toClass(caller.getType());

                Object value = converter.fromConfiguration(lookup, child, toClass(expectedType), parentClass, Thread.currentThread().getContextClassLoader(), new DefaultExpressionEvaluator());
                return value;
            } catch (ComponentConfigurationException e) {
                throw new ConstructionException("Unable to convert configuration for property " + child.getName() + " to " + toClass(expectedType).getName());
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.xbean.recipe.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.