javadoc
diff --git a/org.eclipse.sisu.plexus/src/org/codehaus/plexus/component/configurator/converters/composite/ObjectWithFieldsConverter.java b/org.eclipse.sisu.plexus/src/org/codehaus/plexus/component/configurator/converters/composite/ObjectWithFieldsConverter.java
index be47174..e3c245d 100644
--- a/org.eclipse.sisu.plexus/src/org/codehaus/plexus/component/configurator/converters/composite/ObjectWithFieldsConverter.java
+++ b/org.eclipse.sisu.plexus/src/org/codehaus/plexus/component/configurator/converters/composite/ObjectWithFieldsConverter.java
@@ -89,16 +89,16 @@
{
final PlexusConfiguration element = configuration.getChild( i );
final String propertyName = fromXML( element.getName() );
- Class<?> implType;
+ Class<?> valueType;
try
{
- implType = getClassForImplementationHint( null, element, loader );
+ valueType = getClassForImplementationHint( null, element, loader );
}
catch ( final ComponentConfigurationException e )
{
- implType = null;
+ valueType = null;
}
- helper.setProperty( bean, propertyName, implType, element );
+ helper.setProperty( bean, propertyName, valueType, element );
}
}
}
diff --git a/org.eclipse.sisu.plexus/src/org/eclipse/sisu/plexus/ClassRealmUtils.java b/org.eclipse.sisu.plexus/src/org/eclipse/sisu/plexus/ClassRealmUtils.java
index 13e846d..3b33dc5 100644
--- a/org.eclipse.sisu.plexus/src/org/eclipse/sisu/plexus/ClassRealmUtils.java
+++ b/org.eclipse.sisu.plexus/src/org/eclipse/sisu/plexus/ClassRealmUtils.java
@@ -72,6 +72,9 @@
// Utility methods
// ----------------------------------------------------------------------
+ /**
+ * @return Current context realm
+ */
public static ClassRealm contextRealm()
{
for ( ClassLoader tccl = Thread.currentThread().getContextClassLoader(); tccl != null; tccl = tccl.getParent() )
@@ -84,6 +87,12 @@
return null;
}
+ /**
+ * Walks the {@link ClassRealm} import graph to find all realms visible from the given realm.
+ *
+ * @param contextRealm The initial realm
+ * @return Names of all realms visible from the given realm
+ */
public static Set<String> visibleRealmNames( final ClassRealm contextRealm )
{
if ( GET_IMPORT_REALMS_SUPPORTED && null != contextRealm )
diff --git a/org.eclipse.sisu.plexus/src/org/eclipse/sisu/plexus/CompositeBeanHelper.java b/org.eclipse.sisu.plexus/src/org/eclipse/sisu/plexus/CompositeBeanHelper.java
index ce304c8..066f1b3 100644
--- a/org.eclipse.sisu.plexus/src/org/eclipse/sisu/plexus/CompositeBeanHelper.java
+++ b/org.eclipse.sisu.plexus/src/org/eclipse/sisu/plexus/CompositeBeanHelper.java
@@ -74,6 +74,13 @@
// Public methods
// ----------------------------------------------------------------------
+ /**
+ * Calls the default "set" method on the bean; re-converts the configuration if necessary.
+ *
+ * @param bean The bean being configured
+ * @param defaultValue The default value
+ * @param configuration The configuration
+ */
public void setDefault( final Object bean, final Object defaultValue, final PlexusConfiguration configuration )
throws ComponentConfigurationException
{
@@ -125,7 +132,15 @@
}
}
- public void setProperty( final Object bean, final String propertyName, final Class<?> implType,
+ /**
+ * Sets a property in the bean; looks for public setter/adder method before checking fields.
+ *
+ * @param bean The bean being configured
+ * @param propertyName The property name
+ * @param valueType The value type
+ * @param configuration The configuration
+ */
+ public void setProperty( final Object bean, final String propertyName, final Class<?> valueType,
final PlexusConfiguration configuration )
throws ComponentConfigurationException
{
@@ -152,9 +167,9 @@
{
final TypeLiteral<?> paramType = TypeLiteral.get( paramTypeHolder[0] );
Class<?> rawPropertyType = paramType.getRawType();
- if ( null != implType && rawPropertyType.isAssignableFrom( implType ) )
+ if ( null != valueType && rawPropertyType.isAssignableFrom( valueType ) )
{
- rawPropertyType = implType; // pick more specific type
+ rawPropertyType = valueType; // pick more specific type
}
value = convertProperty( beanType, rawPropertyType, paramType.getType(), configuration );
if ( null != value )
@@ -188,9 +203,9 @@
Class<?> rawPropertyType = fieldType.getRawType();
if ( !rawPropertyType.isInstance( value ) ) // only re-convert if we must
{
- if ( null != implType && rawPropertyType.isAssignableFrom( implType ) )
+ if ( null != valueType && rawPropertyType.isAssignableFrom( valueType ) )
{
- rawPropertyType = implType; // pick more specific type
+ rawPropertyType = valueType; // pick more specific type
}
value = convertProperty( beanType, rawPropertyType, fieldType.getType(), configuration );
}
diff --git a/org.eclipse.sisu.plexus/src/org/eclipse/sisu/plexus/PlexusTypeRegistry.java b/org.eclipse.sisu.plexus/src/org/eclipse/sisu/plexus/PlexusTypeRegistry.java
index 594e41a..4314c92 100644
--- a/org.eclipse.sisu.plexus/src/org/eclipse/sisu/plexus/PlexusTypeRegistry.java
+++ b/org.eclipse.sisu.plexus/src/org/eclipse/sisu/plexus/PlexusTypeRegistry.java
@@ -191,6 +191,12 @@
return null;
}
+ /**
+ * Clones an implementation so it can be bound again with different configuration.
+ *
+ * @param implementation The implementation
+ * @return Cloned implementation
+ */
private DeferredClass<?> cloneImplementation( final String implementation )
{
if ( null == clones )
diff --git a/org.eclipse.sisu.plexus/src/org/eclipse/sisu/plexus/Strategies.java b/org.eclipse.sisu.plexus/src/org/eclipse/sisu/plexus/Strategies.java
index f784406..eb071f3 100644
--- a/org.eclipse.sisu.plexus/src/org/eclipse/sisu/plexus/Strategies.java
+++ b/org.eclipse.sisu.plexus/src/org/eclipse/sisu/plexus/Strategies.java
@@ -15,10 +15,6 @@
*/
public interface Strategies
{
- // ----------------------------------------------------------------------
- // Constants
- // ----------------------------------------------------------------------
-
String LOAD_ON_START = "load-on-start";
String PER_LOOKUP = "per-lookup";