Return-Path: Delivered-To: apmail-avalon-cvs-archive@www.apache.org Received: (qmail 36922 invoked from network); 17 Oct 2003 02:03:10 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 17 Oct 2003 02:03:10 -0000 Received: (qmail 52064 invoked by uid 500); 17 Oct 2003 02:02:52 -0000 Delivered-To: apmail-avalon-cvs-archive@avalon.apache.org Received: (qmail 51969 invoked by uid 500); 17 Oct 2003 02:02:50 -0000 Mailing-List: contact cvs-help@avalon.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Avalon CVS List" Reply-To: "Avalon Developers List" Delivered-To: mailing list cvs@avalon.apache.org Received: (qmail 51870 invoked from network); 17 Oct 2003 02:02:49 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 17 Oct 2003 02:02:49 -0000 Received: (qmail 36855 invoked by uid 1438); 17 Oct 2003 02:03:07 -0000 Date: 17 Oct 2003 02:03:07 -0000 Message-ID: <20031017020307.36854.qmail@minotaur.apache.org> From: mcconnell@apache.org To: avalon-cvs@apache.org Subject: cvs commit: avalon/meta/tools/src/java/org/apache/avalon/meta/info/builder/tags TypeTag.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N mcconnell 2003/10/16 19:03:07 Modified: meta/api project.xml meta/api/src/java/org/apache/avalon/meta/info EntryDescriptor.java InfoDescriptor.java Type.java meta/impl project.xml meta/impl/src/java/org/apache/avalon/meta/info/builder XMLTypeCreator.java meta/impl/src/java/org/apache/avalon/meta/info/writer XMLTypeWriter.java meta/plugin plugin.jelly project.xml meta/site project.xml meta/site/xdocs/meta/info/type/context entry.xml meta/site/xdocs/meta/info/type info.xml meta/spi project.xml meta/tools project.xml meta/tools/src/java/org/apache/avalon/meta/info/builder/tags TypeTag.java Log: Update all project build versions to 1.2. Add tool tag generation support for collection and destruction policies and add the read and write support for info descriptor revisions to the XML handlers. Revision Changes Path 1.2 +1 -1 avalon/meta/api/project.xml Index: project.xml =================================================================== RCS file: /home/cvs/avalon/meta/api/project.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- project.xml 24 Sep 2003 08:14:56 -0000 1.1 +++ project.xml 17 Oct 2003 02:03:06 -0000 1.2 @@ -6,7 +6,7 @@ Avalon Meta Model API org.apache.avalon.meta - 1.1 + 1.2 2002 Meta Model API 1.2 +2 -2 avalon/meta/api/src/java/org/apache/avalon/meta/info/EntryDescriptor.java Index: EntryDescriptor.java =================================================================== RCS file: /home/cvs/avalon/meta/api/src/java/org/apache/avalon/meta/info/EntryDescriptor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- EntryDescriptor.java 24 Sep 2003 08:15:07 -0000 1.1 +++ EntryDescriptor.java 17 Oct 2003 02:03:06 -0000 1.2 @@ -155,7 +155,7 @@ } if ( null == classname ) { - throw new NullPointerException( "classnamei" ); + throw new NullPointerException( "classname" ); } m_key = key; 1.2 +184 -1 avalon/meta/api/src/java/org/apache/avalon/meta/info/InfoDescriptor.java Index: InfoDescriptor.java =================================================================== RCS file: /home/cvs/avalon/meta/api/src/java/org/apache/avalon/meta/info/InfoDescriptor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- InfoDescriptor.java 24 Sep 2003 08:15:08 -0000 1.1 +++ InfoDescriptor.java 17 Oct 2003 02:03:06 -0000 1.2 @@ -88,6 +88,14 @@ public static final String POOLED = "pooled"; + public static final String LIBERAL = "liberal"; + + public static final String CONSERVATIVE = "conservative"; + + public static final String TERMINAL = "terminal"; + + public static final String REDEEMABLE = "redeemable"; + //------------------------------------------------------------------- // immutable state //------------------------------------------------------------------- @@ -119,6 +127,24 @@ */ private final String m_schema; + /** + * The component destruction policy. If the descruction policy is TERMINAL + * then true otherwise the descruction policy is REDIMABLE. A teminal componet + * shall be decommissioned on release. A redimable componet may be recycled by + * a container if a pool is available. Otherwise, the redimable component will + * handled as a terminal component. + */ + private final boolean m_terminal; + + /** + * The component garbage collection policy. If the collection policy is LIBERAL + * then true otherwise the collection policy is CONSERVATIVE. A liberal componet + * shall be decommissioned when a garbage collector has resolved that there are no + * outstanding references to the component. A conservative componet will not be + * decommissioned so long as it containing context exists (i.e. jvm or thread). + */ + private final boolean m_liberal; + //------------------------------------------------------------------- // constructor //------------------------------------------------------------------- @@ -145,11 +171,36 @@ * @param version the implementation version * @param attributes a set of attributes associated with the component type * @exception IllegalArgumentException if the implementation key is not a classname + * @since 1.1 + */ + public InfoDescriptor( final String name, + final String classname, + final Version version, + final String lifestyle, + final String schema, + final Properties attributes ) + throws IllegalArgumentException + { + this( name, classname, version, lifestyle, null, null, schema, attributes ); + } + + /** + * Creation of a new info descriptor using a supplied name, key, version + * and attribute set. + * + * @param name the component name + * @param classname the implemetation classname + * @param version the implementation version + * @param attributes a set of attributes associated with the component type + * @exception IllegalArgumentException if the implementation key is not a classname + * @since 1.2 */ public InfoDescriptor( final String name, final String classname, final Version version, final String lifestyle, + final String collection, + final String destruction, final String schema, final Properties attributes ) throws IllegalArgumentException @@ -177,6 +228,58 @@ m_lifestyle = lifestyle; } + if ( collection == null ) + { + final String policy = getLifestyle(); + if( policy.equals( TRANSIENT ) || policy.equals( POOLED )) + { + m_liberal = true; + } + else + { + m_liberal = false; + } + } + else + { + if( collection.equalsIgnoreCase( CONSERVATIVE ) ) + { + m_liberal = false; + } + else if( collection.equalsIgnoreCase( LIBERAL ) ) + { + m_liberal = true; + } + else + { + final String error = + "Unrecognized collection argument [" + collection + "]"; + throw new IllegalArgumentException( error ); + } + } + + if ( destruction == null ) + { + m_terminal = true; + } + else + { + if( destruction.equalsIgnoreCase( TERMINAL ) ) + { + m_terminal = true; + } + else if( destruction.equalsIgnoreCase( REDEEMABLE ) ) + { + m_terminal = false; + } + else + { + final String error = + "Unrecognized destruction argument [" + destruction + "]"; + throw new IllegalArgumentException( error ); + } + } + if ( name != null ) { m_name = name; @@ -224,6 +327,81 @@ } /** + * Return the component termination policy as a String. + * + * @return the policy + */ + public String getDestructionPolicy() + { + if( m_terminal ) + { + return TERMINAL; + } + else + { + return REDEEMABLE; + } + } + + /** + * Return the component type redemtion policy. + * + * @return the policy + */ + public boolean isRedeemable() + { + return !m_terminal; + } + + /** + * Return the component type termination policy. + * This is the opositite of the redemption policy. + * @return the policy + */ + public boolean isTerminal() + { + return m_terminal; + } + + /** + * Return the component termination policy as a String. + * + * @return the policy + */ + public String getCollectionPolicy() + { + if( m_liberal ) + { + return LIBERAL; + } + else + { + return CONSERVATIVE; + } + } + + + /** + * Return the component termination policy. + * + * @return the policy + */ + public boolean isLiberal() + { + return m_liberal; + } + + /** + * Return the component termination policy. + * + * @return the policy + */ + public boolean isConservative() + { + return !m_liberal; + } + + /** * Return the configuration schema. * * @return the schema declaration (possibly null) @@ -286,6 +464,8 @@ isEqual = isEqual && m_classname.equals( info.m_classname ); isEqual = isEqual && m_name.equals( info.m_name ); isEqual = isEqual && m_lifestyle.equals( info.m_lifestyle ); + isEqual = isEqual && m_liberal == info.m_liberal; + isEqual = isEqual && m_terminal == info.m_terminal; if ( null == m_version ) { @@ -311,6 +491,9 @@ hash >>>= 7; hash ^= m_classname.hashCode(); hash >>>= 7; + + hash >>>= ( m_liberal ) ? 1 : 3; + hash >>>= ( m_terminal ) ? 1 : 3; if ( null != m_name ) { 1.2 +2 -1 avalon/meta/api/src/java/org/apache/avalon/meta/info/Type.java Index: Type.java =================================================================== RCS file: /home/cvs/avalon/meta/api/src/java/org/apache/avalon/meta/info/Type.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Type.java 24 Sep 2003 08:15:11 -0000 1.1 +++ Type.java 17 Oct 2003 02:03:06 -0000 1.2 @@ -105,6 +105,7 @@ * suppier resolution * @exception NullPointerException if the descriptor, loggers, context, services, * dependencies, stages, or extensions argument is null + * @since 1.1 */ public Type( final InfoDescriptor descriptor, final CategoryDescriptor[] loggers, 1.2 +3 -3 avalon/meta/impl/project.xml Index: project.xml =================================================================== RCS file: /home/cvs/avalon/meta/impl/project.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- project.xml 24 Sep 2003 08:15:22 -0000 1.1 +++ project.xml 17 Oct 2003 02:03:06 -0000 1.2 @@ -6,7 +6,7 @@ Avalon Meta Model Implementation org.apache.avalon.meta - 1.1 + 1.2 2002 Meta Model Builder and Verification Framework @@ -31,13 +31,13 @@ avalon-meta avalon-meta-api - 1.1 + 1.2 avalon-meta avalon-meta-spi - 1.1 + 1.2 1.2 +7 -2 avalon/meta/impl/src/java/org/apache/avalon/meta/info/builder/XMLTypeCreator.java Index: XMLTypeCreator.java =================================================================== RCS file: /home/cvs/avalon/meta/impl/src/java/org/apache/avalon/meta/info/builder/XMLTypeCreator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- XMLTypeCreator.java 24 Sep 2003 08:15:38 -0000 1.1 +++ XMLTypeCreator.java 17 Oct 2003 02:03:06 -0000 1.2 @@ -461,8 +461,13 @@ buildAttributes( info.getChild( "attributes" ) ); final String lifestyle = buildLifestyle( info, attributes ); + final String collection = + info.getAttribute( "collection", "liberal" ); + final String destruction = + info.getAttribute( "destruction", "terminal" ); + return new InfoDescriptor( - name, classname, version, lifestyle, schema, attributes ); + name, classname, version, lifestyle, collection, destruction, schema, attributes ); } /** 1.2 +5 -2 avalon/meta/impl/src/java/org/apache/avalon/meta/info/writer/XMLTypeWriter.java Index: XMLTypeWriter.java =================================================================== RCS file: /home/cvs/avalon/meta/impl/src/java/org/apache/avalon/meta/info/writer/XMLTypeWriter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- XMLTypeWriter.java 24 Sep 2003 08:15:51 -0000 1.1 +++ XMLTypeWriter.java 17 Oct 2003 02:03:06 -0000 1.2 @@ -160,7 +160,10 @@ writer.write( ""); } - writer.write( "\n "); + writer.write( + "\n " ); writer.write( info.getLifestyle() ); writer.write( "" ); 1.3 +1 -0 avalon/meta/plugin/plugin.jelly Index: plugin.jelly =================================================================== RCS file: /home/cvs/avalon/meta/plugin/plugin.jelly,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- plugin.jelly 26 Sep 2003 01:45:56 -0000 1.2 +++ plugin.jelly 17 Oct 2003 02:03:06 -0000 1.3 @@ -53,6 +53,7 @@ + avalon-meta avalon-meta-api - 1.1 + 1.2 avalon-meta avalon-meta-spi - 1.1 + 1.2 avalon-meta avalon-meta-impl - 1.1 + 1.2 avalon-meta avalon-meta-tools - 1.1 + 1.2 1.2 +4 -4 avalon/meta/site/project.xml Index: project.xml =================================================================== RCS file: /home/cvs/avalon/meta/site/project.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- project.xml 24 Sep 2003 08:15:53 -0000 1.1 +++ project.xml 17 Oct 2003 02:03:06 -0000 1.2 @@ -21,22 +21,22 @@ avalon-meta avalon-meta-api - 1.1 + 1.2 avalon-meta avalon-meta-spi - 1.1 + 1.2 avalon-meta avalon-meta-impl - 1.1 + 1.2 avalon-meta avalon-meta-tools - 1.1 + 1.2 excalibur-i18n 1.2 +19 -1 avalon/meta/site/xdocs/meta/info/type/context/entry.xml Index: entry.xml =================================================================== RCS file: /home/cvs/avalon/meta/site/xdocs/meta/info/type/context/entry.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- entry.xml 24 Sep 2003 08:15:58 -0000 1.1 +++ entry.xml 17 Oct 2003 02:03:06 -0000 1.2 @@ -36,6 +36,23 @@ is not required to supply the entry. The default value is FALSE. + + aliasno + + An alternative name that a component may use to locate an entry. + This is convinient when dealing with legacy applications. + + + + volatileno + + A 'true' or 'false' value that determines if a entry value may + be cached by a container or if the value must be recomputed on + each access. The default value is 'false' resulting in cached + behaviour. Volotile entries are useful for contitions such as + incremental key generation, time value lookup, etc. + + @@ -50,6 +67,7 @@ + ]]> 1.2 +30 -1 avalon/meta/site/xdocs/meta/info/type/info.xml Index: info.xml =================================================================== RCS file: /home/cvs/avalon/meta/site/xdocs/meta/info/type/info.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- info.xml 24 Sep 2003 08:15:57 -0000 1.1 +++ info.xml 17 Oct 2003 02:03:06 -0000 1.2 @@ -10,6 +10,35 @@
+ + + + + + + + + + + +
AttributeRequiredDescription
collectionno + Declaration of a decommissioning policy default override. If + the value is "liberal" the component will be decommissioned automatically + if all references to the component have ben released. If the value is + "conservative" the component will be maintained for the life of its parent + (where parent for a singleton is the jvm and for a thread lifestyle - the + parent is the thread). The default policy is "liberal" for transient and + pooled components and "conservative" for singelton and thread lifestyles. +
destructionno + Declaration of a destruction policy default override. If + the value is "terminal" the component will be released for garbage collection + folowing decomissioning. If the value is "redeemable" the coponent will be + decommissioned and recommissioned if it is associated with compone pool + (otherwise the terminal policy will hold). The default policy for all + component lifestyle is "terminal". +
+
+ 1.2 +2 -2 avalon/meta/spi/project.xml Index: project.xml =================================================================== RCS file: /home/cvs/avalon/meta/spi/project.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- project.xml 24 Sep 2003 08:16:04 -0000 1.1 +++ project.xml 17 Oct 2003 02:03:06 -0000 1.2 @@ -6,7 +6,7 @@ Avalon Meta Model SPIorg.apache.avalon.meta - 1.1 + 1.22002Meta Model SPI @@ -25,7 +25,7 @@ avalon-meta avalon-meta-api - 1.1 + 1.2 1.2 +4 -4 avalon/meta/tools/project.xml Index: project.xml =================================================================== RCS file: /home/cvs/avalon/meta/tools/project.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- project.xml 24 Sep 2003 08:16:10 -0000 1.1 +++ project.xml 17 Oct 2003 02:03:06 -0000 1.2 @@ -6,7 +6,7 @@ Meta Management Toolkitorg.apache.avalon.meta - 1.1 + 1.22002Meta Model Toolkit @@ -39,17 +39,17 @@ avalon-meta avalon-meta-api - 1.1 + 1.2 avalon-meta avalon-meta-spi - 1.1 + 1.2 avalon-meta avalon-meta-impl - 1.1 + 1.2 1.3 +27 -3 avalon/meta/tools/src/java/org/apache/avalon/meta/info/builder/tags/TypeTag.java Index: TypeTag.java =================================================================== RCS file: /home/cvs/avalon/meta/tools/src/java/org/apache/avalon/meta/info/builder/tags/TypeTag.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- TypeTag.java 4 Oct 2003 11:51:25 -0000 1.2 +++ TypeTag.java 17 Oct 2003 02:03:07 -0000 1.3 @@ -109,11 +109,21 @@ public static final String VERSION_PARAM = "version"; /** - * The version parameter + * The lifestyle parameter */ public static final String LIFESTYLE_PARAM = "lifestyle"; /** + * The lifestyle collection policy parameter + */ + public static final String LIFESTYLE_COLLECTION_PARAM = "collection"; + + /** + * The lifestyle destruction policy parameter + */ + public static final String LIFESTYLE_DESTRUCTION_PARAM = "destruction"; + + /** * Type tag constructor. * @param clazz the javadoc class descriptor */ @@ -138,10 +148,14 @@ final String name = getName( tag ); final Version version = getVersion( tag ); final String lifestyle = getLifestyle( tag ); + final String collection = getLifestyleCollectionPolicy( tag ); + final String destruction = getLifestyleDestructionPolicy( tag ); final String type = getJavaClass().getFullyQualifiedName(); final Properties properties = new AttributeTag( getJavaClass() ).getProperties(); final String schema = new SchemaTag( getJavaClass() ).getConfigurationSchema(); - final InfoDescriptor info = new InfoDescriptor( name, type, version, lifestyle, schema, properties ); + final InfoDescriptor info = + new InfoDescriptor( + name, type, version, lifestyle, collection, destruction, schema, properties ); final ServiceDescriptor[] services = new ServicesTag( getJavaClass() ).getServices(); final CategoryDescriptor[] loggers = new LoggerTag( getJavaClass() ).getCategories(); final DependencyDescriptor[] dependencies = @@ -161,6 +175,16 @@ private String getLifestyle(DocletTag tag) { return getNamedParameter( tag, LIFESTYLE_PARAM, null ); + } + + private String getLifestyleCollectionPolicy(DocletTag tag) + { + return getNamedParameter( tag, LIFESTYLE_COLLECTION_PARAM, null ); + } + + private String getLifestyleDestructionPolicy(DocletTag tag) + { + return getNamedParameter( tag, LIFESTYLE_DESTRUCTION_PARAM, null ); } private Version getVersion(DocletTag tag) --------------------------------------------------------------------- To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org For additional commands, e-mail: cvs-help@avalon.apache.org
ElementOccuranceDescription