You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by rm...@apache.org on 2020/10/26 19:09:42 UTC
[openwebbeans] branch master updated: [OWB-1352]
SimpleApplicationBoundaryService
This is an automated email from the ASF dual-hosted git repository.
rmannibucau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openwebbeans.git
The following commit(s) were added to refs/heads/master by this push:
new a7932dc [OWB-1352] SimpleApplicationBoundaryService
a7932dc is described below
commit a7932dc118b61e58f6b53966182ece8eef2ab3f5
Author: Romain Manni-Bucau <rm...@gmail.com>
AuthorDate: Mon Oct 26 20:09:36 2020 +0100
[OWB-1352] SimpleApplicationBoundaryService
---
.../se/SimpleApplicationBoundaryService.java | 45 ++++++++++++++++++++++
1 file changed, 45 insertions(+)
diff --git a/webbeans-impl/src/main/java/org/apache/webbeans/corespi/se/SimpleApplicationBoundaryService.java b/webbeans-impl/src/main/java/org/apache/webbeans/corespi/se/SimpleApplicationBoundaryService.java
new file mode 100644
index 0000000..aa52592
--- /dev/null
+++ b/webbeans-impl/src/main/java/org/apache/webbeans/corespi/se/SimpleApplicationBoundaryService.java
@@ -0,0 +1,45 @@
+/*
+ * 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.webbeans.corespi.se;
+
+import org.apache.webbeans.spi.ApplicationBoundaryService;
+
+// simplified version targeting applications with a single classloaders (wars, flat classpaths etc)
+// but setting the app loader during startup
+public class SimpleApplicationBoundaryService implements ApplicationBoundaryService
+{
+ private final ClassLoader appLoader;
+
+ public SimpleApplicationBoundaryService()
+ {
+ appLoader = Thread.currentThread().getContextClassLoader();
+ }
+
+ @Override
+ public ClassLoader getApplicationClassLoader()
+ {
+ return appLoader;
+ }
+
+ @Override
+ public ClassLoader getBoundaryClassLoader(final Class<?> classToProxy)
+ {
+ return getApplicationClassLoader();
+ }
+}