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: 1154408 $, $Date: 2011-08-05 23:42:46 +0100 (Fri, 05 Aug 2011) $

Field Summary
 
Fields inherited from class org.apache.aries.blueprint.di.AbstractRecipe
name, prototype
 
Constructor Summary
BeanRecipe(String name, ExtendedBlueprintContainer blueprintContainer, Object type, boolean allowsFieldInjection)
           
 
Method Summary
 void destroy(Object obj)
          Destroy an instance created by this recipe
 List<Recipe> getConstructorDependencies()
          Get the list of constructor dependencies, i.e.
 List<Recipe> getDependencies()
          Get the list of nested recipes, i.e.
 String getDestroyMethod()
           
 Method getDestroyMethod(Object instance)
          Returns destroy method (if any).
 List<Recipe> getExplicitDependencies()
           
 String getInitMethod()
           
protected  Method getInitMethod(Object instance)
          Returns init method (if any).
 Map<String,Object> getProperties()
           
 Object getProperty(String name)
           
 Class getType()
           
protected  Object internalCreate()
           
protected  Class loadClass(String className)
           
protected  org.osgi.service.blueprint.container.ReifiedType loadType(String className)
           
 void setArgTypes(List<String> argTypes)
           
 void setArguments(List<Object> arguments)
           
 void setDestroyMethod(String destroyMethod)
           
 void setExplicitDependencies(List<Recipe> explicitDependencies)
           
 void setFactoryComponent(Recipe factory)
           
 void setFactoryMethod(String method)
           
 void setInitMethod(String initMethod)
           
 void setInterceptorLookupKey(org.osgi.service.blueprint.reflect.BeanMetadata metadata)
           
 void setProperties(Object instance)
           
 void setProperty(String name, 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(String name,
                  ExtendedBlueprintContainer blueprintContainer,
                  Object type,
                  boolean allowsFieldInjection)
Method Detail

getProperty

public Object getProperty(String name)

getProperties

public Map<String,Object> getProperties()

setProperty

public void setProperty(String name,
                        Object value)

setFactoryMethod

public void setFactoryMethod(String method)

setFactoryComponent

public void setFactoryComponent(Recipe factory)

setArgTypes

public void setArgTypes(List<String> argTypes)

setArguments

public void setArguments(List<Object> arguments)

setReorderArguments

public void setReorderArguments(boolean reorder)

setInitMethod

public void setInitMethod(String initMethod)

getInitMethod

public String getInitMethod()

setDestroyMethod

public void setDestroyMethod(String destroyMethod)

getDestroyMethod

public String getDestroyMethod()

getExplicitDependencies

public List<Recipe> getExplicitDependencies()

setExplicitDependencies

public void setExplicitDependencies(List<Recipe> explicitDependencies)

setInterceptorLookupKey

public void setInterceptorLookupKey(org.osgi.service.blueprint.reflect.BeanMetadata metadata)

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
Overrides:
getConstructorDependencies in class AbstractRecipe
Returns:
a list of constructor dependencies

getDependencies

public 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 Class loadClass(String className)
Overrides:
loadClass in class AbstractRecipe

loadType

protected org.osgi.service.blueprint.container.ReifiedType loadType(String className)
Overrides:
loadType in class AbstractRecipe

getInitMethod

protected Method getInitMethod(Object instance)
                        throws org.osgi.service.blueprint.container.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:
org.osgi.service.blueprint.container.ComponentDefinitionException

getDestroyMethod

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

internalCreate

protected Object internalCreate()
                         throws org.osgi.service.blueprint.container.ComponentDefinitionException
Specified by:
internalCreate in class AbstractRecipe
Throws:
org.osgi.service.blueprint.container.ComponentDefinitionException

destroy

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

getType

public Class getType()


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