org.apache.aries.blueprint.di
Class AbstractRecipe

java.lang.Object
  extended by org.apache.aries.blueprint.di.AbstractRecipe
All Implemented Interfaces:
Recipe
Direct Known Subclasses:
AbstractServiceReferenceRecipe, ArrayRecipe, BeanRecipe, CollectionRecipe, ComponentFactoryRecipe, IdRefRecipe, MapRecipe, PassThroughRecipe, RefRecipe, ServiceRecipe, ValueRecipe

public abstract class AbstractRecipe
extends java.lang.Object
implements Recipe


Field Summary
protected  java.lang.String name
           
protected  boolean prototype
           
 
Constructor Summary
protected AbstractRecipe(java.lang.String name)
           
 
Method Summary
protected  void addPartialObject(java.lang.Object obj)
           
protected  java.lang.Object convert(java.lang.Object obj, ReifiedType type)
           
protected  java.lang.Object convert(java.lang.Object obj, java.lang.reflect.Type type)
           
 java.lang.Object create()
          Create an instance for this recipe.
 void destroy(java.lang.Object instance)
          Destroy an instance created by this recipe
 java.util.List<Recipe> getConstructorDependencies()
          Get the list of constructor dependencies, i.e.
 java.lang.String getName()
          Get the unique name for this recipe.
protected abstract  java.lang.Object internalCreate()
           
 boolean isPrototype()
           
protected  java.lang.Class loadClass(java.lang.String className)
           
protected  ReifiedType loadType(java.lang.String typeName)
           
protected  ReifiedType loadType(java.lang.String typeName, java.lang.ClassLoader fromClassLoader)
           
 void setPrototype(boolean prototype)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.aries.blueprint.di.Recipe
getDependencies
 

Field Detail

name

protected final java.lang.String name

prototype

protected boolean prototype
Constructor Detail

AbstractRecipe

protected AbstractRecipe(java.lang.String name)
Method Detail

getName

public java.lang.String getName()
Description copied from interface: Recipe
Get the unique name for this recipe.

Specified by:
getName in interface Recipe
Returns:
the unique name for this recipe.

isPrototype

public boolean isPrototype()

setPrototype

public void setPrototype(boolean prototype)

create

public final java.lang.Object create()
                              throws ComponentDefinitionException
Description copied from interface: Recipe
Create an instance for this recipe.

Specified by:
create in interface Recipe
Returns:
a new instance for this recipe
Throws:
ComponentDefinitionException

internalCreate

protected abstract java.lang.Object internalCreate()
                                            throws ComponentDefinitionException
Throws:
ComponentDefinitionException

addPartialObject

protected void addPartialObject(java.lang.Object obj)

convert

protected java.lang.Object convert(java.lang.Object obj,
                                   ReifiedType type)
                            throws java.lang.Exception
Throws:
java.lang.Exception

convert

protected java.lang.Object convert(java.lang.Object obj,
                                   java.lang.reflect.Type type)
                            throws java.lang.Exception
Throws:
java.lang.Exception

loadClass

protected java.lang.Class loadClass(java.lang.String className)

loadType

protected ReifiedType loadType(java.lang.String typeName)

loadType

protected ReifiedType loadType(java.lang.String typeName,
                               java.lang.ClassLoader fromClassLoader)

destroy

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

Specified by:
destroy in interface Recipe
Parameters:
instance - the instance to be destroyed

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
Returns:
a list of constructor dependencies

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


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