aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From csie...@apache.org
Subject svn commit: r1784898 - in /aries/trunk/cdi: ./ cdi-executable/ cdi-extender/ cdi-extension-jndi/ cdi-extension-jndi/src/main/java/org/apache/aries/cdi/extension/jndi/ cdi-itests/ el-api/
Date Wed, 01 Mar 2017 10:06:54 GMT
Author: csierra
Date: Wed Mar  1 10:06:53 2017
New Revision: 1784898

URL: http://svn.apache.org/viewvc?rev=1784898&view=rev
Log:
[ARIES-CDI] fix dependencies

Signed-off-by: Raymond Augé <rotty3000@apache.org>

Added:
    aries/trunk/cdi/cdi-extension-jndi/src/main/java/org/apache/aries/cdi/extension/jndi/Activator.java
    aries/trunk/cdi/cdi-extension-jndi/src/main/java/org/apache/aries/cdi/extension/jndi/JndiExtensionFactory.java
    aries/trunk/cdi/el-api/
    aries/trunk/cdi/el-api/bnd.bnd
    aries/trunk/cdi/el-api/pom.xml
Modified:
    aries/trunk/cdi/cdi-executable/cdi-executable.bndrun
    aries/trunk/cdi/cdi-executable/pom.xml
    aries/trunk/cdi/cdi-extender/bnd.bnd
    aries/trunk/cdi/cdi-extender/pom.xml
    aries/trunk/cdi/cdi-extension-jndi/bnd.bnd
    aries/trunk/cdi/cdi-extension-jndi/pom.xml
    aries/trunk/cdi/cdi-extension-jndi/src/main/java/org/apache/aries/cdi/extension/jndi/JndiExtension.java
    aries/trunk/cdi/cdi-extension-jndi/src/main/java/org/apache/aries/cdi/extension/jndi/JndiObjectFactory.java
    aries/trunk/cdi/cdi-itests/itest.bndrun
    aries/trunk/cdi/cdi-itests/pom.xml
    aries/trunk/cdi/pom.xml

Modified: aries/trunk/cdi/cdi-executable/cdi-executable.bndrun
URL: http://svn.apache.org/viewvc/aries/trunk/cdi/cdi-executable/cdi-executable.bndrun?rev=1784898&r1=1784897&r2=1784898&view=diff
==============================================================================
--- aries/trunk/cdi/cdi-executable/cdi-executable.bndrun (original)
+++ aries/trunk/cdi/cdi-executable/cdi-executable.bndrun Wed Mar  1 10:06:53 2017
@@ -15,11 +15,11 @@
 	jboss-classfilewriter;version='[1.1.2,1.1.3)',\
 	log4j;version='[1.2.17,1.2.18)',\
 	org.apache.aries.cdi.extender;version='[0.0.1,0.0.2)',\
-	org.apache.felix.bundlerepository;version='[1.6.0,1.6.1)',\
+	org.apache.aries.el-api;version='[0.0.1,0.0.2)',\
 	org.apache.felix.configadmin;version='[1.8.12,1.8.13)',\
-	org.apache.felix.gogo.command;version='[1.0.0,1.0.1)',\
-	org.apache.felix.gogo.jline;version='[1.0.0,1.0.1)',\
-	org.apache.felix.gogo.runtime;version='[1.0.0,1.0.1)',\
+	org.apache.felix.gogo.command;version='[1.0.2,1.0.3)',\
+	org.apache.felix.gogo.jline;version='[1.0.2,1.0.3)',\
+	org.apache.felix.gogo.runtime;version='[1.0.2,1.0.3)',\
 	org.apache.logging.log4j.api;version='[2.7.0,2.7.1)',\
 	org.jboss.logging.jboss-logging;version='[3.2.1,3.2.2)',\
 	org.jboss.spec.javax.annotation.jboss-annotations-api_1.2_spec;version='[1.0.0,1.0.1)',\

Modified: aries/trunk/cdi/cdi-executable/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/cdi/cdi-executable/pom.xml?rev=1784898&r1=1784897&r2=1784898&view=diff
==============================================================================
--- aries/trunk/cdi/cdi-executable/pom.xml (original)
+++ aries/trunk/cdi/cdi-executable/pom.xml Wed Mar  1 10:06:53 2017
@@ -55,37 +55,11 @@
 			<version>1.2.17</version>
 		</dependency>
 		<dependency>
-			<groupId>org.slf4j</groupId>
-			<artifactId>slf4j-api</artifactId>
-			<version>1.7.21</version>
-		</dependency>
-		<dependency>
-			<groupId>org.slf4j</groupId>
-			<artifactId>slf4j-log4j12</artifactId>
-			<version>1.6.1</version>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.logging.log4j</groupId>
-			<artifactId>log4j-api</artifactId>
-			<version>2.7</version>
-		</dependency>
-
-		<dependency>
 			<groupId>org.apache.aries.cdi</groupId>
 			<artifactId>org.apache.aries.cdi.extender</artifactId>
 			<version>0.0.1-SNAPSHOT</version>
 		</dependency>
 		<dependency>
-			<groupId>org.apache.aries.jndi</groupId>
-			<artifactId>org.apache.aries.jndi.api</artifactId>
-			<version>1.1.0</version>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.aries.jndi</groupId>
-			<artifactId>org.apache.aries.jndi.core</artifactId>
-			<version>1.0.2</version>
-		</dependency>
-		<dependency>
 			<groupId>org.apache.felix</groupId>
 			<artifactId>org.apache.felix.configadmin</artifactId>
 			<version>1.8.12</version>
@@ -93,22 +67,22 @@
 		<dependency>
 			<groupId>org.apache.felix</groupId>
 			<artifactId>org.apache.felix.gogo.command</artifactId>
-			<version>1.0.0</version>
+			<version>1.0.2</version>
 		</dependency>
 		<dependency>
 			<groupId>org.apache.felix</groupId>
 			<artifactId>org.apache.felix.gogo.jline</artifactId>
-			<version>1.0.0</version>
+			<version>1.0.2</version>
 		</dependency>
 		<dependency>
 			<groupId>org.apache.felix</groupId>
-			<artifactId>org.apache.felix.scr</artifactId>
-			<version>2.0.2</version>
+			<artifactId>org.apache.felix.gogo.runtime</artifactId>
+			<version>1.0.2</version>
 		</dependency>
 		<dependency>
-			<groupId>org.osgi</groupId>
-			<artifactId>org.eclipse.equinox.metatype</artifactId>
-			<version>1.4.100.v20150408-1437</version>
+			<groupId>org.apache.logging.log4j</groupId>
+			<artifactId>log4j-api</artifactId>
+			<version>2.7</version>
 		</dependency>
 		<dependency>
 			<groupId>org.osgi</groupId>
@@ -116,36 +90,14 @@
 			<version>3.10.100.v20150529-1857</version>
 		</dependency>
 		<dependency>
-			<groupId>org.osgi</groupId>
-			<artifactId>osgi.enroute.junit.wrapper</artifactId>
-			<version>4.12.0</version>
-		</dependency>
-		<dependency>
-			<groupId>org.osgi</groupId>
-			<artifactId>osgi.enroute.hamcrest.wrapper</artifactId>
-			<version>1.3.0</version>
-		</dependency>
-		<dependency>
-			<groupId>org.osgi</groupId>
-			<artifactId>org.osgi.namespace.extender</artifactId>
-			<version>1.0.1</version>
-			<scope>provided</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.osgi</groupId>
-			<artifactId>org.osgi.service.component.annotations</artifactId>
-			<version>1.3.0</version>
-			<scope>provided</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.osgi</groupId>
-			<artifactId>org.osgi.service.metatype</artifactId>
-			<version>1.3.0</version>
+			<groupId>org.slf4j</groupId>
+			<artifactId>slf4j-api</artifactId>
+			<version>1.7.21</version>
 		</dependency>
 		<dependency>
-			<groupId>org.osgi</groupId>
-			<artifactId>osgi.core</artifactId>
-			<version>6.0.0</version>
+			<groupId>org.slf4j</groupId>
+			<artifactId>slf4j-log4j12</artifactId>
+			<version>1.6.1</version>
 		</dependency>
 	</dependencies>
 

Modified: aries/trunk/cdi/cdi-extender/bnd.bnd
URL: http://svn.apache.org/viewvc/aries/trunk/cdi/cdi-extender/bnd.bnd?rev=1784898&r1=1784897&r2=1784898&view=diff
==============================================================================
--- aries/trunk/cdi/cdi-extender/bnd.bnd (original)
+++ aries/trunk/cdi/cdi-extender/bnd.bnd Wed Mar  1 10:06:53 2017
@@ -6,10 +6,18 @@ Conditional-Package: \
 	org.osgi.util.function
 Export-Package: \
 	javax.decorator,\
-	javax.el,\
 	javax.enterprise.*,\
-	javax.inject;version='1.0.0'
+	javax.inject;version='1.0.0',\
+	org.apache.aries.cdi.provider
 Provide-Capability: \
+	osgi.contract; \
+		osgi.contract=JavaCDI; \
+		uses:="javax.decorator,javax.enterprise.context,javax.enterprise.context.spi,javax.enterprise.event,javax.enterprise.inject,javax.enterprise.inject.spi,javax.enterprise.util";
\
+		version:List<Version>='1.0,1.1,1.2', \
+	osgi.contract; \
+		osgi.contract=JavaInject; \
+		uses:="javax.inject"; \
+		version:Version='1', \
 	osgi.extender; \
 		osgi.extender='osgi.cdi'; \
 		uses:="org.osgi.service.cdi,org.osgi.service.cdi.annotations,javax.enterprise.inject.spi";
\

Modified: aries/trunk/cdi/cdi-extender/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/cdi/cdi-extender/pom.xml?rev=1784898&r1=1784897&r2=1784898&view=diff
==============================================================================
--- aries/trunk/cdi/cdi-extender/pom.xml (original)
+++ aries/trunk/cdi/cdi-extender/pom.xml Wed Mar  1 10:06:53 2017
@@ -34,38 +34,61 @@
 	</build>
 
 	<dependencies>
-		<!-- Keep org.osgi:org.osgi.core:6.0.0 before the other Aries ones because otherwise
we get an older version. -->
-		<dependency>
-			<groupId>org.osgi</groupId>
-			<artifactId>osgi.core</artifactId>
-			<version>6.0.0</version>
-			<scope>provided</scope>
-		</dependency>
-
 		<dependency>
 			<groupId>javax.enterprise</groupId>
 			<artifactId>cdi-api</artifactId>
 			<version>1.2</version>
+			<scope>provided</scope>
+			<exclusions>
+				<exclusion>
+					<groupId>javax.el</groupId>
+					<artifactId>javax.el-api</artifactId>
+				</exclusion>
+			</exclusions>
 		</dependency>
 		<dependency>
 			<groupId>javax.inject</groupId>
 			<artifactId>javax.inject</artifactId>
 			<version>1</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.aries.cdi</groupId>
+			<artifactId>org.apache.aries.el-api</artifactId>
+			<version>0.0.1-SNAPSHOT</version>
 		</dependency>
 		<dependency>
 			<groupId>org.apache.felix</groupId>
 			<artifactId>org.apache.felix.converter</artifactId>
 			<version>0.1.0-SNAPSHOT</version>
+			<scope>provided</scope>
 		</dependency>
 		<dependency>
 			<groupId>org.apache.felix</groupId>
 			<artifactId>org.apache.felix.utils</artifactId>
 			<version>1.8.6</version>
+			<scope>provided</scope>
+			<exclusions>
+				<exclusion>
+					<groupId>org.osgi</groupId>
+					<artifactId>org.osgi.core</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>org.osgi</groupId>
+					<artifactId>org.osgi.compendium</artifactId>
+				</exclusion>
+			</exclusions>
 		</dependency>
 		<dependency>
 			<groupId>org.jboss.weld</groupId>
 			<artifactId>weld-osgi-bundle</artifactId>
 			<version>2.4.0.Final</version>
+			<exclusions>
+				<exclusion>
+					<groupId>org.jboss.spec.javax.el</groupId>
+					<artifactId>jboss-el-api_3.0_spec</artifactId>
+				</exclusion>
+			</exclusions>
 		</dependency>
 		<dependency>
 			<groupId>org.osgi</groupId>
@@ -84,6 +107,11 @@
 			<version>1.5.0</version>
 		</dependency>
 		<dependency>
+			<groupId>org.osgi</groupId>
+			<artifactId>osgi.core</artifactId>
+			<version>6.0.0</version>
+		</dependency>
+		<dependency>
 			<groupId>org.slf4j</groupId>
 			<artifactId>slf4j-api</artifactId>
 			<version>1.7.0</version>

Modified: aries/trunk/cdi/cdi-extension-jndi/bnd.bnd
URL: http://svn.apache.org/viewvc/aries/trunk/cdi/cdi-extension-jndi/bnd.bnd?rev=1784898&r1=1784897&r2=1784898&view=diff
==============================================================================
--- aries/trunk/cdi/cdi-extension-jndi/bnd.bnd (original)
+++ aries/trunk/cdi/cdi-extension-jndi/bnd.bnd Wed Mar  1 10:06:53 2017
@@ -1,2 +1,5 @@
-Provide-Capability: osgi.cdi.extension;osgi.cdi.extension=jndi;version:Version="0.0.1"
+Bundle-Activator: org.apache.aries.cdi.extension.jndi.Activator
+Provide-Capability: osgi.cdi.extension;osgi.cdi.extension=jndi;version:Version="${Bundle-Version}"
+Require-Capability: osgi.contract;filter:="(&(osgi.contract=JavaCDI)(version=1.2))"
+
 -includeresource: META-INF/=LICENSE, META-INF/=NOTICE
\ No newline at end of file

Modified: aries/trunk/cdi/cdi-extension-jndi/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/cdi/cdi-extension-jndi/pom.xml?rev=1784898&r1=1784897&r2=1784898&view=diff
==============================================================================
--- aries/trunk/cdi/cdi-extension-jndi/pom.xml (original)
+++ aries/trunk/cdi/cdi-extension-jndi/pom.xml Wed Mar  1 10:06:53 2017
@@ -24,32 +24,13 @@
 				<groupId>biz.aQute.bnd</groupId>
 				<artifactId>bnd-maven-plugin</artifactId>
 			</plugin>
-			<!--
-			<plugin>
-				<groupId>biz.aQute.bnd</groupId>
-				<artifactId>bnd-baseline-maven-plugin</artifactId>
-			</plugin>
-			-->
 		</plugins>
 	</build>
 
 	<dependencies>
-		<!-- Keep org.osgi:osgi.core:6.0.0 before the other Aries ones because otherwise we
get an older version. -->
-		<dependency>
-			<groupId>org.osgi</groupId>
-			<artifactId>osgi.core</artifactId>
-			<version>6.0.0</version>
-			<scope>provided</scope>
-		</dependency>
-
-		<dependency>
-			<groupId>javax.enterprise</groupId>
-			<artifactId>cdi-api</artifactId>
-			<version>1.2</version>
-		</dependency>
 		<dependency>
 			<groupId>org.apache.aries.cdi</groupId>
-			<artifactId>org.apache.aries.cdi.osgi.api</artifactId>
+			<artifactId>org.apache.aries.cdi.extender</artifactId>
 			<version>0.0.1-SNAPSHOT</version>
 		</dependency>
 		<dependency>
@@ -58,20 +39,9 @@
 			<version>1.1.0</version>
 		</dependency>
 		<dependency>
-			<groupId>org.apache.aries.jndi</groupId>
-			<artifactId>org.apache.aries.jndi.core</artifactId>
-			<version>1.0.2</version>
-		</dependency>
-		<dependency>
 			<groupId>org.osgi</groupId>
-			<artifactId>org.osgi.service.component.annotations</artifactId>
-			<version>1.3.0</version>
-			<scope>provided</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.slf4j</groupId>
-			<artifactId>slf4j-api</artifactId>
-			<version>1.7.0</version>
+			<artifactId>org.osgi.service.cdi</artifactId>
+			<version>1.0.0-SNAPSHOT</version>
 		</dependency>
 	</dependencies>
 

Added: aries/trunk/cdi/cdi-extension-jndi/src/main/java/org/apache/aries/cdi/extension/jndi/Activator.java
URL: http://svn.apache.org/viewvc/aries/trunk/cdi/cdi-extension-jndi/src/main/java/org/apache/aries/cdi/extension/jndi/Activator.java?rev=1784898&view=auto
==============================================================================
--- aries/trunk/cdi/cdi-extension-jndi/src/main/java/org/apache/aries/cdi/extension/jndi/Activator.java
(added)
+++ aries/trunk/cdi/cdi-extension-jndi/src/main/java/org/apache/aries/cdi/extension/jndi/Activator.java
Wed Mar  1 10:06:53 2017
@@ -0,0 +1,57 @@
+/**
+ * Licensed 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.aries.cdi.extension.jndi;
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+
+import javax.enterprise.inject.spi.Extension;
+import javax.naming.spi.ObjectFactory;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+import org.osgi.service.cdi.CdiExtenderConstants;
+import org.osgi.service.jndi.JNDIConstants;
+
+public class Activator implements BundleActivator {
+
+	@Override
+	public void start(BundleContext bundleContext) throws Exception {
+		Dictionary<String, Object> properties = new Hashtable<>();
+		properties.put(CdiExtenderConstants.CDI_EXTENSION, "jndi");
+
+		JndiExtensionFactory jndiExtensionFactory = new JndiExtensionFactory();
+
+		_jndiExtensionFactoryRegistration = bundleContext.registerService(
+			Extension.class, jndiExtensionFactory, properties);
+
+		properties = new Hashtable<>();
+		properties.put(JNDIConstants.JNDI_URLSCHEME, "java");
+
+		_objectFactoryRegistration = bundleContext.registerService(
+			ObjectFactory.class, new JndiObjectFactory(jndiExtensionFactory), properties);
+	}
+
+	@Override
+	public void stop(BundleContext bundleContext) throws Exception {
+		_objectFactoryRegistration.unregister();
+		_jndiExtensionFactoryRegistration.unregister();
+	}
+
+	private ServiceRegistration<?> _jndiExtensionFactoryRegistration;
+	private ServiceRegistration<?> _objectFactoryRegistration;
+
+}

Modified: aries/trunk/cdi/cdi-extension-jndi/src/main/java/org/apache/aries/cdi/extension/jndi/JndiExtension.java
URL: http://svn.apache.org/viewvc/aries/trunk/cdi/cdi-extension-jndi/src/main/java/org/apache/aries/cdi/extension/jndi/JndiExtension.java?rev=1784898&r1=1784897&r2=1784898&view=diff
==============================================================================
--- aries/trunk/cdi/cdi-extension-jndi/src/main/java/org/apache/aries/cdi/extension/jndi/JndiExtension.java
(original)
+++ aries/trunk/cdi/cdi-extension-jndi/src/main/java/org/apache/aries/cdi/extension/jndi/JndiExtension.java
Wed Mar  1 10:06:53 2017
@@ -1,58 +1,20 @@
 package org.apache.aries.cdi.extension.jndi;
 
-import java.util.Dictionary;
-import java.util.Hashtable;
-import java.util.Set;
-
-import javax.enterprise.context.spi.CreationalContext;
 import javax.enterprise.event.Observes;
-import javax.enterprise.inject.Any;
 import javax.enterprise.inject.spi.AfterDeploymentValidation;
-import javax.enterprise.inject.spi.Bean;
 import javax.enterprise.inject.spi.BeanManager;
 import javax.enterprise.inject.spi.Extension;
-import javax.enterprise.util.AnnotationLiteral;
-import javax.naming.spi.ObjectFactory;
-
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceRegistration;
-import org.osgi.service.cdi.CdiExtenderConstants;
-import org.osgi.service.component.annotations.Activate;
-import org.osgi.service.component.annotations.Component;
-import org.osgi.service.component.annotations.Deactivate;
-import org.osgi.service.jndi.JNDIConstants;
 
-@Component(property = {CdiExtenderConstants.CDI_EXTENSION + "=jndi"})
 public class JndiExtension implements Extension {
 
-	@Activate
-	void activate(BundleContext bundleContext) {
-		Dictionary<String, Object> properties = new Hashtable<>();
-		properties.put(JNDIConstants.JNDI_URLSCHEME, "java");
-
-		_jndiObjectFactory = new JndiObjectFactory();
-		_objectFactoryRegistration = bundleContext.registerService(
-			ObjectFactory.class, _jndiObjectFactory, properties);
-	}
-
-	@Deactivate
-	void deactivate() {
-		_objectFactoryRegistration.unregister();
-		_objectFactoryRegistration = null;
-		_jndiObjectFactory = null;
+	public BeanManager getBeanManager() {
+		return _beanManager;
 	}
 
 	void afterDeploymentValidation(@Observes AfterDeploymentValidation adv, BeanManager beanManager)
{
-		@SuppressWarnings("serial")
-		Set<Bean<?>> beans = beanManager.getBeans(BundleContext.class, new AnnotationLiteral<Any>()
{});
-		Bean<?> bean = beanManager.resolve(beans);
-		CreationalContext<?> ctx = beanManager.createCreationalContext(bean);
-		BundleContext bundleContext = (BundleContext)beanManager.getReference(bean, BundleContext.class,
ctx);
-
-		_jndiObjectFactory.put(bundleContext, beanManager);
+		_beanManager = beanManager;
 	}
 
-	private JndiObjectFactory _jndiObjectFactory;
-	private ServiceRegistration<ObjectFactory> _objectFactoryRegistration;
+	private BeanManager _beanManager;
 
 }

Added: aries/trunk/cdi/cdi-extension-jndi/src/main/java/org/apache/aries/cdi/extension/jndi/JndiExtensionFactory.java
URL: http://svn.apache.org/viewvc/aries/trunk/cdi/cdi-extension-jndi/src/main/java/org/apache/aries/cdi/extension/jndi/JndiExtensionFactory.java?rev=1784898&view=auto
==============================================================================
--- aries/trunk/cdi/cdi-extension-jndi/src/main/java/org/apache/aries/cdi/extension/jndi/JndiExtensionFactory.java
(added)
+++ aries/trunk/cdi/cdi-extension-jndi/src/main/java/org/apache/aries/cdi/extension/jndi/JndiExtensionFactory.java
Wed Mar  1 10:06:53 2017
@@ -0,0 +1,65 @@
+package org.apache.aries.cdi.extension.jndi;
+
+import java.util.Hashtable;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import javax.enterprise.inject.spi.Extension;
+import javax.naming.Name;
+import javax.naming.spi.ObjectFactory;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.ServiceFactory;
+import org.osgi.framework.ServiceRegistration;
+
+public class JndiExtensionFactory implements ServiceFactory<Extension> {
+
+	@Override
+	public Extension getService(Bundle bundle, ServiceRegistration<Extension> registration)
{
+		JndiExtension jndiExtension = new JndiExtension();
+		_map.put(bundle, jndiExtension);
+		return jndiExtension;
+	}
+
+	@Override
+	public void ungetService(
+		Bundle bundle, ServiceRegistration<Extension> registration, Extension extension)
{
+
+		_map.remove(bundle);
+	}
+
+	ObjectFactory getObjectFactory(Bundle bundle) {
+		JndiExtension jndiExtension = _map.get(bundle);
+
+		if (jndiExtension == null) {
+			return null;
+		}
+
+		return new InnerObjectFactory(new JndiContext(jndiExtension.getBeanManager()));
+	}
+
+	private final Map<Bundle, JndiExtension> _map = new ConcurrentHashMap<>();
+
+	private class InnerObjectFactory implements ObjectFactory {
+
+		public InnerObjectFactory(JndiContext jndiContext) {
+			_jndiContext = jndiContext;
+		}
+
+		@Override
+		public Object getObjectInstance(
+				Object obj, Name name, javax.naming.Context context, Hashtable<?, ?> environment)
+			throws Exception {
+
+			if (obj == null) {
+				return _jndiContext;
+			}
+
+			return null;
+		}
+
+		private final JndiContext _jndiContext;
+
+	}
+
+}

Modified: aries/trunk/cdi/cdi-extension-jndi/src/main/java/org/apache/aries/cdi/extension/jndi/JndiObjectFactory.java
URL: http://svn.apache.org/viewvc/aries/trunk/cdi/cdi-extension-jndi/src/main/java/org/apache/aries/cdi/extension/jndi/JndiObjectFactory.java?rev=1784898&r1=1784897&r2=1784898&view=diff
==============================================================================
--- aries/trunk/cdi/cdi-extension-jndi/src/main/java/org/apache/aries/cdi/extension/jndi/JndiObjectFactory.java
(original)
+++ aries/trunk/cdi/cdi-extension-jndi/src/main/java/org/apache/aries/cdi/extension/jndi/JndiObjectFactory.java
Wed Mar  1 10:06:53 2017
@@ -14,61 +14,27 @@
 
 package org.apache.aries.cdi.extension.jndi;
 
-import java.util.Hashtable;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-import javax.enterprise.inject.spi.BeanManager;
-import javax.naming.Name;
 import javax.naming.spi.ObjectFactory;
 
 import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceFactory;
 import org.osgi.framework.ServiceRegistration;
 
 public class JndiObjectFactory implements ServiceFactory<ObjectFactory> {
 
+	public JndiObjectFactory(JndiExtensionFactory jndiExtensionFactory) {
+		_jndiExtensionFactory = jndiExtensionFactory;
+	}
+
 	@Override
 	public ObjectFactory getService(Bundle bundle, ServiceRegistration<ObjectFactory>
registration) {
-		if (!_contexts.containsKey(bundle.getBundleContext())) {
-			return null;
-		}
-
-		return _contexts.get(bundle.getBundleContext());
+		return _jndiExtensionFactory.getObjectFactory(bundle);
 	}
 
 	@Override
 	public void ungetService(Bundle bundle, ServiceRegistration<ObjectFactory> registration,
ObjectFactory service) {
-		_contexts.remove(bundle.getBundleContext());
 	}
 
-	public void put(BundleContext bundleContext, BeanManager beanManager) {
-		_contexts.putIfAbsent(bundleContext, new InnerObjectFactory(new JndiContext(beanManager)));
-	}
-
-	private final ConcurrentMap<BundleContext, ObjectFactory> _contexts = new ConcurrentHashMap<>();
-
-	private class InnerObjectFactory implements ObjectFactory {
-
-		public InnerObjectFactory(JndiContext jndiContext) {
-			_jndiContext = jndiContext;
-		}
-
-		@Override
-		public Object getObjectInstance(
-				Object obj, Name name, javax.naming.Context context, Hashtable<?, ?> environment)
-			throws Exception {
-
-			if (obj == null) {
-				return _jndiContext;
-			}
-
-			return null;
-		}
-
-		private final JndiContext _jndiContext;
-
-	}
+	private final JndiExtensionFactory _jndiExtensionFactory;
 
 }
\ No newline at end of file

Modified: aries/trunk/cdi/cdi-itests/itest.bndrun
URL: http://svn.apache.org/viewvc/aries/trunk/cdi/cdi-itests/itest.bndrun?rev=1784898&r1=1784897&r2=1784898&view=diff
==============================================================================
--- aries/trunk/cdi/cdi-itests/itest.bndrun (original)
+++ aries/trunk/cdi/cdi-itests/itest.bndrun Wed Mar  1 10:06:53 2017
@@ -20,6 +20,7 @@
 	org.apache.aries.cdi.extender;version='[0.0.1,0.0.2)',\
 	org.apache.aries.cdi.extension.jndi;version='[0.0.1,0.0.2)',\
 	org.apache.aries.cdi.itests;version='[0.0.1,0.0.2)',\
+	org.apache.aries.el-api;version='[0.0.1,0.0.2)',\
 	org.apache.aries.jndi.api;version='[1.1.0,1.1.1)',\
 	org.apache.aries.jndi.core;version='[1.0.2,1.0.3)',\
 	org.apache.aries.util;version='[1.0.0,1.0.1)',\

Modified: aries/trunk/cdi/cdi-itests/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/cdi/cdi-itests/pom.xml?rev=1784898&r1=1784897&r2=1784898&view=diff
==============================================================================
--- aries/trunk/cdi/cdi-itests/pom.xml (original)
+++ aries/trunk/cdi/cdi-itests/pom.xml Wed Mar  1 10:06:53 2017
@@ -73,36 +73,15 @@
 			<version>1.2.17</version>
 		</dependency>
 		<dependency>
-			<groupId>org.slf4j</groupId>
-			<artifactId>slf4j-api</artifactId>
-			<version>1.7.21</version>
-		</dependency>
-		<dependency>
-			<groupId>org.slf4j</groupId>
-			<artifactId>slf4j-log4j12</artifactId>
-			<version>1.6.1</version>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.logging.log4j</groupId>
-			<artifactId>log4j-api</artifactId>
-			<version>2.7</version>
-		</dependency>
-		<dependency>
-			<groupId>org.osgi</groupId>
-			<artifactId>org.osgi.service.component.annotations</artifactId>
-			<version>1.3.0</version>
-			<scope>provided</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.osgi</groupId>
-			<artifactId>osgi.core</artifactId>
-			<version>6.0.0</version>
-		</dependency>
-
-		<dependency>
 			<groupId>org.apache.aries.cdi</groupId>
 			<artifactId>org.apache.aries.cdi.extender</artifactId>
 			<version>0.0.1-SNAPSHOT</version>
+			<exclusions>
+				<exclusion>
+					<groupId>javax.enterprise</groupId>
+					<artifactId>cdi-api</artifactId>
+				</exclusion>
+			</exclusions>
 		</dependency>
 		<dependency>
 			<groupId>org.apache.aries.cdi</groupId>
@@ -111,7 +90,7 @@
 		</dependency>
 		<dependency>
 			<groupId>org.apache.aries.cdi</groupId>
-			<artifactId>org.apache.aries.cdi.log4j.configuration.fragment</artifactId>
+			<artifactId>org.apache.aries.el-api</artifactId>
 			<version>0.0.1-SNAPSHOT</version>
 		</dependency>
 		<dependency>
@@ -133,6 +112,16 @@
 			<groupId>org.apache.felix</groupId>
 			<artifactId>org.apache.felix.gogo.command</artifactId>
 			<version>1.0.2</version>
+			<exclusions>
+				<exclusion>
+					<groupId>org.osgi</groupId>
+					<artifactId>org.osgi.core</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>org.osgi</groupId>
+					<artifactId>org.osgi.compendium</artifactId>
+				</exclusion>
+			</exclusions>
 		</dependency>
 		<dependency>
 			<groupId>org.apache.felix</groupId>
@@ -150,6 +139,11 @@
 			<version>2.0.6</version>
 		</dependency>
 		<dependency>
+			<groupId>org.apache.logging.log4j</groupId>
+			<artifactId>log4j-api</artifactId>
+			<version>2.7</version>
+		</dependency>
+		<dependency>
 			<groupId>org.osgi</groupId>
 			<artifactId>org.eclipse.equinox.metatype</artifactId>
 			<version>1.4.100.v20150408-1437</version>
@@ -177,6 +171,12 @@
 		</dependency>
 		<dependency>
 			<groupId>org.osgi</groupId>
+			<artifactId>org.osgi.service.component.annotations</artifactId>
+			<version>1.3.0</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.osgi</groupId>
 			<artifactId>org.osgi.service.http.whiteboard</artifactId>
 			<version>1.0.0</version>
 			<scope>provided</scope>
@@ -186,5 +186,20 @@
 			<artifactId>org.osgi.service.metatype</artifactId>
 			<version>1.3.0</version>
 		</dependency>
+		<dependency>
+			<groupId>org.osgi</groupId>
+			<artifactId>osgi.core</artifactId>
+			<version>6.0.0</version>
+		</dependency>
+		<dependency>
+			<groupId>org.slf4j</groupId>
+			<artifactId>slf4j-api</artifactId>
+			<version>1.7.21</version>
+		</dependency>
+		<dependency>
+			<groupId>org.slf4j</groupId>
+			<artifactId>slf4j-log4j12</artifactId>
+			<version>1.6.1</version>
+		</dependency>
 	</dependencies>
 </project>

Added: aries/trunk/cdi/el-api/bnd.bnd
URL: http://svn.apache.org/viewvc/aries/trunk/cdi/el-api/bnd.bnd?rev=1784898&view=auto
==============================================================================
--- aries/trunk/cdi/el-api/bnd.bnd (added)
+++ aries/trunk/cdi/el-api/bnd.bnd Wed Mar  1 10:06:53 2017
@@ -0,0 +1,8 @@
+Export-Package: \
+	javax.el;version='1.0.0'
+Provide-Capability: \
+	osgi.contract; \
+		osgi.contract=JavaEL; \
+		uses:="javax.el"; \
+		version:List<Version>='2.1,2.2,3.0'
+-includeresource: @tomcat-el-api-*.jar!/META-INF/LICENSE, @tomcat-el-api-*.jar!/META-INF/NOTICE
\ No newline at end of file

Added: aries/trunk/cdi/el-api/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/cdi/el-api/pom.xml?rev=1784898&view=auto
==============================================================================
--- aries/trunk/cdi/el-api/pom.xml (added)
+++ aries/trunk/cdi/el-api/pom.xml Wed Mar  1 10:06:53 2017
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
+	xmlns="http://maven.apache.org/POM/4.0.0"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+	<modelVersion>4.0.0</modelVersion>
+
+	<parent>
+		<groupId>org.apache.aries.cdi</groupId>
+		<artifactId>org.apache.aries.cdi</artifactId>
+		<version>0.0.1-SNAPSHOT</version>
+		<relativePath>..</relativePath>
+	</parent>
+
+	<artifactId>org.apache.aries.el-api</artifactId>
+	<version>0.0.1-SNAPSHOT</version>
+	<name>EL API Bundle</name>
+	<description>EL API Bundle</description>
+
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>biz.aQute.bnd</groupId>
+				<artifactId>bnd-maven-plugin</artifactId>
+			</plugin>
+		</plugins>
+	</build>
+
+	<dependencies>
+		<dependency>
+			<groupId>org.apache.tomcat</groupId>
+			<artifactId>tomcat-el-api</artifactId>
+			<version>8.0.41</version>
+			<scope>provided</scope>
+		</dependency>
+	</dependencies>
+
+</project>

Modified: aries/trunk/cdi/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/cdi/pom.xml?rev=1784898&r1=1784897&r2=1784898&view=diff
==============================================================================
--- aries/trunk/cdi/pom.xml (original)
+++ aries/trunk/cdi/pom.xml Wed Mar  1 10:06:53 2017
@@ -24,6 +24,7 @@
 	</licenses>
 
 	<modules>
+		<module>el-api</module>
 		<module>cdi-extender</module>
 		<module>cdi-extension-jndi</module>
 		<module>cdi-itests</module>



Mime
View raw message