org.apache.avalon.activation.appliance.impl
Class DefaultAppliance

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.apache.avalon.activation.appliance.impl.AbstractAppliance
          extended byorg.apache.avalon.activation.appliance.impl.DefaultAppliance
All Implemented Interfaces:
Appliance, Composite, Deployable, Disposable, Factory, Home, LogEnabled

public class DefaultAppliance
extends AbstractAppliance
implements Composite, Factory

DefaultAppliance is the default implementation of a local appliance instance.

Version:
$Revision: 1.1.1.1 $ $Date: 2003/09/10 08:56:13 $
Author:
Avalon Development Team

Field Summary
 
Fields inherited from interface org.apache.avalon.activation.appliance.Appliance
MBEAN_SERVER_KEY
 
Constructor Summary
DefaultAppliance(Logger logger, ServiceContext context, DeploymentModel model, Engine engine)
           
 
Method Summary
 void assemble()
          Assemble the appliance.
 void decommission()
          Decommission the block.
 void deploy()
          Deploy the appliance during which deployment phase artifacts such as logging channels, contextualization handlers and so on are established in preparation for component creation requests.
 void destroy(Object instance)
          Decommission and dispose of the supplied component.
 void disassemble()
          Disassemble the appliance.
 void dispose()
           
 Appliance[] getProviders()
          Return the set of appliances assigned as providers.
 boolean isAssembled()
          Returns the assembled state of the appliance.
 Object newInstance()
          Create a new fully deployed instance of the type managed by the appliance.
 void release(Object source, Object instance)
          Release an object.
 Object resolve(Object source)
          Resolve a object to a value.
 Object resolve(Object source, Class[] ref)
          Resolve a object to a value relative to a supplied set of interface classes.
 
Methods inherited from class org.apache.avalon.activation.appliance.impl.AbstractAppliance
getModel, isEnabled, toString
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultAppliance

public DefaultAppliance(Logger logger,
                        ServiceContext context,
                        DeploymentModel model,
                        Engine engine)
Method Detail

isAssembled

public boolean isAssembled()
Returns the assembled state of the appliance.

Specified by:
isAssembled in interface Composite
Returns:
true if this appliance is assembled

assemble

public void assemble()
              throws AssemblyException
Assemble the appliance.

Specified by:
assemble in interface Composite
Throws:
ApplianceException - if an error occurs during appliance assembly
AssemblyException

disassemble

public void disassemble()
Disassemble the appliance.

Specified by:
disassemble in interface Composite

getProviders

public Appliance[] getProviders()
Description copied from interface: Composite
Return the set of appliances assigned as providers.

Specified by:
getProviders in interface Composite
Returns:
the extenernal providers consumed by the appliance

deploy

public void deploy()
            throws Exception
Deploy the appliance during which deployment phase artifacts such as logging channels, contextualization handlers and so on are established in preparation for component creation requests. If the deployment policy is startup, an initial instance of a component will be deployed.

Specified by:
deploy in interface Deployable
Throws:
Exception - if a deployment error occurs

decommission

public void decommission()
Decommission the block. Under the decommissioning phase, all active components will be taken down.

Specified by:
decommission in interface Deployable

resolve

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

Specified by:
resolve in interface Home
Parameters:
source - the context within the the resolution is applied
Returns:
the resolved object
Throws:
Exception - if an error occurs

resolve

public Object resolve(Object source,
                      Class[] ref)
               throws Exception
Resolve a object to a value relative to a supplied set of interface classes.

Specified by:
resolve in interface Home
Parameters:
source - the aquiring source
ref - the castable service classes
Returns:
the resolved object
Throws:
Exception - if an error occurs

release

public void release(Object source,
                    Object instance)
Release an object.

Specified by:
release in interface Home
Parameters:
source - the client that obtained the intial reference
instance - the object to be released

newInstance

public Object newInstance()
                   throws LifecycleException
Create a new fully deployed instance of the type managed by the appliance.

Specified by:
newInstance in interface Factory
Returns:
the deployed component instance
Throws:
LifecycleException - if an error while processing the component though its deployment lifecycle

destroy

public void destroy(Object instance)
Description copied from interface: Factory
Decommission and dispose of the supplied component.

Specified by:
destroy in interface Factory
Parameters:
instance - the object to decommission

dispose

public void dispose()
Specified by:
dispose in interface Disposable
Overrides:
dispose in class AbstractAppliance


Copyright © Apache Software Foundation. All Rights Reserved.