mcconnell 2003/12/14 06:11:00
Modified: meta/api/src/java/org/apache/avalon/meta/info
InfoDescriptor.java
meta/tools project.xml
Log:
Updated to HARD, SOFT, WEAK in preference to CONSERVATIVE, DEMOCRAT, LIBERAL.
Revision Changes Path
1.8 +36 -31
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.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- InfoDescriptor.java 19 Oct 2003 14:05:54 -0000 1.7
+++ InfoDescriptor.java 14 Dec 2003 14:11:00 -0000 1.8
@@ -81,22 +81,25 @@
//-------------------------------------------------------------------
public static final String TRANSIENT = "transient";
-
public static final String SINGLETON = "singleton";
-
public static final String THREAD = "thread";
-
public static final String POOLED = "pooled";
public static final String LIBERAL_KEY = "liberal";
public static final String DEMOCRAT_KEY = "democrat";
public static final String CONSERVATIVE_KEY = "conservative";
-
public static final int UNDEFINED = -1;
public static final int LIBERAL = 0;
public static final int DEMOCRAT = 1;
public static final int CONSERVATIVE = 2;
+ public static final String WEAK_KEY = "weak";
+ public static final String SOFT_KEY = "soft";
+ public static final String HARD_KEY = "hard";
+ public static final int WEAK = 0;
+ public static final int SOFT = 1;
+ public static final int HARD = 2;
+
//-------------------------------------------------------------------
// immutable state
//-------------------------------------------------------------------
@@ -145,18 +148,6 @@
//-------------------------------------------------------------------
/**
- * Creation of a new component descriptor using a classname.
- *
- * @param classname the implemetation classname
- * @exception IllegalArgumentException if the implementation key is not a
classname
- */
- //public InfoDescriptor( final String classname )
- // throws IllegalArgumentException
- //{
- // this( null, classname, null, null, null, null, null);
- //}
-
- /**
* Creation of a new info descriptor using a supplied name, key, version
* and attribute set.
*
@@ -202,11 +193,25 @@
int p = getCollectionPolicy( collection );
if( p > UNDEFINED )
{
- m_collection = p;
+ if(( m_lifestyle == TRANSIENT ) && ( p == HARD ))
+ {
+ m_collection = SOFT;
+ }
+ else
+ {
+ m_collection = p;
+ }
}
else
{
- m_collection = CONSERVATIVE;
+ if( m_lifestyle == TRANSIENT )
+ {
+ m_collection = SOFT;
+ }
+ else
+ {
+ m_collection = HARD;
+ }
}
if ( name != null )
@@ -414,17 +419,17 @@
}
else
{
- if( policy == CONSERVATIVE )
+ if( policy == HARD )
{
- return CONSERVATIVE_KEY;
+ return HARD_KEY;
}
- else if( policy == DEMOCRAT )
+ else if( policy == SOFT )
{
- return DEMOCRAT_KEY;
+ return SOFT_KEY;
}
- else if( policy == LIBERAL )
+ else if( policy == WEAK )
{
- return LIBERAL_KEY;
+ return WEAK_KEY;
}
else
{
@@ -443,17 +448,17 @@
}
else
{
- if( policy.equalsIgnoreCase( CONSERVATIVE_KEY ) )
+ if( policy.equalsIgnoreCase( CONSERVATIVE_KEY ) ||
policy.equalsIgnoreCase( HARD_KEY ) )
{
- return CONSERVATIVE;
+ return HARD;
}
- else if( policy.equalsIgnoreCase( DEMOCRAT_KEY ) )
+ else if( policy.equalsIgnoreCase( DEMOCRAT_KEY ) ||
policy.equalsIgnoreCase( SOFT_KEY ))
{
- return DEMOCRAT;
+ return SOFT;
}
- else if( policy.equalsIgnoreCase( LIBERAL_KEY ) )
+ else if( policy.equalsIgnoreCase( LIBERAL_KEY ) ||
policy.equalsIgnoreCase( WEAK_KEY ))
{
- return LIBERAL;
+ return WEAK;
}
else
{
1.5 +2 -2 avalon/meta/tools/project.xml
Index: project.xml
===================================================================
RCS file: /home/cvs/avalon/meta/tools/project.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- project.xml 19 Oct 2003 06:09:32 -0000 1.4
+++ project.xml 14 Dec 2003 14:11:00 -0000 1.5
@@ -3,12 +3,12 @@
<project>
<extend>${basedir}/../project.xml</extend>
<id>avalon-meta-tools</id>
- <name>Meta Management Toolkit</name>
+ <name>Avalon Meta Model Toolkit</name>
<package>org.apache.avalon.meta</package>
<currentVersion>1.2.1-dev</currentVersion>
<inceptionYear>2002</inceptionYear>
- <shortDescription>Meta Model Toolkit</shortDescription>
+ <shortDescription>Avalon Meta Model Toolkit</shortDescription>
<description>
Component meta info and meta data tools.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]