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 Object
implements Recipe


Field Summary
protected  String name
           
protected  boolean prototype
           
 
Constructor Summary
protected AbstractRecipe(String name)
           
 
Method Summary
protected  void addPartialObject(Object obj)
           
protected  Object convert(Object obj, org.osgi.service.blueprint.container.ReifiedType type)
           
protected  Object convert(Object obj, Type type)
           
 Object create()
          Create an instance for this recipe.
 void destroy(Object instance)
          Destroy an instance created by this recipe
 List<Recipe> getConstructorDependencies()
          Get the list of constructor dependencies, i.e.
 String getName()
          Get the unique name for this recipe.
protected abstract  Object internalCreate()
           
 boolean isPrototype()
           
protected  Class loadClass(String className)
           
protected  org.osgi.service.blueprint.container.ReifiedType loadType(String typeName)
           
protected  org.osgi.service.blueprint.container.ReifiedType loadType(String typeName, ClassLoader fromClassLoader)
           
 void setPrototype(boolean prototype)
           
 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 String name

prototype

protected boolean prototype
Constructor Detail

AbstractRecipe

protected AbstractRecipe(String name)
Method Detail

getName

public 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 Object create()
                    throws org.osgi.service.blueprint.container.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:
org.osgi.service.blueprint.container.ComponentDefinitionException

internalCreate

protected abstract Object internalCreate()
                                  throws org.osgi.service.blueprint.container.ComponentDefinitionException
Throws:
org.osgi.service.blueprint.container.ComponentDefinitionException

addPartialObject

protected void addPartialObject(Object obj)

convert

protected Object convert(Object obj,
                         org.osgi.service.blueprint.container.ReifiedType type)
                  throws Exception
Throws:
Exception

convert

protected Object convert(Object obj,
                         Type type)
                  throws Exception
Throws:
Exception

loadClass

protected Class loadClass(String className)

loadType

protected org.osgi.service.blueprint.container.ReifiedType loadType(String typeName)

loadType

protected org.osgi.service.blueprint.container.ReifiedType loadType(String typeName,
                                                                    ClassLoader fromClassLoader)

destroy

public void destroy(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 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 String toString()
Overrides:
toString in class Object


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