mcconnell 2002/12/27 08:21:42 Modified: assembly/src/java/org/apache/avalon/assembly/appliance ApplianceContext.java DefaultApplianceContext.java Log: Added operation to return a custom appliance classname. Revision Changes Path 1.7 +7 -1 avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/appliance/ApplianceContext.java Index: ApplianceContext.java =================================================================== RCS file: /home/cvs/avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/appliance/ApplianceContext.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- ApplianceContext.java 21 Dec 2002 03:28:37 -0000 1.6 +++ ApplianceContext.java 27 Dec 2002 16:21:41 -0000 1.7 @@ -165,6 +165,12 @@ String getName(); /** + * Get the appliance base classname. + * @return the classname of the appliance implementaiton. + */ + String getApplianceClassname(); + + /** * Get the appliance profile. * @return the profile */ 1.3 +39 -1 avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/appliance/DefaultApplianceContext.java Index: DefaultApplianceContext.java =================================================================== RCS file: /home/cvs/avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/appliance/DefaultApplianceContext.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- DefaultApplianceContext.java 21 Dec 2002 03:44:08 -0000 1.2 +++ DefaultApplianceContext.java 27 Dec 2002 16:21:41 -0000 1.3 @@ -154,6 +154,12 @@ */ private Configuration m_config; + /** + * The appliance classname. + */ + private String m_classname; + + //============================================================== // constructor //============================================================== @@ -176,6 +182,38 @@ //============================================================== // parameters //============================================================== + + /** + * Get the appliance base classname. + * @return the classname of the appliance implementaiton. + * @exception NullPointerException if the supplied classname is null + * @exception IllegalStateException if the context is write protected + */ + public void setApplianceClassname( String classname ) + { + checkWriteable(); + if( classname == null ) + { + throw new NullPointerException( "classname" ); + } + m_classname = classname; + } + + /** + * Get the appliance base classname. + * @return the classname of the appliance implementaiton. + */ + public String getApplianceClassname() + { + if( m_classname == null ) + { + return getType().getInfo().getAttribute( Appliance.APPLIANCE_CLASS_ATTRIBUTE_NAME ); + } + else + { + return m_classname; + } + } /** * Set the appliance name.
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>