mcconnell 2002/12/16 20:52:15 Modified: assembly/src/java/org/apache/avalon/assembly/appliance Appliance.java DefaultAppliance.java Log: Added accessors to partition name and deployment context and termination handler. Revision Changes Path 1.7 +19 -1 avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/appliance/Appliance.java Index: Appliance.java =================================================================== RCS file: /home/cvs/avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/appliance/Appliance.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- Appliance.java 15 Dec 2002 14:08:55 -0000 1.6 +++ Appliance.java 17 Dec 2002 04:52:15 -0000 1.7 @@ -50,6 +50,8 @@ package org.apache.avalon.assembly.appliance; +import java.util.Map; + import org.apache.avalon.framework.activity.Initializable; import org.apache.avalon.assembly.lifestyle.LifestyleException; import org.apache.avalon.meta.info.DependencyDescriptor; @@ -76,6 +78,17 @@ "urn:assembly:appliance.class"; /** + * Get the deployment context. + * @return the deployment context + */ + Map getDeploymentContext(); + + /** + * Get the appliance partition name. + */ + String getPartitionName(); + + /** * Get the appliance path. */ String getPath(); @@ -174,5 +187,10 @@ * Release a reference to a service provided by this appliance. */ void release( Object object ); + + /** + * Terminate the appliance. + */ + void terminate(); } 1.10 +29 -5 avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/appliance/DefaultAppliance.java Index: DefaultAppliance.java =================================================================== RCS file: /home/cvs/avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/appliance/DefaultAppliance.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- DefaultAppliance.java 15 Dec 2002 14:08:56 -0000 1.9 +++ DefaultAppliance.java 17 Dec 2002 04:52:15 -0000 1.10 @@ -162,10 +162,9 @@ m_enabled = context.getEnabled(); m_system = system; - if( context.getPartitionName() != null ) + if( getPartitionName() != null ) { - m_path = - context.getPartitionName() + m_path = getPartitionName() + "/" + context.getProfile().getName(); } else @@ -201,6 +200,14 @@ } /** + * Get the appliance partition name. + */ + public String getPartitionName() + { + return m_context.getPartitionName(); + } + + /** * Release the appliance path. */ public String getPath() @@ -208,6 +215,15 @@ return m_path; } + /** + * Get the deployment context. + * @return the deployment context + */ + public Map getDeploymentContext() + { + return m_context.getDeploymentContext(); + } + /** * Return the profile backing the appliance. * @@ -361,7 +377,15 @@ public String toString() { - return "[appliance: " + getProfile() + " id:" + System.identityHashCode( this ) + "]"; + return "[" + getProfile().getName() + "/" + System.identityHashCode( this ) + "]"; + } + + /** + * Terminate the appliance. + */ + public void terminate() + { + m_handler.terminate(); } }
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>