tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r1022383 - in /openejb/branches/openejb-3.1.3: ./ assembly/openejb-tomcat/openejb-tomcat-bundle/ assembly/test/ container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ container/openejb-core/src/main/java/org/apache/opene...
Date Thu, 14 Oct 2010 06:05:26 GMT
Author: dblevins
Date: Thu Oct 14 06:05:25 2010
New Revision: 1022383

URL: http://svn.apache.org/viewvc?rev=1022383&view=rev
Log:
Merged 3.1.x branch commits:
http://svn.apache.org/viewvc?view=revision&revision=1021445
http://svn.apache.org/viewvc?view=revision&revision=1021880
http://svn.apache.org/viewvc?view=revision&revision=1021903
http://svn.apache.org/viewvc?view=revision&revision=1021955
http://svn.apache.org/viewvc?view=revision&revision=1021961
http://svn.apache.org/viewvc?view=revision&revision=1021965
http://svn.apache.org/viewvc?view=revision&revision=1021975
http://svn.apache.org/viewvc?view=revision&revision=1021979
http://svn.apache.org/viewvc?view=revision&revision=1021990
http://svn.apache.org/viewvc?view=revision&revision=1022375
http://svn.apache.org/viewvc?view=revision&revision=1022380


Added:
    openejb/branches/openejb-3.1.3/server/openejb-client/src/main/java/org/apache/openejb/client/CommandParser.java
      - copied unchanged from r1021955, openejb/branches/openejb-3.1.x/server/openejb-client/src/main/java/org/apache/openejb/client/CommandParser.java
    openejb/branches/openejb-3.1.3/server/openejb-client/src/main/java/org/apache/openejb/client/Options.java
      - copied unchanged from r1021955, openejb/branches/openejb-3.1.x/server/openejb-client/src/main/java/org/apache/openejb/client/Options.java
Modified:
    openejb/branches/openejb-3.1.3/   (props changed)
    openejb/branches/openejb-3.1.3/assembly/openejb-tomcat/openejb-tomcat-bundle/pom.xml
    openejb/branches/openejb-3.1.3/assembly/test/build.xml
    openejb/branches/openejb-3.1.3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
    openejb/branches/openejb-3.1.3/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java
    openejb/branches/openejb-3.1.3/container/openejb-core/src/main/java/org/apache/openejb/config/OutputGeneratedDescriptors.java
    openejb/branches/openejb-3.1.3/container/openejb-core/src/main/java/org/apache/openejb/core/TempClassLoader.java
    openejb/branches/openejb-3.1.3/container/openejb-core/src/main/resources/org/apache/openejb/assembler/classic/Messages.properties
    openejb/branches/openejb-3.1.3/container/openejb-core/src/main/resources/org/apache/openejb/config/rules/Messages.properties
    openejb/branches/openejb-3.1.3/container/openejb-core/src/test/java/org/apache/openejb/config/BusinessInterfacesTest.java
  (props changed)
    openejb/branches/openejb-3.1.3/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java
    openejb/branches/openejb-3.1.3/examples/alternate-descriptors/src/main/resources/META-INF/test.ejb-jar.xml
  (props changed)
    openejb/branches/openejb-3.1.3/server/openejb-client/src/main/java/org/apache/openejb/client/ConnectionManager.java
    openejb/branches/openejb-3.1.3/server/openejb-client/src/main/java/org/apache/openejb/client/MulticastTool.java
    openejb/branches/openejb-3.1.3/server/openejb-ejbd/src/main/java/org/apache/openejb/server/ejbd/JndiRequestHandler.java
    openejb/branches/openejb-3.1.3/server/openejb-multicast/src/main/resources/META-INF/org.apache.openejb.server.ServerService/multicast
    openejb/branches/openejb-3.1.3/server/openejb-multicast/src/main/resources/META-INF/org.apache.openejb.server.ServerService/multipoint
    openejb/branches/openejb-3.1.3/server/openejb-multicast/src/test/java/org/apache/openejb/server/discovery/MulticastDiscoveryAgentTest.java
    openejb/branches/openejb-3.1.3/server/openejb-server/src/main/java/org/apache/openejb/server/ServiceDaemon.java
    openejb/branches/openejb-3.1.3/server/openejb-server/src/main/java/org/apache/openejb/server/ServiceManager.java

Propchange: openejb/branches/openejb-3.1.3/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Oct 14 06:05:25 2010
@@ -1,3 +1,3 @@
 /openejb/branches/openejb-3.1.1:779593
-/openejb/branches/openejb-3.1.x:1021442,1021445
+/openejb/branches/openejb-3.1.x:1021442,1021445,1021880,1021903,1021955,1021961,1021965,1021975,1021979,1021990,1022375,1022380
 /openejb/trunk/openejb3:943472,943862,943965,944757,945989,946399,946485,946489,946705,946792,946805,946814,946861,946863-946864,947010,947017,947042,948022,948241,948243,948548,949014,949233,950391,950801,951611,953191,953196,953556,955104,955496,957463,962382,962750,987030

Modified: openejb/branches/openejb-3.1.3/assembly/openejb-tomcat/openejb-tomcat-bundle/pom.xml
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.3/assembly/openejb-tomcat/openejb-tomcat-bundle/pom.xml?rev=1022383&r1=1022382&r2=1022383&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.3/assembly/openejb-tomcat/openejb-tomcat-bundle/pom.xml (original)
+++ openejb/branches/openejb-3.1.3/assembly/openejb-tomcat/openejb-tomcat-bundle/pom.xml Thu
Oct 14 06:05:25 2010
@@ -31,7 +31,7 @@
     <version>6.0.26.313</version>
     <name>OpenEJB :: Assembly :: Tomcat :: Bundle</name>
     <properties>
-        <tomcat.version>6.0.26</tomcat.version>
+        <tomcat.version>6.0.29</tomcat.version>
         <examples.version>1.1</examples.version>
         <openejb.version>3.1.3</openejb.version>
     </properties>

Modified: openejb/branches/openejb-3.1.3/assembly/test/build.xml
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.3/assembly/test/build.xml?rev=1022383&r1=1022382&r2=1022383&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.3/assembly/test/build.xml (original)
+++ openejb/branches/openejb-3.1.3/assembly/test/build.xml Thu Oct 14 06:05:25 2010
@@ -23,9 +23,9 @@
         Tests OpenEJB distribution using the OpenEJB iTest suite.
     </description>
 
-    <property name="openejb.version" value="3.1.3-SNAPSHOT"/>
+    <property name="openejb.version" value="3.1.3"/>
     <property name="repo" location="${basedir}/repo"/>
-    <property name="maven.repo" value="file:${user.home}/.m2/repository"/>
+    <property name="maven.repo" value="https://repository.apache.org/content/repositories/orgapacheopenejb-017"/>
     <property name="target.dir" location="${basedir}/target"/>
     <property name="windows.sleep" value="5"/>
     <property name="unix.sleep" value="1"/>
@@ -50,43 +50,43 @@
 
     <target name="test:tomcat6">
         <antcall target="tomcat.test">
-            <param name="tomcat.version" value="6.0.14"/>
+            <param name="tomcat.version" value="6.0.29"/>
         </antcall>
     </target>
 
     <target name="test:tomcat6:all">
         <antcall target="tomcat.test">
-            <param name="tomcat.version" value="6.0.14"/>
+            <param name="tomcat.version" value="6.0.29"/>
         </antcall>
         <antcall target="tomcat.test">
-            <param name="tomcat.version" value="6.0.13"/>
+            <param name="tomcat.version" value="6.0.28"/>
         </antcall>
         <antcall target="tomcat.test">
-            <param name="tomcat.version" value="6.0.10"/>
+            <param name="tomcat.version" value="6.0.26"/>
         </antcall>
         <antcall target="tomcat.test">
-            <param name="tomcat.version" value="6.0.9"/>
+            <param name="tomcat.version" value="6.0.24"/>
         </antcall>
     </target>
 
     <target name="test:tomcat55">
         <antcall target="tomcat.test">
-            <param name="tomcat.version" value="5.5.26"/>
+            <param name="tomcat.version" value="5.5.31"/>
         </antcall>
     </target>
 
     <target name="test:tomcat55:all">
         <antcall target="tomcat.test">
-            <param name="tomcat.version" value="5.5.26"/>
+            <param name="tomcat.version" value="5.5.31"/>
         </antcall>
         <antcall target="tomcat.test">
-            <param name="tomcat.version" value="5.5.25"/>
+            <param name="tomcat.version" value="5.5.30"/>
         </antcall>
         <antcall target="tomcat.test">
-            <param name="tomcat.version" value="5.5.23"/>
+            <param name="tomcat.version" value="5.5.29"/>
         </antcall>
         <antcall target="tomcat.test">
-            <param name="tomcat.version" value="5.5.20"/>
+            <param name="tomcat.version" value="5.5.28"/>
         </antcall>
     </target>
 

Modified: openejb/branches/openejb-3.1.3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java?rev=1022383&r1=1022382&r2=1022383&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
(original)
+++ openejb/branches/openejb-3.1.3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
Thu Oct 14 06:05:25 2010
@@ -598,6 +598,11 @@ public class Assembler extends Assembler
                         Container container = deployment.getContainer();
                         container.deploy(deployment);
                         logger.info("createApplication.createdEjb", deployment.getDeploymentID(),
deployment.getEjbName(), container.getContainerID());
+                        if (logger.isDebugEnabled()) {
+                            for (Map.Entry<Object, Object> entry : deployment.getProperties().entrySet())
{
+                                logger.info("createApplication.createdEjb.property", deployment.getEjbName(),
entry.getKey(), entry.getValue());
+                            }
+                        }
                     } catch (Throwable t) {
                         throw new OpenEJBException("Error deploying '"+deployment.getEjbName()+"'.
 Exception: "+t.getClass()+": "+t.getMessage(), t);
                     }

Modified: openejb/branches/openejb-3.1.3/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.3/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java?rev=1022383&r1=1022382&r2=1022383&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.3/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java
(original)
+++ openejb/branches/openejb-3.1.3/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java
Thu Oct 14 06:05:25 2010
@@ -1049,12 +1049,21 @@ public class AnnotationDeployer implemen
             EnterpriseBean[] enterpriseBeans = ejbModule.getEjbJar().getEnterpriseBeans();
             for (EnterpriseBean bean : enterpriseBeans) {
                 final String ejbName = bean.getEjbName();
+                final String ejbClassName = bean.getEjbClass();
 
+                if (ejbClassName == null) {
+                    List<String> others = new ArrayList<String>();
+                    for (EnterpriseBean otherBean : enterpriseBeans) {
+                        others.add(otherBean.getEjbName());
+                    }
+                    fail(ejbName, "xml.noEjbClass", ejbName, join(", ", others));
+                }
+                
                 Class<?> clazz;
                 try {
-                    clazz = classLoader.loadClass(bean.getEjbClass());
+                    clazz = classLoader.loadClass(ejbClassName);
                 } catch (ClassNotFoundException e) {
-                    throw new OpenEJBException("Unable to load bean class: " + bean.getEjbClass(),
e);
+                    throw new OpenEJBException("Unable to load bean class: " + ejbClassName,
e);
                 }
                 ClassFinder classFinder = new ClassFinder(clazz);
 

Modified: openejb/branches/openejb-3.1.3/container/openejb-core/src/main/java/org/apache/openejb/config/OutputGeneratedDescriptors.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.3/container/openejb-core/src/main/java/org/apache/openejb/config/OutputGeneratedDescriptors.java?rev=1022383&r1=1022382&r2=1022383&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.3/container/openejb-core/src/main/java/org/apache/openejb/config/OutputGeneratedDescriptors.java
(original)
+++ openejb/branches/openejb-3.1.3/container/openejb-core/src/main/java/org/apache/openejb/config/OutputGeneratedDescriptors.java
Thu Oct 14 06:05:25 2010
@@ -38,7 +38,7 @@ import java.io.IOException;
 
 public class OutputGeneratedDescriptors implements DynamicDeployer {
     private static final Logger logger = Logger.getInstance(LogCategory.OPENEJB_STARTUP_CONFIG,
"org.apache.openejb.util.resources");
-    private static final String OUTPUT_DESCRIPTORS = "openejb.descriptors.output";
+    public static final String OUTPUT_DESCRIPTORS = "openejb.descriptors.output";
 
     public AppModule deploy(AppModule appModule) throws OpenEJBException {
         boolean output = SystemInstance.get().getOptions().get(OUTPUT_DESCRIPTORS, false);
@@ -51,7 +51,12 @@ public class OutputGeneratedDescriptors 
         for (EjbModule ejbModule : appModule.getEjbModules()) {
             Options options = new Options(ejbModule.getOpenejbJar().getProperties(), SystemInstance.get().getOptions());
 
-            output = options.get(OUTPUT_DESCRIPTORS, false);
+            final ValidationContext context = ejbModule.getValidation();
+
+            // output descriptors by default if there are validation errors
+            final boolean invalid = context.hasErrors() || context.hasFailures();
+
+            output = options.get(OUTPUT_DESCRIPTORS, invalid);
 
             if (output){
                 if (ejbModule.getEjbJar() != null) {

Modified: openejb/branches/openejb-3.1.3/container/openejb-core/src/main/java/org/apache/openejb/core/TempClassLoader.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.3/container/openejb-core/src/main/java/org/apache/openejb/core/TempClassLoader.java?rev=1022383&r1=1022382&r2=1022383&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.3/container/openejb-core/src/main/java/org/apache/openejb/core/TempClassLoader.java
(original)
+++ openejb/branches/openejb-3.1.3/container/openejb-core/src/main/java/org/apache/openejb/core/TempClassLoader.java
Thu Oct 14 06:05:25 2010
@@ -67,6 +67,8 @@ public class TempClassLoader extends URL
     }
 
     protected synchronized Class loadClass(String name, boolean resolve) throws ClassNotFoundException
{
+        if (name == null) throw new NullPointerException("name cannot be null");
+        
         // see if we've already loaded it
         Class c = findLoadedClass(name);
         if (c != null) {

Modified: openejb/branches/openejb-3.1.3/container/openejb-core/src/main/resources/org/apache/openejb/assembler/classic/Messages.properties
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.3/container/openejb-core/src/main/resources/org/apache/openejb/assembler/classic/Messages.properties?rev=1022383&r1=1022382&r2=1022383&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.3/container/openejb-core/src/main/resources/org/apache/openejb/assembler/classic/Messages.properties
(original)
+++ openejb/branches/openejb-3.1.3/container/openejb-core/src/main/resources/org/apache/openejb/assembler/classic/Messages.properties
Thu Oct 14 06:05:25 2010
@@ -59,6 +59,9 @@ createApplication.invalidClass = Applica
 # info("createApplication.createdEjb", beanInfo.ejbDeploymentId, beanInfo.ejbName, beanInfo.containerId);
 createApplication.createdEjb = Created Ejb(deployment-id={0}, ejb-name={1}, container={2})
 
+# info("createApplication.createdEjb.property", deployment.getEjbName(), entry.getKey(),
entry.getValue());
+createApplication.createdEjb.property = {0} property: {1} = {2}
+
 # info("createApplication.createLocalClient", clientClassName, clientInfo.moduleId);
 createApplication.createLocalClient = LocalClient(class={0}, module={1}) 
 

Modified: openejb/branches/openejb-3.1.3/container/openejb-core/src/main/resources/org/apache/openejb/config/rules/Messages.properties
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.3/container/openejb-core/src/main/resources/org/apache/openejb/config/rules/Messages.properties?rev=1022383&r1=1022382&r2=1022383&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.3/container/openejb-core/src/main/resources/org/apache/openejb/config/rules/Messages.properties
(original)
+++ openejb/branches/openejb-3.1.3/container/openejb-core/src/main/resources/org/apache/openejb/config/rules/Messages.properties
Thu Oct 14 06:05:25 2010
@@ -784,3 +784,7 @@ Which can then be implemented by the {0}
 1.userTransactionRef.forbiddenForCmtdBeans = Container-Managed Transaction beans cannot use
UserTransaction
 2.userTransactionRef.forbiddenForCmtdBeans = Container-Managed Transaction beans cannot use
UserTransaction: fix ref {0}
 3.userTransactionRef.forbiddenForCmtdBeans = Only session and message-driven beans with bean-managed
transaction demarcation are allowed to use UserTransaction.  Fix @Resource or resource-env-ref
{0}
+
+1.xml.noEjbClass = Element <ejb-class> unspecified.
+2.xml.noEjbClass = Element <ejb-class> unspecified.  No annotated bean discovered with
<ejb-name>{0}</ejb-name>
+3.xml.noEjbClass = The <ejb-class> element is only optional if there is a matching
annotated bean in the module with the bean name {0}.  No such bean was found.  Other beans
in this module are: {1}  

Propchange: openejb/branches/openejb-3.1.3/container/openejb-core/src/test/java/org/apache/openejb/config/BusinessInterfacesTest.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Oct 14 06:05:25 2010
@@ -1,3 +1,3 @@
 /openejb/branches/openejb-3.1.1/container/openejb-core/src/test/java/org/apache/openejb/config/UberInterfaceTest.java:779593
-/openejb/branches/openejb-3.1.x/container/openejb-core/src/test/java/org/apache/openejb/config/BusinessInterfacesTest.java:1021442,1021445
+/openejb/branches/openejb-3.1.x/container/openejb-core/src/test/java/org/apache/openejb/config/BusinessInterfacesTest.java:1021442,1021445,1021880,1021903,1021955,1021961,1021965,1021975,1021979,1021990,1022375,1022380
 /openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/BusinessInterfacesTest.java:943472,943862,943965,944757,945989,946399,946485,946489,946705,946792,946805,946814,946861,946863-946864,947010,947017,947042,948022,948241,948548,949014,949233,950391,950801,951611,953191,953196,953556,955104,955496,957463,962382,962750,987030,1004172

Modified: openejb/branches/openejb-3.1.3/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.3/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java?rev=1022383&r1=1022382&r2=1022383&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.3/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java
(original)
+++ openejb/branches/openejb-3.1.3/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java
Thu Oct 14 06:05:25 2010
@@ -20,11 +20,11 @@ import java.util.Arrays;
 import java.util.Collection;
 import java.util.EnumSet;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.Map;
 import java.util.Properties;
 import java.util.Set;
 import java.util.Collections;
+import java.lang.reflect.Constructor;
 
 /**
  * The purpose of this class is to provide a more strongly typed version of a
@@ -65,7 +65,7 @@ import java.util.Collections;
  * Additionally TRUE is an alias for ALL and FALSE an alias for NONE.  This allows options
  * that used to support only true/false values to be further defined in the future without
  * breaking compatibility.
- * 
+ *
  * @version $Rev$ $Date$
  */
 public class Options {
@@ -82,6 +82,10 @@ public class Options {
         this.properties = properties;
     }
 
+    public Properties getProperties() {
+        return properties;
+    }
+
     public void setLogger(Log logger) {
         parent.setLogger(logger);
     }
@@ -100,10 +104,29 @@ public class Options {
         return value != null ? log(property, value) : parent.get(property, defaultValue);
     }
 
+    public <T> T get(String property, T defaultValue) {
+        if (defaultValue == null) throw new NullPointerException("defaultValue");
+
+        String value = properties.getProperty(property);
+
+        if (value == null || value.equals("")) return parent.get(property, defaultValue);
+
+        try {
+            Class<?> type = defaultValue.getClass();
+            Constructor<?> constructor = type.getConstructor(String.class);
+            T t = (T) constructor.newInstance(value);
+            return log(property, t);
+        } catch (Exception e) {
+            e.printStackTrace();
+            warn(property, value, e);
+            return parent.get(property, defaultValue);
+        }
+    }
+
     public int get(String property, int defaultValue) {
         String value = properties.getProperty(property);
 
-        if (value == null) return parent.get(property, defaultValue);
+        if (value == null || value.equals("")) return parent.get(property, defaultValue);
 
         try {
             return log(property, Integer.parseInt(value));
@@ -116,7 +139,7 @@ public class Options {
     public long get(String property, long defaultValue) {
         String value = properties.getProperty(property);
 
-        if (value == null) return parent.get(property, defaultValue);
+        if (value == null || value.equals("")) return parent.get(property, defaultValue);
 
         try {
             return log(property, Long.parseLong(value));
@@ -129,7 +152,7 @@ public class Options {
     public boolean get(String property, boolean defaultValue) {
         String value = properties.getProperty(property);
 
-        if (value == null) return parent.get(property, defaultValue);
+        if (value == null || value.equals("")) return parent.get(property, defaultValue);
 
         try {
             return log(property, Boolean.parseBoolean(value));
@@ -156,7 +179,7 @@ public class Options {
     public <T extends Enum<T>> T get(String property, T defaultValue) {
         String value = properties.getProperty(property);
 
-        if (value == null) return parent.get(property, defaultValue);
+        if (value == null || value.equals("")) return parent.get(property, defaultValue);
 
         if (defaultValue == null) throw new IllegalArgumentException("Must supply a default
for property " + property);
 
@@ -194,7 +217,7 @@ public class Options {
     protected <T extends Enum<T>> Set<T> getAll(String property, Set<T>
defaultValue, Class<T> enumType) {
         String value = properties.getProperty(property);
 
-        if (value == null) return parent.getAll(property, defaultValue, enumType);
+        if (value == null || value.equals("")) return parent.getAll(property, defaultValue,
enumType);
 
         // Shorthand for specifying ALL or NONE for any option
         // that allows for multiple values of the enum
@@ -239,7 +262,7 @@ public class Options {
         T value = map.get(name.toUpperCase());
 
         // Call Enum.valueOf for the clean exception
-        if (value == null) Enum.valueOf(enumType, name);
+        if (value == null || value.equals("")) Enum.valueOf(enumType, name);
 
         return value;
     }
@@ -334,6 +357,11 @@ public class Options {
         }
 
         @Override
+        public <T> T get(String property, T defaultValue) {
+            return log(property, defaultValue);
+        }
+
+        @Override
         public int get(String property, int defaultValue) {
             return log(property, defaultValue);
         }

Propchange: openejb/branches/openejb-3.1.3/examples/alternate-descriptors/src/main/resources/META-INF/test.ejb-jar.xml
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Oct 14 06:05:25 2010
@@ -1,3 +1,3 @@
 /openejb/branches/openejb-3.1.1/examples/alternate-descriptors/src/main/resources/META-INF/ejb-jar.xml:779593
-/openejb/branches/openejb-3.1.x/examples/alternate-descriptors/src/main/resources/META-INF/test.ejb-jar.xml:1021442,1021445
+/openejb/branches/openejb-3.1.x/examples/alternate-descriptors/src/main/resources/META-INF/test.ejb-jar.xml:1021442,1021445,1021880,1021903,1021955,1021961,1021965,1021975,1021979,1021990,1022375,1022380
 /openejb/trunk/openejb3/examples/alternate-descriptors/src/main/resources/META-INF/test.ejb-jar.xml:943472,943862,943965,944757,945989,946399,946485,946489,946705,946792,946805,946814,946861,946863-946864,947010,947017,947042,948022,948241,948243,948548,949014,949233,950391,950801,951611,953191,953196,953556,955104,955496,957463,962382,962750,987030

Modified: openejb/branches/openejb-3.1.3/server/openejb-client/src/main/java/org/apache/openejb/client/ConnectionManager.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.3/server/openejb-client/src/main/java/org/apache/openejb/client/ConnectionManager.java?rev=1022383&r1=1022382&r2=1022383&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.3/server/openejb-client/src/main/java/org/apache/openejb/client/ConnectionManager.java
(original)
+++ openejb/branches/openejb-3.1.3/server/openejb-client/src/main/java/org/apache/openejb/client/ConnectionManager.java
Thu Oct 14 06:05:25 2010
@@ -19,9 +19,12 @@ package org.apache.openejb.client;
 import java.io.IOException;
 import java.net.URI;
 import java.util.Properties;
+import java.util.logging.Logger;
 
 public class ConnectionManager {
 
+    private static final Logger logger = Logger.getLogger("OpenEJB.client");
+    
     private static Registry<ConnectionFactory> factories = Registry.create(ConnectionFactory.class);
     private static Registry<ConnectionStrategy> strategies = Registry.create(ConnectionStrategy.class);
 
@@ -61,7 +64,7 @@ public class ConnectionManager {
 
         if (strategy == null) throw new IOException("Unsupported ConnectionStrategy  \""
+ name + "\"");
 
-
+        logger.fine("connect: strategy=" + name + ", uri=" + server.getLocation() + ", strategy-impl="
+ strategy.getClass().getName());
         return strategy.connect(cluster, server);
     }
 
@@ -72,6 +75,7 @@ public class ConnectionManager {
 
         if (factory == null) throw new IOException("Unsupported ConnectionFactory URI scheme
 \"" + scheme + "\"");
 
+        logger.fine("connect: scheme=" + scheme + ", uri=" + uri + ", factory-impl=" + factory.getClass().getName());
         return factory.getConnection(uri);
     }
 

Modified: openejb/branches/openejb-3.1.3/server/openejb-client/src/main/java/org/apache/openejb/client/MulticastTool.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.3/server/openejb-client/src/main/java/org/apache/openejb/client/MulticastTool.java?rev=1022383&r1=1022382&r2=1022383&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.3/server/openejb-client/src/main/java/org/apache/openejb/client/MulticastTool.java
(original)
+++ openejb/branches/openejb-3.1.3/server/openejb-client/src/main/java/org/apache/openejb/client/MulticastTool.java
Thu Oct 14 06:05:25 2010
@@ -24,9 +24,8 @@ import java.net.MulticastSocket;
 import java.net.SocketAddress;
 import java.net.SocketTimeoutException;
 import java.text.SimpleDateFormat;
-import java.util.Arrays;
 import java.util.Date;
-import java.util.Iterator;
+import java.util.List;
 import java.util.Timer;
 import java.util.TimerTask;
 
@@ -35,80 +34,126 @@ import java.util.TimerTask;
  */
 public class MulticastTool {
 
-    private static final int BUFF_SIZE = 8192;
+    private static final CommandParser cmd = new CommandParser() {
+        @Override
+        protected void init() {
+            category("Options");
+            opt('h', "host").type(String.class).value("239.255.3.2")
+                    .description("Address of the multicast channel");
 
-    public static void main(String[] array) throws Exception {
+            opt('p', "port").type(int.class).value(6142)
+                    .description("Port of the multicast channel");
 
-        SimpleDateFormat format = new SimpleDateFormat("HH:mm:ss");
+            opt("date-format").type(String.class).value("HH:mm:ss")
+                    .description("Date format to use for log lines");
 
-        String send = null;
+            category("Sending");
 
-        long rate = 1000;
+            opt('s', "send").type(String.class)
+                    .description("Optional message to broadcast to the channel");
+            opt('r', "rate").type(long.class).value(1000)
+                    .description("Resend every N milliseconds. Zero sends just once");
 
-        String host = "239.255.3.2";
-        int port = 6142;
-        Integer ttl = null;
-        Boolean loopbackmode = null;
-        Integer socketTimeout = null;
-
-        Iterator<String> args = Arrays.asList(array).iterator();
-        while (args.hasNext()) {
-            String arg = args.next();
-
-            if (arg.equals("--host") || arg.equals("-h")) {
-                host = args.next();
-            } else if (arg.equals("--port") || arg.equals("-p")) {
-                port = Integer.parseInt(args.next());
-            } else if (arg.equals("--rate") || arg.equals("-r")) {
-                rate = new Long(args.next());
-            } else if (arg.equals("--ttl")) {
-                ttl = new Integer(args.next());
-            } else if (arg.equals("--send") || arg.equals("-s")) {
-                send = args.next();
-            } else if (arg.equals("--timeout") || arg.equals("-t")) {
-                socketTimeout = new Integer(args.next());
-            } else if (arg.equals("--loopback") || arg.equals("-l")) {
-                loopbackmode = new Boolean(args.next());
-            } else {
-                throw new IllegalArgumentException(arg);
-            }
+            category("Advanced");
+
+            opt("broadcast").type(boolean.class).description("java.net.MulticastSocket#setBroadcast");
+            opt("loopback-mode").type(boolean.class).description("java.net.MulticastSocket#setLoopbackMode");
+            opt("receive-buffer-size").type(int.class).description("java.net.MulticastSocket#setReceiveBufferSize");
+            opt("reuse-address").type(boolean.class).description("java.net.MulticastSocket#setReuseAddress");
+            opt("send-buffer-size").type(int.class).description("java.net.MulticastSocket#setSendBufferSize");
+            opt("so-timeout").type(int.class).description("java.net.MulticastSocket#setSoTimeout");
+            opt("time-to-live").type(int.class).description("java.net.MulticastSocket#setTimeToLive");
+            opt("traffic-class").type(int.class).description("java.net.MulticastSocket#setTrafficClass");
         }
 
-        InetAddress inetAddress = InetAddress.getByName(host);
+        @Override
+        protected List<String> validate(Arguments arguments) {
+            return super.validate(arguments);
+        }
 
-        InetSocketAddress address = new InetSocketAddress(inetAddress, port);
+        @Override
+        protected List<String> usage() {
+            return super.usage();
+        }
+    };
 
-        MulticastSocket multicast = new MulticastSocket(port);
-        multicast.joinGroup(inetAddress);
+    private static final int BUFF_SIZE = 8192;
 
-        if (ttl != null) {
-            multicast.setTimeToLive(ttl);
-        }
+    public static void main(String[] array) throws Exception {
 
-        if (socketTimeout != null) {
-            multicast.setSoTimeout(socketTimeout);
+        final CommandParser.Arguments arguments;
+        try {
+            arguments = cmd.parse(array);
+        } catch (CommandParser.HelpException e) {
+            System.exit(0);
+            throw new Exception(); // never reached, but keeps compiler happy
+        } catch (CommandParser.InvalidOptionsException e) {
+            System.exit(1);
+            throw new Exception(); // never reached, but keeps compiler happy
         }
 
-        if (loopbackmode != null) {
-            multicast.setLoopbackMode(loopbackmode);
-        }
+        final Options options = arguments.options();
+
+        SimpleDateFormat format = new SimpleDateFormat(options.get("date-format", "HH:mm:ss"));
+
+        final String host = options.get("host", "239.255.3.2");
+        final int port = options.get("port", 6142);
+
+        InetAddress inetAddress = InetAddress.getByName(host);
 
-        System.out.print("Connecting to multicast group: ");
-        System.out.print(host);
-        System.out.print(":");
-        System.out.println(multicast.getLocalPort());
+        InetSocketAddress address = new InetSocketAddress(inetAddress, port);
 
-        print("LoopbackMode", multicast.getLoopbackMode());
-        print("TimeToLive", multicast.getTimeToLive());
-        print("SoTimeout", multicast.getSoTimeout());
+        MulticastSocket multicast = new MulticastSocket(port);
+        multicast.joinGroup(inetAddress);
 
-        System.out.println("-------------------------------");
 
-        if (send != null) {
-            Timer timer = new Timer("Multicast Send", true);
-            timer.scheduleAtFixedRate(new Send(address, multicast, send), 0, rate);
+        final MulticastSocket s = multicast;
+        if (options.has("reuse-address")) s.setReuseAddress(options.get("reuse-address",
false));
+        if (options.has("broadcast")) s.setBroadcast(options.get("broadcast", false));
+        if (options.has("loopback-mode")) s.setLoopbackMode(options.get("loopback-mode",
false));
+        if (options.has("send-buffer-size")) s.setSendBufferSize(options.get("send-buffer-size",
0));
+        if (options.has("receive-buffer-size")) s.setReceiveBufferSize(options.get("receive-buffer-size",
0));
+        if (options.has("so-timeout")) s.setSoTimeout(options.get("so-timeout", 0));
+        if (options.has("time-to-live")) s.setTimeToLive(options.get("time-to-live", 0));
+        if (options.has("traffic-class")) s.setTrafficClass(options.get("traffic-class",
0));
+
+        System.out.println("Connected");
+        print("host", host);
+        print("port", port);
+        System.out.println();
+
+        System.out.println("Socket");
+        print("broadcast", s.getBroadcast());
+        print("loopback-mode", s.getLoopbackMode());
+        print("receive-buffer-size", s.getReceiveBufferSize());
+        print("reuse-address", s.getReuseAddress());
+        print("send-buffer-size", s.getSendBufferSize());
+        print("so-timeout", s.getSoTimeout());
+        print("time-to-live", s.getTimeToLive());
+        print("traffic-class", s.getTrafficClass());
+        System.out.println();
+
+        if (options.has("send")) {
+            String send = options.get("send", "");
+            long rate = options.get("rate", 1000);
+
+            System.out.println("Sending");
+            print("send", send);
+            print("rate", rate);
+            System.out.println();
+
+            final Send message = new Send(address, multicast, send);
+
+            if (rate >0) {
+                Timer timer = new Timer("Multicast Send", true);
+                timer.scheduleAtFixedRate(message, 0, rate);
+            } else {
+                message.run();
+            }
         }
 
+        System.out.println("Listening....");
+
         byte[] buf = new byte[BUFF_SIZE];
         DatagramPacket packet = new DatagramPacket(buf, 0, buf.length);
 
@@ -116,23 +161,30 @@ public class MulticastTool {
             try {
                 multicast.receive(packet);
                 if (packet.getLength() > 0) {
-                    InetAddress a = packet.getAddress();
-                    System.out.print(format.format(new Date()));
-                    System.out.print(" - ");
-                    System.out.print(a.getHostAddress());
-                    System.out.print(" - ");
+                    final StringBuilder sb = new StringBuilder();
+                    sb.append(format.format(new Date()));
+                    sb.append(" - ");
+                    sb.append(packet.getAddress().getHostAddress());
+                    sb.append(" - ");
                     String str = new String(packet.getData(), packet.getOffset(), packet.getLength());
-                    System.out.println(str);
+                    sb.append(str);
+                    System.out.println(sb.toString());
                 }
             } catch (SocketTimeoutException e) {
+                final StringBuilder sb = new StringBuilder();
+                sb.append(format.format(new Date()));
+                sb.append(" - ");
+                sb.append("ERROR");
+                sb.append(" - ");
+                sb.append(e.getMessage());
+                System.out.println(sb.toString());
             }
         }
     }
 
     private static void print(String name, Object value) {
-        System.out.print(name);
-        System.out.print(":");
-        System.out.println(value);
+        System.out.printf(" %-20s: %s", name, value);
+        System.out.println();
     }
 
     static class Send extends TimerTask {

Modified: openejb/branches/openejb-3.1.3/server/openejb-ejbd/src/main/java/org/apache/openejb/server/ejbd/JndiRequestHandler.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.3/server/openejb-ejbd/src/main/java/org/apache/openejb/server/ejbd/JndiRequestHandler.java?rev=1022383&r1=1022382&r2=1022383&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.3/server/openejb-ejbd/src/main/java/org/apache/openejb/server/ejbd/JndiRequestHandler.java
(original)
+++ openejb/branches/openejb-3.1.3/server/openejb-ejbd/src/main/java/org/apache/openejb/server/ejbd/JndiRequestHandler.java
Thu Oct 14 06:05:25 2010
@@ -380,7 +380,7 @@ class JndiRequestHandler {
                         deploymentID,
                         -1, convert(proxyInfo.getInterfaceType()), null);
                 metaData.loadProperties(deployment.getProperties());
-
+                log(metaData);
                 res.setResult(metaData);
                 break;
             }
@@ -401,6 +401,7 @@ class JndiRequestHandler {
                 metaData.setPrimaryKey(proxyInfo.getPrimaryKey());
                 metaData.loadProperties(deployment.getProperties());
 
+                log(metaData);
                 res.setResult(metaData);
                 break;
             }
@@ -425,6 +426,26 @@ class JndiRequestHandler {
 
     }
 
+    private void log(EJBMetaDataImpl metaData) {
+        if (logger.isDebugEnabled()) {
+            final StringBuilder sb = new StringBuilder();
+            sb.append("Sending Ejb(");
+
+            sb.append("deployment-id").append("=");
+            sb.append(metaData.getDeploymentID());
+            sb.append(", properties=[");
+            final String delimiter = "|";
+            for (Map.Entry<Object, Object> entry : metaData.getProperties().entrySet())
{
+                sb.append(entry.getKey()).append("=").append(entry.getValue()).append(delimiter);
+            }
+            if (metaData.getProperties().size() > 1) {
+                sb.delete(sb.length() - delimiter.length(), sb.length());
+            }
+            sb.append("])");
+            logger.debug(sb.toString());
+        }
+    }
+
     protected void updateServer(JNDIRequest req, JNDIResponse res, ProxyInfo proxyInfo) {
         clusterableRequestHandler.updateServer(proxyInfo.getDeploymentInfo(), req, res);
     }

Modified: openejb/branches/openejb-3.1.3/server/openejb-multicast/src/main/resources/META-INF/org.apache.openejb.server.ServerService/multicast
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.3/server/openejb-multicast/src/main/resources/META-INF/org.apache.openejb.server.ServerService/multicast?rev=1022383&r1=1022382&r2=1022383&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.3/server/openejb-multicast/src/main/resources/META-INF/org.apache.openejb.server.ServerService/multicast
(original)
+++ openejb/branches/openejb-3.1.3/server/openejb-multicast/src/main/resources/META-INF/org.apache.openejb.server.ServerService/multicast
Thu Oct 14 06:05:25 2010
@@ -2,3 +2,8 @@ server      = org.apache.openejb.server.
 bind        = 239.255.2.3
 port        = 6142
 disabled    = true
+
+group                  = default
+heart_rate             = 500
+loopback_mode          = false
+max_missed_heartbeats  = 10

Modified: openejb/branches/openejb-3.1.3/server/openejb-multicast/src/main/resources/META-INF/org.apache.openejb.server.ServerService/multipoint
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.3/server/openejb-multicast/src/main/resources/META-INF/org.apache.openejb.server.ServerService/multipoint?rev=1022383&r1=1022382&r2=1022383&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.3/server/openejb-multicast/src/main/resources/META-INF/org.apache.openejb.server.ServerService/multipoint
(original)
+++ openejb/branches/openejb-3.1.3/server/openejb-multicast/src/main/resources/META-INF/org.apache.openejb.server.ServerService/multipoint
Thu Oct 14 06:05:25 2010
@@ -1,5 +1,10 @@
 server      = org.apache.openejb.server.discovery.MultipointDiscoveryAgent
 bind        = 127.0.0.1
 port        = 4212
-initialServers = 
 disabled    = true
+
+initialServers         =
+group                  = default
+heart_rate             = 500
+loopback_mode          = false
+max_missed_heartbeats  = 10

Modified: openejb/branches/openejb-3.1.3/server/openejb-multicast/src/test/java/org/apache/openejb/server/discovery/MulticastDiscoveryAgentTest.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.3/server/openejb-multicast/src/test/java/org/apache/openejb/server/discovery/MulticastDiscoveryAgentTest.java?rev=1022383&r1=1022382&r2=1022383&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.3/server/openejb-multicast/src/test/java/org/apache/openejb/server/discovery/MulticastDiscoveryAgentTest.java
(original)
+++ openejb/branches/openejb-3.1.3/server/openejb-multicast/src/test/java/org/apache/openejb/server/discovery/MulticastDiscoveryAgentTest.java
Thu Oct 14 06:05:25 2010
@@ -22,6 +22,7 @@ import java.net.URI;
 import java.net.URISyntaxException;
 import java.io.IOException;
 import java.util.HashSet;
+import java.util.Properties;
 import java.util.Set;
 
 import org.apache.openejb.server.ServiceException;
@@ -77,6 +78,7 @@ public class MulticastDiscoveryAgentTest
 
     private MulticastDiscoveryAgent agent(String id) throws IOException, URISyntaxException,
ServiceException {
         MulticastDiscoveryAgent agent = new MulticastDiscoveryAgent();
+        agent.init(new Properties());
         agent.setDiscoveryListener(new MyDiscoveryListener(id));
         agent.registerService(new URI("ejbd://"+id+":4201"));
         agent.start();

Modified: openejb/branches/openejb-3.1.3/server/openejb-server/src/main/java/org/apache/openejb/server/ServiceDaemon.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.3/server/openejb-server/src/main/java/org/apache/openejb/server/ServiceDaemon.java?rev=1022383&r1=1022382&r2=1022383&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.3/server/openejb-server/src/main/java/org/apache/openejb/server/ServiceDaemon.java
(original)
+++ openejb/branches/openejb-3.1.3/server/openejb-server/src/main/java/org/apache/openejb/server/ServiceDaemon.java
Thu Oct 14 06:05:25 2010
@@ -70,6 +70,7 @@ public class ServiceDaemon implements Se
     private boolean secure;
     private StringTemplate discoveryUriFormat;
     private URI uri;
+    private Properties props;
 
     public ServiceDaemon(ServerService next) {
         this.next = next;
@@ -112,6 +113,8 @@ public class ServiceDaemon implements Se
 
     public void init(Properties props) throws Exception {
 
+        this.props = props;
+        
         String formatString = props.getProperty("discovery");
         if (formatString != null){
             discoveryUriFormat = new StringTemplate(formatString);
@@ -171,9 +174,26 @@ public class ServiceDaemon implements Se
             DiscoveryAgent agent = SystemInstance.get().getComponent(DiscoveryAgent.class);
             if (agent != null && discoveryUriFormat != null) {
                 Map<String,String> map = new HashMap<String,String>();
+
+                // add all the properties that were used to construct this service
+                for (Map.Entry<Object, Object> entry : props.entrySet()) {
+                    map.put(entry.getKey().toString(), entry.getValue().toString());
+                }
+
                 map.put("port", Integer.toString(port));
-                map.put("host", ip);
-                map.put("bind", ip);
+
+                String address = ip;
+
+                if ("0.0.0.0".equals(address)) {
+                    try {
+                        address = InetAddress.getLocalHost().getHostAddress();
+                    } catch (UnknownHostException e) {
+                        log.error("Failed to resolve 0.0.0.0 to a routable address", e);
+                    }
+                }
+
+                map.put("host", address);
+                map.put("bind", address);
                 String uriString = discoveryUriFormat.apply(map);
                 try {
                     uri = new URI(uriString);

Modified: openejb/branches/openejb-3.1.3/server/openejb-server/src/main/java/org/apache/openejb/server/ServiceManager.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.3/server/openejb-server/src/main/java/org/apache/openejb/server/ServiceManager.java?rev=1022383&r1=1022382&r2=1022383&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.3/server/openejb-server/src/main/java/org/apache/openejb/server/ServiceManager.java
(original)
+++ openejb/branches/openejb-3.1.3/server/openejb-server/src/main/java/org/apache/openejb/server/ServiceManager.java
Thu Oct 14 06:05:25 2010
@@ -41,7 +41,7 @@ import org.apache.xbean.recipe.Option;
  */
 public abstract class ServiceManager {
 
-    static Logger logger = Logger.getInstance(LogCategory.OPENEJB_SERVER_REMOTE, "org.apache.openejb.server.util.resources");
+    static Logger logger = Logger.getInstance(LogCategory.OPENEJB_SERVER, "org.apache.openejb.server.util.resources");
 
     private static ServiceManager manager;
 
@@ -111,7 +111,14 @@ public abstract class ServiceManager {
 
             Class serviceClass = (Class) serviceProperties.get(ServerService.class);
 
-            logger.debug("Creating ServerService(id=" + serviceName + ")");
+            logger.info("Creating ServerService(id=" + serviceName + ")");
+
+            // log all properties on debug
+            if (logger.isDebugEnabled()){
+                for (Map.Entry<Object, Object> entry : serviceProperties.entrySet())
{
+                    logger.debug(entry.getKey() +" = "+ entry.getValue());
+                }
+            }
 
             try {
                 // Create Service



Mime
View raw message