Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 21063 invoked from network); 29 Oct 2008 08:02:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Oct 2008 08:02:54 -0000 Received: (qmail 28941 invoked by uid 500); 29 Oct 2008 08:02:59 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 28889 invoked by uid 500); 29 Oct 2008 08:02:59 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 28880 invoked by uid 99); 29 Oct 2008 08:02:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Oct 2008 01:02:59 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Oct 2008 08:01:51 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id C306423888A5; Wed, 29 Oct 2008 01:02:01 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r708815 [1/2] - in /geronimo/server/trunk: plugingroups/javaee5-jetty/ plugingroups/javaee5-jetty/src/main/history/ plugingroups/javaee5-tomcat/ plugingroups/javaee5-tomcat/src/main/history/ plugins/console/console-portal-driver/src/main/we... Date: Wed, 29 Oct 2008 08:02:00 -0000 To: scm@geronimo.apache.org From: manugeorge@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20081029080201.C306423888A5@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: manugeorge Date: Wed Oct 29 01:01:59 2008 New Revision: 708815 URL: http://svn.apache.org/viewvc?rev=708815&view=rev Log: Merging patch for GERONIMO-3811 EjbServer Portlet. Added: geronimo/server/trunk/plugins/openejb/openejb-console-jetty/ geronimo/server/trunk/plugins/openejb/openejb-console-jetty/pom.xml geronimo/server/trunk/plugins/openejb/openejb-console-jetty/src/ geronimo/server/trunk/plugins/openejb/openejb-console-jetty/src/main/ geronimo/server/trunk/plugins/openejb/openejb-console-jetty/src/main/history/ geronimo/server/trunk/plugins/openejb/openejb-console-jetty/src/main/history/dependencies.xml geronimo/server/trunk/plugins/openejb/openejb-console-jetty/src/main/plan/ geronimo/server/trunk/plugins/openejb/openejb-console-jetty/src/main/plan/plan.xml geronimo/server/trunk/plugins/openejb/openejb-console-tomcat/ geronimo/server/trunk/plugins/openejb/openejb-console-tomcat/pom.xml geronimo/server/trunk/plugins/openejb/openejb-console-tomcat/src/ geronimo/server/trunk/plugins/openejb/openejb-console-tomcat/src/main/ geronimo/server/trunk/plugins/openejb/openejb-console-tomcat/src/main/history/ geronimo/server/trunk/plugins/openejb/openejb-console-tomcat/src/main/history/dependencies.xml geronimo/server/trunk/plugins/openejb/openejb-console-tomcat/src/main/plan/ geronimo/server/trunk/plugins/openejb/openejb-console-tomcat/src/main/plan/plan.xml geronimo/server/trunk/plugins/openejb/openejb-portlets/ geronimo/server/trunk/plugins/openejb/openejb-portlets/pom.xml geronimo/server/trunk/plugins/openejb/openejb-portlets/src/ geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/ geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/ geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/ geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/ geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/ geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/console/ geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/console/ejbserver/ geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/console/ejbserver/EJBServerPortlet.java geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/console/ejbserver/EjbHelper.java geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/console/ejbserver/EjbInformation.java geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/console/ejbserver/Status.java geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/console/ejbserver/Tree.java geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/console/ejbserver/TreeEntry.java geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/resources/ geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/resources/openejb-portlet.properties geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/webapp/ geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/webapp/WEB-INF/ geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/webapp/WEB-INF/portlet.xml geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/webapp/WEB-INF/view/ geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/webapp/WEB-INF/view/ejbserver/ geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/webapp/WEB-INF/view/ejbserver/help.jsp geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/webapp/WEB-INF/view/ejbserver/view.jsp geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/webapp/WEB-INF/web.xml Modified: geronimo/server/trunk/plugingroups/javaee5-jetty/pom.xml geronimo/server/trunk/plugingroups/javaee5-jetty/src/main/history/dependencies.xml geronimo/server/trunk/plugingroups/javaee5-tomcat/pom.xml geronimo/server/trunk/plugingroups/javaee5-tomcat/src/main/history/dependencies.xml geronimo/server/trunk/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/web.xml 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/OpenEjbSystem.java geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystemGBean.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/pom.xml geronimo/server/trunk/plugins/openejb/pom.xml Modified: geronimo/server/trunk/plugingroups/javaee5-jetty/pom.xml URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugingroups/javaee5-jetty/pom.xml?rev=708815&r1=708814&r2=708815&view=diff ============================================================================== --- geronimo/server/trunk/plugingroups/javaee5-jetty/pom.xml (original) +++ geronimo/server/trunk/plugingroups/javaee5-jetty/pom.xml Wed Oct 29 01:01:59 2008 @@ -209,6 +209,13 @@ ${version} car + + + org.apache.geronimo.plugins + openejb-console-jetty + ${version} + car + Modified: geronimo/server/trunk/plugingroups/javaee5-jetty/src/main/history/dependencies.xml URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugingroups/javaee5-jetty/src/main/history/dependencies.xml?rev=708815&r1=708814&r2=708815&view=diff ============================================================================== --- geronimo/server/trunk/plugingroups/javaee5-jetty/src/main/history/dependencies.xml (original) +++ geronimo/server/trunk/plugingroups/javaee5-jetty/src/main/history/dependencies.xml Wed Oct 29 01:01:59 2008 @@ -121,4 +121,9 @@ agent car + + org.apache.geronimo.plugins + openejb-console-jetty + car + Modified: geronimo/server/trunk/plugingroups/javaee5-tomcat/pom.xml URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugingroups/javaee5-tomcat/pom.xml?rev=708815&r1=708814&r2=708815&view=diff ============================================================================== --- geronimo/server/trunk/plugingroups/javaee5-tomcat/pom.xml (original) +++ geronimo/server/trunk/plugingroups/javaee5-tomcat/pom.xml Wed Oct 29 01:01:59 2008 @@ -201,6 +201,13 @@ ${version} car + + + org.apache.geronimo.plugins + openejb-console-tomcat + ${version} + car + Modified: geronimo/server/trunk/plugingroups/javaee5-tomcat/src/main/history/dependencies.xml URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugingroups/javaee5-tomcat/src/main/history/dependencies.xml?rev=708815&r1=708814&r2=708815&view=diff ============================================================================== --- geronimo/server/trunk/plugingroups/javaee5-tomcat/src/main/history/dependencies.xml (original) +++ geronimo/server/trunk/plugingroups/javaee5-tomcat/src/main/history/dependencies.xml Wed Oct 29 01:01:59 2008 @@ -121,4 +121,9 @@ agent car + + org.apache.geronimo.plugins + openejb-console-tomcat + car + Modified: geronimo/server/trunk/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/web.xml URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/web.xml?rev=708815&r1=708814&r2=708815&view=diff ============================================================================== --- geronimo/server/trunk/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/web.xml (original) +++ geronimo/server/trunk/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/web.xml Wed Oct 29 01:01:59 2008 @@ -128,6 +128,21 @@ + + + DWR Forward Servlet 6 + dwr-forward6 + org.apache.geronimo.console.servlet.ContextForwardServlet + + servlet-path + /dwr6 + + + context-path + /openejb-server + + + Generic Context Forward Servlet context-forward @@ -176,6 +191,11 @@ + dwr-forward6 + /dwr6/* + + + plutoPortalDriver /portal/* @@ -238,6 +258,7 @@ /dwr3/* /dwr4/* /dwr5/* + /dwr6/* GET POST PUT 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=708815&r1=708814&r2=708815&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 Wed Oct 29 01:01:59 2008 @@ -38,11 +38,11 @@ @ParamSpecial(type = SpecialAttributeType.abstractName) AbstractName abstractName, @ParamReference(name = "OpenEjbSystem") OpenEjbSystem openEjbSystem, @ParamAttribute(name = "provider") String provider, - @ParamAttribute(name = "accessTimeout") int accessTimeout, + @ParamAttribute(name = "poolSize") int poolSize, @ParamAttribute(name = "properties") Properties properties) { super(abstractName, BmpEntityContainerInfo.class, openEjbSystem, provider, "BMP_ENTITY", properties); - set("AccessTimeout", Integer.toString(accessTimeout)); - this.poolSize = accessTimeout; + set("PoolSize", Integer.toString(poolSize)); + this.poolSize = poolSize; } public int getPoolSize() { Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystem.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystem.java?rev=708815&r1=708814&r2=708815&view=diff ============================================================================== --- geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystem.java (original) +++ geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystem.java Wed Oct 29 01:01:59 2008 @@ -62,4 +62,8 @@ AppInfo configureApplication(AppModule appModule) throws OpenEJBException; void setORBContext(ORB orb, HandleDelegate handleDelegate); + + void setProperties(Properties properties); + + Properties getProperties(); } Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystemGBean.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystemGBean.java?rev=708815&r1=708814&r2=708815&view=diff ============================================================================== --- geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystemGBean.java (original) +++ geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystemGBean.java Wed Oct 29 01:01:59 2008 @@ -88,14 +88,16 @@ // These are provided by the corba subsystem when it first initializes. // Once we have a set, we ignore any additional notifications. private ORB orb; - + private Properties properties; + public OpenEjbSystemGBean(TransactionManager transactionManager) throws Exception { - this(transactionManager, null, null, null, OpenEjbSystemGBean.class.getClassLoader()); + this(transactionManager, null, null, null, OpenEjbSystemGBean.class.getClassLoader(), new Properties()); } - public OpenEjbSystemGBean(TransactionManager transactionManager, Collection resourceAdapters, Collection persistenceUnitGBeans, Kernel kernel, ClassLoader classLoader) throws Exception { + public OpenEjbSystemGBean(TransactionManager transactionManager, Collection resourceAdapters, Collection persistenceUnitGBeans, Kernel kernel, ClassLoader classLoader, Properties properties) throws Exception { this.kernel = kernel; this.classLoader = classLoader; - + this.properties = properties; + System.setProperty("duct tape",""); System.setProperty("admin.disabled", "true"); System.setProperty("openejb.logger.external", "true"); @@ -161,6 +163,14 @@ } } + public Properties getProperties() { + return properties; + } + + public void setProperties(Properties properties) { + this.properties = properties; + } + @SuppressWarnings({"unchecked"}) private static T getRawService(Kernel kernel, T proxy) { if (kernel == null) return proxy; @@ -279,6 +289,11 @@ ContainerInfo containerInfo = configurationFactory.configureService(MdbContainerInfo.class, containerName, null, null, "Container"); containerInfo.id = containerName; containerInfo.displayName = containerName; + properties = (properties == null)?new Properties():properties; + String instanceLimit = (String)properties.get(containerName + "." + "InstanceLimit"); + if(instanceLimit != null){ + containerInfo.properties.put("InstanceLimit", instanceLimit); + } // set ra specific properties containerInfo.properties.put("MessageListenerInterface", @@ -286,7 +301,7 @@ containerInfo.properties.put("ActivationSpecClass", resourceAdapter.getClass().getClassLoader().loadClass(activationSpecClass)); containerInfo.properties.put("ResourceAdapter", resourceAdapter); - containerInfo.properties.put("TxRecovery", true); + // containerInfo.properties.put("TxRecovery", true); // create the container assembler.createContainer(containerInfo); @@ -423,12 +438,14 @@ infoBuilder.addReference("PersistenceUnitGBeans", PersistenceUnitGBean.class); infoBuilder.addAttribute("kernel", Kernel.class, false); infoBuilder.addAttribute("classLoader", ClassLoader.class, false); + infoBuilder.addAttribute("properties", Properties.class, true, true); infoBuilder.setConstructor(new String[] { "TransactionManager", "ResourceAdapterWrappers", "PersistenceUnitGBeans", "kernel", "classLoader", + "properties" }); GBEAN_INFO = infoBuilder.getBeanInfo(); } 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=708815&r1=708814&r2=708815&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 Wed Oct 29 01:01:59 2008 @@ -59,9 +59,9 @@ @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)); + set("BulkPassivate", Integer.toString(bulkPassivate)); + set("Capacity", Integer.toString(capacity)); + set("TimeOut", Long.toString(timeout)); this.bulkPassivate = bulkPassivate; this.capacity = capacity; this.timeout = 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=708815&r1=708814&r2=708815&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 Wed Oct 29 01:01:59 2008 @@ -72,9 +72,9 @@ @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)); + set("PoolSize", Integer.toString(poolSize)); + set("StrictPooling", Boolean.toString(strictPooling)); + set("TimeOut", Integer.toString(timeout)); this.poolSize = poolSize; this.strictPooling = strictPooling; this.timeout = timeout; Added: geronimo/server/trunk/plugins/openejb/openejb-console-jetty/pom.xml URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/openejb-console-jetty/pom.xml?rev=708815&view=auto ============================================================================== --- geronimo/server/trunk/plugins/openejb/openejb-console-jetty/pom.xml (added) +++ geronimo/server/trunk/plugins/openejb/openejb-console-jetty/pom.xml Wed Oct 29 01:01:59 2008 @@ -0,0 +1,126 @@ + + + + + + + + 4.0.0 + + + org.apache.geronimo.plugins + openejb + 2.2-SNAPSHOT + + + openejb-console-jetty + Geronimo Plugins, OpenEJB :: Jetty + car + + + + org.apache.geronimo.configs + ${jetty}-deployer + ${version} + car + provided + + + + org.apache.geronimo.configs + jasper-deployer + ${version} + car + provided + + + + org.apache.geronimo.plugins + openejb-portlets + ${version} + war + provided + + + + org.apache.geronimo.configs + openejb + ${version} + car + + + + org.apache.geronimo.plugins + console-jetty + ${version} + car + + + + org.apache.geronimo.configs + dojo-jetty6 + ${version} + car + + + + org.apache.geronimo.framework + plugin + ${version} + car + + + + + + + + ${pom.basedir}/src/main/resources + true + + + + + + org.apache.geronimo.buildsupport + car-maven-plugin + + + ${gbeanDeployer} + ${j2eeDeployer} + ${jettyDeployer} + ${jasperDeployer} + + + org.apache.geronimo.plugins + openejb-portlets + ${version} + war + + Administration + true + + true + true + + + + + + + Added: geronimo/server/trunk/plugins/openejb/openejb-console-jetty/src/main/history/dependencies.xml URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/openejb-console-jetty/src/main/history/dependencies.xml?rev=708815&view=auto ============================================================================== --- geronimo/server/trunk/plugins/openejb/openejb-console-jetty/src/main/history/dependencies.xml (added) +++ geronimo/server/trunk/plugins/openejb/openejb-console-jetty/src/main/history/dependencies.xml Wed Oct 29 01:01:59 2008 @@ -0,0 +1,29 @@ + + + + org.apache.geronimo.plugins + openejb-console-jetty + 2.2-SNAPSHOT + car + + + org.apache.geronimo.plugins + console-jetty + car + + + org.apache.geronimo.configs + openejb + car + + + org.apache.geronimo.framework + plugin + car + + + org.apache.geronimo.configs + dojo-jetty6 + car + + Added: geronimo/server/trunk/plugins/openejb/openejb-console-jetty/src/main/plan/plan.xml URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/openejb-console-jetty/src/main/plan/plan.xml?rev=708815&view=auto ============================================================================== --- geronimo/server/trunk/plugins/openejb/openejb-console-jetty/src/main/plan/plan.xml (added) +++ geronimo/server/trunk/plugins/openejb/openejb-console-jetty/src/main/plan/plan.xml Wed Oct 29 01:01:59 2008 @@ -0,0 +1,44 @@ + + + + + /openejb-server + + + geronimo-admin + + + + + + + + + + + Server/EJB Server + /openejb-server + [EJBServerPortlet] + /images/ico_beanjar_16x16.gif + + PlutoPortalServices + + + Added: geronimo/server/trunk/plugins/openejb/openejb-console-tomcat/pom.xml URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/openejb-console-tomcat/pom.xml?rev=708815&view=auto ============================================================================== --- geronimo/server/trunk/plugins/openejb/openejb-console-tomcat/pom.xml (added) +++ geronimo/server/trunk/plugins/openejb/openejb-console-tomcat/pom.xml Wed Oct 29 01:01:59 2008 @@ -0,0 +1,129 @@ + + + + + + + + 4.0.0 + + + org.apache.geronimo.plugins + openejb + 2.2-SNAPSHOT + + + openejb-console-tomcat + Geronimo Plugins, OpenEJB :: Tomcat + car + + + + org.apache.geronimo.configs + tomcat6-deployer + ${version} + car + provided + + + + org.apache.geronimo.configs + jasper-deployer + ${version} + car + provided + + + + org.apache.geronimo.plugins + openejb-portlets + ${version} + war + provided + + + + org.apache.geronimo.plugins + console-tomcat + ${version} + car + + + + org.apache.geronimo.configs + openejb + ${version} + car + + + + org.apache.geronimo.configs + dojo-tomcat + ${version} + car + + + + org.apache.geronimo.framework + plugin + ${version} + car + + + + + + + + ${pom.basedir}/src/main/resources + true + + + + + + org.apache.geronimo.buildsupport + car-maven-plugin + + + ${gbeanDeployer} + ${j2eeDeployer} + ${tomcatDeployer} + ${jasperDeployer} + + + org.apache.geronimo.plugins + openejb-portlets + ${version} + war + + Administration + + OpenEJB Server plugin for Tomcat + + true + + true + true + + + + + + + Added: geronimo/server/trunk/plugins/openejb/openejb-console-tomcat/src/main/history/dependencies.xml URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/openejb-console-tomcat/src/main/history/dependencies.xml?rev=708815&view=auto ============================================================================== --- geronimo/server/trunk/plugins/openejb/openejb-console-tomcat/src/main/history/dependencies.xml (added) +++ geronimo/server/trunk/plugins/openejb/openejb-console-tomcat/src/main/history/dependencies.xml Wed Oct 29 01:01:59 2008 @@ -0,0 +1,29 @@ + + + + org.apache.geronimo.plugins + openejb-console-tomcat + 2.2-SNAPSHOT + car + + + org.apache.geronimo.plugins + console-tomcat + car + + + org.apache.geronimo.configs + dojo-tomcat + car + + + org.apache.geronimo.configs + openejb + car + + + org.apache.geronimo.framework + plugin + car + + Added: geronimo/server/trunk/plugins/openejb/openejb-console-tomcat/src/main/plan/plan.xml URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/openejb-console-tomcat/src/main/plan/plan.xml?rev=708815&view=auto ============================================================================== --- geronimo/server/trunk/plugins/openejb/openejb-console-tomcat/src/main/plan/plan.xml (added) +++ geronimo/server/trunk/plugins/openejb/openejb-console-tomcat/src/main/plan/plan.xml Wed Oct 29 01:01:59 2008 @@ -0,0 +1,46 @@ + + + + + /openejb-server + + + + + geronimo-admin + + + + + + + + + + + Server/EJB Server + /openejb-server + [EJBServerPortlet] + /images/ico_beanjar_16x16.gif + + PlutoPortalServices + + + Added: geronimo/server/trunk/plugins/openejb/openejb-portlets/pom.xml URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/openejb-portlets/pom.xml?rev=708815&view=auto ============================================================================== --- geronimo/server/trunk/plugins/openejb/openejb-portlets/pom.xml (added) +++ geronimo/server/trunk/plugins/openejb/openejb-portlets/pom.xml Wed Oct 29 01:01:59 2008 @@ -0,0 +1,159 @@ + + + + + + + + 4.0.0 + + + org.apache.geronimo.plugins + openejb + 2.2-SNAPSHOT + + + openejb-portlets + Geronimo Plugins, OpenEJB :: Portlets + war + + + + + org.apache.geronimo.framework + jee-specs + ${version} + car + provided + + + org.apache.geronimo.configs + openejb + 2.2-SNAPSHOT + car + + + + + org.apache.pluto + pluto-taglib + ${plutoVersion} + provided + + + + org.apache.geronimo.framework + geronimo-management + ${version} + provided + + + + org.apache.geronimo.modules + geronimo-j2ee-builder + ${version} + provided + + + + org.apache.geronimo.modules + geronimo-naming-builder + ${version} + provided + + + + org.apache.geronimo.modules + geronimo-security-builder + ${version} + provided + + + + org.apache.geronimo.modules + geronimo-connector-builder + ${version} + provided + + + + org.apache.geronimo.modules + geronimo-web-2.5-builder + ${version} + provided + + + + org.apache.geronimo.framework + geronimo-deploy-jsr88 + ${version} + provided + + + + org.apache.geronimo.plugins + console-core + ${version} + provided + + + + javax.portlet + portlet-api + provided + + + + commons-fileupload + commons-fileupload + provided + + + + org.apache.xmlbeans + xmlbeans + provided + + + + org.directwebremoting + dwr + provided + + + + + + + src/main/resources + true + + + + + org.codehaus.mojo.jspc + jspc-maven-plugin + + + org.apache.maven.plugins + maven-war-plugin + + + + + Added: geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/console/ejbserver/EJBServerPortlet.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/console/ejbserver/EJBServerPortlet.java?rev=708815&view=auto ============================================================================== --- geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/console/ejbserver/EJBServerPortlet.java (added) +++ geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/console/ejbserver/EJBServerPortlet.java Wed Oct 29 01:01:59 2008 @@ -0,0 +1,110 @@ +/** + * 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.console.ejbserver; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.StringTokenizer; + +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import javax.portlet.GenericPortlet; +import javax.portlet.PortletConfig; +import javax.portlet.PortletException; +import javax.portlet.PortletRequestDispatcher; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.WindowState; + +import org.apache.geronimo.console.BasePortlet; +import org.apache.geronimo.console.util.PortletManager; +import org.apache.geronimo.kernel.GBeanNotFoundException; +import org.apache.geronimo.kernel.Kernel; +import org.apache.geronimo.kernel.KernelRegistry; +import org.apache.geronimo.openejb.EjbDeployment; +import org.apache.openejb.assembler.classic.ContainerInfo; +import org.apache.openejb.assembler.classic.ServiceInfo; +import org.apache.openejb.assembler.classic.ContainerSystemInfo; +import org.apache.openejb.assembler.classic.OpenEjbConfiguration; +import org.apache.openejb.Container; +import org.apache.openejb.DeploymentInfo; +import org.apache.openejb.loader.SystemInstance; +import org.apache.openejb.spi.ContainerSystem; + +public class EJBServerPortlet extends BasePortlet { + + + private static final String VIEW_JSP = "/WEB-INF/view/ejbserver/view.jsp"; + + private static final String HELPVIEW_JSP = "/WEB-INF/view/ejbserver/help.jsp"; + + private PortletRequestDispatcher normalView; + + private PortletRequestDispatcher helpView; + + private List treeList; + + public void processAction(ActionRequest actionRequest, + ActionResponse actionResponse) throws PortletException, IOException { + } + + protected void doView(RenderRequest renderRequest, + RenderResponse renderResponse) throws IOException, PortletException { + + if (WindowState.MAXIMIZED.equals(renderRequest.getWindowState())) { + normalView.include(renderRequest, renderResponse); + } else if (WindowState.MINIMIZED.equals(renderRequest.getWindowState())) { + return; + } else if (WindowState.NORMAL.equals(renderRequest.getWindowState())) { + normalView.include(renderRequest, renderResponse); + } else { + return; + } + } + + private List split(String path, String sep) { + StringTokenizer st = new StringTokenizer(path, sep); + + List l = new ArrayList(); + + while (st.hasMoreTokens()) { + l.add(st.nextToken()); + } + return l; + } + + protected void doHelp(RenderRequest renderRequest, + RenderResponse renderResponse) throws PortletException, IOException { + helpView.include(renderRequest, renderResponse); + } + + public void init(PortletConfig portletConfig) throws PortletException { + super.init(portletConfig); + normalView = portletConfig.getPortletContext().getRequestDispatcher( + VIEW_JSP); + helpView = portletConfig.getPortletContext().getRequestDispatcher( + HELPVIEW_JSP); + } + + public void destroy() { + normalView = null; + helpView = null; + super.destroy(); + } + +} Added: 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=708815&view=auto ============================================================================== --- geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/console/ejbserver/EjbHelper.java (added) +++ geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/console/ejbserver/EjbHelper.java Wed Oct 29 01:01:59 2008 @@ -0,0 +1,530 @@ +/** + * 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.console.ejbserver; + +import java.lang.reflect.Method; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.ResourceBundle; +import java.util.Set; +import java.util.TreeMap; + +import org.apache.geronimo.console.util.KernelManagementHelper; +import org.apache.geronimo.gbean.AbstractName; +import org.apache.geronimo.gbean.AbstractNameQuery; +import org.apache.geronimo.gbean.GAttributeInfo; +import org.apache.geronimo.gbean.GBeanData; +import org.apache.geronimo.kernel.GBeanNotFoundException; +import org.apache.geronimo.kernel.InternalKernelException; +import org.apache.geronimo.kernel.Kernel; +import org.apache.geronimo.kernel.KernelRegistry; +import org.apache.geronimo.kernel.NoSuchAttributeException; +import org.apache.geronimo.kernel.config.Configuration; +import org.apache.geronimo.kernel.config.ConfigurationUtil; +import org.apache.geronimo.kernel.config.ManageableAttributeStore; +import org.apache.geronimo.openejb.EjbContainer; +import org.apache.geronimo.openejb.OpenEjbSystem; +import org.apache.openejb.Container; +import org.apache.openejb.ContainerType; +import org.apache.openejb.DeploymentInfo; +import org.apache.openejb.assembler.classic.ContainerInfo; +import org.apache.openejb.assembler.classic.ContainerSystemInfo; +import org.apache.openejb.assembler.classic.OpenEjbConfiguration; +import org.apache.openejb.loader.SystemInstance; +import org.apache.openejb.spi.ContainerSystem; +import org.apache.openejb.util.Duration; +import org.directwebremoting.annotations.RemoteMethod; +import org.directwebremoting.annotations.RemoteProxy; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@RemoteProxy +public class EjbHelper { + + private static final Logger log = LoggerFactory.getLogger(EjbHelper.class); + + private static final String POOLSIZE = "PoolSize"; + private static final String BULKPASSIVATE = "BulkPassivate"; + private static final String CAPACITY = "Capacity"; + private static final String TIMEOUT = "TimeOut"; + private static final String ACCESSTIMEOUT = "AccessTimeout"; + private static final String PASSIVATOR = "Passivator"; + private static final String STRICTPOOLING = "StrictPooling"; + private static final String INSTANCELIMIT = "InstanceLimit"; + private static final String CMPENGINEFACTORY = "CmpEngineFactory"; + private static final String TXRECOVERY = "TxRecovery"; + private static final String RESOURCEADAPTER = "ResourceAdapter"; + private static final String MESSAGELISTENERINTERFACE = "MessageListenerInterface"; + private static final String ACTIVATIONSPECCLASS = "ActivationSpecClass"; + private static final String TRUE = "true"; + private static final String FALSE = "false"; + private static final String BUNDLE_NAME = "openejb-portlet"; + private static final String BEANCLASSNAME_KEY="portlet.openejb.view.beanclassname"; + private static final String BLI_KEY="portlet.openejb.view.businesslocalinterfaces"; + private static final String BRI_KEY="portlet.openejb.view.businessremoteinterfaces"; + private static final String DEPLOYMENTID_KEY="portlet.openejb.view.deploymentid"; + private static final String EJBNAME_KEY="portlet.openejb.view.ejbname"; + private static final String EJBHOMEI_KEY="portlet.openejb.view.ejbhomeinterface"; + private static final String JNDINAMES_KEY="portlet.openejb.view.jndinames"; + private static final String LHI_KEY="portlet.openejb.view.localhomeinterface"; + private static final String LI_KEY="portlet.openejb.view.localinterface"; + private static final String RI_KEY="portlet.openejb.view.remoteinterface"; + private static final String PKC_KEY="portlet.openejb.view.primarykeyclass"; + private static final String PKF_KEY="portlet.openejb.view.primarykeyfield"; + private static final String SEI_KEY="portlet.openejb.view.sepinterface"; + private static final String CC_KEY="portlet.openejb.view.containerclass"; + private static final String CI_KEY="portlet.openejb.view.containerid"; + private static final String CD_KEY="portlet.openejb.view.containerdescription"; + private static final String DN_KEY="portlet.openejb.view.displayname"; + + + private ContainerSystem containerSystem; + private OpenEjbConfiguration configuration; + private Kernel kernel; + private ResourceBundle resourceBundle; + private KernelManagementHelper helper = null; + public EjbHelper() { + initContainerSystem(); + } + + private void initContainerSystem() { + kernel = KernelRegistry.getSingleKernel(); + helper = new KernelManagementHelper(kernel); + containerSystem = SystemInstance.get().getComponent( + ContainerSystem.class); + configuration = SystemInstance.get().getComponent( + OpenEjbConfiguration.class); + resourceBundle = ResourceBundle.getBundle(BUNDLE_NAME); + } + + @RemoteMethod + public Tree getEjbInformation() { + + ClassLoader oldcl = Thread.currentThread().getContextClassLoader(); + ClassLoader newcl = null; + Container container = null; + ContainerSystemInfo systemInfo = configuration.containerSystem; + Map containerMap = new TreeMap(); + List containerInfos = systemInfo.containers; + ContainerInfo containerInfo = null; + TreeEntry containerTypesEntry, containersEntry, deploymentsEntry = null; + Tree tree = new Tree("name", "name"); + List entries = new ArrayList(); + for (int i = 0; i < containerInfos.size(); i++) { + + containerInfo = containerInfos.get(i); + container = containerSystem.getContainer(containerInfo.id); + List containers = null; + if (containerMap.get(container.getContainerType()) != null) { + containerTypesEntry = containerMap.get(container + .getContainerType()); + containers = containerTypesEntry.getChildren(); + } else { + containerTypesEntry = new TreeEntry(); + containerTypesEntry.setName(resolveContainerTypes(container + .getContainerType())); + containerTypesEntry.setValue(containerTypesEntry.getName()); + containers = new ArrayList(); + containerTypesEntry.setChildren(containers); + containerMap.put(container.getContainerType(), + containerTypesEntry); + entries.add(containerTypesEntry); + } + containersEntry = new TreeEntry(); + containersEntry.setName(containerInfo.id); + containersEntry.setValue(containerInfo.id); + + DeploymentInfo[] deployments = container.deployments(); + containersEntry.setChildren(getDeployments(deployments)); + containers.add(containersEntry); + } + tree.setItems(entries); + return tree; + } + + public List getDeployments(DeploymentInfo[] deploymentInfos) { + List deployments = new ArrayList(); + TreeEntry deploymentsEntry = null; + for (DeploymentInfo deployment : deploymentInfos) { + deploymentsEntry = new TreeEntry(); + deploymentsEntry.setName(deployment.getEjbName()); + deploymentsEntry.setValue(deployment.getContainer() + .getContainerID() + + "#^~" + deployment.getDeploymentID()); + deploymentsEntry.setChildren(new ArrayList()); + deployments.add(deploymentsEntry); + } + return deployments; + } + + @RemoteMethod + public List getContainerInfo(String containerId) { + Container container = containerSystem.getContainer(containerId); + if (container == null) + return null; + ContainerSystemInfo systemInfo = configuration.containerSystem; + List containerInfos = systemInfo.containers; + List infos = new ArrayList(); + EjbInformation information = null; + GBeanData data = null; + if (container.getContainerType() == ContainerType.MESSAGE_DRIVEN) { + data = getOpenEJBPropertiesGBean(containerId, OpenEjbSystem.class); + } else { + data = getOpenEJBPropertiesGBean(containerId, EjbContainer.class); + } + Properties props = null; + if (data != null) { + props = (Properties) data.getAttribute("properties"); + } + for (ContainerInfo containerInfo : containerInfos) { + if (containerInfo.id.equals(containerId)) { + information = new EjbInformation(); + information.setName(resourceBundle.getString(CC_KEY)); + information.setId("ContainerClass"); + information.setValue(containerInfo.className); + infos.add(information); + information = new EjbInformation(); + information.setName(resourceBundle.getString(CI_KEY)); + information.setId("ContainerId"); + information.setValue(containerInfo.id); + infos.add(information); + information = new EjbInformation(); + information.setName(resourceBundle.getString(CD_KEY)); + information.setId("ContainerDesc"); + information.setValue(containerInfo.description); + infos.add(information); + information = new EjbInformation(); + information.setName(resourceBundle.getString(DN_KEY)); + information.setId("DisplayName"); + information.setValue(containerInfo.displayName); + infos.add(information); + List editableProperties = new ArrayList(); + editableProperties.add(POOLSIZE); + editableProperties.add(BULKPASSIVATE); + editableProperties.add(TIMEOUT); + editableProperties.add(ACCESSTIMEOUT); + 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()); + } + 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.setDirty(TRUE); + } + information.setValue(value); + information.setEditable(TRUE); + } else { + information.setEditable(FALSE); + } + infos.add(information); + } + + } + } + return infos; + } + + @RemoteMethod + public Status setContainerProperty(String containerId, String propertyKey, + String propertyValue) { + propertyKey = propertyKey.trim(); + propertyValue = propertyValue.trim(); + if (containerId.indexOf("%20") != -1) { + containerId = containerId.replaceAll("%20", "\\ "); + } + List numericProperties = new ArrayList(); + numericProperties.add(POOLSIZE); + numericProperties.add(BULKPASSIVATE); + numericProperties.add(TIMEOUT); + numericProperties.add(INSTANCELIMIT); + numericProperties.add(CAPACITY); + numericProperties.add(ACCESSTIMEOUT); + + if (numericProperties.contains(propertyKey)) { + try { + Integer.parseInt(propertyValue); + } catch (NumberFormatException nfe) { + return new Status(MessageFormat.format(resourceBundle.getString("portlet.openejb.view.message1"),propertyKey)); + } + } else if (STRICTPOOLING.equals(propertyKey)) { + if (!propertyValue.equalsIgnoreCase(TRUE) + && !propertyValue.equalsIgnoreCase(FALSE)) { + return new Status(MessageFormat.format(resourceBundle.getString("portlet.openejb.view.message2"),propertyKey)); + } + } else { + try { + EjbHelper.class.getClassLoader().loadClass(propertyValue); + } catch (ClassNotFoundException e) { + return new Status(MessageFormat.format(resourceBundle.getString("portlet.openejb.view.message3"),propertyKey)); + } + } + + 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 systemGBeans = kernel.listGBeans(absQuery); + for (Object obj : systemGBeans) { + AbstractName absName = (AbstractName) obj; + 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); + + } + } else { + AbstractNameQuery absQuery = new AbstractNameQuery( + EjbContainer.class.getName()); + Set containerGBeans = kernel.listGBeans(absQuery); + for (Object obj : containerGBeans) { + try { + String id = (String) kernel.getAttribute( + (AbstractName) obj, "id"); + if (containerId.equals(id)) { + AbstractName absName = (AbstractName) obj; + 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); + attributeStore.setValue(absName.getArtifact(), absName, gAttributeInfo, propertyValue, Thread.currentThread().getContextClassLoader()); + } + } + } + } catch (GBeanNotFoundException e) { + return new Status( + resourceBundle.getString("portlet.openejb.view.errorMessage1")); + } catch (NoSuchAttributeException e) { + return new Status( + resourceBundle.getString("portlet.openejb.view.errorMessage1")); + } catch (Exception e) { + return new Status( + resourceBundle.getString("portlet.openejb.view.errorMessage1")); + } + } + } + return new Status(resourceBundle.getString("portlet.openejb.view.message4")); + } + + private GBeanData getGBeanDataFromConfiguration(AbstractName absName){ + Configuration configuration = ConfigurationUtil.getConfigurationManager(kernel).getConfiguration(absName.getArtifact()); + GBeanData gData = configuration.getGBeans().get(absName); + return gData; + } + @RemoteMethod + public List getDeploymentInfo(String containerId, + String deploymentId) { + Container container = containerSystem.getContainer(containerId); + DeploymentInfo deploymentInfo = container + .getDeploymentInfo(deploymentId); + List informations = new ArrayList(); + EjbInformation information = new EjbInformation(); + information.setName(resourceBundle.getString(BEANCLASSNAME_KEY)); + information.setValue(deploymentInfo.getBeanClass().getName()); + informations.add(information); + + if (deploymentInfo.getBusinessLocalInterface() != null) { + information = new EjbInformation(); + information.setName(resourceBundle.getString(BLI_KEY)); + information.setValue(appendMultipleInterfaces(deploymentInfo + .getBusinessLocalInterfaces())); + informations.add(information); + } + if (deploymentInfo.getBusinessRemoteInterface() != null) { + information = new EjbInformation(); + information.setName(resourceBundle.getString(BRI_KEY)); + information.setValue(appendMultipleInterfaces(deploymentInfo + .getBusinessRemoteInterfaces())); + informations.add(information); + } + information = new EjbInformation(); + information.setName(resourceBundle.getString(DEPLOYMENTID_KEY)); + information.setValue(deploymentId); + informations.add(information); + ; + information = new EjbInformation(); + information.setName(resourceBundle.getString(EJBNAME_KEY)); + information.setValue(deploymentInfo.getEjbName()); + informations.add(information); + if (deploymentInfo.getHomeInterface() != null) { + information = new EjbInformation(); + information.setValue(deploymentInfo.getHomeInterface().getName()); + information.setName(resourceBundle.getString(EJBHOMEI_KEY)); + informations.add(information); + } + if (!container.getContainerType().equals(ContainerType.MESSAGE_DRIVEN)) { + information = new EjbInformation(); + Class cls = null; + try { + cls = Class + .forName("org.apache.openejb.assembler.classic.JndiBuilder$Bindings"); + Method method = cls.getMethod("getBindings"); + List jndiNames = (List) method.invoke(deploymentInfo + .get(cls)); + StringBuffer names = new StringBuffer(); + for (String jndiName : jndiNames) { + if (jndiName.startsWith("openejb/ejb/")) { + jndiName = jndiName.replaceFirst("openejb/ejb/", ""); + names.append(jndiName).append(","); + } + } + information.setValue(names.substring(0, names.length() - 1)); + } catch (Exception e) { + log.error(resourceBundle.getString("portlet.openejb.view.errorMessage2"), e); + } + information.setName(resourceBundle.getString(JNDINAMES_KEY)); + informations.add(information); + } + if (deploymentInfo.getLocalHomeInterface() != null) { + information = new EjbInformation(); + information.setName(resourceBundle.getString(LHI_KEY)); + information.setValue(deploymentInfo.getLocalHomeInterface() + .getName()); + informations.add(information); + } + + if (deploymentInfo.getLocalInterface() != null) { + information = new EjbInformation(); + information.setName(resourceBundle.getString(LI_KEY)); + information.setValue(deploymentInfo.getLocalInterface().getName()); + informations.add(information); + } + + if (deploymentInfo.getRemoteInterface() != null) { + information = new EjbInformation(); + information.setName(resourceBundle.getString(RI_KEY)); + information.setValue(deploymentInfo.getRemoteInterface().getName()); + informations.add(information); + } + + if (deploymentInfo.getPrimaryKeyClass() != null) { + information = new EjbInformation(); + information.setName(resourceBundle.getString(PKC_KEY)); + information.setValue(deploymentInfo.getPrimaryKeyClass().getName()); + informations.add(information); + } + + if (deploymentInfo.getPrimaryKeyField() != null) { + information = new EjbInformation(); + information.setName(resourceBundle.getString(PKF_KEY)); + information.setValue(deploymentInfo.getPrimaryKeyField()); + informations.add(information); + } + + if (deploymentInfo.getServiceEndpointInterface() != null) { + information = new EjbInformation(); + information.setName(resourceBundle.getString(SEI_KEY)); + information.setValue(deploymentInfo.getServiceEndpointInterface() + .getName()); + informations.add(information); + } + + return informations; + } + + private String appendMultipleInterfaces(List multipleValues) { + StringBuffer multipleValuedStringBuffer = new StringBuffer(); + for (Class singleValue : multipleValues) { + multipleValuedStringBuffer.append(singleValue.getName()) + .append(","); + } + if (multipleValuedStringBuffer.length() == 0) { + return null; + } + return multipleValuedStringBuffer.substring(0, + multipleValuedStringBuffer.length() - 1); + } + + private String resolveContainerTypes(ContainerType cType) { + switch (cType) { + case STATELESS: + return "Stateless Containers"; + case STATEFUL: + return "Stateful Containers"; + case CMP_ENTITY: + return "CMP Entity Containers"; + case BMP_ENTITY: + return "BMP Entity Containers"; + case MESSAGE_DRIVEN: + return "Message Driven Containers"; + default: + return "None"; + } + } + + private GBeanData getOpenEJBPropertiesGBean(String containerId, Class query) { + GBeanData data = null; + AbstractNameQuery absQuery = new AbstractNameQuery(query.getName()); + Set containerGBeans = kernel.listGBeans(absQuery); + for (Object obj : containerGBeans) { + try { + data = kernel.getGBeanData((AbstractName) obj); + } catch (GBeanNotFoundException e) { + log.error(MessageFormat.format(resourceBundle.getString("portlet.openejb.view.errorMessage3") + , (AbstractName) obj), e); + } catch (InternalKernelException e) { + log.error(MessageFormat.format(resourceBundle.getString("portlet.openejb.view.errorMessage4") + , (AbstractName) obj), e); + } catch (IllegalStateException e) { + log.error(MessageFormat.format(resourceBundle.getString("portlet.openejb.view.errorMessage5") + , (AbstractName) obj), e); + } + if (containerId.equals(EjbContainer.getId(data.getAbstractName())) + || query == OpenEjbSystem.class) { + break; + } + data = null; + } + return data; + } + +} Added: geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/console/ejbserver/EjbInformation.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/console/ejbserver/EjbInformation.java?rev=708815&view=auto ============================================================================== --- geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/console/ejbserver/EjbInformation.java (added) +++ geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/console/ejbserver/EjbInformation.java Wed Oct 29 01:01:59 2008 @@ -0,0 +1,74 @@ +/** + * 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.console.ejbserver; + +import org.directwebremoting.annotations.DataTransferObject; + +@DataTransferObject +public class EjbInformation { + + private String id; + + private String name; + + private String value; + + private String editable; + + private String dirty = "false"; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getEditable() { + return editable; + } + + public void setEditable(String editable) { + this.editable = editable; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getDirty() { + return dirty; + } + + public void setDirty(String dirty) { + this.dirty = dirty; + } + +} Added: geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/console/ejbserver/Status.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/console/ejbserver/Status.java?rev=708815&view=auto ============================================================================== --- geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/console/ejbserver/Status.java (added) +++ geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/console/ejbserver/Status.java Wed Oct 29 01:01:59 2008 @@ -0,0 +1,38 @@ +/** + * 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.console.ejbserver; + +import org.directwebremoting.annotations.DataTransferObject; +import org.directwebremoting.annotations.RemoteProperty; + +@DataTransferObject +public class Status { + + private static final long serialVersionUID = -6124413956057404301L; + + private String message; + + public Status(String message){ + this.message = message; + } + + @RemoteProperty + public String getMessage() { + return this.message; + } + +} Added: geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/console/ejbserver/Tree.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/console/ejbserver/Tree.java?rev=708815&view=auto ============================================================================== --- geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/console/ejbserver/Tree.java (added) +++ geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/console/ejbserver/Tree.java Wed Oct 29 01:01:59 2008 @@ -0,0 +1,60 @@ +/** + * 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.console.ejbserver; + +import java.util.List; +import org.directwebremoting.annotations.DataTransferObject; + +@DataTransferObject +public class Tree { + + private String label; + + private String identifier; + + private List items; + + public Tree(String label, String identifier){ + this.label = label; + this.identifier = identifier; + } + + public List getItems() { + return items; + } + + public void setItems(List items) { + this.items = items; + } + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public String getIdentifier() { + return identifier; + } + + public void setId(String identifier) { + this.identifier = identifier; + } + +} Added: geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/console/ejbserver/TreeEntry.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/console/ejbserver/TreeEntry.java?rev=708815&view=auto ============================================================================== --- geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/console/ejbserver/TreeEntry.java (added) +++ geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/console/ejbserver/TreeEntry.java Wed Oct 29 01:01:59 2008 @@ -0,0 +1,53 @@ +/** + * 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.console.ejbserver; + +import java.util.List; +import org.directwebremoting.annotations.DataTransferObject; + +@DataTransferObject +public class TreeEntry { + + private String name; + private List children; + private String value; + + public List getChildren() { + return children; + } + + public void setChildren(List children) { + this.children = children; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + +}