Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.mule.api.object
Interface ObjectFactory

All Superinterfaces:
  Disposable, Initialisable

All Known Implementing Classes:
  AbstractObjectFactory, GuiceLookupObjectFactory, JndiObjectFactory, PooledJavaComponent.LifeCycleAdaptorFactory, PrototypeObjectFactory, ScopedObjectFactory, SingletonObjectFactory, SpringBeanLookup

    public interface ObjectFactory

extends Initialisable, Disposable

`ObjectFactory` is a generic Factory interface.

Field Summary

Fields inherited from interface org.mule.api.lifecycle.Initialisable
`PHASE_NAME`

Fields inherited from interface org.mule.api.lifecycle.Disposable
`PHASE_NAME`

Method Summary
`void` | `addObjectInitialisationCallback(InitialisationCallback callback)` Register a custom initialiser
`Object` | `getInstance()` Retrieve an instance of the object.
`Class<?>` | `getObjectClass()` Returns the class of the object to be instantiated without actually creating an instance.
`boolean` | `isAutoWireObject()` Return true if the created object should get its dependencies wired from the registry automatically.
`boolean` | `isExternallyManagedLifecycle()` Returns true if Mule should not manage the life-cycle the object instance returned from the ObjectFactory.
`boolean` | `isSingleton()` Returns true if the ObjectFactory implementation always returns the same object instance.

Methods inherited from interface org.mule.api.lifecycle.Initialisable
`initialise`

Methods inherited from interface org.mule.api.lifecycle.Disposable
`dispose`

Method Detail

### getInstance

    Object getInstance()
                       throws Exception

  Retrieve an instance of the object. This may create a new instance or look up an existing instance depending on the implementation. If a new instance is created it will also be initialized by this method (Initilisable.initialise()).

  Throws:
    `Exception`

### getObjectClass

    Class<?> getObjectClass()

  Returns the class of the object to be instantiated without actually creating an instance. This may not be logical or even possible depending on the implementation.

### isSingleton

    boolean isSingleton()

  Returns true if the ObjectFactory implementation always returns the same object instance.

### isExternallyManagedLifecycle

    boolean isExternallyManagedLifecycle()

  Returns true if Mule should not manage the life-cycle the object instance returned from the ObjectFactory. This is normally false except when an ObjectFactory implementation obtains instance from containers (e.g. Spring) that already manages the objects lifecycle. instance.

### isAutoWireObject

    boolean isAutoWireObject()

  Return true if the created object should get its dependencies wired from the registry automatically. Typically Mule object factories would return true for this value, objects managed by DI container such as Spring should set this to false.

  Returns:

### addObjectInitialisationCallback

    void addObjectInitialisationCallback(InitialisationCallback callback)

  Register a custom initialiser

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2009 MuleSource, Inc.. All Rights Reserved.