[jboss-cvs] JBossAS SVN: r87427 - in projects/ejb3/trunk/endpoint-deployer/src: test/resources and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Apr 16 10:04:31 EDT 2009


Author: wolfc
Date: 2009-04-16 10:04:31 -0400 (Thu, 16 Apr 2009)
New Revision: 87427

Added:
   projects/ejb3/trunk/endpoint-deployer/src/main/java/org/jboss/ejb3/endpoint/deployers/DefaultEndpointResolver.java
   projects/ejb3/trunk/endpoint-deployer/src/main/java/org/jboss/ejb3/endpoint/deployers/EndpointResolver.java
Modified:
   projects/ejb3/trunk/endpoint-deployer/src/main/java/org/jboss/ejb3/endpoint/deployers/EJB3EndpointDeployer.java
   projects/ejb3/trunk/endpoint-deployer/src/main/java/org/jboss/ejb3/endpoint/deployers/EJBIdentifier.java
   projects/ejb3/trunk/endpoint-deployer/src/test/resources/deploy/ejb-container-beans.xml
   projects/ejb3/trunk/endpoint-deployer/src/test/resources/log4j.xml
Log:
EJBTHREE-1786: added EndpointResolver

Added: projects/ejb3/trunk/endpoint-deployer/src/main/java/org/jboss/ejb3/endpoint/deployers/DefaultEndpointResolver.java
===================================================================
--- projects/ejb3/trunk/endpoint-deployer/src/main/java/org/jboss/ejb3/endpoint/deployers/DefaultEndpointResolver.java	                        (rev 0)
+++ projects/ejb3/trunk/endpoint-deployer/src/main/java/org/jboss/ejb3/endpoint/deployers/DefaultEndpointResolver.java	2009-04-16 14:04:31 UTC (rev 87427)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.endpoint.deployers;
+
+import org.jboss.beans.metadata.api.annotations.Inject;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+
+/**
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class DefaultEndpointResolver implements EndpointResolver
+{
+   private EJBIdentifier identifier;
+
+   public String resolve(DeploymentUnit unit, String ejbName)
+   {
+      return identifier.identifyEJB(unit, ejbName).concat("_endpoint");
+   }
+   
+   @Inject
+   public void setEJBIdentifier(EJBIdentifier identifier)
+   {
+      this.identifier = identifier;
+   }
+}

Modified: projects/ejb3/trunk/endpoint-deployer/src/main/java/org/jboss/ejb3/endpoint/deployers/EJB3EndpointDeployer.java
===================================================================
--- projects/ejb3/trunk/endpoint-deployer/src/main/java/org/jboss/ejb3/endpoint/deployers/EJB3EndpointDeployer.java	2009-04-16 13:49:42 UTC (rev 87426)
+++ projects/ejb3/trunk/endpoint-deployer/src/main/java/org/jboss/ejb3/endpoint/deployers/EJB3EndpointDeployer.java	2009-04-16 14:04:31 UTC (rev 87427)
@@ -41,6 +41,7 @@
 public class EJB3EndpointDeployer extends AbstractSimpleRealDeployer<JBossMetaData>
 {
    private EJBIdentifier identifier;
+   private EndpointResolver resolver;
 
    public EJB3EndpointDeployer()
    {
@@ -65,8 +66,9 @@
 
    protected void deploy(DeploymentUnit unit, JBossSessionBeanMetaData beanMetaData) throws DeploymentException
    {
-      String ejbBeanName = identifier.identifyEJB(unit, beanMetaData.getEjbName());
-      String name = ejbBeanName + "_endpoint";
+      String ejbName = beanMetaData.getEjbName();
+      String ejbBeanName = identifier.identifyEJB(unit, ejbName);
+      String name = resolver.resolve(unit, ejbName);
       BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder(name, EndpointImpl.class.getName());
       builder.addPropertyMetaData("container", builder.createInject(ejbBeanName));
       BeanMetaData bmd = builder.getBeanMetaData();
@@ -80,6 +82,12 @@
       this.identifier = identifier;
    }
    
+   @Inject
+   public void setEndpointResolver(EndpointResolver resolver)
+   {
+      this.resolver = resolver;
+   }
+   
    @Override
    public void undeploy(DeploymentUnit unit, JBossMetaData metaData)
    {

Modified: projects/ejb3/trunk/endpoint-deployer/src/main/java/org/jboss/ejb3/endpoint/deployers/EJBIdentifier.java
===================================================================
--- projects/ejb3/trunk/endpoint-deployer/src/main/java/org/jboss/ejb3/endpoint/deployers/EJBIdentifier.java	2009-04-16 13:49:42 UTC (rev 87426)
+++ projects/ejb3/trunk/endpoint-deployer/src/main/java/org/jboss/ejb3/endpoint/deployers/EJBIdentifier.java	2009-04-16 14:04:31 UTC (rev 87427)
@@ -24,10 +24,20 @@
 import org.jboss.deployers.structure.spi.DeploymentUnit;
 
 /**
+ * Find EJB containers in a deployment unit.
+ * 
+ * Do not use this one, use EndpointResolver.
+ * TODO: move to ejb3-deployers
+ * 
  * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
  * @version $Revision: $
  */
 public interface EJBIdentifier
 {
+   /**
+    * @param unit       the unit in which the EJB is known to hide
+    * @param ejbName    the name of the EJB
+    * @return           the bean name of the EJB container
+    */
    String identifyEJB(DeploymentUnit unit, String ejbName);
 }

Added: projects/ejb3/trunk/endpoint-deployer/src/main/java/org/jboss/ejb3/endpoint/deployers/EndpointResolver.java
===================================================================
--- projects/ejb3/trunk/endpoint-deployer/src/main/java/org/jboss/ejb3/endpoint/deployers/EndpointResolver.java	                        (rev 0)
+++ projects/ejb3/trunk/endpoint-deployer/src/main/java/org/jboss/ejb3/endpoint/deployers/EndpointResolver.java	2009-04-16 14:04:31 UTC (rev 87427)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.endpoint.deployers;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+
+/**
+ * Find EJB endpoints in a deployment unit.
+ * 
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public interface EndpointResolver
+{
+   /**
+    * @param unit       the unit in which the EJB is known to hide
+    * @param ejbName    the name of the EJB
+    * @return           the bean name of the EJB container
+    */
+   String resolve(DeploymentUnit unit, String ejbName);
+}

Modified: projects/ejb3/trunk/endpoint-deployer/src/test/resources/deploy/ejb-container-beans.xml
===================================================================
--- projects/ejb3/trunk/endpoint-deployer/src/test/resources/deploy/ejb-container-beans.xml	2009-04-16 13:49:42 UTC (rev 87426)
+++ projects/ejb3/trunk/endpoint-deployer/src/test/resources/deploy/ejb-container-beans.xml	2009-04-16 14:04:31 UTC (rev 87427)
@@ -9,5 +9,7 @@
    
    <bean name="EJBIdentifier" class="org.jboss.ejb3.endpoint.deployers.test.common.MockEJBIdentifier"/>
    
+   <bean name="EJB3EndpointResolver" class="org.jboss.ejb3.endpoint.deployers.DefaultEndpointResolver"/>
+   
    <bean name="TimerServiceFactory" class="org.jboss.ejb3.endpoint.deployers.test.common.MockTimerServiceFactory"/>
 </deployment>

Modified: projects/ejb3/trunk/endpoint-deployer/src/test/resources/log4j.xml
===================================================================
--- projects/ejb3/trunk/endpoint-deployer/src/test/resources/log4j.xml	2009-04-16 13:49:42 UTC (rev 87426)
+++ projects/ejb3/trunk/endpoint-deployer/src/test/resources/log4j.xml	2009-04-16 14:04:31 UTC (rev 87427)
@@ -24,7 +24,7 @@
   <appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender">
     <param name="File" value="target/test.log"/>
     <param name="Append" value="false"/>
-    
+
     <!-- Rollover at midnight each day -->
     <param name="DatePattern" value="'.'yyyy-MM-dd"/>
 
@@ -61,7 +61,7 @@
 
   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
     <param name="Target" value="System.out"/>
-    <param name="Threshold" value="ALL"/>
+    <param name="Threshold" value="DEBUG"/>
 
     <layout class="org.apache.log4j.PatternLayout">
       <!-- The default pattern: Date Priority [Category] Message\n -->
@@ -103,29 +103,29 @@
   -->
 
   <category name="org.jboss">
-    <priority value="DEBUG"/>
+    <priority value="INFO"/>
   </category>
   
-  
+  <!-- 
   <category name="org.jboss.ejb3">
     <priority value="ALL"/>
   </category>
+  -->
   
-   
-  <category name="org.jboss.kernel">
-    <priority value="TRACE"/>
+  <category name="org.jboss.kernel.plugins.dependency">
+    <priority value="ERROR"/>
   </category>
   
-  <category name="org.jboss.deployers">
-    <priority value="TRACE"/>
+  <category name="org.jboss.deployers.plugins.deployers.DeployWrapper">
+    <priority value="ERROR"/>
   </category>
-   
+  
   <!-- ======================= -->
   <!-- Setup the Root category -->
   <!-- ======================= -->
 
   <root>
-    
+    <priority value="WARN" />
     <appender-ref ref="CONSOLE"/>
     <appender-ref ref="FILE"/>
   </root>




More information about the jboss-cvs-commits mailing list