avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject cvs commit: avalon/meta/tools project.xml
Date Fri, 17 Oct 2003 04:22:02 GMT
mcconnell    2003/10/16 21:22:02

  Modified:    meta/api project.xml
               meta/api/src/java/org/apache/avalon/meta/info
                        InfoDescriptor.java
               meta/impl project.xml
               meta/impl/src/java/org/apache/avalon/meta/info/builder
                        XMLTypeCreator.java
               meta/plugin project.xml
               meta/site project.xml
               meta/spi project.xml
               meta/tools project.xml
  Log:
  Add DEMOCRAT policy under which a component may be decommissioned in the case of a memory
contention (heavier then LIBERAL but lighter than a CONSERVATIVE).
  
  Revision  Changes    Path
  1.3       +1 -1      avalon/meta/api/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/avalon/meta/api/project.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- project.xml	17 Oct 2003 02:03:06 -0000	1.2
  +++ project.xml	17 Oct 2003 04:22:01 -0000	1.3
  @@ -6,7 +6,7 @@
     <name>Avalon Meta Model API</name>
     <package>org.apache.avalon.meta</package>
   
  -  <currentVersion>1.2</currentVersion>
  +  <currentVersion>1.2-dev</currentVersion>
     <inceptionYear>2002</inceptionYear>
     <shortDescription>Meta Model API</shortDescription>
     
  
  
  
  1.3       +40 -26    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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- InfoDescriptor.java	17 Oct 2003 02:03:06 -0000	1.2
  +++ InfoDescriptor.java	17 Oct 2003 04:22:01 -0000	1.3
  @@ -90,6 +90,8 @@
   
       public static final String LIBERAL = "liberal";
   
  +    public static final String DEMOCRAT = "democrat";
  +
       public static final String CONSERVATIVE = "conservative";
   
       public static final String TERMINAL = "terminal";
  @@ -137,13 +139,17 @@
       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).
  +     * The component garbage collection policy. The value returned is either 
  +     * LIBERAL, DEMOCAT or CONSERVATIVE.  A component implmenting a LIBERAL policy 
  +     * will be decommissioned if now references exist.  A component declaring a 
  +     * DEMOCRAT policy will exist without reference so long as memory contention
  +     * does not occur.  A component implementing CONSERVATIVE policies will be 
  +     * maintained irrespective of usage and memory constraints so long as its 
  +     * scope exists (the jvm for a "singleton" and Thread for "thread" lifestyles).  
  +     * The default policy is DEMOCRAT for singleton and per thread componet. 
  +     * Transient and poooled components default to LIBERAL.
        */
  -    private final boolean m_liberal;
  +    private final String m_collection;
   
       //-------------------------------------------------------------------
       // constructor
  @@ -233,22 +239,26 @@
               final String policy = getLifestyle();
               if( policy.equals( TRANSIENT ) || policy.equals( POOLED ))
               {
  -                m_liberal = true;
  +                m_collection = LIBERAL;
               }
               else
               {
  -                m_liberal = false;
  +                m_collection = DEMOCRAT;
               }
           }
           else
           {
               if( collection.equalsIgnoreCase( CONSERVATIVE ) )
               {
  -                m_liberal = false;
  +                m_collection = CONSERVATIVE;
  +            }
  +            else if( collection.equalsIgnoreCase( DEMOCRAT ) )
  +            {
  +                m_collection = DEMOCRAT;
               }
               else if( collection.equalsIgnoreCase( LIBERAL ) )
               {
  -                m_liberal = true;
  +                m_collection = LIBERAL;
               }
               else
               {
  @@ -370,35 +380,37 @@
        */
       public String getCollectionPolicy()
       {
  -        if( m_liberal )
  -        {
  -            return LIBERAL;
  -        }
  -        else
  -        {
  -            return CONSERVATIVE;
  -        }
  +        return m_collection;
       }
   
  +   /**
  +    * Test is the component type implements a liberal collection policy.
  +    *
  +    * @return the policy
  +    */
  +    public boolean isLiberal()
  +    {
  +        return m_collection.equals( LIBERAL );
  +    }
   
       /**
  -     * Return the component termination policy.
  +     * Test is the component type implements a democrat collection policy.
        *
        * @return the policy
        */
  -    public boolean isLiberal()
  +    public boolean isDemocrat()
       {
  -        return m_liberal;
  +        return m_collection.equals( DEMOCRAT );
       }
   
       /**
  -     * Return the component termination policy.
  +     * Test is the component type implements a coservative collection policy.
        *
        * @return the policy
        */
       public boolean isConservative()
       {
  -        return !m_liberal;
  +        return m_collection.equals( CONSERVATIVE );
       }
   
       /**
  @@ -462,9 +474,9 @@
           {
               InfoDescriptor info = (InfoDescriptor)other;
               isEqual = isEqual && m_classname.equals( info.m_classname );
  +            isEqual = isEqual && m_collection.equals( info.m_collection );
               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 )
  @@ -492,7 +504,9 @@
           hash ^= m_classname.hashCode();
           hash >>>= 7;
   
  -        hash >>>= ( m_liberal ) ? 1 : 3;
  +        hash ^= m_collection.hashCode();
  +        hash >>>= 7;
  +
           hash >>>= ( m_terminal ) ? 1 : 3;
   
           if ( null != m_name )
  
  
  
  1.3       +3 -3      avalon/meta/impl/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/avalon/meta/impl/project.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- project.xml	17 Oct 2003 02:03:06 -0000	1.2
  +++ project.xml	17 Oct 2003 04:22:01 -0000	1.3
  @@ -6,7 +6,7 @@
     <name>Avalon Meta Model Implementation</name>
     <package>org.apache.avalon.meta</package>
   
  -  <currentVersion>1.2</currentVersion>
  +  <currentVersion>1.2-dev</currentVersion>
     <inceptionYear>2002</inceptionYear>
     <shortDescription>Meta Model Builder and Verification Framework</shortDescription>
     
  @@ -31,13 +31,13 @@
       <dependency>
         <groupId>avalon-meta</groupId>
         <artifactId>avalon-meta-api</artifactId>
  -      <version>1.2</version>
  +      <version>1.2-dev</version>
       </dependency>
   
       <dependency>
         <groupId>avalon-meta</groupId>
         <artifactId>avalon-meta-spi</artifactId>
  -      <version>1.2</version>
  +      <version>1.2-dev</version>
       </dependency>
   
       <dependency>
  
  
  
  1.3       +3 -3      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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XMLTypeCreator.java	17 Oct 2003 02:03:06 -0000	1.2
  +++ XMLTypeCreator.java	17 Oct 2003 04:22:01 -0000	1.3
  @@ -462,9 +462,9 @@
           final String lifestyle = 
             buildLifestyle( info, attributes );
           final String collection = 
  -          info.getAttribute( "collection", "liberal" );
  +          info.getAttribute( "collection", null );
           final String destruction = 
  -          info.getAttribute( "destruction", "terminal" );
  +          info.getAttribute( "destruction", null );
   
           return new InfoDescriptor( 
             name, classname, version, lifestyle, collection, destruction, schema, attributes
);
  
  
  
  1.4       +4 -4      avalon/meta/plugin/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/avalon/meta/plugin/project.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- project.xml	17 Oct 2003 02:03:06 -0000	1.3
  +++ project.xml	17 Oct 2003 04:22:01 -0000	1.4
  @@ -27,25 +27,25 @@
       <dependency>
         <groupId>avalon-meta</groupId>
         <artifactId>avalon-meta-api</artifactId>
  -      <version>1.2</version>
  +      <version>1.2-dev</version>
       </dependency>
   
       <dependency>
         <groupId>avalon-meta</groupId>
         <artifactId>avalon-meta-spi</artifactId>
  -      <version>1.2</version>
  +      <version>1.2-dev</version>
       </dependency>
   
       <dependency>
         <groupId>avalon-meta</groupId>
         <artifactId>avalon-meta-impl</artifactId>
  -      <version>1.2</version>
  +      <version>1.2-dev</version>
       </dependency>
   
       <dependency>
         <groupId>avalon-meta</groupId>
         <artifactId>avalon-meta-tools</artifactId>
  -      <version>1.2</version>
  +      <version>1.2-dev</version>
       </dependency>
   
       <dependency>
  
  
  
  1.3       +4 -4      avalon/meta/site/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/avalon/meta/site/project.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- project.xml	17 Oct 2003 02:03:06 -0000	1.2
  +++ project.xml	17 Oct 2003 04:22:02 -0000	1.3
  @@ -21,22 +21,22 @@
       <dependency>
         <groupId>avalon-meta</groupId>
         <artifactId>avalon-meta-api</artifactId>
  -      <version>1.2</version>
  +      <version>1.2-dev</version>
       </dependency>
       <dependency>
         <groupId>avalon-meta</groupId>
         <artifactId>avalon-meta-spi</artifactId>
  -      <version>1.2</version>
  +      <version>1.2-dev</version>
       </dependency>
       <dependency>
         <groupId>avalon-meta</groupId>
         <artifactId>avalon-meta-impl</artifactId>
  -      <version>1.2</version>
  +      <version>1.2-dev</version>
       </dependency>
       <dependency>
         <groupId>avalon-meta</groupId>
         <artifactId>avalon-meta-tools</artifactId>
  -      <version>1.2</version>
  +      <version>1.2-dev</version>
       </dependency>
       <dependency>
         <id>excalibur-i18n</id>
  
  
  
  1.3       +2 -2      avalon/meta/spi/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/avalon/meta/spi/project.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- project.xml	17 Oct 2003 02:03:06 -0000	1.2
  +++ project.xml	17 Oct 2003 04:22:02 -0000	1.3
  @@ -6,7 +6,7 @@
     <name>Avalon Meta Model SPI</name>
     <package>org.apache.avalon.meta</package>
   
  -  <currentVersion>1.2</currentVersion>
  +  <currentVersion>1.2-dev</currentVersion>
     <inceptionYear>2002</inceptionYear>
     <shortDescription>Meta Model SPI</shortDescription>
     
  @@ -25,7 +25,7 @@
       <dependency>
         <groupId>avalon-meta</groupId>
         <artifactId>avalon-meta-api</artifactId>
  -      <version>1.2</version>
  +      <version>1.2-dev</version>
       </dependency>
   
     </dependencies>
  
  
  
  1.3       +4 -4      avalon/meta/tools/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/avalon/meta/tools/project.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- project.xml	17 Oct 2003 02:03:06 -0000	1.2
  +++ project.xml	17 Oct 2003 04:22:02 -0000	1.3
  @@ -6,7 +6,7 @@
     <name>Meta Management Toolkit</name>
     <package>org.apache.avalon.meta</package>
   
  -  <currentVersion>1.2</currentVersion>
  +  <currentVersion>1.2-dev</currentVersion>
     <inceptionYear>2002</inceptionYear>
     <shortDescription>Meta Model Toolkit</shortDescription>
     
  @@ -39,17 +39,17 @@
       <dependency>
         <groupId>avalon-meta</groupId>
         <artifactId>avalon-meta-api</artifactId>
  -      <version>1.2</version>
  +      <version>1.2-dev</version>
       </dependency>
       <dependency>
         <groupId>avalon-meta</groupId>
         <artifactId>avalon-meta-spi</artifactId>
  -      <version>1.2</version>
  +      <version>1.2-dev</version>
       </dependency>
       <dependency>
         <groupId>avalon-meta</groupId>
         <artifactId>avalon-meta-impl</artifactId>
  -      <version>1.2</version>
  +      <version>1.2-dev</version>
       </dependency>
   
       <dependency>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org


Mime
View raw message