org.apache.camel.impl
Class DefaultInjector

java.lang.Object
  extended by org.apache.camel.impl.DefaultInjector
All Implemented Interfaces:
Injector

public class DefaultInjector
extends Object
implements Injector

A default implementation of Injector which just uses reflection to instantiate new objects using their zero argument constructor, and then performing bean post processing using DefaultCamelBeanPostProcessor.

For more complex implementations try the Spring or Guice implementations.

See Also:
ReflectionInjector

Constructor Summary
DefaultInjector(CamelContext context)
           
 
Method Summary
<T> T
newInstance(Class<T> type)
          Instantiates a new instance of the given type possibly injecting values into the object in the process
<T> T
newInstance(Class<T> type, Object instance)
          Instantiates a new instance of the given object type possibly injecting values into the object in the process
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultInjector

public DefaultInjector(CamelContext context)
Method Detail

newInstance

public <T> T newInstance(Class<T> type)
Description copied from interface: Injector
Instantiates a new instance of the given type possibly injecting values into the object in the process

Specified by:
newInstance in interface Injector
Parameters:
type - the type of object to create
Returns:
a newly created instance

newInstance

public <T> T newInstance(Class<T> type,
                         Object instance)
Description copied from interface: Injector
Instantiates a new instance of the given object type possibly injecting values into the object in the process

Specified by:
newInstance in interface Injector
Parameters:
type - the type of object to create
instance - an instance of the type to create
Returns:
a newly created instance


Apache CAMEL