geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r698750 - in /geronimo/server/trunk/plugins/openejb: geronimo-openejb/src/main/java/org/apache/geronimo/openejb/ openejb-clustering-wadi/src/main/plan/ openejb/src/main/plan/
Date Wed, 24 Sep 2008 21:43:04 GMT
Author: dblevins
Date: Wed Sep 24 14:43:04 2008
New Revision: 698750

URL: http://svn.apache.org/viewvc?rev=698750&view=rev
Log:
Improved integration so	that the properties of each container are gbean	attributes.

Added:
    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/CmpContainerGBean.java
    geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/GenericContainerGBean.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
Modified:
    geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbContainer.java
    geronimo/server/trunk/plugins/openejb/openejb-clustering-wadi/src/main/plan/plan.xml
    geronimo/server/trunk/plugins/openejb/openejb/src/main/plan/plan.xml

Added: 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=698750&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/BmpContainerGBean.java
(added)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/BmpContainerGBean.java
Wed Sep 24 14:43:04 2008
@@ -0,0 +1,51 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.openejb;
+
+import org.apache.geronimo.gbean.annotation.GBean;
+import org.apache.geronimo.gbean.annotation.ParamSpecial;
+import org.apache.geronimo.gbean.annotation.ParamReference;
+import org.apache.geronimo.gbean.annotation.ParamAttribute;
+import org.apache.geronimo.gbean.annotation.SpecialAttributeType;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.openejb.assembler.classic.BmpEntityContainerInfo;
+
+import java.util.Properties;
+
+/**
+ * @version $Rev$ $Date$
+ */
+@GBean
+public class BmpContainerGBean extends EjbContainer {
+
+    private final int poolSize;
+
+    public BmpContainerGBean(
+            @ParamSpecial(type = SpecialAttributeType.abstractName) AbstractName abstractName,
+            @ParamReference(name = "OpenEjbSystem") OpenEjbSystem openEjbSystem,
+            @ParamAttribute(name = "provider") String provider,
+            @ParamAttribute(name = "accessTimeout") int accessTimeout,
+            @ParamAttribute(name = "properties") Properties properties) {
+        super(abstractName, BmpEntityContainerInfo.class, openEjbSystem, provider, "BMP_ENTITY",
properties);
+        set("AccessTimeout", Integer.toString(accessTimeout));
+        this.poolSize = accessTimeout;
+    }
+
+    public int getPoolSize() {
+        return poolSize;
+    }
+}

Added: geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/CmpContainerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/CmpContainerGBean.java?rev=698750&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/CmpContainerGBean.java
(added)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/CmpContainerGBean.java
Wed Sep 24 14:43:04 2008
@@ -0,0 +1,43 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.openejb;
+
+import org.apache.geronimo.gbean.annotation.GBean;
+import org.apache.geronimo.gbean.annotation.ParamSpecial;
+import org.apache.geronimo.gbean.annotation.ParamReference;
+import org.apache.geronimo.gbean.annotation.ParamAttribute;
+import org.apache.geronimo.gbean.annotation.SpecialAttributeType;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.openejb.assembler.classic.CmpEntityContainerInfo;
+
+import java.util.Properties;
+
+/**
+ * @version $Rev$ $Date$
+ */
+@GBean
+public class CmpContainerGBean extends EjbContainer {
+
+    public CmpContainerGBean(
+            @ParamSpecial(type = SpecialAttributeType.abstractName) AbstractName abstractName,
+            @ParamReference(name = "OpenEjbSystem") OpenEjbSystem openEjbSystem,
+            @ParamAttribute(name = "provider") String provider,
+            @ParamAttribute(name = "properties") Properties properties) {
+        super(abstractName, CmpEntityContainerInfo.class, openEjbSystem, provider, "CMP_ENTITY",
properties);
+    }
+
+}

Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbContainer.java?rev=698750&r1=698749&r2=698750&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbContainer.java
(original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbContainer.java
Wed Sep 24 14:43:04 2008
@@ -16,10 +16,7 @@
  */
 package org.apache.geronimo.openejb;
 
-import java.util.Properties;
-
-import org.apache.geronimo.gbean.GBeanInfo;
-import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.GBeanLifecycle;
 import org.apache.openejb.assembler.classic.ContainerInfo;
 import org.apache.openejb.assembler.classic.StatelessSessionContainerInfo;
@@ -28,73 +25,56 @@
 import org.apache.openejb.assembler.classic.CmpEntityContainerInfo;
 import org.apache.openejb.assembler.classic.MdbContainerInfo;
 
+import java.util.Properties;
+
 /**
  * @version $Rev$ $Date$
  */
 public class EjbContainer implements GBeanLifecycle {
-    private OpenEjbSystem openEjbSystem;
-    private String id;
-    private Properties properties;
-    private String provider;
-    private String type;
-    private Class<? extends ContainerInfo> infoType;
+    private final OpenEjbSystem openEjbSystem;
+    private final String id;
+    private final Properties properties = new Properties();
+    private final String provider;
+    private final String type;
+    private final Class<? extends ContainerInfo> infoType;
 
-    public OpenEjbSystem getOpenEjbSystem() {
-        return openEjbSystem;
+    public EjbContainer(AbstractName abstractName, Class<? extends ContainerInfo> infoType,
OpenEjbSystem openEjbSystem, String provider, String type, Properties properties) {
+        this.id = (String) abstractName.getName().get("name");
+        this.infoType = infoType;
+        this.openEjbSystem = openEjbSystem;
+        this.provider = provider;
+        this.type = type;
+        if (properties != null){
+            this.properties.putAll(properties);
+        }
     }
 
-    public void setOpenEjbSystem(OpenEjbSystem openEjbSystem) {
-        this.openEjbSystem = openEjbSystem;
+    protected Object set(String key, String value) {
+        return properties.setProperty(key, value);
     }
 
     public String getId() {
         return id;
     }
 
-    public void setId(String id) {
-        this.id = id;
+    public OpenEjbSystem getOpenEjbSystem() {
+        return openEjbSystem;
     }
 
     public Properties getProperties() {
         return properties;
     }
 
-    public void setProperties(Properties properties) {
-        this.properties = properties;
-    }
-
     public String getProvider() {
         return provider;
     }
 
-    public void setProvider(String provider) {
-        this.provider = provider;
-    }
-
     public String getType() {
         return type;
     }
 
-    public void setType(String type) {
-        this.type = type;
-    }
-
-    public static Class<? extends ContainerInfo> getInfoType(String type) {
-        if ("STATELESS".equalsIgnoreCase(type)) return StatelessSessionContainerInfo.class;
-        if ("STATEFUL".equalsIgnoreCase(type)) return StatefulSessionContainerInfo.class;
-        if ("BMP_ENTITY".equalsIgnoreCase(type)) return BmpEntityContainerInfo.class;
-        if ("CMP_ENTITY".equalsIgnoreCase(type)) return CmpEntityContainerInfo.class;
-        if ("CMP2_ENTITY".equalsIgnoreCase(type)) return CmpEntityContainerInfo.class;
-        if ("MESSAGE".equalsIgnoreCase(type)) return MdbContainerInfo.class;
-        else return ContainerInfo.class;
-    }
-
     public Class<? extends ContainerInfo> getInfoType() {
-        return infoType == null? getInfoType(type): infoType;
-    }
-
-    public void setInfoType(Class<? extends ContainerInfo> infoType) {
-        this.infoType = infoType;
+        return infoType;
     }
 
     public void doStart() throws Exception {
@@ -107,20 +87,14 @@
     public void doFail() {
     }
 
-    public static final GBeanInfo GBEAN_INFO;
-
-    static {
-        GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(EjbContainer.class);
-        infoBuilder.addReference("OpenEjbSystem", OpenEjbSystem.class);
-        infoBuilder.addAttribute("id", String.class, true);
-        infoBuilder.addAttribute("properties", Properties.class, true);
-        infoBuilder.addAttribute("provider", String.class, true);
-        infoBuilder.addAttribute("type", String.class, true);
-        infoBuilder.addAttribute("infoType", Class.class, true);
-        GBEAN_INFO = infoBuilder.getBeanInfo();
-    }
-
-    public static GBeanInfo getGBeanInfo() {
-        return GBEAN_INFO;
+    public static Class<? extends ContainerInfo> getInfoType(String type) {
+        if ("STATELESS".equalsIgnoreCase(type)) return StatelessSessionContainerInfo.class;
+        if ("STATEFUL".equalsIgnoreCase(type)) return StatefulSessionContainerInfo.class;
+        if ("BMP_ENTITY".equalsIgnoreCase(type)) return BmpEntityContainerInfo.class;
+        if ("CMP_ENTITY".equalsIgnoreCase(type)) return CmpEntityContainerInfo.class;
+        if ("CMP2_ENTITY".equalsIgnoreCase(type)) return CmpEntityContainerInfo.class;
+        if ("MESSAGE".equalsIgnoreCase(type)) return MdbContainerInfo.class;
+        else return ContainerInfo.class;
     }
+    
 }

Added: geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/GenericContainerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/GenericContainerGBean.java?rev=698750&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/GenericContainerGBean.java
(added)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/GenericContainerGBean.java
Wed Sep 24 14:43:04 2008
@@ -0,0 +1,51 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.openejb;
+
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.annotation.GBean;
+import org.apache.geronimo.gbean.annotation.ParamAttribute;
+import org.apache.geronimo.gbean.annotation.ParamReference;
+import org.apache.geronimo.gbean.annotation.ParamSpecial;
+import org.apache.geronimo.gbean.annotation.SpecialAttributeType;
+import org.apache.openejb.assembler.classic.BmpEntityContainerInfo;
+import org.apache.openejb.assembler.classic.CmpEntityContainerInfo;
+import org.apache.openejb.assembler.classic.ContainerInfo;
+import org.apache.openejb.assembler.classic.MdbContainerInfo;
+import org.apache.openejb.assembler.classic.StatefulSessionContainerInfo;
+import org.apache.openejb.assembler.classic.StatelessSessionContainerInfo;
+
+import java.util.Properties;
+
+/**
+ * @version $Rev$ $Date$
+ */
+@GBean
+public class GenericContainerGBean extends EjbContainer {
+
+    public GenericContainerGBean(
+            @ParamSpecial(type = SpecialAttributeType.abstractName) AbstractName abstractName,
+            @ParamReference(name = "OpenEjbSystem") OpenEjbSystem openEjbSystem,
+            @ParamAttribute(name = "provider") String provider,
+            @ParamAttribute(name = "type") String type,
+            @ParamAttribute(name = "properties") Properties properties) {
+        super(abstractName, getInfoType(type), openEjbSystem, provider, type, new Properties());
+        getProperties().putAll(properties);
+    }
+
+
+}

Added: 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=698750&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/SingletonContainerGBean.java
(added)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/SingletonContainerGBean.java
Wed Sep 24 14:43:04 2008
@@ -0,0 +1,51 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.openejb;
+
+import org.apache.geronimo.gbean.annotation.GBean;
+import org.apache.geronimo.gbean.annotation.ParamSpecial;
+import org.apache.geronimo.gbean.annotation.ParamReference;
+import org.apache.geronimo.gbean.annotation.ParamAttribute;
+import org.apache.geronimo.gbean.annotation.SpecialAttributeType;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.openejb.assembler.classic.SingletonSessionContainerInfo;
+
+import java.util.Properties;
+
+/**
+ * @version $Rev$ $Date$
+ */
+@GBean
+public class SingletonContainerGBean extends EjbContainer {
+
+    private final long accessTimeout;
+
+    public SingletonContainerGBean(
+            @ParamSpecial(type = SpecialAttributeType.abstractName) AbstractName abstractName,
+            @ParamReference(name = "OpenEjbSystem") OpenEjbSystem openEjbSystem,
+            @ParamAttribute(name = "provider") String provider,
+            @ParamAttribute(name = "accessTimeout") long accessTimeout,
+            @ParamAttribute(name = "properties") Properties properties) {
+        super(abstractName, SingletonSessionContainerInfo.class, openEjbSystem, provider,
"SINGLETON", properties);
+        set("AccessTimeout", Long.toString(accessTimeout));
+        this.accessTimeout = accessTimeout;
+    }
+
+    public long getAccessTimeout() {
+        return accessTimeout;
+    }
+}

Added: 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=698750&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/StatefulContainerGBean.java
(added)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/StatefulContainerGBean.java
Wed Sep 24 14:43:04 2008
@@ -0,0 +1,81 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.openejb;
+
+import org.apache.geronimo.gbean.annotation.GBean;
+import org.apache.geronimo.gbean.annotation.ParamSpecial;
+import org.apache.geronimo.gbean.annotation.ParamReference;
+import org.apache.geronimo.gbean.annotation.ParamAttribute;
+import org.apache.geronimo.gbean.annotation.SpecialAttributeType;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.openejb.assembler.classic.StatefulSessionContainerInfo;
+
+import java.util.Properties;
+
+/**
+ * @version $Rev$ $Date$
+ */
+@GBean
+public class StatefulContainerGBean extends EjbContainer {
+
+    /**
+     * Maximum number of values that should be in the LRU
+     */
+    private final 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;
+
+    /**
+     * A bean may be destroyed if it isn't used in this length of time (in
+     * milliseconds).
+     */
+    private final long timeout;
+
+
+    public StatefulContainerGBean(
+            @ParamSpecial(type = SpecialAttributeType.abstractName) AbstractName abstractName,
+            @ParamReference(name = "OpenEjbSystem") OpenEjbSystem openEjbSystem,
+            @ParamAttribute(name = "provider") String provider,
+            @ParamAttribute(name = "bulkPassivate") int bulkPassivate,
+            @ParamAttribute(name = "capacity") int capacity,
+            @ParamAttribute(name = "timeout") long timeout,
+            @ParamAttribute(name = "properties") Properties properties) {
+        super(abstractName, StatefulSessionContainerInfo.class, openEjbSystem, provider,
"STATEFUL", properties);
+        set("bulkPassivate", Integer.toString(bulkPassivate));
+        set("capacity", Integer.toString(capacity));
+        set("timeout", Long.toString(timeout));
+        this.bulkPassivate = bulkPassivate;
+        this.capacity = capacity;
+        this.timeout = timeout;
+    }
+
+    public int getBulkPassivate() {
+        return bulkPassivate;
+    }
+
+    public int getCapacity() {
+        return capacity;
+    }
+
+    public long getTimeout() {
+        return timeout;
+    }
+}

Added: 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=698750&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/StatelessContainerGBean.java
(added)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/StatelessContainerGBean.java
Wed Sep 24 14:43:04 2008
@@ -0,0 +1,94 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.openejb;
+
+import org.apache.geronimo.gbean.annotation.GBean;
+import org.apache.geronimo.gbean.annotation.ParamSpecial;
+import org.apache.geronimo.gbean.annotation.ParamReference;
+import org.apache.geronimo.gbean.annotation.ParamAttribute;
+import org.apache.geronimo.gbean.annotation.SpecialAttributeType;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.openejb.assembler.classic.StatelessSessionContainerInfo;
+
+import java.util.Properties;
+
+/**
+ * @version $Rev$ $Date$
+ */
+@GBean
+public class StatelessContainerGBean extends EjbContainer {
+
+    /**
+     * Specifies the time to wait between invocations. This
+     * value is measured in milliseconds. A value of 5 would
+     * result in a time-out of 5 milliseconds between invocations.
+     * A value of zero would mean no timeout.
+     */
+    private final int timeout;
+
+    /**
+     * Specifies the size of the bean pools for this
+     * stateless SessionBean container.
+     */
+
+    private final int poolSize;
+
+    /**
+     * StrictPooling tells the container what to do when the pool
+     * reaches it's maximum size and there are incoming requests
+     * that need instances.
+     * <p/>
+     * With strict pooling, requests will have to wait for instances
+     * to become available. The pool size will never grow beyond the
+     * the set PoolSize value.
+     * <p/>
+     * Without strict pooling, the container will create temporary
+     * instances to meet demand. The instances will last for just one
+     * method invocation and then are removed.
+     */
+    private final boolean strictPooling;
+
+
+    public StatelessContainerGBean(
+            @ParamSpecial(type = SpecialAttributeType.abstractName) AbstractName abstractName,
+            @ParamReference(name = "OpenEjbSystem") OpenEjbSystem openEjbSystem,
+            @ParamAttribute(name = "provider") String provider,
+            @ParamAttribute(name = "poolSize") int poolSize,
+            @ParamAttribute(name = "strictPooling") boolean strictPooling,
+            @ParamAttribute(name = "timeout") int timeout,
+            @ParamAttribute(name = "properties") Properties properties) {
+        super(abstractName, StatelessSessionContainerInfo.class, openEjbSystem, provider,
"STATELESS", properties);
+        set("poolSize", Integer.toString(poolSize));
+        set("strictPooling", Boolean.toString(strictPooling));
+        set("timeout", Integer.toString(timeout));
+        this.poolSize = poolSize;
+        this.strictPooling = strictPooling;
+        this.timeout = timeout;
+    }
+
+    public int getPoolSize() {
+        return poolSize;
+    }
+
+    public boolean isStrictPooling() {
+        return strictPooling;
+    }
+
+    public int getTimeout() {
+        return timeout;
+    }
+}

Modified: geronimo/server/trunk/plugins/openejb/openejb-clustering-wadi/src/main/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/openejb-clustering-wadi/src/main/plan/plan.xml?rev=698750&r1=698749&r2=698750&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/openejb-clustering-wadi/src/main/plan/plan.xml (original)
+++ geronimo/server/trunk/plugins/openejb/openejb-clustering-wadi/src/main/plan/plan.xml Wed
Sep 24 14:43:04 2008
@@ -20,10 +20,8 @@
 
 <module xmlns="http://geronimo.apache.org/xml/ns/deployment-${geronimoSchemaVersion}">
 
-    <gbean name="DefaultClusteredStatefulContainer" class="org.apache.geronimo.openejb.EjbContainer">
-        <attribute name="id">org.apache.geronimo.openejb.cluster:Default Clustered
Stateful Container</attribute>
-        <attribute name="type">STATEFUL</attribute>
-        <attribute name="properties">PoolSize=1000</attribute>
+    <gbean name="DefaultClusteredStatefulContainer" class="org.apache.geronimo.openejb.StatefulContainerGBean">
+        <attribute name="provider">org.apache.geronimo.openejb.cluster:Default Clustered
Stateful Container</attribute>
         <reference name="OpenEjbSystem">
             <name>OpenEjbSystem</name>
         </reference>

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=698750&r1=698749&r2=698750&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 Wed Sep 24 14:43:04
2008
@@ -34,31 +34,35 @@
         </dependency>
     </gbean>
 
-    <gbean name="DefaultStatelessContainer" class="org.apache.geronimo.openejb.EjbContainer">
-        <attribute name="id">Default Stateless Container</attribute>
-        <attribute name="type">STATELESS</attribute>
+    <gbean name="DefaultStatelessContainer" class="org.apache.geronimo.openejb.StatelessContainerGBean">
+        <attribute name="timeout">0</attribute>
+        <attribute name="poolSize">10</attribute>
+        <attribute name="strictPooling">true</attribute>
         <reference name="OpenEjbSystem">
             <name>OpenEjbSystem</name>
         </reference>
     </gbean>
-    <gbean name="DefaultStatefulContainer" class="org.apache.geronimo.openejb.EjbContainer">
-        <attribute name="id">Default Stateful Container</attribute>
-        <attribute name="type">STATEFUL</attribute>
-        <attribute name="properties">PoolSize=1000</attribute>
+    <gbean name="DefaultStatefulContainer" class="org.apache.geronimo.openejb.StatefulContainerGBean">
+        <attribute name="timeout">20</attribute>
+        <attribute name="capacity">1000</attribute>
+        <attribute name="bulkPassivate">100</attribute>
         <reference name="OpenEjbSystem">
             <name>OpenEjbSystem</name>
         </reference>
     </gbean>
-    <gbean name="DefaultBMPContainer" class="org.apache.geronimo.openejb.EjbContainer">
-        <attribute name="id">Default BMP Container</attribute>
-        <attribute name="type">BMP_ENTITY</attribute>
+    <gbean name="DefaultSingletonContainer" class="org.apache.geronimo.openejb.SingletonContainerGBean">
+        <attribute name="accessTimeout">30</attribute>
         <reference name="OpenEjbSystem">
             <name>OpenEjbSystem</name>
         </reference>
     </gbean>
-    <gbean name="DefaultCMPContainer" class="org.apache.geronimo.openejb.EjbContainer">
-        <attribute name="id">Default CMP Container</attribute>
-        <attribute name="type">CMP_ENTITY</attribute>
+    <gbean name="DefaultBMPContainer" class="org.apache.geronimo.openejb.BmpContainerGBean">
+        <attribute name="poolSize">10</attribute>
+        <reference name="OpenEjbSystem">
+            <name>OpenEjbSystem</name>
+        </reference>
+    </gbean>
+    <gbean name="DefaultCMPContainer" class="org.apache.geronimo.openejb.CmpContainerGBean">
         <reference name="OpenEjbSystem">
             <name>OpenEjbSystem</name>
         </reference>



Mime
View raw message