geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From michaelf...@apache.org
Subject svn commit: r1175647 - in /geronimo/server/trunk/plugins/openejb: geronimo-openejb/src/main/java/org/apache/geronimo/openejb/ openejb-portlets/src/main/i18n-resources/ openejb-portlets/src/main/java/org/apache/geronimo/console/ejbserver/ openejb/ opene...
Date Mon, 26 Sep 2011 02:43:50 GMT
Author: michaelfang
Date: Mon Sep 26 02:43:50 2011
New Revision: 1175647

URL: http://svn.apache.org/viewvc?rev=1175647&view=rev
Log:
GERONIMO-6163 The changed values on EJB portlet are not persistent to config.xml

Modified:
    geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/BmpContainerGBean.java
    geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/SingletonContainerGBean.java
    geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/StatefulContainerGBean.java
    geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/StatelessContainerGBean.java
    geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/i18n-resources/openejb-portlet_en.properties
    geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/i18n-resources/openejb-portlet_ja.properties
    geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/i18n-resources/openejb-portlet_zh.properties
    geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/console/ejbserver/EjbHelper.java
    geronimo/server/trunk/plugins/openejb/openejb/pom.xml
    geronimo/server/trunk/plugins/openejb/openejb/src/main/plan/plan.xml

Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/BmpContainerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/BmpContainerGBean.java?rev=1175647&r1=1175646&r2=1175647&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/BmpContainerGBean.java
(original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/BmpContainerGBean.java
Mon Sep 26 02:43:50 2011
@@ -32,7 +32,7 @@ import java.util.Properties;
 @GBean
 public class BmpContainerGBean extends EjbContainer {
 
-    private final int poolSize;
+    private int poolSize;
 
     public BmpContainerGBean(
             @ParamSpecial(type = SpecialAttributeType.abstractName) AbstractName abstractName,
@@ -41,11 +41,17 @@ public class BmpContainerGBean extends E
             @ParamAttribute(name = "poolSize") int poolSize,
             @ParamAttribute(name = "properties") Properties properties) {
         super(abstractName, BmpEntityContainerInfo.class, openEjbSystem, provider, "BMP_ENTITY",
properties);
-        set("PoolSize", Integer.toString(poolSize));
-        this.poolSize = poolSize;
+
+        setPoolSize(poolSize);
     }
 
     public int getPoolSize() {
         return poolSize;
     }
+
+    public void setPoolSize(int poolSize) {
+        this.poolSize = poolSize;
+        set("PoolSize", Integer.toString(poolSize));
+    }
+
 }

Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/SingletonContainerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/SingletonContainerGBean.java?rev=1175647&r1=1175646&r2=1175647&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/SingletonContainerGBean.java
(original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/SingletonContainerGBean.java
Mon Sep 26 02:43:50 2011
@@ -34,7 +34,7 @@ import java.util.concurrent.TimeUnit;
 @GBean
 public class SingletonContainerGBean extends EjbContainer {
 
-    private final long accessTimeout;
+    private long accessTimeout;
 
     public SingletonContainerGBean(
             @ParamSpecial(type = SpecialAttributeType.abstractName) AbstractName abstractName,
@@ -44,12 +44,17 @@ public class SingletonContainerGBean ext
             @ParamAttribute(name = "properties") Properties properties) {
         super(abstractName, SingletonSessionContainerInfo.class, openEjbSystem, provider,
"SINGLETON", properties);
 
-        Duration duration = new Duration(accessTimeout, TimeUnit.SECONDS);
-        set("AccessTimeout", duration.toString());
-        this.accessTimeout = accessTimeout;
+        setAccessTimeout(accessTimeout);
     }
 
     public long getAccessTimeout() {
         return accessTimeout;
     }
+
+    public void setAccessTimeout(long accessTimeout) {
+        this.accessTimeout = accessTimeout;
+        Duration duration = new Duration(accessTimeout, TimeUnit.SECONDS);
+        set("AccessTimeout", duration.toString());
+    }
+
 }

Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/StatefulContainerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/StatefulContainerGBean.java?rev=1175647&r1=1175646&r2=1175647&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/StatefulContainerGBean.java
(original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/StatefulContainerGBean.java
Mon Sep 26 02:43:50 2011
@@ -40,25 +40,25 @@ public class StatefulContainerGBean exte
      * 
      * After the timeout is reached a javax.ejb.ConcurrentAccessTimeoutException will be
thrown.
      */
-    private final int accessTimeout;   
+    private long accessTimeout;   
     
     
     /**
      * Maximum number of values that should be in the LRU
      */
-    private final int capacity;
+    private int capacity;
 
     /**
      * When the LRU is exceeded, this is the is the number of beans stored.
      * This helps to avoid passivating a bean at a time.
      */
-    private final int bulkPassivate;
+    private int bulkPassivate;
 
     /**
      * A bean may be destroyed if it isn't used in this length of time (in
      * milliseconds).
      */
-    private final long timeout;
+    private long timeOut;
 
 
     public StatefulContainerGBean(
@@ -66,31 +66,53 @@ public class StatefulContainerGBean exte
             @ParamReference(name = "OpenEjbSystem") OpenEjbSystem openEjbSystem,
             @ParamAttribute(name = "provider") String provider,
             @ParamAttribute(name = "bulkPassivate") int bulkPassivate,
-            @ParamAttribute(name = "accessTimeout") int accessTimeout,
+            @ParamAttribute(name = "accessTimeout") long accessTimeout,
             @ParamAttribute(name = "capacity") int capacity,
-            @ParamAttribute(name = "timeout") long timeout,
+            @ParamAttribute(name = "timeOut") long timeOut,
             @ParamAttribute(name = "properties") Properties properties) {
         super(abstractName, StatefulSessionContainerInfo.class, openEjbSystem, provider,
"STATEFUL", properties);
-        set("BulkPassivate", Integer.toString(bulkPassivate));
+        setAccessTimeout(accessTimeout);
+        setCapacity(capacity);
+        setBulkPassivate(bulkPassivate);
+        setTimeOut(timeOut);
+    }
+
+
+    public long getAccessTimeout() {
+        return accessTimeout;
+    }
+
+    public void setAccessTimeout(long accessTimeout) {
+        this.accessTimeout = accessTimeout;
         Duration accessTimeoutDuration = new Duration(accessTimeout, TimeUnit.SECONDS);
         set("AccessTimeout", accessTimeoutDuration.toString());
-        set("Capacity", Integer.toString(capacity));
-        set("TimeOut", Long.toString(timeout));
-        this.bulkPassivate = bulkPassivate;
-        this.accessTimeout = accessTimeout;
-        this.capacity = capacity;
-        this.timeout = timeout;
     }
 
     public int getBulkPassivate() {
         return bulkPassivate;
     }
 
+    public void setBulkPassivate(int bulkPassivate) {
+        this.bulkPassivate = bulkPassivate;
+        set("BulkPassivate", Integer.toString(bulkPassivate));
+    }
+
     public int getCapacity() {
         return capacity;
     }
 
-    public long getTimeout() {
-        return timeout;
+    public void setCapacity(int capacity) {
+        this.capacity = capacity;
+        set("Capacity", Integer.toString(capacity));
     }
+    
+    public long getTimeOut() {
+        return timeOut;
+    }
+    
+    public void setTimeOut(long timeOut) {
+        this.timeOut = timeOut;
+        set("TimeOut", Long.toString(timeOut));
+    }
+
 }

Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/StatelessContainerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/StatelessContainerGBean.java?rev=1175647&r1=1175646&r2=1175647&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/StatelessContainerGBean.java
(original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/StatelessContainerGBean.java
Mon Sep 26 02:43:50 2011
@@ -40,7 +40,7 @@ public class StatelessContainerGBean ext
      * After the timeout is reached, if an instance in the pool cannot be obtained, the method
invocation will fail.
      * 
      */
-    private final int accessTimeout;
+    private long accessTimeout;
     
     /**
      * PostConstruct methods are invoked on all instances in the pool
@@ -55,20 +55,20 @@ public class StatelessContainerGBean ext
      * stateless SessionBean container.
      */
 
-    private final int maxSize;
+    private int maxSize;
     
     
     /** Specifies the minimum number of bean instances that should be
      * in this stateless SessionBean container  
      */
-     private int minSize;
+    private int minSize;
      
      
 	/**
 	 * Specifies the maximum time that an instance should be allowed to sit idly
 	 * in the pool without use before it should be retired and removed.
 	 */
-      private int idleTimeout;
+    private int idleTimeout;
      
 
     /**
@@ -84,7 +84,7 @@ public class StatelessContainerGBean ext
      * instances to meet demand. The instances will last for just one
      * method invocation and then are removed.
      */
-    private final boolean strictPooling;
+    private boolean strictPooling;
 
 
     public StatelessContainerGBean(
@@ -94,49 +94,75 @@ public class StatelessContainerGBean ext
             @ParamAttribute(name = "maxSize") int maxSize,
             @ParamAttribute(name = "minSize") int minSize,
             @ParamAttribute(name = "strictPooling") boolean strictPooling,
-            @ParamAttribute(name = "accessTimeout") int accessTimeout,
+            @ParamAttribute(name = "accessTimeout") long accessTimeout,
             @ParamAttribute(name = "closeTimeout") int closeTimeout,
             @ParamAttribute(name = "idleTimeout") int idleTimeout,            
             @ParamAttribute(name = "properties") Properties properties) {
         super(abstractName, StatelessSessionContainerInfo.class, openEjbSystem, provider,
"STATELESS", properties);
-        set("MaxSize", Integer.toString(maxSize));
-        set("MinSize", Integer.toString(minSize));        
-        set("StrictPooling", Boolean.toString(strictPooling));
-        Duration accessTimeoutDuration = new Duration(accessTimeout, TimeUnit.SECONDS);
-        set("AccessTimeout", accessTimeoutDuration.toString());
-        Duration closeTimeoutDuration = new Duration(closeTimeout, TimeUnit.MINUTES);
-        set("CloseTimeout", closeTimeoutDuration.toString());
-        Duration idleTimeoutDuration = new Duration(idleTimeout, TimeUnit.MINUTES);
-        set("IdleTimeout", idleTimeoutDuration.toString());
-        this.maxSize = maxSize;
-        this.minSize= minSize;
-        this.strictPooling = strictPooling;
-        this.accessTimeout = accessTimeout;
-        this.closeTimeout=closeTimeout;
-        this.idleTimeout=idleTimeout;        
+
+        setMaxSize(maxSize);
+        setMinSize(minSize);
+        setStrictPooling(strictPooling);
+        setAccessTimeout(accessTimeout);
+        setCloseTimeout(closeTimeout);
+        setIdleTimeout(idleTimeout);     
     }
 
-    public int getPoolSize() {
+    public int getMaxSize() {
         return maxSize;
     }
 
+    public void setMaxSize(int maxSize) {
+        this.maxSize = maxSize;
+        set("MaxSize", Integer.toString(maxSize));
+    }
+
+    public int getMinSize() {
+        return minSize;
+    }
+
+    public void setMinSize(int minSize) {
+        this.minSize = minSize;
+        set("MinSize", Integer.toString(minSize));
+    }
+
     public boolean isStrictPooling() {
         return strictPooling;
     }
 
-    public int getAccessTimeout() {
+    public void setStrictPooling(boolean strictPooling) {
+        this.strictPooling = strictPooling;
+        set("StrictPooling", Boolean.toString(strictPooling));
+    }
+
+    public long getAccessTimeout() {
         return accessTimeout;
     }
 
+    public void setAccessTimeout(long accessTimeout) {
+        this.accessTimeout = accessTimeout;
+        Duration accessTimeoutDuration = new Duration(accessTimeout, TimeUnit.SECONDS);
+        set("AccessTimeout", accessTimeoutDuration.toString());
+    }
+
     public int getCloseTimeout() {
         return closeTimeout;
     }
-    
+
+    public void setCloseTimeout(int closeTimeout) {
+        this.closeTimeout = closeTimeout;
+        Duration closeTimeoutDuration = new Duration(closeTimeout, TimeUnit.MINUTES);
+        set("CloseTimeout", closeTimeoutDuration.toString());
+    }
+
     public int getIdleTimeout() {
         return idleTimeout;
     }    
 
-    public int getPoolMin() {
-        return minSize;
+    public void setIdleTimeout(int idleTimeout) {
+        this.idleTimeout=idleTimeout;
+        Duration idleTimeoutDuration = new Duration(idleTimeout, TimeUnit.MINUTES);
+        set("IdleTimeout", idleTimeoutDuration.toString());
     }
+
 }

Modified: geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/i18n-resources/openejb-portlet_en.properties
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/i18n-resources/openejb-portlet_en.properties?rev=1175647&r1=1175646&r2=1175647&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/i18n-resources/openejb-portlet_en.properties
(original)
+++ geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/i18n-resources/openejb-portlet_en.properties
Mon Sep 26 02:43:50 2011
@@ -101,9 +101,9 @@ portlet.openejb.view.numeric            
 portlet.openejb.view.primarykeyclass          = Primary Key Class
 portlet.openejb.view.primarykeyfield          = Primary Key Field
 portlet.openejb.view.remoteinterface          = Remote Interface
-portlet.openejb.view.restart                  = Restart the openejb configuration for the
changes to take effect.
+portlet.openejb.view.restart                  = Restart the server for the changes to take
effect.
 portlet.openejb.view.sepinterface             = Service EndPoint Interface
 portlet.openejb.view.unchanged                = An unexpected error has occurred and the
value cannot be set.
-portlet.openejb.view.unrestarted              = The openejb configuration should be restarted
for the changes that were made to the fields to take effect. The changed fields are now shown
in red color.
+portlet.openejb.view.unrestarted              = The server should be restarted for the changes
that were made to the fields to take effect. The changed fields are now shown in red color.
 portlet.openejb.view.update                   = Update
 portlet.openejb.view.value                    = Value

Modified: geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/i18n-resources/openejb-portlet_ja.properties
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/i18n-resources/openejb-portlet_ja.properties?rev=1175647&r1=1175646&r2=1175647&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/i18n-resources/openejb-portlet_ja.properties
(original)
+++ geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/i18n-resources/openejb-portlet_ja.properties
Mon Sep 26 02:43:50 2011
@@ -101,9 +101,9 @@ portlet.openejb.view.numeric            
 portlet.openejb.view.primarykeyclass          = Primary Key Class
 portlet.openejb.view.primarykeyfield          = Primary Key Field
 portlet.openejb.view.remoteinterface          = Remote Interface
-portlet.openejb.view.restart                  = 影響を与える変更については
OpenEJB の構成を再始動してください。
+portlet.openejb.view.restart                  = Restart the server for the changes to take
effect.
 portlet.openejb.view.sepinterface             = Service EndPoint Interface
 portlet.openejb.view.unchanged                = 予期しなかったエラーが発生し、値を設定することができません。
-portlet.openejb.view.unrestarted              = OpenEJB の構成で項目に影響を与えてしまった変更は再始動すべきです。変更された項目は赤色で表示されます。
+portlet.openejb.view.unrestarted              = The server should be restarted for the changes
that were made to the fields to take effect. The changed fields are now shown in red color.
 portlet.openejb.view.update                   = 更新
 portlet.openejb.view.value                    = 値

Modified: geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/i18n-resources/openejb-portlet_zh.properties
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/i18n-resources/openejb-portlet_zh.properties?rev=1175647&r1=1175646&r2=1175647&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/i18n-resources/openejb-portlet_zh.properties
(original)
+++ geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/i18n-resources/openejb-portlet_zh.properties
Mon Sep 26 02:43:50 2011
@@ -101,9 +101,9 @@ portlet.openejb.view.numeric            
 portlet.openejb.view.primarykeyclass          = 主键类
 portlet.openejb.view.primarykeyfield          = 主键字段
 portlet.openejb.view.remoteinterface          = 远程接口
-portlet.openejb.view.restart                  = OpenEJB需要重启以使配置生效。
+portlet.openejb.view.restart                  = 服务器需要重启以使配置生效。
 portlet.openejb.view.sepinterface             = 服务终端接口
 portlet.openejb.view.unchanged                = 发生了不可预料的错误,
{0}的值没有被修改。
-portlet.openejb.view.unrestarted              = OpenEJB配置模块需要重启以使属性修改生效,
修改了的属性以红色显示。
+portlet.openejb.view.unrestarted              = 服务器需要重启以使属性修改生效,
修改了的属性以红色显示。
 portlet.openejb.view.update                   = 更新
 portlet.openejb.view.value                    = 值

Modified: geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/console/ejbserver/EjbHelper.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/console/ejbserver/EjbHelper.java?rev=1175647&r1=1175646&r2=1175647&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/console/ejbserver/EjbHelper.java
(original)
+++ geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/console/ejbserver/EjbHelper.java
Mon Sep 26 02:43:50 2011
@@ -73,6 +73,7 @@ public class EjbHelper extends BaseRemot
     private static final String ACCESSTIMEOUT = "AccessTimeout";
     private static final String IDLETIMEOUT = "IdleTimeout";    
     private static final String PASSIVATOR = "Passivator";
+    private static final String TIMEOUT = "TimeOut";
     private static final String STRICTPOOLING = "StrictPooling";
     private static final String INSTANCELIMIT = "InstanceLimit";
     private static final String CMPENGINEFACTORY = "CmpEngineFactory";
@@ -231,45 +232,38 @@ public class EjbHelper extends BaseRemot
                 information.setId("DisplayName");
                 information.setValue(containerInfo.displayName);
                 infos.add(information);
-                List<String> editableProperties = new ArrayList<String>();
-                editableProperties.add(POOLSIZE);
-                editableProperties.add(POOLMIN);                
-                editableProperties.add(BULKPASSIVATE);
-                editableProperties.add(CLOSETIMEOUT);
-                editableProperties.add(ACCESSTIMEOUT);
-                editableProperties.add(IDLETIMEOUT);                
-                editableProperties.add(CAPACITY);
-                editableProperties.add(STRICTPOOLING);
-                editableProperties.add(INSTANCELIMIT);
 
                 for (Map.Entry entry : containerInfo.properties.entrySet()) {
                     information = new EjbInformation();
-                    information.setName(entry.getKey().toString());
-                    information.setId(entry.getKey().toString());
-                    if (entry.getKey().toString().equals(RESOURCEADAPTER)) {
-                        information.setValue(entry.getValue().getClass()
-                                .getName());
-                    } else {
-                        information.setValue(entry.getValue().toString());
+
+                    String key = entry.getKey().toString();
+                    String value = entry.getValue().toString();
+
+                    information.setId(key);
+
+                    String name = key;
+                    if (ACCESSTIMEOUT.equals(key)) {
+                        name = key + " (seconds)";
+                    } else if (TIMEOUT.equals(key) || CLOSETIMEOUT.equals(key) || IDLETIMEOUT.equals(key))
{
+                        name = key + " (minutes)";
                     }
-                    if (editableProperties.contains(entry.getKey().toString())) {
-                        String key = information.getName();
-                        String value = null;
-                        if (props != null && props.containsKey(key)) {
-                            value = (String) props.get(key);
-                        } else if (props != null
-                                && props.containsKey(containerId + "." + key)) {
-                            value = (String) props.get(containerId + "." + key);
-                        } else {
-                            value = information.getValue();
-                        }
-                        if (!value.equals(information.getValue())) {
+                    information.setName(name);
+
+                    String attributeName = key.substring(0,1).toLowerCase() + key.substring(1);
+                    Object attributeValue = data.getAttribute(attributeName);
+                    if (attributeValue != null) {
+                        information.setEditable(TRUE);
+                        information.setValue(attributeValue.toString());
+                        if (props != null && !value.equals(props.get(key))) {
                             information.setDirty(TRUE);
                         }
-                        information.setValue(value);
-                        information.setEditable(TRUE);
                     } else {
                         information.setEditable(FALSE);
+                        if (key.equals(RESOURCEADAPTER)) {
+                            information.setValue(entry.getValue().getClass().getName());
+                        } else {
+                            information.setValue(value);
+                        }
                     }
                     infos.add(information);
                 }
@@ -287,91 +281,67 @@ public class EjbHelper extends BaseRemot
 
         containerId = replaceEscapes(containerId);
 
-        List<String> numericProperties = new ArrayList<String>();
-        numericProperties.add(POOLSIZE);
-        numericProperties.add(POOLMIN);        
-        numericProperties.add(BULKPASSIVATE);
-        numericProperties.add(CLOSETIMEOUT);
-        numericProperties.add(ACCESSTIMEOUT);
-        numericProperties.add(IDLETIMEOUT);           
-        numericProperties.add(INSTANCELIMIT);
-        numericProperties.add(CAPACITY);
-     
+        Container container = containerSystem.getContainer(containerId);
 
-        if (numericProperties.contains(propertyKey)) {
-            try {
-                Integer.parseInt(propertyValue);
-            } catch (NumberFormatException nfe) {
-                return new JSCommonMessage(CommonMessage.Type.Error, getLocalizedString(request,
BUNDLE_NAME, "portlet.openejb.view.numeric", propertyKey), null);
-            }
-        } else if (STRICTPOOLING.equals(propertyKey)) {
-            if (!propertyValue.equalsIgnoreCase(TRUE)
-                    && !propertyValue.equalsIgnoreCase(FALSE)) {
-                return new JSCommonMessage(CommonMessage.Type.Error, getLocalizedString(request,
BUNDLE_NAME, "portlet.openejb.view.boolean", propertyKey), null);
-            }
-        } else {
-            try {
-                EjbHelper.class.getClassLoader().loadClass(propertyValue);
-            } catch (ClassNotFoundException e) {
-                return new JSCommonMessage(CommonMessage.Type.Error, getLocalizedString(request,
BUNDLE_NAME, "portlet.openejb.view.invalid", propertyKey), null);
-            }
-        }
+        String query = null;
 
-        Properties props = null;
-        Container container = containerSystem.getContainer(containerId);
         if (container.getContainerType() == ContainerType.MESSAGE_DRIVEN) {
-            OpenEjbSystem openEjbSystem = null;
-            AbstractNameQuery absQuery = new AbstractNameQuery(
-                    OpenEjbSystem.class.getName());
-            Set<AbstractName> systemGBeans = kernel.listGBeans(absQuery);
-            for (AbstractName absName : systemGBeans) {
-                openEjbSystem = kernel.getProxyManager()
-                        .createProxy(absName, OpenEjbSystem.class);
-                props = openEjbSystem.getProperties();
-                if (props == null) {
-                    props = new Properties();
-                }
-                props.put(containerId + "." + propertyKey, propertyValue);
-                openEjbSystem.setProperties(props);
-                getGBeanDataFromConfiguration(absName).setAttribute("properties", props);
+            query = OpenEjbSystem.class.getName();
+        } else {
+            query = EjbContainer.class.getName();
+        }
 
+        AbstractNameQuery absQuery = new AbstractNameQuery(query);
+        Set<AbstractName> gbeans = kernel.listGBeans(absQuery);
+        for (AbstractName gbean : gbeans) {
+            if (!gbean.getName().get("name").equals(containerId)) {
+                continue;
             }
-        } else {
-            AbstractNameQuery absQuery = new AbstractNameQuery(
-                    EjbContainer.class.getName());
-            Set<AbstractName> containerGBeans = kernel.listGBeans(absQuery);
-            for (AbstractName absName : containerGBeans) {
+            String attributeName = propertyKey.substring(0,1).toLowerCase() + propertyKey.substring(1);
+            Object attributeValue = null;
+
+            if (ACCESSTIMEOUT.equals(propertyKey) || TIMEOUT.equals(propertyKey)) {
                 try {
-                    String id = (String) kernel.getAttribute(absName, "id");
-                    if (containerId.equals(id)) {
-                        GBeanData gData1  = kernel.getGBeanData(absName);
-                        ManageableAttributeStore attributeStore = kernel.getGBean(ManageableAttributeStore.class);
-                        GBeanData gData  = getGBeanDataFromConfiguration(absName);
-                        for(String attributeName : gData.getAttributeNames()){
-                            if(attributeName.equalsIgnoreCase(propertyKey)){
-                                // Hack to make changed values reflect on configuration restart.
-                                gData.setAttribute(attributeName, propertyValue);
-                                Properties gbeanProps = (Properties)gData1.getAttribute("properties");
-                                gbeanProps.setProperty(propertyKey, propertyValue);
-                                GAttributeInfo gAttributeInfo = gData.getGBeanInfo().getAttribute(attributeName);
-// TODO:  This needs to be solved and re-enabled.
-//                                 attributeStore.setValue(absName.getArtifact(), absName,
gAttributeInfo, propertyValue, Thread.currentThread().getContextClassLoader());
-                            }
-                        }
-                    }
-                } catch (GBeanNotFoundException e) {
-                    return new JSCommonMessage(CommonMessage.Type.Error,
-                            getLocalizedString(request, BUNDLE_NAME, "portlet.openejb.view.unchanged",
propertyKey), null);
-                } catch (NoSuchAttributeException e) {
-                    return new JSCommonMessage(CommonMessage.Type.Error,
-                            getLocalizedString(request, BUNDLE_NAME, "portlet.openejb.view.unchanged",
propertyKey), null);
-                } catch (Exception e) {
-                    return new JSCommonMessage(CommonMessage.Type.Error,
-                            getLocalizedString(request, BUNDLE_NAME, "portlet.openejb.view.unchanged",
propertyKey), null);
+                    attributeValue = Long.parseLong(propertyValue);
+                } catch (NumberFormatException nfe) {
+                    return new JSCommonMessage(CommonMessage.Type.Error, 
+                            getLocalizedString(request, BUNDLE_NAME, "portlet.openejb.view.numeric",
propertyKey), null);
+                }
+            } else if (STRICTPOOLING.equals(propertyKey)) {
+                if (!propertyValue.equalsIgnoreCase(TRUE)
+                        && !propertyValue.equalsIgnoreCase(FALSE)) {
+                    return new JSCommonMessage(CommonMessage.Type.Error, 
+                            getLocalizedString(request, BUNDLE_NAME, "portlet.openejb.view.boolean",
propertyKey), null);
+                }
+                attributeValue = Boolean.parseBoolean(propertyValue);
+            } else {
+                try {
+                    attributeValue = Integer.parseInt(propertyValue);
+                } catch (NumberFormatException nfe) {
+                    return new JSCommonMessage(CommonMessage.Type.Error, 
+                            getLocalizedString(request, BUNDLE_NAME, "portlet.openejb.view.numeric",
propertyKey), null);
                 }
             }
+
+            try {
+                kernel.setAttribute(gbean, attributeName, attributeValue);
+            } catch (GBeanNotFoundException e) {
+                return new JSCommonMessage(CommonMessage.Type.Error,
+                        getLocalizedString(request, BUNDLE_NAME, "portlet.openejb.view.unchanged",
propertyKey), null);
+            } catch (NoSuchAttributeException e) {
+                return new JSCommonMessage(CommonMessage.Type.Error,
+                        getLocalizedString(request, BUNDLE_NAME, "portlet.openejb.view.unchanged",
propertyKey), null);
+            } catch (Exception e) {
+                return new JSCommonMessage(CommonMessage.Type.Error,
+                        getLocalizedString(request, BUNDLE_NAME, "portlet.openejb.view.unchanged",
propertyKey), null);
+            }
+            
+            return new JSCommonMessage(CommonMessage.Type.Warn, 
+                    getLocalizedString(request, BUNDLE_NAME, "portlet.openejb.view.restart"),
null);
         }
-        return new JSCommonMessage(CommonMessage.Type.Warn, getLocalizedString(request, BUNDLE_NAME,
"portlet.openejb.view.restart"), null);
+
+        return new JSCommonMessage(CommonMessage.Type.Error,
+                getLocalizedString(request, BUNDLE_NAME, "portlet.openejb.view.unchanged",
propertyKey), null);
     }
 
     private GBeanData getGBeanDataFromConfiguration(AbstractName absName){

Modified: geronimo/server/trunk/plugins/openejb/openejb/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/openejb/pom.xml?rev=1175647&r1=1175646&r2=1175647&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/openejb/pom.xml (original)
+++ geronimo/server/trunk/plugins/openejb/openejb/pom.xml Mon Sep 26 02:43:50 2011
@@ -227,39 +227,27 @@
                                     <attribute name="clusterName">${ClusterName}</attribute>
                                 </gbean>
                                 <gbean name="DefaultStatefulContainer">
-                                    <attribute name="accessTimeout">${StatefulAccessTimeout}</attribute>
-                                    <attribute name="timeout">${StatefulTimeout}</attribute>
-                                    <attribute name="capacity">${StatefulCapacity}</attribute>
-                                    <attribute name="bulkPassivate">${StatefulBulkPassivate}</attribute>
+                                    <attribute name="accessTimeout">30</attribute>
+                                    <attribute name="timeOut">20</attribute>
+                                    <attribute name="capacity">1000</attribute>
+                                    <attribute name="bulkPassivate">100</attribute>
                                 </gbean>
                                 <gbean name="DefaultSingletonContainer">
-                                    <attribute name="accessTimeout">${SingletonAccessTimeout}</attribute>
+                                    <attribute name="accessTimeout">30</attribute>
                                 </gbean>
                                 <gbean name="DefaultBMPContainer">
-                                    <attribute name="poolSize">${BMPPoolSize}</attribute>
+                                    <attribute name="poolSize">10</attribute>
                                 </gbean>
                                 <gbean name="DefaultStatelessContainer">
-                                    <attribute name="accessTimeout">${StatelessAccessTimeout}</attribute>
-                                    <attribute name="closeTimeout">${StatelessCloseTimeout}</attribute>
                                   
-                                    <attribute name="maxSize">${StatelessPoolSize}</attribute>
-                                    <attribute name="minSize">${StatelessMinPoolSize}</attribute>
                                   
-                                    <attribute name="strictPooling">${StatelessStrictPooling}</attribute>
-                                    <attribute name="idleTimeout">${StatelessIdleTimeout}</attribute>
                                     
+                                    <attribute name="accessTimeout">30</attribute>
+                                    <attribute name="closeTimeout">5</attribute>
+                                    <attribute name="maxSize">10</attribute>
+                                    <attribute name="minSize">0</attribute>
+                                    <attribute name="strictPooling">true</attribute>
+                                    <attribute name="idleTimeout">0</attribute>
                                 </gbean>
                             </config-xml-content>
                             <config-substitution key="OpenEJBPort">4201</config-substitution>
-                            <config-substitution key="StatefulAccessTimeout">30</config-substitution>
-                            <config-substitution key="StatefulTimeout">20</config-substitution>
-                            <config-substitution key="StatefulCapacity">1000</config-substitution>
-                            <config-substitution key="StatefulBulkPassivate">100</config-substitution>
-                            <config-substitution key="SingletonAccessTimeout">30</config-substitution>
-                            <config-substitution key="BMPPoolSize">10</config-substitution>
-                            <config-substitution key="StatelessAccessTimeout">30</config-substitution>
-                            <config-substitution key="StatelessCloseTimeout">5</config-substitution>
                           
-                            <config-substitution key="StatelessPoolSize">10</config-substitution>

-                            <config-substitution key="StatelessMinPoolSize">0</config-substitution>
                            
-                            <config-substitution key="StatelessStrictPooling">true</config-substitution>
-                            <config-substitution key="StatelessIdleTimeout">0</config-substitution>
                              
                             <config-substitution key="MulticastDiscoveryAddress">239.255.3.2</config-substitution>
                             <config-substitution key="MulticastDiscoveryPort">6142</config-substitution>
                             <config-substitution key="MultipointHost">0.0.0.0</config-substitution>

Modified: geronimo/server/trunk/plugins/openejb/openejb/src/main/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/openejb/src/main/plan/plan.xml?rev=1175647&r1=1175646&r2=1175647&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/openejb/src/main/plan/plan.xml (original)
+++ geronimo/server/trunk/plugins/openejb/openejb/src/main/plan/plan.xml Mon Sep 26 02:43:50
2011
@@ -55,7 +55,7 @@
     </gbean>
     <gbean name="DefaultStatefulContainer" class="org.apache.geronimo.openejb.StatefulContainerGBean">
         <attribute name="accessTimeout">30</attribute>
-        <attribute name="timeout">20</attribute>
+        <attribute name="timeOut">20</attribute>
         <attribute name="capacity">1000</attribute>
         <attribute name="bulkPassivate">100</attribute>
         <reference name="OpenEjbSystem">



Mime
View raw message