org.apache.avalon.activation.impl
Class AbstractLifestyleManager

java.lang.Object
  extended byorg.apache.avalon.activation.impl.AbstractLifestyleManager
All Implemented Interfaces:
Commissionable, LifestyleManager, Resolver
Direct Known Subclasses:
SingletonLifestyleManager, ThreadLifestyleManager, TransientLifestyleManager

public abstract class AbstractLifestyleManager
extends Object
implements LifestyleManager

Abstract implentation class for a lifestyle handler.

Version:
$Revision: 1.8 $ $Date: 2004/04/04 23:33:56 $
Author:
Avalon Development Team

Constructor Summary
AbstractLifestyleManager(ComponentModel model, ComponentFactory factory)
          Creation of a new instance.
 
Method Summary
abstract  void commission()
          Commission the runtime handler.
abstract  void decommission()
          Invokes the decommissioning phase.
 void finalize()
           
 void finalize(Object instance)
          Release and finalize the supplied object.
protected  ComponentFactory getComponentFactory()
           
protected  ComponentModel getComponentModel()
           
protected  Logger getLogger()
           
protected  Reference getReference(Object instance)
           
protected abstract  void handleRelease(Object instance)
           
protected abstract  Object handleResolve()
           
 void release(Object instance)
          Release an object
 Object resolve()
          Resolve a object to a value.
 Object resolve(boolean proxy)
          Resolve a object to a value.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractLifestyleManager

public AbstractLifestyleManager(ComponentModel model,
                                ComponentFactory factory)
Creation of a new instance.

Parameters:
model - the component model
factory - the component factory
Method Detail

commission

public abstract void commission()
                         throws Exception
Commission the runtime handler.

Specified by:
commission in interface Commissionable
Throws:
Exception - if a hanfdler commissioning error occurs

decommission

public abstract void decommission()
Invokes the decommissioning phase. Once a handler is decommissioned it may be re-commissioned.

Specified by:
decommission in interface Commissionable

resolve

public Object resolve()
               throws Exception
Resolve a object to a value.

Specified by:
resolve in interface Resolver
Returns:
the resolved object
Throws:
Exception - if an error occurs

resolve

public Object resolve(boolean proxy)
               throws Exception
Resolve a object to a value.

Specified by:
resolve in interface Resolver
Parameters:
proxy - if TRUE ruturn a proxied reference if the underlying component suppports proxied representation otherwise return the raw component instance
Returns:
the resolved object
Throws:
Exception - if an error occurs

release

public void release(Object instance)
Release an object

Specified by:
release in interface Resolver
Parameters:
instance - the object to be released

finalize

public void finalize(Object instance)
Description copied from interface: LifestyleManager
Release and finalize the supplied object.

Specified by:
finalize in interface LifestyleManager
Parameters:
instance - the object to be released

handleResolve

protected abstract Object handleResolve()
                                 throws Exception
Throws:
Exception

handleRelease

protected abstract void handleRelease(Object instance)

getLogger

protected Logger getLogger()

getComponentModel

protected ComponentModel getComponentModel()

getComponentFactory

protected ComponentFactory getComponentFactory()

getReference

protected Reference getReference(Object instance)

finalize

public void finalize()


Copyright © The Apache Software Foundation. All Rights Reserved.