You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by va...@apache.org on 2007/07/13 15:39:28 UTC
svn commit: r555993 - in /geronimo/server/trunk:
maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/
modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/runtime/
modules/geronimo-kernel/src/main/java/org/apach...
Author: vamsic007
Date: Fri Jul 13 06:39:25 2007
New Revision: 555993
URL: http://svn.apache.org/viewvc?view=rev&rev=555993
Log:
GERONIMO-3318 LocalAttributeManager unable to save updates to LoginModuleControlFlag attribute
o Added a ClassLoader parameter to setValue() and addGBean() methods in ManageableAttributeStore interface
o Added a ClassLoader parameter to GBeanOverride.getAsText() so that the configuration's classLoader could be used to find PropertyEditor
o GBeanInstance.updateManageableAttribute() now uses the configuration's classLoader with ManageableAttributeStore.setValue() call
Modified:
geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/MavenAttributeStore.java
geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/EditableKernelConfigurationManager.java
geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ManageableAttributeStore.java
geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/GBeanOverride.java
geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java
geronimo/server/trunk/modules/geronimo-system/src/test/java/org/apache/geronimo/system/configuration/LocalAttributeManagerTest.java
Modified: geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/MavenAttributeStore.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/MavenAttributeStore.java?view=diff&rev=555993&r1=555992&r2=555993
==============================================================================
--- geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/MavenAttributeStore.java (original)
+++ geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/MavenAttributeStore.java Fri Jul 13 06:39:25 2007
@@ -47,7 +47,7 @@
return datas;
}
- public void setValue(Artifact configurationName, AbstractName gbean, GAttributeInfo attribute, Object value) {
+ public void setValue(Artifact configurationName, AbstractName gbean, GAttributeInfo attribute, Object value, ClassLoader classLoader) {
}
public void setReferencePatterns(Artifact configurationName, AbstractName gbean, GReferenceInfo reference, ReferencePatterns patterns) {
@@ -56,7 +56,7 @@
public void setShouldLoad(Artifact configurationName, AbstractName gbean, boolean load) {
}
- public void addGBean(Artifact configurationName, GBeanData gbeanData) {
+ public void addGBean(Artifact configurationName, GBeanData gbeanData, ClassLoader classLoader) {
}
public void save() throws IOException {
Modified: geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java?view=diff&rev=555993&r1=555992&r2=555993
==============================================================================
--- geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java (original)
+++ geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java Fri Jul 13 06:39:25 2007
@@ -775,7 +775,7 @@
}
Artifact configName = abstractName.getArtifact();
if (configName != null) {
- manageableStore.setValue(configName, abstractName, attribute.getAttributeInfo(), value);
+ manageableStore.setValue(configName, abstractName, attribute.getAttributeInfo(), value, classLoader);
} else {
log.error("Unable to identify Configuration for GBean " + abstractName + ". Manageable attribute " + attribute.getName() + " was not updated in persistent store.");
}
Modified: geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/EditableKernelConfigurationManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/EditableKernelConfigurationManager.java?view=diff&rev=555993&r1=555992&r2=555993
==============================================================================
--- geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/EditableKernelConfigurationManager.java (original)
+++ geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/EditableKernelConfigurationManager.java Fri Jul 13 06:39:25 2007
@@ -125,7 +125,7 @@
}
if (attributeStore != null) {
- attributeStore.addGBean(configuration.getId(), gbean);
+ attributeStore.addGBean(configuration.getId(), gbean, configurationClassLoader);
}
}
Modified: geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ManageableAttributeStore.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ManageableAttributeStore.java?view=diff&rev=555993&r1=555992&r2=555993
==============================================================================
--- geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ManageableAttributeStore.java (original)
+++ geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ManageableAttributeStore.java Fri Jul 13 06:39:25 2007
@@ -66,8 +66,9 @@
* @param gbean The ObjectName of the GBean in question
* @param attribute The attribute in question
* @param value The value to save, or null if no value should be saved
+ * @param classLoader The configuration's classLoader
*/
- public void setValue(Artifact configurationName, AbstractName gbean, GAttributeInfo attribute, Object value);
+ public void setValue(Artifact configurationName, AbstractName gbean, GAttributeInfo attribute, Object value, ClassLoader classLoader);
/**
* Sets the pattern for a GBean reference. The reference is
@@ -100,8 +101,9 @@
* Adds a GBean to the configuration.
* @param configurationName the configuration that the GBean belongs to
* @param gbeanData the GBean to add
+ * @param classLoader The configuration classLoader
*/
- public void addGBean(Artifact configurationName, GBeanData gbeanData);
+ public void addGBean(Artifact configurationName, GBeanData gbeanData, ClassLoader classLoader);
/**
* Saves the current values to persistent storage. This should be called
Modified: geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/GBeanOverride.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/GBeanOverride.java?view=diff&rev=555993&r1=555992&r2=555993
==============================================================================
--- geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/GBeanOverride.java (original)
+++ geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/GBeanOverride.java Fri Jul 13 06:39:25 2007
@@ -125,7 +125,7 @@
return buf.toString();
}
- public GBeanOverride(GBeanData gbeanData, JexlExpressionParser expressionParser) throws InvalidAttributeException {
+ public GBeanOverride(GBeanData gbeanData, JexlExpressionParser expressionParser, ClassLoader classLoader) throws InvalidAttributeException {
GBeanInfo gbeanInfo = gbeanData.getGBeanInfo();
this.gbeanInfo = gbeanInfo.getSourceClass();
if (this.gbeanInfo == null) {
@@ -143,7 +143,7 @@
throw new InvalidAttributeException("No attribute: " + attributeName + " for gbean: " + gbeanData.getAbstractName());
}
Object attributeValue = entry.getValue();
- setAttribute(attributeName, attributeValue, attributeInfo.getType());
+ setAttribute(attributeName, attributeValue, attributeInfo.getType(), classLoader);
}
// references can be coppied in blind
@@ -353,8 +353,8 @@
clearReferences.add(referenceName);
}
- public void setAttribute(String attributeName, Object attributeValue, String attributeType) throws InvalidAttributeException {
- String stringValue = getAsText(attributeValue, attributeType);
+ public void setAttribute(String attributeName, Object attributeValue, String attributeType, ClassLoader classLoader) throws InvalidAttributeException {
+ String stringValue = getAsText(attributeValue, attributeType, classLoader);
setAttribute(attributeName, stringValue);
}
@@ -636,11 +636,11 @@
return gbean;
}
- public static String getAsText(Object value, String type) throws InvalidAttributeException {
+ public static String getAsText(Object value, String type, ClassLoader classLoader) throws InvalidAttributeException {
try {
String attributeStringValue = null;
if (value != null) {
- PropertyEditor editor = PropertyEditors.findEditor(type, GBeanOverride.class.getClassLoader());
+ PropertyEditor editor = PropertyEditors.findEditor(type, classLoader);
if (editor == null) {
throw new InvalidAttributeException("Unable to format attribute of type " + type + "; no editor found");
}
Modified: geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java?view=diff&rev=555993&r1=555992&r2=555993
==============================================================================
--- geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java (original)
+++ geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java Fri Jul 13 06:39:25 2007
@@ -208,7 +208,7 @@
attributeChanged();
}
- public synchronized void setValue(Artifact configurationName, AbstractName gbeanName, GAttributeInfo attribute, Object value) {
+ public synchronized void setValue(Artifact configurationName, AbstractName gbeanName, GAttributeInfo attribute, Object value, ClassLoader classLoader) {
if (readOnly) {
return;
}
@@ -223,7 +223,7 @@
}
try {
- gbean.setAttribute(attribute.getName(), value, attribute.getType());
+ gbean.setAttribute(attribute.getName(), value, attribute.getType(), classLoader);
attributeChanged();
} catch (InvalidAttributeException e) {
// attribute can not be represented as a string
@@ -270,7 +270,7 @@
attributeChanged();
}
- public void addGBean(Artifact configurationName, GBeanData gbeanData) {
+ public void addGBean(Artifact configurationName, GBeanData gbeanData, ClassLoader classLoader) {
if (readOnly) {
return;
}
@@ -280,7 +280,7 @@
return;
}
try {
- GBeanOverride gbean = new GBeanOverride(gbeanData, expressionParser);
+ GBeanOverride gbean = new GBeanOverride(gbeanData, expressionParser, classLoader);
configuration.addGBean(gbean);
attributeChanged();
} catch (InvalidAttributeException e) {
Modified: geronimo/server/trunk/modules/geronimo-system/src/test/java/org/apache/geronimo/system/configuration/LocalAttributeManagerTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-system/src/test/java/org/apache/geronimo/system/configuration/LocalAttributeManagerTest.java?view=diff&rev=555993&r1=555992&r2=555993
==============================================================================
--- geronimo/server/trunk/modules/geronimo-system/src/test/java/org/apache/geronimo/system/configuration/LocalAttributeManagerTest.java (original)
+++ geronimo/server/trunk/modules/geronimo-system/src/test/java/org/apache/geronimo/system/configuration/LocalAttributeManagerTest.java Fri Jul 13 06:39:25 2007
@@ -67,7 +67,7 @@
// declare an attribute value so this configuration will exist in the store
String attributeValue = "attribute value";
localAttributeManager.addConfiguration(configurationName);
- localAttributeManager.setValue(configurationName, gbeanName, attributeInfo, attributeValue);
+ localAttributeManager.setValue(configurationName, gbeanName, attributeInfo, attributeValue, getClass().getClassLoader());
// should still load
newDatas = new HashSet(localAttributeManager.applyOverrides(configurationName, originalDatas, getClass().getClassLoader()));
@@ -102,7 +102,7 @@
// declare an attribute value so this configuration will exist in the store
String attributeValue = "attribute value";
localAttributeManager.addConfiguration(configurationName);
- localAttributeManager.setValue(configurationName, gbeanName, attributeInfo, attributeValue);
+ localAttributeManager.setValue(configurationName, gbeanName, attributeInfo, attributeValue, getClass().getClassLoader());
// should still load
newDatas = new HashSet(localAttributeManager.applyOverrides(configurationName, originalDatas, getClass().getClassLoader()));
@@ -122,7 +122,7 @@
public void testSetAttribute() throws Exception {
String attributeValue = "attribute value";
- localAttributeManager.setValue(configurationName, gbeanName, attributeInfo, attributeValue);
+ localAttributeManager.setValue(configurationName, gbeanName, attributeInfo, attributeValue, getClass().getClassLoader());
Collection gbeanDatas = new ArrayList();
GBeanData gbeanData = new GBeanData(gbeanName, GBEAN_INFO);
gbeanDatas.add(gbeanData);
@@ -164,7 +164,7 @@
gbeanData.setAttribute(attributeInfo.getName(), attributeValue);
gbeanData.setReferencePattern(referenceInfo.getName(), referencePattern);
localAttributeManager.addConfiguration(configurationName);
- localAttributeManager.addGBean(configurationName, gbeanData);
+ localAttributeManager.addGBean(configurationName, gbeanData, getClass().getClassLoader());
Collection gbeanDatas = new ArrayList();
@@ -182,7 +182,7 @@
public void testBadGBeanSpec() throws Exception {
String attributeValue = "attribute value";
localAttributeManager.addConfiguration(configurationName);
- localAttributeManager.setValue(configurationName, gbeanName, attributeInfo, attributeValue);
+ localAttributeManager.setValue(configurationName, gbeanName, attributeInfo, attributeValue, getClass().getClassLoader());
try {
localAttributeManager.applyOverrides(configurationName, Collections.EMPTY_SET, getClass().getClassLoader());
fail("no gbeans were specified in the 'plan' so overrides should fail");
@@ -196,7 +196,7 @@
AbstractNameQuery referencePattern = new AbstractNameQuery(LocalAttributeManagerTest.class.getName());
localAttributeManager.addConfiguration(configurationName);
- localAttributeManager.setValue(configurationName, gbeanName, attributeInfo, attributeValue);
+ localAttributeManager.setValue(configurationName, gbeanName, attributeInfo, attributeValue, getClass().getClassLoader());
Collection gbeanDatas = new ArrayList();
GBeanData gbeanData = new GBeanData(gbeanName, GBEAN_INFO);