You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by jg...@apache.org on 2015/04/22 21:46:12 UTC

[1/6] tomee git commit: TOMEE-1548 @PostContruct/@preDestroy support in resource attributes - with merge

Repository: tomee
Updated Branches:
  refs/heads/tomee-1.7.x 808f91b24 -> 037cb47fb


TOMEE-1548 @PostContruct/@preDestroy support in resource attributes - with merge

Conflicts:
	container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/fe1e06d0
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/fe1e06d0
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/fe1e06d0

Branch: refs/heads/tomee-1.7.x
Commit: fe1e06d09207ade87e4c6db55252d7d5846d3821
Parents: 28998c9
Author: Romain Manni-Bucau <rm...@apache.org>
Authored: Wed Apr 15 20:14:07 2015 +0200
Committer: Jonathan Gallimore <jo...@jrg.me.uk>
Committed: Mon Apr 20 13:25:39 2015 +0100

----------------------------------------------------------------------
 .../src/test/resources/META-INF/resources.xml   |   2 -
 .../openejb/assembler/classic/Assembler.java    | 201 ++++++++++++-----
 .../openejb/assembler/classic/ResourceInfo.java |   2 +
 .../openejb/config/ConfigurationFactory.java    |  13 +-
 .../org/apache/openejb/config/sys/Resource.java |  22 ++
 .../apache/openejb/config/sys/StackHandler.java |   2 +
 .../ivm/naming/ContextualJndiReference.java     |   4 +
 .../openejb/resource/ResourceLifecycleTest.java | 221 +++++++++++++++++++
 8 files changed, 403 insertions(+), 64 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/fe1e06d0/arquillian/arquillian-tomee-tests/arquillian-tomee-config-tests/src/test/resources/META-INF/resources.xml
----------------------------------------------------------------------
diff --git a/arquillian/arquillian-tomee-tests/arquillian-tomee-config-tests/src/test/resources/META-INF/resources.xml b/arquillian/arquillian-tomee-tests/arquillian-tomee-config-tests/src/test/resources/META-INF/resources.xml
index 0249b91..3edb7dc 100644
--- a/arquillian/arquillian-tomee-tests/arquillian-tomee-config-tests/src/test/resources/META-INF/resources.xml
+++ b/arquillian/arquillian-tomee-tests/arquillian-tomee-config-tests/src/test/resources/META-INF/resources.xml
@@ -20,14 +20,12 @@
 
 <Resources>
   <Resource id="Hello" class-name="org.apache.openejb.arquillian.tests.resource.ResourceTest$Hello">
-    code org.apache.openejb.arquillian.tests.resource.ResourceTest.Hello
     Lazy true
     UseAppClassLoader true
     InitializeAfterDeployment true
   </Resource>
 
   <Resource id="Destroyable" class-name="org.apache.openejb.arquillian.tests.resource.ResourceTest$Destroyable">
-    code org.apache.openejb.arquillian.tests.resource.ResourceTest.Destroyable
     Lazy true
     UseAppClassLoader true
     InitializeAfterDeployment true

http://git-wip-us.apache.org/repos/asf/tomee/blob/fe1e06d0/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java b/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
index 6ced0e9..fc10d9e 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
@@ -125,6 +125,7 @@ import org.apache.openejb.util.PropertiesHelper;
 import org.apache.openejb.util.PropertyPlaceHolderHelper;
 import org.apache.openejb.util.References;
 import org.apache.openejb.util.SafeToolkit;
+import org.apache.openejb.util.SetAccessible;
 import org.apache.openejb.util.SuperProperties;
 import org.apache.openejb.util.URISupport;
 import org.apache.openejb.util.URLs;
@@ -133,6 +134,7 @@ import org.apache.openejb.util.classloader.URLClassLoaderFirst;
 import org.apache.openejb.util.proxy.ProxyFactory;
 import org.apache.openejb.util.proxy.ProxyManager;
 import org.apache.webbeans.config.WebBeansContext;
+import org.apache.webbeans.container.BeanManagerImpl;
 import org.apache.webbeans.inject.OWBInjector;
 import org.apache.webbeans.logger.JULLoggerFactory;
 import org.apache.webbeans.spi.ContainerLifecycle;
@@ -143,9 +145,11 @@ import org.apache.webbeans.spi.ResourceInjectionService;
 import org.apache.webbeans.spi.ScannerService;
 import org.apache.webbeans.spi.TransactionService;
 import org.apache.webbeans.spi.adaptor.ELAdaptor;
+import org.apache.xbean.finder.AnnotationFinder;
 import org.apache.xbean.finder.ClassLoaders;
 import org.apache.xbean.finder.ResourceFinder;
 import org.apache.xbean.finder.UrlSet;
+import org.apache.xbean.finder.archive.ClassesArchive;
 import org.apache.xbean.recipe.ObjectRecipe;
 import org.apache.xbean.recipe.Option;
 import org.apache.xbean.recipe.UnsetPropertiesRecipe;
@@ -182,7 +186,6 @@ import javax.transaction.TransactionSynchronizationRegistry;
 import javax.validation.ValidationException;
 import javax.validation.Validator;
 import javax.validation.ValidatorFactory;
-
 import java.io.ByteArrayInputStream;
 import java.io.Externalizable;
 import java.io.File;
@@ -191,7 +194,6 @@ import java.io.InputStream;
 import java.io.InvalidObjectException;
 import java.io.ObjectStreamException;
 import java.io.Serializable;
-import java.lang.annotation.Annotation;
 import java.lang.instrument.ClassFileTransformer;
 import java.lang.instrument.Instrumentation;
 import java.lang.reflect.Constructor;
@@ -222,6 +224,8 @@ import java.util.concurrent.Executors;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.locks.ReentrantLock;
 
+import static org.apache.openejb.util.Classes.ancestors;
+
 @SuppressWarnings({"UnusedDeclaration", "UnqualifiedFieldAccess", "UnqualifiedMethodAccess"})
 public class Assembler extends AssemblerTool implements org.apache.openejb.spi.Assembler, JndiConstants {
 
@@ -510,9 +514,11 @@ public class Assembler extends AssemblerTool implements org.apache.openejb.spi.A
 
         createSecurityService(configInfo.facilities.securityService);
 
+        final Set<String> rIds = new HashSet<String>(configInfo.facilities.resources.size());
         for (final ResourceInfo resourceInfo : configInfo.facilities.resources) {
             createResource(resourceInfo);
         }
+        postConstructResources(rIds, ParentClassLoaderFinder.Helper.get(), systemInstance.getComponent(ContainerSystem.class).getJNDIContext(), null);
 
         // Containers
         for (final ContainerInfo serviceInfo : containerSystemInfo.containers) {
@@ -934,7 +940,7 @@ public class Assembler extends AssemblerTool implements org.apache.openejb.spi.A
                 }
             }
 
-            postConstructResources(appInfo, classLoader, containerSystemContext, appContext);
+            postConstructResources(appInfo.resourceIds, classLoader, containerSystemContext, appContext);
             
             deployedApplications.put(appInfo.path, appInfo);
             resumePersistentSchedulers(appContext);
@@ -955,66 +961,89 @@ public class Assembler extends AssemblerTool implements org.apache.openejb.spi.A
         }
     }
 
-    private void postConstructResources(final AppInfo appInfo, final ClassLoader classLoader, final Context containerSystemContext, final AppContext appContext) throws NamingException, OpenEJBException {
-        final ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
+    private void postConstructResources(final Set<String> inResourceIds, final ClassLoader classLoader, final Context containerSystemContext, final AppContext appContext) throws NamingException, OpenEJBException {
+        final Thread thread = Thread.currentThread();
+        final ClassLoader oldCl = thread.getContextClassLoader();
 
         try {
-            Thread.currentThread().setContextClassLoader(classLoader);
+            thread.setContextClassLoader(classLoader);
 
-            final Set<String> resourceIds = new HashSet<String>(appInfo.resourceIds);
+            final Set<String> resourceIds = new HashSet<String>(inResourceIds);
             final List<ResourceInfo> resourceList = config.facilities.resources;
 
             for (final ResourceInfo resourceInfo : resourceList) {
-                if (!resourceIds.contains(resourceInfo.id)) {
-                    continue;
-                }
-
                 try {
-                    final Class<?> cls = Class.forName(resourceInfo.className, true, classLoader);
-                    final Method postConstruct = findMethodAnnotatedWith(PostConstruct.class, cls);
+                    final Class<?> clazz = classLoader.loadClass(resourceInfo.className);
+                    final AnnotationFinder finder = new AnnotationFinder(new ClassesArchive(ancestors(clazz)));
+                    final List<Method> postConstructs = finder.findAnnotatedMethods(PostConstruct.class);
+                    final List<Method> preDestroys = finder.findAnnotatedMethods(PreDestroy.class);
                     final boolean initialize = "true".equalsIgnoreCase(String.valueOf(resourceInfo.properties.remove("InitializeAfterDeployment")));
-                    if (postConstruct != null || initialize) {
 
-                        Object resource = containerSystemContext.lookup(OPENEJB_RESOURCE_JNDI_PREFIX + resourceInfo.id);
-                        if (resource instanceof LazyResource) {
-                            resource = LazyResource.class.cast(resource).getObject();
-                            this.bindResource(resourceInfo.id, resource);
+                    CreationalContext<?> creationalContext = null;
+                    Object originalResource = null;
+                    if (!postConstructs.isEmpty() || initialize) {
+                        originalResource = containerSystemContext.lookup(OPENEJB_RESOURCE_JNDI_PREFIX + resourceInfo.id);
+                        Object resource = originalResource;
+                        if (resource instanceof Reference) {
+                            resource = unwrapReference(resource);
+                            this.bindResource(resourceInfo.id, resource, true);
                         }
 
                         try {
                             // wire up CDI
-                            OWBInjector.inject(appContext.getBeanManager(),
-                                    resource,
-                                    appContext.getBeanManager().createCreationalContext(null));
+                            if (appContext != null) {
+                                final BeanManagerImpl beanManager = appContext.getWebBeansContext().getBeanManagerImpl();
+                                if (beanManager.isInUse()) {
+                                    creationalContext = beanManager.createCreationalContext(null);
+                                    OWBInjector.inject(beanManager, resource, creationalContext);
+                                }
+                            }
+
+                            if (resourceInfo.postConstruct != null) {
+                                final Method p = clazz.getDeclaredMethod(resourceInfo.postConstruct);
+                                if (!p.isAccessible()) {
+                                    SetAccessible.on(p);
+                                }
+                                p.invoke(resource);
+                            }
 
-                            if (postConstruct != null) {
-                                postConstruct.invoke(resource);
+                            for (final Method m : postConstructs) {
+                                if (!m.isAccessible()) {
+                                    SetAccessible.on(m);
+                                }
+                                m.invoke(resource);
                             }
-                        } catch (Exception e) {
+                        } catch (final Exception e) {
                             logger.fatal("Error calling @PostConstruct method on " + resource.getClass().getName());
                             throw new OpenEJBException(e);
                         }
                     }
-                } catch (Exception e) {
+
+                    if (resourceInfo.preDestroy != null) {
+                        final Method p = clazz.getDeclaredMethod(resourceInfo.preDestroy);
+                        if (!p.isAccessible()) {
+                            SetAccessible.on(p);
+                        }
+                        preDestroys.add(p);
+                    }
+
+                    if (!preDestroys.isEmpty() || creationalContext != null) {
+                        final String name = OPENEJB_RESOURCE_JNDI_PREFIX + resourceInfo.id;
+                        if (originalResource == null) {
+                            originalResource = containerSystemContext.lookup(name);
+                        }
+                        this.bindResource(resourceInfo.id, new ResourceInstance(name, originalResource, preDestroys, creationalContext), true);
+                    }
+                } catch (final Exception e) {
                     logger.fatal("Error calling @PostConstruct method on " + resourceInfo.id);
                     throw new OpenEJBException(e);
                 }
             }
         } finally {
-            Thread.currentThread().setContextClassLoader(oldCl);
+            thread.setContextClassLoader(oldCl);
         }
     }
 
-    private Method findMethodAnnotatedWith(final Class<? extends Annotation> annotation, final Class<?> cls) {
-        final Method[] methods = cls.getDeclaredMethods();
-        for (final Method method : methods) {
-            if (method.getAnnotation(annotation) != null) {
-                return method;
-            }
-        }
-
-        return null;
-    }
 
     public static void mergeServices(final AppInfo appInfo) throws URISyntaxException {
         for (final ServiceInfo si : appInfo.services) { // used lazily by JaxWsServiceObjectFactory, we could do the same for resources
@@ -1606,7 +1635,7 @@ public class Assembler extends AssemblerTool implements org.apache.openejb.spi.A
 
     private void destroyResource(final String name, final String className, final Object object) {
 
-        Method preDestroy = null;
+        Collection<Method> preDestroy = null;
 
         if (object instanceof ResourceAdapterReference) {
             final ResourceAdapterReference resourceAdapter = (ResourceAdapterReference) object;
@@ -1666,13 +1695,6 @@ public class Assembler extends AssemblerTool implements org.apache.openejb.spi.A
             } catch (final RuntimeException e) {
                 logger.error(e.getMessage(), e);
             }
-        } else if ((preDestroy = findPreDestroy(object)) != null) {
-            logger.debug("Calling @PreDestroy on: " + className);
-            try {
-                preDestroy.invoke(object);
-            } catch (final Exception e) {
-                logger.error(e.getMessage(), e);
-            }
         } else if (logger.isDebugEnabled() && !DataSource.class.isInstance(object)) {
             logger.debug("Not processing resource on destroy: " + className);
         }
@@ -1693,18 +1715,19 @@ public class Assembler extends AssemblerTool implements org.apache.openejb.spi.A
         }
     }
 
-    private Method findPreDestroy(final Object object) {
-        try {
-            Object resource = object;
-            if (LazyResource.class.isInstance(resource) && LazyResource.class.cast(resource).isInitialized()) {
-                resource = LazyResource.class.cast(resource).getObject();
+    private static Object unwrapReference(final Object object) {
+        Object o = object;
+        while (o != null && Reference.class.isInstance(o)) {
+            try {
+                o = Reference.class.cast(o).getObject();
+            } catch (final NamingException e) {
+                // break
             }
-
-            final Class<? extends Object> cls = resource.getClass();
-            return findMethodAnnotatedWith(PreDestroy.class, cls);
-        } catch (Exception e) {
-            return null;
         }
+        if (o == null) {
+            o = object;
+        }
+        return o;
     }
 
     public void destroyApplication(final String filePath) throws UndeployException, NoSuchApplicationException {
@@ -2384,9 +2407,9 @@ public class Assembler extends AssemblerTool implements org.apache.openejb.spi.A
                 newLazyResource(serviceInfo) :
                 doCreateResource(serviceInfo);
 
-        bindResource(serviceInfo.id, service);
+        bindResource(serviceInfo.id, service, false);
         for (final String alias : serviceInfo.aliases) {
-            bindResource(alias, service);
+            bindResource(alias, service, false);
         }
         if (serviceInfo.originAppName != null && !serviceInfo.originAppName.isEmpty() && !"/".equals(serviceInfo.originAppName)
             && !serviceInfo.id.startsWith("global")) {
@@ -2394,7 +2417,7 @@ public class Assembler extends AssemblerTool implements org.apache.openejb.spi.A
             serviceInfo.aliases.add(baseJndiName);
             final ContextualJndiReference ref = new ContextualJndiReference(baseJndiName);
             ref.addPrefix(serviceInfo.originAppName);
-            bindResource(baseJndiName, ref);
+            bindResource(baseJndiName, ref, false);
         }
 
         // Update the config tree
@@ -2657,7 +2680,7 @@ public class Assembler extends AssemblerTool implements org.apache.openejb.spi.A
         return service;
     }
 
-    private void bindResource(final String id, final Object service) throws OpenEJBException {
+    private void bindResource(final String id, final Object service, final boolean canReplace) throws OpenEJBException {
         final String name = OPENEJB_RESOURCE_JNDI_PREFIX + id;
         final Context jndiContext = containerSystem.getJNDIContext();
         Object existing = null;
@@ -2680,12 +2703,21 @@ public class Assembler extends AssemblerTool implements org.apache.openejb.spi.A
             } else if (existingIsContextual && !serviceIsExisting) {
                 ContextualJndiReference.class.cast(existing).setDefaultValue(service);
             } else if (existingIsContextual) { // && serviceIsExisting is always true here
-                ContextualJndiReference.class.cast(existing).addPrefix(ContextualJndiReference.class.cast(service).lastPrefix());
+                final ContextualJndiReference contextual = ContextualJndiReference.class.cast(existing);
+                if (canReplace && contextual.prefixesSize() == 1) { // replace!
+                    contextual.removePrefix(contextual.lastPrefix());
+                    contextual.setDefaultValue(service);
+                } else {
+                    contextual.addPrefix(ContextualJndiReference.class.cast(service).lastPrefix());
+                }
                 return;
             }
         }
 
         try {
+            if (canReplace && existing != null) {
+                jndiContext.unbind(name);
+            }
             if (rebind) {
                 jndiContext.rebind(name, service);
             } else {
@@ -3122,4 +3154,55 @@ public class Assembler extends AssemblerTool implements org.apache.openejb.spi.A
             }
         }
     }
+
+    public static class ResourceInstance extends Reference implements Serializable, DestroyableResource {
+        private final String name;
+        private final Object delegate;
+        private transient final Collection<Method> preDestroys;
+        private transient final CreationalContext<?> context;
+
+        public ResourceInstance(final String name, final Object delegate, final Collection<Method> preDestroys, final CreationalContext<?> context) {
+            this.name = name;
+            this.delegate = delegate;
+            this.preDestroys = preDestroys;
+            this.context = context;
+        }
+
+        @Override
+        public Object getObject() throws NamingException {
+            return delegate;
+        }
+
+        @Override
+        public void destroyResource() {
+            final Object o = unwrapReference(delegate);
+            for (final Method m : preDestroys) {
+                try {
+                    if (!m.isAccessible()) {
+                        SetAccessible.on(m);
+                    }
+                    m.invoke(o);
+                } catch (final Exception e) {
+                    SystemInstance.get().getComponent(Assembler.class).logger.error(e.getMessage(), e);
+                }
+            }
+            try {
+                if (context != null) {
+                    context.release();
+                }
+            } catch (final Exception e) {
+                // no-op
+            }
+        }
+
+        // we don't care unwrapping the resource here since we want to keep ResourceInstance data for destruction
+        // which is never serialized (IvmContext)
+        Object readResolve() throws ObjectStreamException {
+            try {
+                return SystemInstance.get().getComponent(ContainerSystem.class).getJNDIContext().lookup(name);
+            } catch (final NamingException e) {
+                throw new IllegalStateException(e);
+            }
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/tomee/blob/fe1e06d0/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ResourceInfo.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ResourceInfo.java b/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ResourceInfo.java
index 502947e..c24ae24 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ResourceInfo.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ResourceInfo.java
@@ -22,6 +22,8 @@ import java.util.List;
 
 public class ResourceInfo extends ServiceInfo {
     public String jndiName = "";
+    public String postConstruct;
+    public String preDestroy;
     public String originAppName; // if define by an app
     public List<String> aliases = new ArrayList<String>();
 }

http://git-wip-us.apache.org/repos/asf/tomee/blob/fe1e06d0/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurationFactory.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurationFactory.java b/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurationFactory.java
index 678cc2e..6e011ea 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurationFactory.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurationFactory.java
@@ -762,10 +762,13 @@ public class ConfigurationFactory implements OpenEjbConfigurationFactory {
                 }
 
                 if (object instanceof Resource) {
+                    final Resource resource = Resource.class.cast(object);
                     final String aliases = map.remove("aliases");
                     if (aliases != null) {
-                        ((Resource) object).getAliases().addAll(Arrays.asList(aliases.split(",")));
+                        resource.getAliases().addAll(Arrays.asList(aliases.split(",")));
                     }
+                    resource.setPostConstruct(map.remove("post-construct"));
+                    resource.setPreDestroy(map.remove("pre-destroy"));
                 }
 
                 service.getProperties().putAll(map);
@@ -1191,8 +1194,12 @@ public class ConfigurationFactory implements OpenEjbConfigurationFactory {
             info.properties = props;
             info.constructorArgs.addAll(parseConstructorArgs(provider));
             if (info instanceof ResourceInfo && service instanceof Resource) {
-                ((ResourceInfo) info).jndiName = ((Resource) service).getJndi();
-                ((ResourceInfo) info).aliases.addAll(((Resource) service).getAliases());
+                final ResourceInfo ri = ResourceInfo.class.cast(info);
+                final Resource resource = Resource.class.cast(service);
+                ri.jndiName = resource.getJndi();
+                ri.postConstruct = resource.getPostConstruct();
+                ri.preDestroy = resource.getPreDestroy();
+                ri.aliases.addAll(resource.getAliases());
             }
 
             if (service.getClasspath() != null && service.getClasspath().length() > 0) {

http://git-wip-us.apache.org/repos/asf/tomee/blob/fe1e06d0/container/openejb-core/src/main/java/org/apache/openejb/config/sys/Resource.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/sys/Resource.java b/container/openejb-core/src/main/java/org/apache/openejb/config/sys/Resource.java
index 2e651f6..f953be7 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/sys/Resource.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/sys/Resource.java
@@ -52,6 +52,12 @@ public class Resource extends AbstractService {
     @XmlAttribute
     protected String jndi;
 
+    @XmlAttribute(name = "post-construct")
+    protected String postConstruct;
+
+    @XmlAttribute(name = "pre-destroy")
+    protected String preDestroy;
+
     @XmlElement(name = "aliases")
     protected List<String> aliases = new ArrayList<String>();
 
@@ -94,6 +100,22 @@ public class Resource extends AbstractService {
         return aliases;
     }
 
+    public String getPostConstruct() {
+        return postConstruct;
+    }
+
+    public void setPostConstruct(final String postConstruct) {
+        this.postConstruct = postConstruct;
+    }
+
+    public String getPreDestroy() {
+        return preDestroy;
+    }
+
+    public void setPreDestroy(final String preDestroy) {
+        this.preDestroy = preDestroy;
+    }
+
     @Override
     public boolean equals(final Object o) {
         if (this == o) {

http://git-wip-us.apache.org/repos/asf/tomee/blob/fe1e06d0/container/openejb-core/src/main/java/org/apache/openejb/config/sys/StackHandler.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/sys/StackHandler.java b/container/openejb-core/src/main/java/org/apache/openejb/config/sys/StackHandler.java
index f4d3b02..bc69a08 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/sys/StackHandler.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/sys/StackHandler.java
@@ -193,6 +193,8 @@ public class StackHandler extends DefaultHandler {
         public void startElement(final String uri, final String localName, final String qName, final Attributes attributes) throws SAXException {
             super.startElement(uri, localName, qName, attributes);
             service.setJndi(attributes.getValue("jndi"));
+            service.setPostConstruct(attributes.getValue("post-construct"));
+            service.setPreDestroy(attributes.getValue("pre-destroy"));
             service.setPropertiesProvider(attributes.getValue("property-provider"));
 
             final String aliases = attributes.getValue("aliases");

http://git-wip-us.apache.org/repos/asf/tomee/blob/fe1e06d0/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/naming/ContextualJndiReference.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/naming/ContextualJndiReference.java b/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/naming/ContextualJndiReference.java
index 3417164..390c373 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/naming/ContextualJndiReference.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/naming/ContextualJndiReference.java
@@ -73,6 +73,10 @@ public class ContextualJndiReference extends IntraVmJndiReference {
         return prefixes.isEmpty();
     }
 
+    public int prefixesSize() {
+        return prefixes.size();
+    }
+
     @Override
     public Object getObject() throws NamingException {
         final Boolean rawValue = !followReference.get();

http://git-wip-us.apache.org/repos/asf/tomee/blob/fe1e06d0/container/openejb-core/src/test/java/org/apache/openejb/resource/ResourceLifecycleTest.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/test/java/org/apache/openejb/resource/ResourceLifecycleTest.java b/container/openejb-core/src/test/java/org/apache/openejb/resource/ResourceLifecycleTest.java
new file mode 100644
index 0000000..6a4ebe9
--- /dev/null
+++ b/container/openejb-core/src/test/java/org/apache/openejb/resource/ResourceLifecycleTest.java
@@ -0,0 +1,221 @@
+/*
+ * 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.openejb.resource;
+
+import org.apache.openejb.jee.WebApp;
+import org.apache.openejb.junit.ApplicationComposer;
+import org.apache.openejb.testing.Configuration;
+import org.apache.openejb.testing.Module;
+import org.apache.openejb.testing.SimpleLog;
+import org.apache.openejb.testng.PropertiesBuilder;
+import org.junit.AfterClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.annotation.Resource;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.Properties;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+@SimpleLog
+@RunWith(ApplicationComposer.class)
+public class ResourceLifecycleTest {
+
+
+    @Configuration
+    public Properties configuration() {
+        return new PropertiesBuilder()
+                .p("postConstructAndPreDestroy", "new://Resource?class-name=org.apache.openejb.resource.ResourceLifecycleTest$WithBoth")
+                .p("postConstructAndPreDestroy.myAttr", "done")
+                .p("postConstructOnly", "new://Resource?class-name=org.apache.openejb.resource.ResourceLifecycleTest$WithPostConstruct")
+                .p("postConstructOnly.myAttr", "done")
+                .p("postConstructAnnotationAndConfigOnly", "new://Resource?class-name=org.apache.openejb.resource.ResourceLifecycleTest$WithPostConstruct&post-construct=init2")
+                .p("postConstructAnnotationAndConfigOnly.myAttr", "done")
+                .p("preDestroyOnly", "new://Resource?class-name=org.apache.openejb.resource.ResourceLifecycleTest$WithPreDestroy")
+                .p("preDestroyOnly.myAttr", "done")
+                .p("preDestroyAnnotationAndConfigOnly", "new://Resource?class-name=org.apache.openejb.resource.ResourceLifecycleTest$WithPreDestroy&pre-destroy=init2")
+                .p("preDestroyAnnotationAndConfigOnly.myAttr", "done")
+                .build();
+    }
+
+    @Module
+    public WebApp webApp() {
+        return new WebApp();
+    }
+
+    @Resource(name = "postConstructAndPreDestroy")
+    private WithBoth both;
+
+    @Resource(name = "postConstructOnly")
+    private WithPostConstruct postConstruct;
+
+    @Resource(name = "postConstructAnnotationAndConfigOnly")
+    private WithPostConstruct postConstruct2;
+
+    @Resource(name = "preDestroyOnly")
+    private WithPreDestroy preDestroy;
+
+    @Resource(name = "preDestroyAnnotationAndConfigOnly")
+    private WithPreDestroy preDestroy2;
+
+    private static final Collection<Runnable> POST_CONTAINER_VALIDATIONS = new LinkedList<Runnable>();
+
+    @AfterClass
+    public static void lastValidations() { // late to make the test failing (ie junit report will be broken) but better than destroying eagerly the resource
+        for (final Runnable runnable : POST_CONTAINER_VALIDATIONS) {
+            runnable.run();
+        }
+        POST_CONTAINER_VALIDATIONS.clear();
+    }
+
+    @Test
+    public void postConstructOnly() {
+        assertNotNull(postConstruct);
+        assertTrue(postConstruct.isInit());
+        assertFalse(postConstruct.isInit2());
+        assertEquals("done", postConstruct.myAttr);
+    }
+
+    @Test
+    public void postConstructAnnotationAndConfigOnly() {
+        assertNotNull(postConstruct2);
+        assertTrue(postConstruct2.isInit());
+        assertTrue(postConstruct2.isInit2());
+        assertEquals("done", postConstruct2.myAttr);
+    }
+
+    @Test
+    public void preDestroyOnly() {
+        assertNotNull(preDestroy);
+        assertFalse(preDestroy.isDestroy());
+        assertFalse(preDestroy.isDestroy2());
+        assertEquals("done", preDestroy.myAttr);
+        POST_CONTAINER_VALIDATIONS.add(new Runnable() {
+            @Override
+            public void run() {
+                assertTrue(preDestroy.isDestroy());
+            }
+        });
+    }
+
+    @Test
+    public void preDestroyAnnotationAndConfigOnly() {
+        assertNotNull(preDestroy2);
+        assertFalse(preDestroy2.isDestroy());
+        assertFalse(preDestroy2.isDestroy2());
+        assertEquals("done", preDestroy2.myAttr);
+        POST_CONTAINER_VALIDATIONS.add(new Runnable() {
+            @Override
+            public void run() {
+                assertTrue(preDestroy2.isDestroy());
+                assertTrue(preDestroy2.isDestroy2());
+            }
+        });
+    }
+
+    @Test
+    public void postConstructAndPreDestroy() {
+        assertNotNull(both);
+        assertTrue(both.isInit());
+        assertFalse(both.isDestroy());
+        assertEquals("done", both.myAttr);
+        POST_CONTAINER_VALIDATIONS.add(new Runnable() {
+            @Override
+            public void run() {
+                assertTrue(both.isDestroy());
+            }
+        });
+    }
+
+    public static class TrivialConfigToCheckWarnings {
+        protected String myAttr;
+    }
+
+    public static class WithBoth extends TrivialConfigToCheckWarnings {
+        private boolean init;
+        private boolean destroy;
+
+        @PostConstruct
+        private void init() {
+            init = true;
+        }
+
+        @PreDestroy
+        private void init2() {
+            destroy = true;
+        }
+
+        public boolean isInit() {
+            return init;
+        }
+
+        public boolean isDestroy() {
+            return destroy;
+        }
+    }
+
+    public static class WithPostConstruct extends TrivialConfigToCheckWarnings {
+        private boolean init;
+        private boolean init2;
+
+        @PostConstruct
+        private void init() {
+            init = true;
+        }
+
+        private void init2() {
+            init2 = true;
+        }
+
+        public boolean isInit() {
+            return init;
+        }
+
+        public boolean isInit2() {
+            return init2;
+        }
+    }
+
+    public static class WithPreDestroy extends TrivialConfigToCheckWarnings {
+        private boolean destroy;
+        private boolean destroy2;
+
+        @PreDestroy
+        private void init() {
+            destroy = true;
+        }
+
+        private void init2() {
+            destroy2 = true;
+        }
+
+        public boolean isDestroy() {
+            return destroy;
+        }
+
+        public boolean isDestroy2() {
+            return destroy2;
+        }
+    }
+}


[6/6] tomee git commit: Fix compile error and update to OpenJPA 2.4.0

Posted by jg...@apache.org.
Fix compile error and update to OpenJPA 2.4.0


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/037cb47f
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/037cb47f
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/037cb47f

Branch: refs/heads/tomee-1.7.x
Commit: 037cb47fbf1a33e27186d2b3c9918162ae97cdca
Parents: 56905f6
Author: Jonathan Gallimore <jo...@jrg.me.uk>
Authored: Wed Apr 22 20:45:27 2015 +0100
Committer: Jonathan Gallimore <jo...@jrg.me.uk>
Committed: Wed Apr 22 20:45:27 2015 +0100

----------------------------------------------------------------------
 arquillian/arquillian-tomee-common/pom.xml                     | 2 +-
 arquillian/arquillian-tomee-webapp-remote/pom.xml              | 2 +-
 container/openejb-core/pom.xml                                 | 2 +-
 .../org/apache/openejb/assembler/classic/ResourceInfo.java     | 2 +-
 .../java/org/apache/openejb/assembler/classic/ServiceInfo.java | 2 +-
 examples/alternate-descriptors/pom.xml                         | 2 +-
 examples/multi-jpa-provider-testing/pom.xml                    | 2 +-
 examples/polling-parent/polling-client/pom.xml                 | 2 +-
 examples/polling-parent/polling-domain/pom.xml                 | 6 +++---
 examples/pom.xml                                               | 2 +-
 examples/resources-jmx-example/pom.xml                         | 2 +-
 examples/rest-example/pom.xml                                  | 2 +-
 examples/simple-osgi/simple-osgi-core/pom.xml                  | 4 ++--
 .../src/main/resources/archetype-resources/pom.xml             | 2 +-
 pom.xml                                                        | 4 ++--
 tomee/pom.xml                                                  | 2 +-
 utils/openejb-core-eclipselink/pom.xml                         | 2 +-
 utils/openejb-core-hibernate/pom.xml                           | 2 +-
 18 files changed, 22 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/037cb47f/arquillian/arquillian-tomee-common/pom.xml
----------------------------------------------------------------------
diff --git a/arquillian/arquillian-tomee-common/pom.xml b/arquillian/arquillian-tomee-common/pom.xml
index 76eccf9..3b3d71a 100644
--- a/arquillian/arquillian-tomee-common/pom.xml
+++ b/arquillian/arquillian-tomee-common/pom.xml
@@ -184,7 +184,7 @@
         </exclusion>
         <exclusion>
           <artifactId>openjpa</artifactId>
-          <groupId>org.apache.openejb.patch</groupId>
+          <groupId>org.apache.openjpa</groupId>
         </exclusion>
         <exclusion>
           <artifactId>openwebbeans-web</artifactId>

http://git-wip-us.apache.org/repos/asf/tomee/blob/037cb47f/arquillian/arquillian-tomee-webapp-remote/pom.xml
----------------------------------------------------------------------
diff --git a/arquillian/arquillian-tomee-webapp-remote/pom.xml b/arquillian/arquillian-tomee-webapp-remote/pom.xml
index eb72444..ca427b0 100644
--- a/arquillian/arquillian-tomee-webapp-remote/pom.xml
+++ b/arquillian/arquillian-tomee-webapp-remote/pom.xml
@@ -203,7 +203,7 @@
         </exclusion>
         <exclusion>
           <artifactId>openjpa</artifactId>
-          <groupId>org.apache.openejb.patch</groupId>
+          <groupId>org.apache.openjpa</groupId>
         </exclusion>
         <exclusion>
           <artifactId>openwebbeans-web</artifactId>

http://git-wip-us.apache.org/repos/asf/tomee/blob/037cb47f/container/openejb-core/pom.xml
----------------------------------------------------------------------
diff --git a/container/openejb-core/pom.xml b/container/openejb-core/pom.xml
index af58db5..8d6fa6b 100644
--- a/container/openejb-core/pom.xml
+++ b/container/openejb-core/pom.xml
@@ -657,7 +657,7 @@
       <artifactId>openwebbeans-web</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.apache.openejb.patch</groupId>
+      <groupId>org.apache.openjpa</groupId>
       <artifactId>openjpa</artifactId>
     </dependency>
     <!--

http://git-wip-us.apache.org/repos/asf/tomee/blob/037cb47f/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ResourceInfo.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ResourceInfo.java b/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ResourceInfo.java
index d7ed93d..c24ae24 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ResourceInfo.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ResourceInfo.java
@@ -25,5 +25,5 @@ public class ResourceInfo extends ServiceInfo {
     public String postConstruct;
     public String preDestroy;
     public String originAppName; // if define by an app
-    public List<String> aliases = new ArrayList<>();
+    public List<String> aliases = new ArrayList<String>();
 }

http://git-wip-us.apache.org/repos/asf/tomee/blob/037cb47f/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ServiceInfo.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ServiceInfo.java b/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ServiceInfo.java
index bd55d12..06dfc45 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ServiceInfo.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ServiceInfo.java
@@ -33,7 +33,7 @@ public class ServiceInfo extends InfoObject {
     public String codebase;
     public URI[] classpath;
     public Properties properties;
-    public final List<String> constructorArgs = new ArrayList<>();
+    public final List<String> constructorArgs = new ArrayList<String>();
     public Properties unsetProperties; // keep it in the model to be able to investigate it dumping Infos
 
     /**

http://git-wip-us.apache.org/repos/asf/tomee/blob/037cb47f/examples/alternate-descriptors/pom.xml
----------------------------------------------------------------------
diff --git a/examples/alternate-descriptors/pom.xml b/examples/alternate-descriptors/pom.xml
index 94812a6..b75acc5 100644
--- a/examples/alternate-descriptors/pom.xml
+++ b/examples/alternate-descriptors/pom.xml
@@ -65,7 +65,7 @@
     <dependency>
       <groupId>org.apache.openjpa</groupId>
       <artifactId>openjpa</artifactId>
-      <version>2.3.0</version>
+      <version>2.4.0</version>
       <scope>provided</scope>
       <exclusions>
         <exclusion>

http://git-wip-us.apache.org/repos/asf/tomee/blob/037cb47f/examples/multi-jpa-provider-testing/pom.xml
----------------------------------------------------------------------
diff --git a/examples/multi-jpa-provider-testing/pom.xml b/examples/multi-jpa-provider-testing/pom.xml
index 423f6ca..d401095 100644
--- a/examples/multi-jpa-provider-testing/pom.xml
+++ b/examples/multi-jpa-provider-testing/pom.xml
@@ -132,7 +132,7 @@
     <dependency>
       <groupId>org.apache.openjpa</groupId>
       <artifactId>openjpa</artifactId>
-      <version>2.3.0</version>
+      <version>2.4.0</version>
       <scope>test</scope>
     </dependency>
     <dependency> <!-- just a facade pom which will bring hibernate for us -->

http://git-wip-us.apache.org/repos/asf/tomee/blob/037cb47f/examples/polling-parent/polling-client/pom.xml
----------------------------------------------------------------------
diff --git a/examples/polling-parent/polling-client/pom.xml b/examples/polling-parent/polling-client/pom.xml
index 0a7edce..67e183a 100644
--- a/examples/polling-parent/polling-client/pom.xml
+++ b/examples/polling-parent/polling-client/pom.xml
@@ -91,7 +91,7 @@
           <dependency> <!-- because entities was enhanced -->
             <groupId>org.apache.openjpa</groupId>
             <artifactId>openjpa</artifactId>
-            <version>2.3.0</version>
+            <version>2.4.0</version>
           </dependency>
         </dependencies>
       </plugin>

http://git-wip-us.apache.org/repos/asf/tomee/blob/037cb47f/examples/polling-parent/polling-domain/pom.xml
----------------------------------------------------------------------
diff --git a/examples/polling-parent/polling-domain/pom.xml b/examples/polling-parent/polling-domain/pom.xml
index c13f5ba..6884da5 100644
--- a/examples/polling-parent/polling-domain/pom.xml
+++ b/examples/polling-parent/polling-domain/pom.xml
@@ -41,7 +41,7 @@
       <plugin>
         <groupId>org.apache.openjpa</groupId>
         <artifactId>openjpa-maven-plugin</artifactId>
-        <version>2.3.0</version>
+        <version>2.4.0</version>
         <configuration>
           <includes>jug/domain/*.class</includes>
           <addDefaultConstructor>true</addDefaultConstructor>
@@ -58,9 +58,9 @@
         </executions>
         <dependencies>
           <dependency>
-            <groupId>org.apache.openejb.patch</groupId>
+            <groupId>org.apache.openjpa</groupId>
             <artifactId>openjpa</artifactId>
-            <version>2.4.0-nonfinal-1598334</version>
+            <version>2.4.0</version>
           </dependency>
         </dependencies>
       </plugin>

http://git-wip-us.apache.org/repos/asf/tomee/blob/037cb47f/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index 0a9d548..d701286 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -165,7 +165,7 @@
     <dependency>
       <groupId>org.apache.openjpa</groupId>
       <artifactId>openjpa-maven-plugin</artifactId>
-      <version>2.3.0</version>
+      <version>2.4.0</version>
     </dependency>
   </dependencies>
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/037cb47f/examples/resources-jmx-example/pom.xml
----------------------------------------------------------------------
diff --git a/examples/resources-jmx-example/pom.xml b/examples/resources-jmx-example/pom.xml
index 62f5d03..d7d95e1 100644
--- a/examples/resources-jmx-example/pom.xml
+++ b/examples/resources-jmx-example/pom.xml
@@ -32,7 +32,7 @@
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <version.openejb>4.7.2-SNAPSHOT</version.openejb>
     <version.tomee>1.7.2-SNAPSHOT</version.tomee>
-    <version.openjpa>2.3.0</version.openjpa>
+    <version.openjpa>2.4.0</version.openjpa>
   </properties>
   
   <repositories>

http://git-wip-us.apache.org/repos/asf/tomee/blob/037cb47f/examples/rest-example/pom.xml
----------------------------------------------------------------------
diff --git a/examples/rest-example/pom.xml b/examples/rest-example/pom.xml
index 3e9b895..609e8d7 100644
--- a/examples/rest-example/pom.xml
+++ b/examples/rest-example/pom.xml
@@ -28,7 +28,7 @@
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <openejb.version>4.7.2-SNAPSHOT</openejb.version>
     <tomee.version>1.7.2-SNAPSHOT</tomee.version>
-    <version.openjpa>2.3.0</version.openjpa>
+    <version.openjpa>2.4.0</version.openjpa>
   </properties>
   
   <repositories>

http://git-wip-us.apache.org/repos/asf/tomee/blob/037cb47f/examples/simple-osgi/simple-osgi-core/pom.xml
----------------------------------------------------------------------
diff --git a/examples/simple-osgi/simple-osgi-core/pom.xml b/examples/simple-osgi/simple-osgi-core/pom.xml
index 71fdcc7..199aaf5 100644
--- a/examples/simple-osgi/simple-osgi-core/pom.xml
+++ b/examples/simple-osgi/simple-osgi-core/pom.xml
@@ -45,7 +45,7 @@
       <plugin> <!-- needed otherwise it will not work at runtime -->
         <groupId>org.apache.openjpa</groupId>
         <artifactId>openjpa-maven-plugin</artifactId>
-        <version>2.3.0</version>
+        <version>2.4.0</version>
         <configuration>
           <includes>org/superbiz/osgi/moviefun/Movie.class</includes>
           <addDefaultConstructor>true</addDefaultConstructor>
@@ -64,7 +64,7 @@
           <dependency>
             <groupId>org.apache.openjpa</groupId>
             <artifactId>openjpa</artifactId>
-            <version>2.3.0</version>
+            <version>2.4.0</version>
           </dependency>
         </dependencies>
       </plugin>

http://git-wip-us.apache.org/repos/asf/tomee/blob/037cb47f/maven/tomee-webapp-archetype/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/maven/tomee-webapp-archetype/src/main/resources/archetype-resources/pom.xml b/maven/tomee-webapp-archetype/src/main/resources/archetype-resources/pom.xml
index 549d6e6..bae2811 100644
--- a/maven/tomee-webapp-archetype/src/main/resources/archetype-resources/pom.xml
+++ b/maven/tomee-webapp-archetype/src/main/resources/archetype-resources/pom.xml
@@ -29,7 +29,7 @@
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
-    <version.openjpa>2.3.0</version.openjpa>
+    <version.openjpa>2.4.0</version.openjpa>
   </properties>
 
   <dependencies>

http://git-wip-us.apache.org/repos/asf/tomee/blob/037cb47f/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 97fe4c4..66fe197 100644
--- a/pom.xml
+++ b/pom.xml
@@ -99,7 +99,7 @@
     <openejb.version>4.7.2-SNAPSHOT</openejb.version>
     <tomee.version>1.7.2-SNAPSHOT</tomee.version>
 
-    <openjpa.version>2.4.0-nonfinal-1598334</openjpa.version>
+    <openjpa.version>2.4.0</openjpa.version>
     <org.apache.openwebbeans.version>1.2.7</org.apache.openwebbeans.version>
 
     <!-- Maven module versions -->
@@ -1515,7 +1515,7 @@
         <scope>provided</scope>
       </dependency>
       <dependency>
-        <groupId>org.apache.openejb.patch</groupId>
+        <groupId>org.apache.openjpa</groupId>
         <artifactId>openjpa</artifactId>
         <version>${openjpa.version}</version>
         <exclusions>

http://git-wip-us.apache.org/repos/asf/tomee/blob/037cb47f/tomee/pom.xml
----------------------------------------------------------------------
diff --git a/tomee/pom.xml b/tomee/pom.xml
index 7515c10..774f8bc 100644
--- a/tomee/pom.xml
+++ b/tomee/pom.xml
@@ -128,7 +128,7 @@
           <version>${version.openejb}</version>
           <exclusions>
             <exclusion>
-              <groupId>org.apache.openejb.patch</groupId>
+              <groupId>org.apache.openjpa</groupId>
               <artifactId>openjpa</artifactId>
             </exclusion>
             <exclusion>

http://git-wip-us.apache.org/repos/asf/tomee/blob/037cb47f/utils/openejb-core-eclipselink/pom.xml
----------------------------------------------------------------------
diff --git a/utils/openejb-core-eclipselink/pom.xml b/utils/openejb-core-eclipselink/pom.xml
index 8ede3e5..b3e6d6e 100644
--- a/utils/openejb-core-eclipselink/pom.xml
+++ b/utils/openejb-core-eclipselink/pom.xml
@@ -35,7 +35,7 @@
       <version>${project.version}</version>
       <exclusions>
         <exclusion>
-          <groupId>org.apache.openejb.patch</groupId>
+          <groupId>org.apache.openjpa</groupId>
           <artifactId>openjpa</artifactId>
         </exclusion>
       </exclusions>

http://git-wip-us.apache.org/repos/asf/tomee/blob/037cb47f/utils/openejb-core-hibernate/pom.xml
----------------------------------------------------------------------
diff --git a/utils/openejb-core-hibernate/pom.xml b/utils/openejb-core-hibernate/pom.xml
index 19bd7b5..8c67390 100644
--- a/utils/openejb-core-hibernate/pom.xml
+++ b/utils/openejb-core-hibernate/pom.xml
@@ -35,7 +35,7 @@
       <version>${project.version}</version>
       <exclusions>
         <exclusion>
-          <groupId>org.apache.openejb.patch</groupId>
+          <groupId>org.apache.openjpa</groupId>
           <artifactId>openjpa</artifactId>
         </exclusion>
         <exclusion>


[2/6] tomee git commit: dont break custom classpath for resource lifecycle

Posted by jg...@apache.org.
dont break custom classpath for resource lifecycle


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/cd4de99e
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/cd4de99e
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/cd4de99e

Branch: refs/heads/tomee-1.7.x
Commit: cd4de99e3ccfe424984510a1afa2f2768955f6c2
Parents: fe1e06d
Author: Romain Manni-Bucau <rm...@apache.org>
Authored: Wed Apr 15 22:37:09 2015 +0200
Committer: Jonathan Gallimore <jo...@jrg.me.uk>
Committed: Mon Apr 20 13:26:23 2015 +0100

----------------------------------------------------------------------
 .../apache/openejb/assembler/classic/Assembler.java  | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/cd4de99e/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java b/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
index fc10d9e..66f1920 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
@@ -192,19 +192,15 @@ import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InvalidObjectException;
-import java.io.ObjectStreamException;
-import java.io.Serializable;
 import java.lang.instrument.ClassFileTransformer;
 import java.lang.instrument.Instrumentation;
 import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
 import java.net.MalformedURLException;
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.HashMap;
@@ -973,7 +969,12 @@ public class Assembler extends AssemblerTool implements org.apache.openejb.spi.A
 
             for (final ResourceInfo resourceInfo : resourceList) {
                 try {
-                    final Class<?> clazz = classLoader.loadClass(resourceInfo.className);
+                    Class<?> clazz;
+                    try {
+                        clazz = classLoader.loadClass(resourceInfo.className);
+                    } catch (final ClassNotFoundException cnfe) { // custom classpath
+                        clazz = containerSystemContext.lookup(OPENEJB_RESOURCE_JNDI_PREFIX + resourceInfo.id).getClass();
+                    }
                     final AnnotationFinder finder = new AnnotationFinder(new ClassesArchive(ancestors(clazz)));
                     final List<Method> postConstructs = finder.findAnnotatedMethods(PostConstruct.class);
                     final List<Method> preDestroys = finder.findAnnotatedMethods(PreDestroy.class);
@@ -3158,8 +3159,8 @@ public class Assembler extends AssemblerTool implements org.apache.openejb.spi.A
     public static class ResourceInstance extends Reference implements Serializable, DestroyableResource {
         private final String name;
         private final Object delegate;
-        private transient final Collection<Method> preDestroys;
-        private transient final CreationalContext<?> context;
+        private transient Collection<Method> preDestroys;
+        private transient CreationalContext<?> context;
 
         public ResourceInstance(final String name, final Object delegate, final Collection<Method> preDestroys, final CreationalContext<?> context) {
             this.name = name;


[3/6] tomee git commit: cleaning up JMXBeanCreator and its Alternative to remove properly used properties + logging in time unused properties + storing unset properties in ResourceInfo since it can be super uselful for runtime investigation

Posted by jg...@apache.org.
cleaning up JMXBeanCreator and its Alternative to remove properly used properties + logging in time unused properties + storing unset properties in ResourceInfo since it can be super uselful for runtime investigation

Conflicts:
	container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/78f29048
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/78f29048
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/78f29048

Branch: refs/heads/tomee-1.7.x
Commit: 78f29048f921cfae2bf8f4bba1c2654747ceb683
Parents: cd4de99
Author: Romain Manni-Bucau <rm...@apache.org>
Authored: Fri Apr 17 20:06:16 2015 +0200
Committer: Jonathan Gallimore <jo...@jrg.me.uk>
Committed: Mon Apr 20 13:31:07 2015 +0100

----------------------------------------------------------------------
 .../openejb/assembler/classic/Assembler.java    | 106 ++++++++++++++-----
 .../openejb/assembler/classic/ResourceInfo.java |   2 +-
 .../openejb/assembler/classic/ServiceInfo.java  |   3 +-
 .../resource/jmx/factory/JMXBeanCreator.java    |   5 +-
 .../resource/jmx/resources/Alternative.java     |  11 +-
 5 files changed, 91 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/78f29048/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java b/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
index 66f1920..9e7e0a3 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
@@ -150,6 +150,7 @@ import org.apache.xbean.finder.ClassLoaders;
 import org.apache.xbean.finder.ResourceFinder;
 import org.apache.xbean.finder.UrlSet;
 import org.apache.xbean.finder.archive.ClassesArchive;
+import org.apache.xbean.recipe.ConstructionException;
 import org.apache.xbean.recipe.ObjectRecipe;
 import org.apache.xbean.recipe.Option;
 import org.apache.xbean.recipe.UnsetPropertiesRecipe;
@@ -192,15 +193,20 @@ import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InvalidObjectException;
+import java.io.ObjectStreamException;
+import java.io.Serializable;
 import java.lang.instrument.ClassFileTransformer;
 import java.lang.instrument.Instrumentation;
 import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
+import java.lang.reflect.Type;
 import java.net.MalformedURLException;
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.HashMap;
@@ -218,6 +224,7 @@ import java.util.concurrent.Executor;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicReference;
 import java.util.concurrent.locks.ReentrantLock;
 
 import static org.apache.openejb.util.Classes.ancestors;
@@ -968,6 +975,10 @@ public class Assembler extends AssemblerTool implements org.apache.openejb.spi.A
             final List<ResourceInfo> resourceList = config.facilities.resources;
 
             for (final ResourceInfo resourceInfo : resourceList) {
+                if (isTemplatizedResource(resourceInfo)) {
+                    continue;
+                }
+
                 try {
                     Class<?> clazz;
                     try {
@@ -975,6 +986,7 @@ public class Assembler extends AssemblerTool implements org.apache.openejb.spi.A
                     } catch (final ClassNotFoundException cnfe) { // custom classpath
                         clazz = containerSystemContext.lookup(OPENEJB_RESOURCE_JNDI_PREFIX + resourceInfo.id).getClass();
                     }
+
                     final AnnotationFinder finder = new AnnotationFinder(new ClassesArchive(ancestors(clazz)));
                     final List<Method> postConstructs = finder.findAnnotatedMethods(PostConstruct.class);
                     final List<Method> preDestroys = finder.findAnnotatedMethods(PreDestroy.class);
@@ -1000,19 +1012,21 @@ public class Assembler extends AssemblerTool implements org.apache.openejb.spi.A
                                 }
                             }
 
-                            if (resourceInfo.postConstruct != null) {
-                                final Method p = clazz.getDeclaredMethod(resourceInfo.postConstruct);
-                                if (!p.isAccessible()) {
-                                    SetAccessible.on(p);
+                            if (!"none".equals(resourceInfo.postConstruct)) {
+                                if (resourceInfo.postConstruct != null) {
+                                    final Method p = clazz.getDeclaredMethod(resourceInfo.postConstruct);
+                                    if (!p.isAccessible()) {
+                                        SetAccessible.on(p);
+                                    }
+                                    p.invoke(resource);
                                 }
-                                p.invoke(resource);
-                            }
 
-                            for (final Method m : postConstructs) {
-                                if (!m.isAccessible()) {
-                                    SetAccessible.on(m);
+                                for (final Method m : postConstructs) {
+                                    if (!m.isAccessible()) {
+                                        SetAccessible.on(m);
+                                    }
+                                    m.invoke(resource);
                                 }
-                                m.invoke(resource);
                             }
                         } catch (final Exception e) {
                             logger.fatal("Error calling @PostConstruct method on " + resource.getClass().getName());
@@ -1020,20 +1034,30 @@ public class Assembler extends AssemblerTool implements org.apache.openejb.spi.A
                         }
                     }
 
-                    if (resourceInfo.preDestroy != null) {
-                        final Method p = clazz.getDeclaredMethod(resourceInfo.preDestroy);
-                        if (!p.isAccessible()) {
-                            SetAccessible.on(p);
+                    if (!"none".equals(resourceInfo.preDestroy)) {
+                        if (resourceInfo.preDestroy != null) {
+                            final Method p = clazz.getDeclaredMethod(resourceInfo.preDestroy);
+                            if (!p.isAccessible()) {
+                                SetAccessible.on(p);
+                            }
+                            preDestroys.add(p);
+                        }
+
+                        if (!preDestroys.isEmpty() || creationalContext != null) {
+                            final String name = OPENEJB_RESOURCE_JNDI_PREFIX + resourceInfo.id;
+                            if (originalResource == null) {
+                                originalResource = containerSystemContext.lookup(name);
+                            }
+                            this.bindResource(resourceInfo.id, new ResourceInstance(name, originalResource, preDestroys, creationalContext), true);
                         }
-                        preDestroys.add(p);
                     }
 
-                    if (!preDestroys.isEmpty() || creationalContext != null) {
-                        final String name = OPENEJB_RESOURCE_JNDI_PREFIX + resourceInfo.id;
-                        if (originalResource == null) {
-                            originalResource = containerSystemContext.lookup(name);
+                    // log unused now for these resources now we built the resource completely and @PostConstruct can have used injected properties
+                    if (resourceInfo.unsetProperties != null) {
+                        final Set<String> unsetKeys = resourceInfo.unsetProperties.stringPropertyNames();
+                        for (final String key : unsetKeys) { // don't use keySet to auto filter txMgr for instance and not real properties!
+                            unusedProperty(resourceInfo.id, logger, key);
                         }
-                        this.bindResource(resourceInfo.id, new ResourceInstance(name, originalResource, preDestroys, creationalContext), true);
                     }
                 } catch (final Exception e) {
                     logger.fatal("Error calling @PostConstruct method on " + resourceInfo.id);
@@ -1045,7 +1069,9 @@ public class Assembler extends AssemblerTool implements org.apache.openejb.spi.A
         }
     }
 
-
+    private static boolean isTemplatizedResource(final ResourceInfo resourceInfo) { // ~ container resource even if not 100% right
+        return resourceInfo.className == null || resourceInfo.className.isEmpty();
+    }
     public static void mergeServices(final AppInfo appInfo) throws URISyntaxException {
         for (final ServiceInfo si : appInfo.services) { // used lazily by JaxWsServiceObjectFactory, we could do the same for resources
             if (!appInfo.properties.containsKey(si.id)) {
@@ -2463,7 +2489,25 @@ public class Assembler extends AssemblerTool implements org.apache.openejb.spi.A
         }
         serviceInfo.properties.remove("SkipImplicitAttributes");
 
-        serviceRecipe.setProperty("properties", new UnsetPropertiesRecipe());
+        final AtomicReference<Properties> injectedProperties = new AtomicReference<Properties>();
+        serviceRecipe.setProperty("properties", new UnsetPropertiesRecipe() {
+            @Override
+            protected Object internalCreate(final Type expectedType, final boolean lazyRefAllowed) throws ConstructionException {
+                final Map<String, Object> original = serviceRecipe.getUnsetProperties();
+                final Properties properties = new SuperProperties() {
+                    @Override
+                    public Object remove(final Object key) { // avoid to log them then
+                        original.remove(key);
+                        return super.remove(key);
+                    }
+                }.caseInsensitive(true); // keep our nice case insensitive feature
+                for (final Map.Entry<String, Object> entry : original.entrySet()) {
+                    properties.put(entry.getKey(), entry.getValue());
+                }
+                injectedProperties.set(properties);
+                return properties;
+            }
+        });
 
         final Properties props = PropertyPlaceHolderHelper.holds(serviceInfo.properties);
         if (serviceInfo.properties.containsKey("Definition")) {
@@ -2515,6 +2559,8 @@ public class Assembler extends AssemblerTool implements org.apache.openejb.spi.A
             } // else proxy would be useless
         }
 
+        serviceInfo.unsetProperties = injectedProperties.get();
+
         // Java Connector spec ResourceAdapters and ManagedConnectionFactories need special activation
         if (service instanceof ResourceAdapter) {
             final ResourceAdapter resourceAdapter = (ResourceAdapter) service;
@@ -2676,7 +2722,9 @@ public class Assembler extends AssemblerTool implements org.apache.openejb.spi.A
                 }
             }
         } else if (!Properties.class.isInstance(service)) {
-            logUnusedProperties(serviceRecipe, serviceInfo);
+            if (serviceInfo.unsetProperties == null || isTemplatizedResource(serviceInfo)) {
+                logUnusedProperties(serviceRecipe, serviceInfo);
+            } // else wait post construct
         }
         return service;
     }
@@ -2912,7 +2960,7 @@ public class Assembler extends AssemblerTool implements org.apache.openejb.spi.A
         logUnusedProperties(unsetProperties, info);
     }
 
-    private static void logUnusedProperties(final Map<String, Object> unsetProperties, final ServiceInfo info) {
+    private static void logUnusedProperties(final Map<String, ?> unsetProperties, final ServiceInfo info) {
         Logger logger = null;
         for (final String property : unsetProperties.keySet()) {
             //TODO: DMB: Make more robust later
@@ -2956,10 +3004,18 @@ public class Assembler extends AssemblerTool implements org.apache.openejb.spi.A
             if (logger == null) {
                 logger = SystemInstance.get().getComponent(Assembler.class).logger;
             }
-            logger.getChildLogger("service").warning("unusedProperty", property, info.id);
+            unusedProperty(info.id, logger, property);
         }
     }
 
+    private static void unusedProperty(final String id, final Logger parentLogger, final String property) {
+        parentLogger.getChildLogger("service").warning("unusedProperty", property, id);
+    }
+
+    private static void unusedProperty(final String id, final String property) {
+        unusedProperty(id, SystemInstance.get().getComponent(Assembler.class).logger, property);
+    }
+
     public static ObjectRecipe prepareRecipe(final ServiceInfo info) {
         final String[] constructorArgs = info.constructorArgs.toArray(new String[info.constructorArgs.size()]);
         final ObjectRecipe serviceRecipe = new ObjectRecipe(info.className, info.factoryMethod, constructorArgs, null);

http://git-wip-us.apache.org/repos/asf/tomee/blob/78f29048/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ResourceInfo.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ResourceInfo.java b/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ResourceInfo.java
index c24ae24..d7ed93d 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ResourceInfo.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ResourceInfo.java
@@ -25,5 +25,5 @@ public class ResourceInfo extends ServiceInfo {
     public String postConstruct;
     public String preDestroy;
     public String originAppName; // if define by an app
-    public List<String> aliases = new ArrayList<String>();
+    public List<String> aliases = new ArrayList<>();
 }

http://git-wip-us.apache.org/repos/asf/tomee/blob/78f29048/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ServiceInfo.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ServiceInfo.java b/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ServiceInfo.java
index 86d7ada..bd55d12 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ServiceInfo.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ServiceInfo.java
@@ -33,7 +33,8 @@ public class ServiceInfo extends InfoObject {
     public String codebase;
     public URI[] classpath;
     public Properties properties;
-    public final List<String> constructorArgs = new ArrayList<String>();
+    public final List<String> constructorArgs = new ArrayList<>();
+    public Properties unsetProperties; // keep it in the model to be able to investigate it dumping Infos
 
     /**
      * Optional *

http://git-wip-us.apache.org/repos/asf/tomee/blob/78f29048/examples/resources-jmx-example/resources-jmx-ejb/src/main/java/org/superbiz/resource/jmx/factory/JMXBeanCreator.java
----------------------------------------------------------------------
diff --git a/examples/resources-jmx-example/resources-jmx-ejb/src/main/java/org/superbiz/resource/jmx/factory/JMXBeanCreator.java b/examples/resources-jmx-example/resources-jmx-ejb/src/main/java/org/superbiz/resource/jmx/factory/JMXBeanCreator.java
index 14a21a6..2571fc4 100644
--- a/examples/resources-jmx-example/resources-jmx-ejb/src/main/java/org/superbiz/resource/jmx/factory/JMXBeanCreator.java
+++ b/examples/resources-jmx-example/resources-jmx-ejb/src/main/java/org/superbiz/resource/jmx/factory/JMXBeanCreator.java
@@ -65,9 +65,8 @@ public class JMXBeanCreator {
             final T instance = (T) cls.newInstance();
             final StandardMBean mBean = new StandardMBean(instance, ifaceCls);
 
-            for (Object property : properties.keySet()) {
-                String attributeName = (String) property;
-                final Object value = properties.getProperty(attributeName);
+            for (String attributeName : properties.stringPropertyNames()) {
+                final Object value = properties.remove(attributeName);
 
                 if (prefix != null) {
                     if (! attributeName.startsWith(prefix + ".")) {

http://git-wip-us.apache.org/repos/asf/tomee/blob/78f29048/examples/resources-jmx-example/resources-jmx-ejb/src/main/java/org/superbiz/resource/jmx/resources/Alternative.java
----------------------------------------------------------------------
diff --git a/examples/resources-jmx-example/resources-jmx-ejb/src/main/java/org/superbiz/resource/jmx/resources/Alternative.java b/examples/resources-jmx-example/resources-jmx-ejb/src/main/java/org/superbiz/resource/jmx/resources/Alternative.java
index 20799da..00adecc 100644
--- a/examples/resources-jmx-example/resources-jmx-ejb/src/main/java/org/superbiz/resource/jmx/resources/Alternative.java
+++ b/examples/resources-jmx-example/resources-jmx-ejb/src/main/java/org/superbiz/resource/jmx/resources/Alternative.java
@@ -80,9 +80,9 @@ public class Alternative implements AlternativeMBean {
     @PostConstruct
     public <T> void postConstruct() throws MBeanRegistrationException {
 
-        final String name = properties.getProperty("name");
-        final String iface = properties.getProperty("interface");
-        final String prefix = properties.getProperty("prefix");
+        final String name = properties.remove("name").toString();
+        final String iface = properties.remove("interface").toString();
+        final String prefix = properties.remove("prefix").toString();
 
         requireNotNull(name);
         requireNotNull(iface);
@@ -91,9 +91,8 @@ public class Alternative implements AlternativeMBean {
             final Class<T> ifaceCls = (Class<T>) Class.forName(iface, true, Thread.currentThread().getContextClassLoader());
             final StandardMBean mBean = new StandardMBean((T) this, ifaceCls);
 
-            for (Object property : properties.keySet()) {
-                String attributeName = (String) property;
-                final Object value = properties.getProperty(attributeName);
+            for (String attributeName : properties.stringPropertyNames()) {
+                final Object value = properties.remove(attributeName);
 
                 if (prefix != null) {
                     if (! attributeName.startsWith(prefix + ".")) {


[4/6] tomee git commit: Update arquillian file

Posted by jg...@apache.org.
Update arquillian file


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/3cf8f2fd
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/3cf8f2fd
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/3cf8f2fd

Branch: refs/heads/tomee-1.7.x
Commit: 3cf8f2fd0f972cd88f3747e0a8deee9a6f953cb5
Parents: 78f2904
Author: Jonathan Gallimore <jo...@jrg.me.uk>
Authored: Mon Apr 20 13:32:35 2015 +0100
Committer: Jonathan Gallimore <jo...@jrg.me.uk>
Committed: Mon Apr 20 13:32:35 2015 +0100

----------------------------------------------------------------------
 .../resources-jmx-ejb/src/test/resources/arquillian.xml          | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/3cf8f2fd/examples/resources-jmx-example/resources-jmx-ejb/src/test/resources/arquillian.xml
----------------------------------------------------------------------
diff --git a/examples/resources-jmx-example/resources-jmx-ejb/src/test/resources/arquillian.xml b/examples/resources-jmx-example/resources-jmx-ejb/src/test/resources/arquillian.xml
index 7466cda..2a16207 100644
--- a/examples/resources-jmx-example/resources-jmx-ejb/src/test/resources/arquillian.xml
+++ b/examples/resources-jmx-example/resources-jmx-ejb/src/test/resources/arquillian.xml
@@ -22,9 +22,9 @@
     <configuration>
       <property name="classifier">plus</property>
       <property name="httpPort">-1</property>
+      <property name="httpsPort">-1</property>
+      <property name="ajpPort">-1</property>
       <property name="stopPort">-1</property>
-      <property name="tomcatVersion"></property>
-      <property name="openejbVersion">${tomee.version}</property>
       <property name="dir">target/apache-tomee-remote</property>
       <property name="appWorkingDir">target/arquillian-test-working-dir</property>
     </configuration>


[5/6] tomee git commit: Merge remote-tracking branch 'apache/tomee-1.7.x' into tomee-1.7.x

Posted by jg...@apache.org.
Merge remote-tracking branch 'apache/tomee-1.7.x' into tomee-1.7.x


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/56905f67
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/56905f67
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/56905f67

Branch: refs/heads/tomee-1.7.x
Commit: 56905f67aa3f13e9eb8c330eb1e09dcde1440192
Parents: 3cf8f2f 808f91b
Author: Jonathan Gallimore <jo...@jrg.me.uk>
Authored: Wed Apr 22 10:53:25 2015 +0100
Committer: Jonathan Gallimore <jo...@jrg.me.uk>
Committed: Wed Apr 22 10:53:25 2015 +0100

----------------------------------------------------------------------
 .../org/apache/openejb/config/AutoConfig.java   |  6 +-
 .../util/classloader/URLClassLoaderFirst.java   | 83 +++++++++-----------
 .../openejb/junit/jee/EJBContainerRunner.java   |  2 +-
 tomee/apache-tomee/src/main/resources/tomee.sh  |  8 +-
 4 files changed, 45 insertions(+), 54 deletions(-)
----------------------------------------------------------------------