From commits-return-42633-archive-asf-public=cust-asf.ponee.io@tomee.apache.org Thu Jul 26 12:18:25 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id EA285180679 for ; Thu, 26 Jul 2018 12:18:23 +0200 (CEST) Received: (qmail 93637 invoked by uid 500); 26 Jul 2018 10:18:18 -0000 Mailing-List: contact commits-help@tomee.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tomee.apache.org Delivered-To: mailing list commits@tomee.apache.org Received: (qmail 93352 invoked by uid 99); 26 Jul 2018 10:18:17 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Jul 2018 10:18:17 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 0331CE1169; Thu, 26 Jul 2018 10:18:17 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jgallimore@apache.org To: commits@tomee.apache.org Date: Thu, 26 Jul 2018 10:18:30 -0000 Message-Id: In-Reply-To: <41a3200c3be34383a11239904de8e448@git.apache.org> References: <41a3200c3be34383a11239904de8e448@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [15/50] [abbrv] tomee git commit: Introduced configuration properties to include / exclude urls in the Classloader. Introduced configuration properties to include / exclude urls in the Classloader. Project: http://git-wip-us.apache.org/repos/asf/tomee/repo Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/021b9ca8 Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/021b9ca8 Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/021b9ca8 Branch: refs/heads/master Commit: 021b9ca8d01a78f5b7ee3438f30fd8901ff60d5b Parents: a04e4b7 Author: Roberto Cortez Authored: Fri Mar 9 16:10:56 2018 +0000 Committer: Roberto Cortez Committed: Fri Mar 9 16:10:56 2018 +0000 ---------------------------------------------------------------------- .../apache/openejb/config/DeploymentLoader.java | 12 +++-- .../config/src/test/resources/arquillian.xml | 2 + tomee/pom.xml | 1 - tomee/tomee-microprofile-webapp/pom.xml | 6 --- tomee/tomee-microprofile/pom.xml | 56 -------------------- .../tomee/microprofile/MicroProfileService.java | 51 ------------------ 6 files changed, 11 insertions(+), 117 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tomee/blob/021b9ca8/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentLoader.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentLoader.java b/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentLoader.java index 1135c07..d602f81 100644 --- a/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentLoader.java +++ b/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentLoader.java @@ -60,6 +60,7 @@ import org.apache.xbean.finder.UrlSet; import org.apache.xbean.finder.archive.ClassesArchive; import org.apache.xbean.finder.filter.Filter; import org.apache.xbean.finder.filter.Filters; +import org.apache.xbean.finder.filter.PatternFilter; import java.io.BufferedInputStream; import java.io.File; @@ -81,6 +82,7 @@ import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.LinkedList; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Properties; import java.util.Set; @@ -90,7 +92,6 @@ import java.util.jar.JarEntry; import java.util.jar.JarFile; import java.util.jar.Manifest; import java.util.zip.ZipEntry; -import java.util.Locale; import static java.util.Arrays.asList; @@ -116,6 +117,9 @@ public class DeploymentLoader implements DeploymentFilterable { private static String ALTDD = SystemInstance.get().getOptions().get(OPENEJB_ALTDD_PREFIX, (String) null); private volatile List containerUrls = null; + private static final String OPENEJB_CONTAINER_INCLUDES = "openejb.scan.webapp.container.includes"; + private static final String OPENEJB_CONTAINER_EXCLUDES = "openejb.scan.webapp.container.excludes"; + @Deprecated // use load(File, ExternalConfiguration) public AppModule load(final File jarFile) throws OpenEJBException { return load(jarFile, null); @@ -1098,13 +1102,15 @@ public class DeploymentLoader implements DeploymentFilterable { private void ensureContainerUrls() { if (containerUrls == null) { - if ("true".equalsIgnoreCase(SystemInstance.get().getProperty("openejb.scan.webapp.container", "false"))) { + if ("true".equalsIgnoreCase(SystemInstance.get().getProperty("openejb.scan.webapp.container", "true"))) { synchronized (this) { if (containerUrls == null) { try { UrlSet urlSet = new UrlSet(ParentClassLoaderFinder.Helper.get()); urlSet = URLs.cullSystemJars(urlSet); - urlSet = NewLoaderLogic.applyBuiltinExcludes(urlSet); + final PatternFilter containerIncludes = new PatternFilter(SystemInstance.get().getProperty(OPENEJB_CONTAINER_INCLUDES, ".*")); + final PatternFilter containerExcludes = new PatternFilter(SystemInstance.get().getProperty(OPENEJB_CONTAINER_EXCLUDES, "")); + urlSet = NewLoaderLogic.applyBuiltinExcludes(urlSet, containerIncludes, containerExcludes); containerUrls = urlSet.getUrls(); final boolean skipContainerFolders = "true".equalsIgnoreCase(SystemInstance.get().getProperty("openejb.scan.webapp.container.skip-folder", "true")); http://git-wip-us.apache.org/repos/asf/tomee/blob/021b9ca8/tck/microprofile-tck/config/src/test/resources/arquillian.xml ---------------------------------------------------------------------- diff --git a/tck/microprofile-tck/config/src/test/resources/arquillian.xml b/tck/microprofile-tck/config/src/test/resources/arquillian.xml index 629d71d..d04c730 100644 --- a/tck/microprofile-tck/config/src/test/resources/arquillian.xml +++ b/tck/microprofile-tck/config/src/test/resources/arquillian.xml @@ -23,6 +23,7 @@ http://jboss.org/schema/arquillian/arquillian_1_0.xsd"> + false -1 -1 -1 @@ -33,6 +34,7 @@ true config.test = SUCCESS + org.apache.geronimo.config.configsource.SystemPropertyConfigSource.copy = false http://git-wip-us.apache.org/repos/asf/tomee/blob/021b9ca8/tomee/pom.xml ---------------------------------------------------------------------- diff --git a/tomee/pom.xml b/tomee/pom.xml index 0ac220a..c92e163 100644 --- a/tomee/pom.xml +++ b/tomee/pom.xml @@ -47,7 +47,6 @@ tomee-plume-webapp tomee-webservices tomee-embedded - tomee-microprofile tomee-microprofile-webapp apache-tomee tomee-util http://git-wip-us.apache.org/repos/asf/tomee/blob/021b9ca8/tomee/tomee-microprofile-webapp/pom.xml ---------------------------------------------------------------------- diff --git a/tomee/tomee-microprofile-webapp/pom.xml b/tomee/tomee-microprofile-webapp/pom.xml index 55ae7f0..4d0b71f 100644 --- a/tomee/tomee-microprofile-webapp/pom.xml +++ b/tomee/tomee-microprofile-webapp/pom.xml @@ -52,12 +52,6 @@ war - - ${project.groupId} - tomee-microprofile - ${project.version} - - - - - - - - - tomee - org.apache.tomee - 7.0.5-SNAPSHOT - - - 4.0.0 - tomee-microprofile - jar - OpenEJB :: TomEE :: MicroProfile - - - UTF-8 - - - - - ${project.groupId} - tomee-catalina - ${project.version} - provided - - - - ${project.groupId} - tomee-common - ${project.version} - provided - - - - http://git-wip-us.apache.org/repos/asf/tomee/blob/021b9ca8/tomee/tomee-microprofile/src/main/java/org/apache/tomee/microprofile/MicroProfileService.java ---------------------------------------------------------------------- diff --git a/tomee/tomee-microprofile/src/main/java/org/apache/tomee/microprofile/MicroProfileService.java b/tomee/tomee-microprofile/src/main/java/org/apache/tomee/microprofile/MicroProfileService.java deleted file mode 100644 index 70448c6..0000000 --- a/tomee/tomee-microprofile/src/main/java/org/apache/tomee/microprofile/MicroProfileService.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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.tomee.microprofile; - -import org.apache.openejb.loader.SystemInstance; -import org.apache.openejb.spi.Service; - -import java.util.Properties; - -import static org.apache.tomee.catalina.TomEEClassLoaderEnricher.TOMEE_WEBAPP_CLASSLOADER_ENRICHMENT_PREFIXES; - -/** - * This is used as an optional service in org.apache.tomee.catalina.TomcatLoader - */ -@SuppressWarnings("unused") -public class MicroProfileService implements Service { - // Separate with comma - private static final String MICROPROFILE_LIBS_IMPLS_PREFIXES = "geronimo-config-impl"; - - @Override - public void init(final Properties props) throws Exception { - String prefixes = SystemInstance.get().getOptions().get(TOMEE_WEBAPP_CLASSLOADER_ENRICHMENT_PREFIXES, ""); - prefixes = prefixes.isEmpty() ? - MICROPROFILE_LIBS_IMPLS_PREFIXES : - MICROPROFILE_LIBS_IMPLS_PREFIXES + "," + prefixes; - - SystemInstance.get() - .getOptions() - .getProperties() - .setProperty(TOMEE_WEBAPP_CLASSLOADER_ENRICHMENT_PREFIXES, prefixes); - - final String microProfileReloadConfig = - System.getProperty("org.apache.geronimo.config.configsource.SystemPropertyConfigSource.copy", "false"); - System.setProperty("org.apache.geronimo.config.configsource.SystemPropertyConfigSource.copy", - microProfileReloadConfig); - } -}