org.apache.aries.blueprint.container
Class BeanRecipe

java.lang.Object
  extended by org.apache.aries.blueprint.di.AbstractRecipe
      extended by org.apache.aries.blueprint.container.BeanRecipe
All Implemented Interfaces:
Recipe

public class BeanRecipe
extends AbstractRecipe

A Recipe to create POJOs.

Version:
$Rev: 1055827 $, $Date: 2011-01-06 11:03:36 +0000 (Thu, 06 Jan 2011) $

Field Summary
 
Fields inherited from class org.apache.aries.blueprint.di.AbstractRecipe
name, prototype
 
Constructor Summary
BeanRecipe(java.lang.String name, ExtendedBlueprintContainer blueprintContainer, java.lang.Object type, boolean allowsFieldInjection)
           
 
Method Summary
 void destroy(java.lang.Object obj)
          Destroy an instance created by this recipe
 java.util.List<Recipe> getConstructorDependencies()
          Get the list of constructor dependencies, i.e.
 java.util.List<Recipe> getDependencies()
          Get the list of nested recipes, i.e.
 java.lang.String getDestroyMethod()
           
 java.lang.reflect.Method getDestroyMethod(java.lang.Object instance)
          Returns destroy method (if any).
 java.util.List<Recipe> getExplicitDependencies()
           
 java.lang.String getInitMethod()
           
protected  java.lang.reflect.Method getInitMethod(java.lang.Object instance)
          Returns init method (if any).
 java.util.Map<java.lang.String,java.lang.Object> getProperties()
           
 java.lang.Object getProperty(java.lang.String name)
           
 java.lang.Class getType()
           
protected  java.lang.Object internalCreate()
           
protected  java.lang.Class loadClass(java.lang.String className)
           
protected  ReifiedType loadType(java.lang.String className)
           
 void setArgTypes(java.util.List<java.lang.String> argTypes)
           
 void setArguments(java.util.List<java.lang.Object> arguments)
           
 void setDestroyMethod(java.lang.String destroyMethod)
           
 void setExplicitDependencies(java.util.List<Recipe> explicitDependencies)
           
 void setFactoryComponent(Recipe factory)
           
 void setFactoryMethod(java.lang.String method)
           
 void setInitMethod(java.lang.String initMethod)
           
 void setInterceptorLookupKey(BeanMetadata metadata)
           
 void setProperties(java.lang.Object instance)
           
 void setProperty(java.lang.String name, java.lang.Object value)
           
 void setReorderArguments(boolean reorder)
           
 
Methods inherited from class org.apache.aries.blueprint.di.AbstractRecipe
addPartialObject, convert, convert, create, getName, isPrototype, loadType, setPrototype, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BeanRecipe

public BeanRecipe(java.lang.String name,
                  ExtendedBlueprintContainer blueprintContainer,
                  java.lang.Object type,
                  boolean allowsFieldInjection)
Method Detail

getProperty

public java.lang.Object getProperty(java.lang.String name)

getProperties

public java.util.Map<java.lang.String,java.lang.Object> getProperties()

setProperty

public void setProperty(java.lang.String name,
                        java.lang.Object value)

setFactoryMethod

public void setFactoryMethod(java.lang.String method)

setFactoryComponent

public void setFactoryComponent(Recipe factory)

setArgTypes

public void setArgTypes(java.util.List<java.lang.String> argTypes)

setArguments

public void setArguments(java.util.List<java.lang.Object> arguments)

setReorderArguments

public void setReorderArguments(boolean reorder)

setInitMethod

public void setInitMethod(java.lang.String initMethod)

getInitMethod

public java.lang.String getInitMethod()

setDestroyMethod

public void setDestroyMethod(java.lang.String destroyMethod)

getDestroyMethod

public java.lang.String getDestroyMethod()

getExplicitDependencies

public java.util.List<Recipe> getExplicitDependencies()

setExplicitDependencies

public void setExplicitDependencies(java.util.List<Recipe> explicitDependencies)

setInterceptorLookupKey

public void setInterceptorLookupKey(BeanMetadata metadata)

getConstructorDependencies

public java.util.List<Recipe> getConstructorDependencies()
Description copied from interface: Recipe
Get the list of constructor dependencies, i.e. explicit and argument dependencies. These dependencies must be satisfied before the an object can be created.

Specified by:
getConstructorDependencies in interface Recipe
Overrides:
getConstructorDependencies in class AbstractRecipe
Returns:
a list of constructor dependencies

getDependencies

public java.util.List<Recipe> getDependencies()
Description copied from interface: Recipe
Get the list of nested recipes, i.e. all dependencies including constructor dependencies.

Returns:
a list of dependencies

loadClass

protected java.lang.Class loadClass(java.lang.String className)
Overrides:
loadClass in class AbstractRecipe

loadType

protected ReifiedType loadType(java.lang.String className)
Overrides:
loadType in class AbstractRecipe

getInitMethod

protected java.lang.reflect.Method getInitMethod(java.lang.Object instance)
                                          throws ComponentDefinitionException
Returns init method (if any). Throws exception if the init-method was set explicitly on the bean and the method is not found on the instance.

Throws:
ComponentDefinitionException

getDestroyMethod

public java.lang.reflect.Method getDestroyMethod(java.lang.Object instance)
                                          throws ComponentDefinitionException
Returns destroy method (if any). Throws exception if the destroy-method was set explicitly on the bean and the method is not found on the instance.

Throws:
ComponentDefinitionException

internalCreate

protected java.lang.Object internalCreate()
                                   throws ComponentDefinitionException
Specified by:
internalCreate in class AbstractRecipe
Throws:
ComponentDefinitionException

destroy

public void destroy(java.lang.Object obj)
Description copied from interface: Recipe
Destroy an instance created by this recipe

Specified by:
destroy in interface Recipe
Overrides:
destroy in class AbstractRecipe
Parameters:
obj - the instance to be destroyed

setProperties

public void setProperties(java.lang.Object instance)
                   throws ComponentDefinitionException
Throws:
ComponentDefinitionException

getType

public java.lang.Class getType()


Copyright © 2009-2011 The Apache Software Foundation. All Rights Reserved.