Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandra Schladebeck2013-05-15 13:48:16 +0000
committerAlexandra Schladebeck2013-05-15 13:48:16 +0000
commit20c860af8237330483101846360a882552744525 (patch)
treed8edb2c5da9f7fed2574667f773182ae2c6c3505
parenta90cf7957a83c9f42af0db2dc9c42c0684c359d8 (diff)
parent2249f6854dc78e5345079d52a0a7e708e9e8de13 (diff)
downloadorg.eclipse.jubula.core-20c860af8237330483101846360a882552744525.tar.gz
org.eclipse.jubula.core-20c860af8237330483101846360a882552744525.tar.xz
org.eclipse.jubula.core-20c860af8237330483101846360a882552744525.zip
Merge branch 'master' of ssh://gatekeeper.bredex.de:2407/jubula/org.eclipse.jubula.core
-rw-r--r--org.eclipse.jubula.client.core/META-INF/MANIFEST.MF10
-rw-r--r--org.eclipse.jubula.feature/feature.xml87
-rw-r--r--org.eclipse.jubula.persistence.jpa.osgi/.classpath7
-rw-r--r--org.eclipse.jubula.persistence.jpa.osgi/.gitignore2
-rw-r--r--org.eclipse.jubula.persistence.jpa.osgi/.project28
-rw-r--r--org.eclipse.jubula.persistence.jpa.osgi/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--org.eclipse.jubula.persistence.jpa.osgi/.settings/org.eclipse.pde.core.prefs5
-rw-r--r--org.eclipse.jubula.persistence.jpa.osgi/META-INF/MANIFEST.MF24
-rw-r--r--org.eclipse.jubula.persistence.jpa.osgi/build.properties5
-rw-r--r--org.eclipse.jubula.persistence.jpa.osgi/pom.xml16
-rw-r--r--org.eclipse.jubula.persistence.jpa.osgi/src/org/eclipse/persistence/internal/jpa/deployment/osgi/BundleProxyClassLoader.java66
-rw-r--r--org.eclipse.jubula.persistence.jpa.osgi/src/org/eclipse/persistence/internal/jpa/deployment/osgi/CompositeClassLoader.java194
-rw-r--r--org.eclipse.jubula.persistence.jpa.osgi/src/org/eclipse/persistence/internal/jpa/deployment/osgi/CompositeEnumeration.java75
-rw-r--r--org.eclipse.jubula.persistence.jpa.osgi/src/org/eclipse/persistence/internal/jpa/deployment/osgi/OSGiInitializer.java72
-rw-r--r--org.eclipse.jubula.persistence.jpa.osgi/src/org/eclipse/persistence/jpa/osgi/Activator.java220
-rw-r--r--org.eclipse.jubula.persistence.jpa.osgi/src/org/eclipse/persistence/jpa/osgi/EMFBuilderServiceProxyHandler.java93
-rw-r--r--org.eclipse.jubula.persistence.jpa.osgi/src/org/eclipse/persistence/jpa/osgi/EMFServiceProxyHandler.java120
-rw-r--r--org.eclipse.jubula.persistence.jpa.osgi/src/org/eclipse/persistence/jpa/osgi/PersistenceProvider.java210
-rw-r--r--org.eclipse.jubula.project.configuration/target/definitions/juno+nightly.target2
-rw-r--r--org.eclipse.jubula.project.configuration/target/definitions/juno.target2
-rw-r--r--org.eclipse.jubula.releng.client/pom.xml1
21 files changed, 86 insertions, 1161 deletions
diff --git a/org.eclipse.jubula.client.core/META-INF/MANIFEST.MF b/org.eclipse.jubula.client.core/META-INF/MANIFEST.MF
index aba69ae88..710dce1ab 100644
--- a/org.eclipse.jubula.client.core/META-INF/MANIFEST.MF
+++ b/org.eclipse.jubula.client.core/META-INF/MANIFEST.MF
@@ -58,11 +58,11 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.6.0,4.0.0)",
org.apache.commons.lang;bundle-version="[2.4.0,3.0.0)",
org.apache.commons.cli;bundle-version="[1.2.0,2.0.0)",
org.apache.commons.beanutils;bundle-version="[1.7.0,2.0.0)",
- javax.persistence;bundle-version="[2.0.3,3.0.0)",
- org.eclipse.persistence.core;bundle-version="[2.2.0,3.0.0)",
- org.eclipse.persistence.jpa;bundle-version="[2.2.0,3.0.0)",
- org.eclipse.persistence.asm;bundle-version="[2.2.0,3.5.0)",
- org.eclipse.jubula.persistence.jpa.osgi;bundle-version="[2.1.0,2.2.0)",
+ javax.persistence;bundle-version="[2.0.3,2.1.0)",
+ org.eclipse.persistence.core;bundle-version="[2.3.0,2.4.0)",
+ org.eclipse.persistence.jpa;bundle-version="[2.3.0,2.4.0)",
+ org.eclipse.persistence.asm;bundle-version="[2.3.0,2.4.0)",
+ org.eclipse.persistence.jpa.osgi;bundle-version="[2.3.0,2.4.0)",
org.slf4j.api;bundle-version="[1.5.11,2.0.0)",
ch.qos.logback.classic;bundle-version="[1.0.0,2.0.0)",
ch.qos.logback.core;bundle-version="[1.0.0,2.0.0)",
diff --git a/org.eclipse.jubula.feature/feature.xml b/org.eclipse.jubula.feature/feature.xml
index 4ff351698..3dc047ca4 100644
--- a/org.eclipse.jubula.feature/feature.xml
+++ b/org.eclipse.jubula.feature/feature.xml
@@ -48,7 +48,6 @@ BREDEX GmbH - initial API and implementation and/or initial documentation
<import plugin="org.eclipse.core.filesystem" version="1.3.1" match="compatible"/>
<import plugin="org.eclipse.core.databinding.property" version="1.3.0" match="compatible"/>
<import plugin="org.eclipse.search" version="3.6.0" match="compatible"/>
- <import feature="org.eclipse.persistence.jpa" version="2.2.0" match="compatible"/>
<import feature="org.eclipse.help"/>
<import plugin="org.eclipse.equinox.security" version="1.0.0" match="compatible"/>
</requires>
@@ -409,12 +408,84 @@ BREDEX GmbH - initial API and implementation and/or initial documentation
install-size="0"
version="0.0.0"
unpack="false"/>
-
- <plugin
- id="org.eclipse.jubula.persistence.jpa.osgi"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
+
+ <!-- SPECIFIC EclipseLink Bundle inclusion see #407730 -->
+
+ <plugin
+ id="javax.activation"
+ download-size="0"
+ install-size="0"
+ version="1.1.0"
+ unpack="false"/>
+
+ <plugin
+ id="javax.mail"
+ download-size="0"
+ install-size="0"
+ version="1.4.0"
+ unpack="false"/>
+
+ <plugin
+ id="javax.persistence"
+ download-size="0"
+ install-size="0"
+ version="2.0.3"
+ unpack="false"/>
+
+ <plugin
+ id="javax.xml.stream"
+ download-size="0"
+ install-size="0"
+ version="1.0.1"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.persistence.antlr"
+ download-size="0"
+ install-size="0"
+ version="2.3.2"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.persistence.asm"
+ download-size="0"
+ install-size="0"
+ version="2.3.2"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.persistence.core"
+ download-size="0"
+ install-size="0"
+ version="2.3.2"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.persistence.jpa"
+ download-size="0"
+ install-size="0"
+ version="2.3.2"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.persistence.jpa.jpql"
+ download-size="0"
+ install-size="0"
+ version="1.0.1"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.persistence.jpa.osgi"
+ download-size="0"
+ install-size="0"
+ version="2.3.2"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.persistence.oracle"
+ download-size="0"
+ install-size="0"
+ version="2.3.2"
+ unpack="false"/>
</feature>
diff --git a/org.eclipse.jubula.persistence.jpa.osgi/.classpath b/org.eclipse.jubula.persistence.jpa.osgi/.classpath
deleted file mode 100644
index 2d1a4302f..000000000
--- a/org.eclipse.jubula.persistence.jpa.osgi/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/org.eclipse.jubula.persistence.jpa.osgi/.gitignore b/org.eclipse.jubula.persistence.jpa.osgi/.gitignore
deleted file mode 100644
index 934e0e06f..000000000
--- a/org.eclipse.jubula.persistence.jpa.osgi/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/bin
-/target
diff --git a/org.eclipse.jubula.persistence.jpa.osgi/.project b/org.eclipse.jubula.persistence.jpa.osgi/.project
deleted file mode 100644
index 3ad4caf43..000000000
--- a/org.eclipse.jubula.persistence.jpa.osgi/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jubula.persistence.jpa.osgi</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/org.eclipse.jubula.persistence.jpa.osgi/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jubula.persistence.jpa.osgi/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index a02320ec7..000000000
--- a/org.eclipse.jubula.persistence.jpa.osgi/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,8 +0,0 @@
-#Tue May 04 15:19:10 EDT 2010
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/org.eclipse.jubula.persistence.jpa.osgi/.settings/org.eclipse.pde.core.prefs b/org.eclipse.jubula.persistence.jpa.osgi/.settings/org.eclipse.pde.core.prefs
deleted file mode 100644
index 6e21fa680..000000000
--- a/org.eclipse.jubula.persistence.jpa.osgi/.settings/org.eclipse.pde.core.prefs
+++ /dev/null
@@ -1,5 +0,0 @@
-#Tue May 04 15:19:10 EDT 2010
-eclipse.preferences.version=1
-pluginProject.equinox=false
-pluginProject.extensions=false
-resolve.requirebundle=false
diff --git a/org.eclipse.jubula.persistence.jpa.osgi/META-INF/MANIFEST.MF b/org.eclipse.jubula.persistence.jpa.osgi/META-INF/MANIFEST.MF
deleted file mode 100644
index d7ae77fb7..000000000
--- a/org.eclipse.jubula.persistence.jpa.osgi/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,24 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.eclipse.persistence.jpa.osgi;version="2.1.0"
-Bundle-Name: EclipseLink OSGi Integration (deprecated, use Gemini JPA instead)
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.persistence.core;bundle-version="[2.5.0,3.0.0)",
- org.eclipse.persistence.jpa;bundle-version="[2.5.0,3.0.0)"
-Bundle-Vendor: Eclipse Jubula
-Bundle-Version: 2.1.0.qualifier
-Bundle-ManifestVersion: 2
-Bundle-Activator: org.eclipse.persistence.jpa.osgi.Activator
-Import-Package: javax.persistence;jpa="2.1";version="[1.1.0,2.2)",
- javax.persistence.criteria;jpa="2.1";version="[1.1.0,2.2)",
- javax.persistence.metamodel;jpa="2.1";version="[1.1.0,2.2)",
- javax.persistence.spi;jpa="2.1";version="[1.1.0,2.2)",
- org.eclipse.persistence.exceptions,
- org.eclipse.persistence.internal.jpa.deployment,
- org.eclipse.persistence.internal.localization,
- org.eclipse.persistence.jpa,
- org.eclipse.persistence.logging,
- org.osgi.framework,
- org.osgi.service.jpa,
- org.osgi.service.packageadmin
-Bundle-SymbolicName: org.eclipse.jubula.persistence.jpa.osgi
-
diff --git a/org.eclipse.jubula.persistence.jpa.osgi/build.properties b/org.eclipse.jubula.persistence.jpa.osgi/build.properties
deleted file mode 100644
index 32b7db056..000000000
--- a/org.eclipse.jubula.persistence.jpa.osgi/build.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-bin.includes = .,\
- META-INF/
-source.. = src/,\
- resource/
-src.excludes = */.svn/*
diff --git a/org.eclipse.jubula.persistence.jpa.osgi/pom.xml b/org.eclipse.jubula.persistence.jpa.osgi/pom.xml
deleted file mode 100644
index c694944e0..000000000
--- a/org.eclipse.jubula.persistence.jpa.osgi/pom.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>org.eclipse.jubula.releng.client</artifactId>
- <groupId>org.eclipse.jubula</groupId>
- <version>2.1.0-SNAPSHOT</version>
- <relativePath>../org.eclipse.jubula.releng.client</relativePath>
- </parent>
- <groupId>org.eclipse.jubula</groupId>
- <artifactId>org.eclipse.jubula.persistence.jpa.osgi</artifactId>
- <version>2.1.0-SNAPSHOT</version>
- <packaging>eclipse-plugin</packaging>
-
-</project>
diff --git a/org.eclipse.jubula.persistence.jpa.osgi/src/org/eclipse/persistence/internal/jpa/deployment/osgi/BundleProxyClassLoader.java b/org.eclipse.jubula.persistence.jpa.osgi/src/org/eclipse/persistence/internal/jpa/deployment/osgi/BundleProxyClassLoader.java
deleted file mode 100644
index e53975724..000000000
--- a/org.eclipse.jubula.persistence.jpa.osgi/src/org/eclipse/persistence/internal/jpa/deployment/osgi/BundleProxyClassLoader.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2013 Oracle and/or its affiliates. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * tware - 1.0 - Taken from Eclipse Wiki - http://wiki.eclipse.org/index.php/BundleProxyClassLoader_recipe
- ******************************************************************************/
-package org.eclipse.persistence.internal.jpa.deployment.osgi;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.Enumeration;
-
-import org.osgi.framework.Bundle;
-
-public class BundleProxyClassLoader extends ClassLoader {
- private Bundle bundle;
- private ClassLoader parent;
-
- public BundleProxyClassLoader(Bundle bundle) {
- this.bundle = bundle;
- }
-
- public BundleProxyClassLoader(Bundle bundle, ClassLoader parent) {
- super(parent);
- this.parent = parent;
- this.bundle = bundle;
- }
-
- // Note: Both ClassLoader.getResources(...) and bundle.getResources(...) consult
- // the boot classloader. As a result, BundleProxyClassLoader.getResources(...)
- // might return duplicate results from the boot classloader. Prior to Java 5
- // Classloader.getResources was marked final. If your target environment requires
- // at least Java 5 you can prevent the occurence of duplicate boot classloader
- // resources by overriding ClassLoader.getResources(...) instead of
- // ClassLoader.findResources(...).
- public Enumeration findResources(String name) throws IOException {
- return bundle.getResources(name);
- }
-
- public URL findResource(String name) {
- return bundle.getResource(name);
- }
-
- public Class findClass(String name) throws ClassNotFoundException {
- return bundle.loadClass(name);
- }
-
- public URL getResource(String name) {
- return (parent == null) ? findResource(name) : super.getResource(name);
- }
-
- protected Class loadClass(String name, boolean resolve) throws ClassNotFoundException {
- Class clazz = (parent == null) ? findClass(name) : super.loadClass(name, false);
- if (resolve)
- super.resolveClass(clazz);
-
- return clazz;
- }
-}
-
diff --git a/org.eclipse.jubula.persistence.jpa.osgi/src/org/eclipse/persistence/internal/jpa/deployment/osgi/CompositeClassLoader.java b/org.eclipse.jubula.persistence.jpa.osgi/src/org/eclipse/persistence/internal/jpa/deployment/osgi/CompositeClassLoader.java
deleted file mode 100644
index 762e63dcf..000000000
--- a/org.eclipse.jubula.persistence.jpa.osgi/src/org/eclipse/persistence/internal/jpa/deployment/osgi/CompositeClassLoader.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2013 Oracle and/or its affiliates. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * ssmith = 1.1 - A ClassLoader that aggregates multiple ClassLoaders
- ******************************************************************************/
-package org.eclipse.persistence.internal.jpa.deployment.osgi;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.Vector;
-
-public class CompositeClassLoader extends ClassLoader {
- private List<ClassLoader> classLoaders = new ArrayList<ClassLoader>();
-
- /**
- * Create a CompositeClassLoader with two class loaders.
- *
- * @param loader1
- * @param loader2
- */
- public CompositeClassLoader(ClassLoader loader1, ClassLoader loader2) {
- classLoaders.add(loader1);
- classLoaders.add(loader2);
- }
-
- /**
- * Create a CompositeClassLoader from a list of class loaders.
- *
- * @param loaders
- */
- public CompositeClassLoader(List<ClassLoader> loaders) {
- classLoaders.addAll(loaders);
- }
-
- /**
- * Get the contained class loaders.
- *
- * @return the list of the contained class loaders
- */
- public List<ClassLoader> getClassLoaders() {
- return classLoaders;
- }
-
- /**
- * Sets the default assertion status for this class loader to
- * <tt>false</tt> and discards any package defaults or class assertion
- * on all contained class loaders.
- *
- * @see ClassLoader#clearAssertionStatus()
- */
- @Override
- public synchronized void clearAssertionStatus() {
- for (ClassLoader classLoader : getClassLoaders()) {
- classLoader.clearAssertionStatus();
- }
- }
-
- /**
- * Finds the resource with the given name. Contained class
- * loaders are queried until one returns the requested
- * resource or <tt>null</tt> if not found.
- *
- * @see ClassLoader#getResource(String)
- */
- @Override
- public URL getResource(String name) {
- for (ClassLoader classLoader : getClassLoaders()) {
- URL resource = classLoader.getResource(name);
- if (resource != null) {
- return resource;
- }
- }
- return null;
- }
-
- /**
- * Returns an input stream for reading the specified resource.
- * Contained class loaders are queried until one returns the
- * requested resource stream or <tt>null</tt> if not found.
- *
- * @see ClassLoader#getResourceAsStream(String)
- */
- @Override
- public InputStream getResourceAsStream(String name) {
- for (ClassLoader classLoader : getClassLoaders()) {
- InputStream stream = classLoader.getResourceAsStream(name);
- if (stream != null) {
- return stream;
- }
- }
- return null;
- }
-
- /**
- * Finds all the resources with the given name. Contained class
- * loaders are queried and the results aggregated into a single
- * Enumeration.
- *
- * @throws IOException
- * If I/O errors occur
- *
- * @see ClassLoader#getResources(String)
- */
- @Override
- public Enumeration<URL> getResources(String name) throws IOException {
- Vector<URL> resourceList = new Vector<URL>();
- for (int i = 0; i < getClassLoaders().size(); i++) {
- Enumeration<URL> localResources = getClassLoaders().get(i).getResources(name);
- while(localResources.hasMoreElements()){
- URL resource = localResources.nextElement();
- if (!resourceList.contains(resource)){
- resourceList.add(resource);
- }
- }
- }
- return resourceList.elements();
- }
-
- /**
- * Loads the class with the specified <a href="#name">binary name</a>.
- * Contained class loaders are queried until one returns the
- * requested class.
- *
- * @see ClassLoader#loadClass(String)
- *
- * @throws ClassNotFoundException
- * If the class was not found
- */
- @Override
- public Class<?> loadClass(String name) throws ClassNotFoundException {
- for (ClassLoader classLoader : getClassLoaders()) {
- try {
- Class<?> aClass = classLoader.loadClass(name);
- return aClass;
- } catch (ClassNotFoundException e) {
- }
- }
- throw new ClassNotFoundException(name);
- }
-
- /**
- * Sets the desired assertion status for the named top-level class.
- *
- * @see ClassLoader#setClassAssertionStatus(String, boolean)
- */
- @Override
- public synchronized void setClassAssertionStatus(String className,
- boolean enabled) {
- for (ClassLoader classLoader : getClassLoaders()) {
- classLoader.setClassAssertionStatus(className, enabled);
- }
- }
-
- /**
- * Sets the default assertion status for this class loader.
- *
- * @see ClassLoader#setDefaultAssertionStatus(boolean)
- */
- @Override
- public synchronized void setDefaultAssertionStatus(boolean enabled) {
- for (ClassLoader classLoader : getClassLoaders()) {
- classLoader.setDefaultAssertionStatus(enabled);
- }
- }
-
- /**
- * Sets the package default assertion status for the named package.
- *
- * @see ClassLoader#setPackageAssertionStatus(String,boolean)
- */
- @Override
- public synchronized void setPackageAssertionStatus(String packageName,
- boolean enabled) {
- for (ClassLoader classLoader : getClassLoaders()) {
- classLoader.setPackageAssertionStatus(packageName, enabled);
- }
- }
-
-
-
-}
diff --git a/org.eclipse.jubula.persistence.jpa.osgi/src/org/eclipse/persistence/internal/jpa/deployment/osgi/CompositeEnumeration.java b/org.eclipse.jubula.persistence.jpa.osgi/src/org/eclipse/persistence/internal/jpa/deployment/osgi/CompositeEnumeration.java
deleted file mode 100644
index 16f62728a..000000000
--- a/org.eclipse.jubula.persistence.jpa.osgi/src/org/eclipse/persistence/internal/jpa/deployment/osgi/CompositeEnumeration.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2013 Oracle and/or its affiliates. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * ssmith
- ******************************************************************************/
-package org.eclipse.persistence.internal.jpa.deployment.osgi;
-
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.List;
-import java.util.NoSuchElementException;
-
-/**
- * CompositeEnumeration is, as the name implies, a Composite of Enumerations.
- * It provides a way to iterate across a set of Enumerations as if they are
- * a single Enumeration. The order of the elements returned reflects the order
- * of the Enumerations in the Vector passed to the constructor.
- *
- * @author shsmith
- *
- * @see org.eclipse.persistence.internal.jpa.deployment.osgi.CompositeClassLoader
- *
- * @param <T>
- */
-public class CompositeEnumeration<T> implements Enumeration<T> {
-
- private Enumeration<T> currentEnumeration;
- private Iterator<Enumeration<T>> enumerationIterator;
-
- public CompositeEnumeration(List<Enumeration<T>> enumerations) {
- this.enumerationIterator = enumerations.iterator();
- if (this.enumerationIterator.hasNext()) {
- this.currentEnumeration = this.enumerationIterator.next();
- } else {
- this.currentEnumeration = new NullObjectEnumeration();
- }
- }
-
- public boolean hasMoreElements() {
- boolean hasMoreElements = this.currentEnumeration.hasMoreElements();
- if (hasMoreElements) {
- return true;
- } else {
- if (this.enumerationIterator.hasNext()) {
- this.currentEnumeration = this.enumerationIterator.next();
- return this.hasMoreElements();
- } else {
- return false;
- }
- }
- }
-
- public T nextElement() {
- return this.currentEnumeration.nextElement();
- }
-
- private final class NullObjectEnumeration implements Enumeration<T> {
- public boolean hasMoreElements() {
- return false;
- }
-
- public T nextElement() {
- throw new NoSuchElementException();
- }
- }
-
-
-}
diff --git a/org.eclipse.jubula.persistence.jpa.osgi/src/org/eclipse/persistence/internal/jpa/deployment/osgi/OSGiInitializer.java b/org.eclipse.jubula.persistence.jpa.osgi/src/org/eclipse/persistence/internal/jpa/deployment/osgi/OSGiInitializer.java
deleted file mode 100644
index f6a2544cc..000000000
--- a/org.eclipse.jubula.persistence.jpa.osgi/src/org/eclipse/persistence/internal/jpa/deployment/osgi/OSGiInitializer.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2013 Oracle and/or its affiliates. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * tware, ssmith = 1.0 - bootstrap the deployment of Entities
- ******************************************************************************/
-package org.eclipse.persistence.internal.jpa.deployment.osgi;
-
-import java.util.Collection;
-import java.util.Map;
-
-import javax.persistence.spi.ClassTransformer;
-import javax.persistence.spi.PersistenceUnitInfo;
-
-import org.eclipse.persistence.config.PersistenceUnitProperties;
-import org.eclipse.persistence.internal.jpa.deployment.JPAInitializer;
-
-/**
- * INTERNAL:
- *
- * OSGiInitializer is used to bootstrap the deployment of Entities
- * when deployed in a non-managed OSGi environment
- *
- * It is called internally by our Provider
- *
- * @see org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider
- */
-public class OSGiInitializer extends JPAInitializer {
-
- public OSGiInitializer(ClassLoader classLoader) {
- this.initializationClassloader = classLoader;
- }
-
- /**
- * Check whether weaving is possible and update the properties and variable as appropriate
- * @param properties The list of properties to check for weaving and update if weaving is not needed
- */
- public void checkWeaving(Map properties){
- String weaving = "false";
- properties.put(PersistenceUnitProperties.WEAVING, weaving);
- shouldCreateInternalLoader=false;
- }
-
- /**
- * Create a temporary class loader that can be used to inspect classes and then
- * thrown away. This allows classes to be introspected prior to loading them
- * with application's main class loader enabling weaving.
- */
- protected ClassLoader createTempLoader(Collection classNames) {
- return initializationClassloader;
- }
-
- protected ClassLoader createTempLoader(Collection classNames, boolean shouldOverrideLoadClassForCollectionMembers) {
- return initializationClassloader;
- }
-
- /**
- * Register a transformer. In this case, this is a no-op since weaving does not work on default OSGi
- * environments
- * @param transformer
- * @param persistenceUnitInfo
- */
- public void registerTransformer(final ClassTransformer transformer, PersistenceUnitInfo persistenceUnitInfo, Map properties){
- }
-
-}
diff --git a/org.eclipse.jubula.persistence.jpa.osgi/src/org/eclipse/persistence/jpa/osgi/Activator.java b/org.eclipse.jubula.persistence.jpa.osgi/src/org/eclipse/persistence/jpa/osgi/Activator.java
deleted file mode 100644
index bb6b7b1b5..000000000
--- a/org.eclipse.jubula.persistence.jpa.osgi/src/org/eclipse/persistence/jpa/osgi/Activator.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2013 Oracle and/or its affiliates. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * tware, ssmith = 1.0 - Activator for EclipseLink persistence
- * tware - updates to allow support of gemini project
- ******************************************************************************/
-package org.eclipse.persistence.jpa.osgi;
-
-import java.lang.reflect.Proxy;
-import java.util.Dictionary;
-import java.util.Hashtable;
-
-import javax.persistence.EntityManagerFactory;
-
-import org.eclipse.persistence.internal.localization.LoggingLocalization;
-import org.eclipse.persistence.logging.AbstractSessionLog;
-import org.eclipse.persistence.logging.SessionLog;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleEvent;
-import org.osgi.framework.ServiceReference;
-import org.osgi.framework.SynchronousBundleListener;
-import org.osgi.service.jpa.EntityManagerFactoryBuilder;
-import org.osgi.service.packageadmin.PackageAdmin;
-
-/**
- * Activator for JPA OSGi service.
- *
- * This Activator provides EclipseLink's OSGi integration. When the Eclipse
- * Gemini project comes out of incubation that behavior this integration will be
- * deprecated and users will be encouraged to use OSGi JPA in the way defined by
- * the OSGi EE specification
- *
- * @author tware, ssmith
- */
-public class Activator implements BundleActivator, SynchronousBundleListener {
- public static final String MANIFEST_PU_LABEL = "JPA-PersistenceUnits";
- public static final String PERSISTENCE_PROVIDER = "javax.persistence.spi.PersistenceProvider";
- public static final String ECLIPSELINK_OSGI_PROVIDER = "org.eclipse.persistence.jpa.osgi.PersistenceProviderOSGi";
-
- /**
- * Context is stored on this activator by its subclass for use
- * in weaving.
- */
- protected static BundleContext context;
- protected static PersistenceProvider osgiProvider;
-
- public static BundleContext getContext() {
- return Activator.context;
- }
-
- /**
- * Simply add bundles to our bundle list as they start and remove them as they stop
- */
- public void bundleChanged(BundleEvent event) {
- switch (event.getType()) {
- case BundleEvent.STARTING:
- registerBundle(event.getBundle());
- break;
-
- case BundleEvent.STOPPING:
- deregisterBundle(event.getBundle());
- break;
- }
- }
-
- /**
- * On start, we do two things
- * We register a listener for bundles and we start our JPA server
- */
- public void start(BundleContext context) throws Exception {
- Activator.context = context;
- String initializer = null;
- ServiceReference packageAdminRef = context.getServiceReference("org.osgi.service.packageadmin.PackageAdmin");
- PackageAdmin packageAdmin = (PackageAdmin)context.getService(packageAdminRef);
- Bundle[] fragments = packageAdmin.getFragments(context.getBundle());
- if (fragments != null){
- for (int i=0;i<fragments.length;i++){
- Bundle fragment = fragments[i];
- initializer = (String)fragment.getHeaders().get("JPA-Initializer");
- if (initializer != null){
- AbstractSessionLog.getLog().log(SessionLog.CONFIG, LoggingLocalization.buildMessage("osgi_initializer", new Object[]{initializer}));
- break;
- }
- }
- }
- osgiProvider = new PersistenceProvider(initializer);
- registerBundleListener();
- }
-
- /**
- * Add our bundle listener
- */
- private void registerBundleListener() {
- getContext().addBundleListener(this);
- Bundle bundles[] = getContext().getBundles();
- for (int i = 0; i < bundles.length; i++) {
- Bundle bundle = bundles[i];
- registerBundle(bundle);
- }
- }
-
- /**
- * Store a reference to a bundle as it is started so the bundle can be
- * accessed later.
- */
- private void registerBundle(Bundle bundle) {
- if ((bundle.getState() & (Bundle.STARTING | Bundle.RESOLVED | Bundle.ACTIVE)) != 0) {
- AbstractSessionLog.getLog().finest("EclipseLink OSGi - examining bundle: " +
- bundle.getSymbolicName() + "_" + bundle.getBundleId());
- if (!PersistenceProvider.includesBundle(bundle)) {
- try {
- String[] persistenceUnitNames = getPersistenceUnitNames(bundle);
- if (persistenceUnitNames != null) {
- // Bundle contains persistence unit(s)
- PersistenceProvider.addBundle(bundle, persistenceUnitNames);
- registerEMFServices(persistenceUnitNames);
- }
- } catch (Exception e) {
- AbstractSessionLog.getLog().logThrowable(SessionLog.WARNING, e);
- }
- }
- }
- }
-
- protected void registerEMFServices(String[] persistenceUnitNames) {
- for (String puName : persistenceUnitNames) {
- AbstractSessionLog.getLog().finest("EclipseLink OSGi - registering services for PU '" +
- puName + "'");
- // Assemble the properties
- Dictionary<String,String> props = new Hashtable<String,String>();
- props.put("osgi.unit.name", puName);
- props.put("osgi.unit.provider", PersistenceProvider.class.getName());
-
- EMFServiceProxyHandler emfServiceProxyHandler = registerEMFService(puName, props);
- registerEMFBuilderService(emfServiceProxyHandler, puName, props);
- }
- }
-
- protected EMFServiceProxyHandler registerEMFService(String puName, Dictionary<String, String> props) {
- EMFServiceProxyHandler emfServiceProxyHandler = new EMFServiceProxyHandler(osgiProvider, puName);
- Object emfServiceProxy = null ;
-
- try {
- emfServiceProxy =
- Proxy.newProxyInstance(this.getClass().getClassLoader(),
- new Class[]{EntityManagerFactory.class},
- emfServiceProxyHandler);
- } catch (Exception e) {
- AbstractSessionLog.getLog().finest("EclipseLink OSGi - Failed to create proxy for EMF service: " + e);
- }
-
- try {
- String[] serviceInterfaces = new String[]{EntityManagerFactory.class.getName()};
- context.registerService(serviceInterfaces, emfServiceProxy, props);
- } catch (Exception e) {
- AbstractSessionLog.getLog().finest("EclipseLink OSGi could not register EMF service for " + puName + e);
- }
- AbstractSessionLog.getLog().finer("EclipseLink OSGi registered EMF service for " + puName);
- return emfServiceProxyHandler;
- }
-
- protected EMFBuilderServiceProxyHandler registerEMFBuilderService(EMFServiceProxyHandler emfServiceProxyHandler, String puName, Dictionary<String, String> props) {
- EMFBuilderServiceProxyHandler emfBuilderProxyHandler = new EMFBuilderServiceProxyHandler(osgiProvider, puName, emfServiceProxyHandler);
- Object emfBuilderServiceProxy = null ;
-
- try {
- emfBuilderServiceProxy =
- Proxy.newProxyInstance(this.getClass().getClassLoader(),
- new Class[]{EntityManagerFactoryBuilder.class},
- emfBuilderProxyHandler);
- } catch (Exception e) {
- AbstractSessionLog.getLog().finest("EclipseLink OSGi - Failed to create proxy for EMF builder service: " + e);
- }
-
- try {
- String[] serviceInterfaces = new String[]{EntityManagerFactoryBuilder.class.getName()};
- context.registerService(serviceInterfaces, emfBuilderServiceProxy, props);
- } catch (Exception e) {
- AbstractSessionLog.getLog().finest("EclipseLink OSGi could not register EMF Builder service for " + puName + e);
- }
- AbstractSessionLog.getLog().finer("EclipseLink OSGi registered EMF Builder service for " + puName);
- return emfBuilderProxyHandler;
- }
-
- /**
- * Extract the list of persistence unit names from the OSGi manifest.
- */
- private String[] getPersistenceUnitNames(Bundle bundle) {
- String names = (String) bundle.getHeaders().get(MANIFEST_PU_LABEL);
- if (names != null) {
- String[] values = names.split(",");
- // Must trim spaces.
- for (int index = 0; index < values.length; index++) {
- values[index] = values[index].trim();
- }
- return values;
- } else {
- return null;
- }
- }
-
-
- private void deregisterBundle(Bundle bundle) {
- PersistenceProvider.removeBundle(bundle);
- }
-
- public void stop(BundleContext context) throws Exception {
- getContext().removeBundleListener(this);
- }
-
-}
diff --git a/org.eclipse.jubula.persistence.jpa.osgi/src/org/eclipse/persistence/jpa/osgi/EMFBuilderServiceProxyHandler.java b/org.eclipse.jubula.persistence.jpa.osgi/src/org/eclipse/persistence/jpa/osgi/EMFBuilderServiceProxyHandler.java
deleted file mode 100644
index 1f1b190e7..000000000
--- a/org.eclipse.jubula.persistence.jpa.osgi/src/org/eclipse/persistence/jpa/osgi/EMFBuilderServiceProxyHandler.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2013 Oracle and/or its affiliates. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * mkeith - Gemini JPA work
- * ssmith - EclipseLink integration
- ******************************************************************************/
-package org.eclipse.persistence.jpa.osgi;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-import java.util.Map;
-
-import javax.persistence.EntityManagerFactory;
-
-/**
- * Dynamic proxy class to proxy the EMFBuilder service
- */
-public class EMFBuilderServiceProxyHandler extends EMFServiceProxyHandler
- implements InvocationHandler {
-
- // Keep this to let us know if a factory has already been created via the EMF service
- protected EMFServiceProxyHandler emfService;
-
- public EMFBuilderServiceProxyHandler(PersistenceProvider provider,
- String puName,
- EMFServiceProxyHandler emfService) {
- super(provider, puName);
- this.emfService = emfService;
- }
-
- /*=========================*/
- /* InvocationProxy methods */
- /*=========================*/
-
- // Will only get calls for the method on the EntityManagerFactoryBuilder interface
- @Override
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
-
- if (method.getName().equals("hashCode"))
- return this.hashCode();
-
- // Must be a createEntityManagerFactory(String, Map) call
-
- // If we have a factory and it has already been closed, discard it
- synchronized (this) {
- if ((emf != null) && (!emf.isOpen()))
- emf = null;
-
- // If we have a local factory, return it
- if (emf != null)
- return emf;
- }
-
- // If an EMF service is registered the EMF must be stored there
- if (emfService != null) {
-
- // Synchronize to ensure we share the same factory
- synchronized(emfService) {
-
- // If EMF service has one that is closed then discard it
- if ((emfService.getEMF() != null) && (!emfService.getEMF().isOpen())) {
- emfService.setEMF(null);
- }
- // If it doesn't have one, then assign it one
- // The first arg must be the props Map
- Map<String,Object> props = (Map<String,Object>)args[0];
- if (emfService.getEMF() == null) {
- emfService.setEMF(createEMF(props));
- }
- // Create a proxy to the EMF in the EMFService
- return Proxy.newProxyInstance(this.getClass().getClassLoader(),
- new Class[] { EntityManagerFactory.class },
- emfService);
- }
- } else {
- // No EMF service (data source was not active). Create our own EMF since we don't have one
- synchronized (this) {
- if (emf == null) {
- emf = createEMF((Map<String,Object>)args[0]);
- }
- }
- return emf;
- }
- }
-}
diff --git a/org.eclipse.jubula.persistence.jpa.osgi/src/org/eclipse/persistence/jpa/osgi/EMFServiceProxyHandler.java b/org.eclipse.jubula.persistence.jpa.osgi/src/org/eclipse/persistence/jpa/osgi/EMFServiceProxyHandler.java
deleted file mode 100644
index 72cde82ea..000000000
--- a/org.eclipse.jubula.persistence.jpa.osgi/src/org/eclipse/persistence/jpa/osgi/EMFServiceProxyHandler.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2013 Oracle and/or its affiliates. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * mkeith - Gemini JPA work
- * ssmith - EclipseLink integration
- ******************************************************************************/
-package org.eclipse.persistence.jpa.osgi;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.spi.PersistenceProvider;
-
-import org.osgi.framework.Bundle;
-import org.osgi.framework.ServiceFactory;
-import org.osgi.framework.ServiceRegistration;
-
-/**
- * Dynamic proxy class to proxy the EMF service
- */
-public class EMFServiceProxyHandler implements InvocationHandler, ServiceFactory {
- protected EntityManagerFactory emf;
- protected PersistenceProvider provider;
- protected String puName;
-
- public EMFServiceProxyHandler(PersistenceProvider provider, String puName) {
- this.provider = provider;
- this.puName = puName;
- }
-
- // May be called by the EMFBuilder service
- EntityManagerFactory getEMF() {
- return this.emf;
- }
-
- void setEMF(EntityManagerFactory emf) {
- this.emf = emf;
- }
-
-
- /*=========================*/
- /* InvocationProxy methods */
- /*=========================*/
-
- // Will only get calls for the methods on the EntityManagerFactory interface
- @SuppressWarnings("unchecked")
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
-
- // If close() invoked then just ignore it
-// if (method.getName().equals("close"))
-// return null;
-
- // Invoke these methods on the actual proxy (not the object it's proxying)
- if (method.getName().equals("hashCode"))
- return this.hashCode();
- if (method.getName().equals("toString"))
- return this.toString();
-
- if (emf == null) {
- synchronized(this) {
- if (emf == null) {
- emf = createEMF(new HashMap<String,Object>());
- }
- }
- }
- // Invoke the EMF method that was called
- Object result = method.invoke(emf,args);
-
- // If the operation was to close the EMF then remove our ref to it
- synchronized(this) {
- if (!emf.isOpen())
- emf = null;
- }
- return result;
- }
-
- /*========================*/
- /* ServiceFactory methods */
- /*========================*/
-
- public Object getService(Bundle b, ServiceRegistration serviceReg) {
- // TODO Track client bundles that use this service and clean up if they leave
- return this;
- }
-
- public void ungetService(Bundle b, ServiceRegistration serviceReg, Object obj) {
- // EMF is shared, leave as is until the p-unit or the provider goes away
- // and the service is unregistered
- }
-
- /*================*/
- /* Helper methods */
- /*================*/
-
- // Use info from the cached pUnitInfo and create a new EMF to store locally
- protected EntityManagerFactory createEMF(Map<String,Object> props) {
- EntityManagerFactory result = this.provider.createEntityManagerFactory(this.puName, props);
- if (result == null)
- fatalError("Proxy could not create EMF " + puName + " from provider " + provider, null);
- return result;
- }
-
- private void fatalError(String string, Object object) {
- // TODO EclipseLink Logging
- System.err.println(this.getClass().getName() + ": " + string + ": " + object);
-
- }
-
-}
-
diff --git a/org.eclipse.jubula.persistence.jpa.osgi/src/org/eclipse/persistence/jpa/osgi/PersistenceProvider.java b/org.eclipse.jubula.persistence.jpa.osgi/src/org/eclipse/persistence/jpa/osgi/PersistenceProvider.java
deleted file mode 100644
index b45f84b40..000000000
--- a/org.eclipse.jubula.persistence.jpa.osgi/src/org/eclipse/persistence/jpa/osgi/PersistenceProvider.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2013 Oracle and/or its affiliates. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * tware, ssmith - OSGi Persistence provider
- ******************************************************************************/
-package org.eclipse.persistence.jpa.osgi;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.spi.PersistenceUnitInfo;
-import org.eclipse.persistence.config.PersistenceUnitProperties;
-import org.eclipse.persistence.exceptions.EntityManagerSetupException;
-
-import org.eclipse.persistence.internal.jpa.deployment.JPAInitializer;
-import org.eclipse.persistence.internal.jpa.deployment.osgi.BundleProxyClassLoader;
-import org.eclipse.persistence.internal.jpa.deployment.osgi.CompositeClassLoader;
-import org.eclipse.persistence.internal.jpa.deployment.osgi.OSGiInitializer;
-import org.eclipse.persistence.internal.localization.LoggingLocalization;
-import org.eclipse.persistence.logging.AbstractSessionLog;
-import org.eclipse.persistence.logging.SessionLog;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-
-/**
- * EclipseLink JPA provider for use in OSGI Environments
- */
-public class PersistenceProvider extends org.eclipse.persistence.jpa.PersistenceProvider{
-
- protected String initializerClassName;
-
- public static final String EQUINOX_INITIALIZER_NAME = "org.eclipse.persistence.internal.jpa.deployment.osgi.equinox.EquinoxInitializer";
- private static final String ORG_ECLIPSE_PERSISTENCE_CORE = "org.eclipse.persistence.core";
-
- // these maps are used to retrieve the classloader used for different bundles
- private static Map<String, Bundle> puToBundle = Collections.synchronizedMap(new HashMap<String,Bundle>());
- private static Map<Bundle, String[]> bundleToPUs = Collections.synchronizedMap(new HashMap<Bundle, String[]>());
-
- private Map<String,ClassLoader> puClassLoaders = new HashMap<String, ClassLoader>();
-
- public PersistenceProvider(){
- }
-
- public PersistenceProvider(String initializerClassName){
- this.initializerClassName = initializerClassName;
- }
-
- @Override
- public EntityManagerFactory createContainerEntityManagerFactory(
- PersistenceUnitInfo info, Map map) {
- throw EntityManagerSetupException.createContainerEntityManagerFactoryNotSupportedInOSGi();
- }
-
- /**
- * Get the initializer class
- * Here we will attempt to build an EquinoxInitializer. It will only be available if the org.eclipse.persistence.jpa.equinox
- * fragment is available. Else, we will return a standard OSGi initializer.
- */
- public JPAInitializer getInitializer(String emName, Map m){
- ClassLoader classLoader = getClassLoader(emName, m);
- JPAInitializer initializer;
- if (this.initializerClassName != null) {
- try {
- // try to build the passed-in initializer. If it is available, we will build it otherwise
- // we will assume generic OSGI
- Class initializerClass = Class.forName(this.initializerClassName);
- Class[] argTypes = new Class[]{ClassLoader.class, Map.class};
- Object[] args = new Object[]{classLoader, m};
- initializer = (JPAInitializer)initializerClass.getConstructor(argTypes).newInstance(args);
- initializer.initialize(m);
- return initializer;
- } catch (Exception exception) {
- AbstractSessionLog.getLog().log(SessionLog.WARNING,
- LoggingLocalization.buildMessage("osgi_initializer_failed", new Object[]{this.initializerClassName, exception}));
- AbstractSessionLog.getLog().logThrowable(SessionLog.WARNING, exception);
- }
- }
- initializer = new OSGiInitializer(classLoader);
- initializer.initialize(m);
- return initializer;
- }
-
-
- /**
- * Add a bundle to the list of bundles managed by this persistence provider
- * The bundle is indexed so it's classloader can be accessed
- * @param bundle
- * @param persistenceUnitNames
- */
- public static void addBundle(Bundle bundle, String[] persistenceUnitNames) {
- for (int i = 0; i < persistenceUnitNames.length; i++) {
- String name = persistenceUnitNames[i];
- puToBundle.put(name, bundle);
- }
- bundleToPUs.put(bundle, persistenceUnitNames);
- }
-
- /**
- * Removed a bundle from the list of bundles managed by this persistence provider
- * This typically happens on deactivation.
- * @param bundle
- */
- public static void removeBundle(Bundle bundle) {
- String[] persistenceUnitNames = bundleToPUs.remove(bundle);
- if (persistenceUnitNames != null) {
- for (int i = 0; i < persistenceUnitNames.length; i++) {
- String name = persistenceUnitNames[i];
- puToBundle.remove(name);
- }
- }
- }
-
- /**
- * Answer the ClassLoader to use to create an EntityManager.
- * The result is a CompositeClassLoader capable of loading
- * classes from the optionally provided ClassLoader, the
- * bundle that provides the persistence unit (i.e., contains the
- * persistence.xml, and EclipseLink classes (since the
- * persistence unit bundle may not have an explicit dependency
- * on EclipseLink).
- *
- * @param persistenceUnitName
- * @param properties
- * @return ClassLoader
- */
- public ClassLoader getClassLoader(String persistenceUnitName, Map properties) {
- // This method is called more than once for the same persistence unit so
- // check to see if a ClassLoader already constructed and if so return it.
- ClassLoader previouslyDefinedLoader = puClassLoaders.get(persistenceUnitName);
- if (previouslyDefinedLoader != null) {
- return previouslyDefinedLoader;
- }
-
- List<ClassLoader> loaders = new ArrayList<ClassLoader>();
- ClassLoader propertyClassLoader = null;
-
- // Look for a ClassLoader in the properties.
- if (properties != null) {
- Object propertyValue = properties.get(PersistenceUnitProperties.CLASSLOADER);
- if ((propertyValue != null) && (propertyValue instanceof ClassLoader)) {
- propertyClassLoader = (ClassLoader)propertyValue;
- loaders.add(propertyClassLoader);
- }
- }
-
- // If a bundle has registered for a persistence unit
- // then wrap the bundle to support the ClassLoader interface.
- Bundle bundle = puToBundle.get(persistenceUnitName);
- if (bundle != null) {
- ClassLoader bundleClassLoader = new BundleProxyClassLoader(bundle);
- loaders.add(bundleClassLoader);
- }
-
- if ((propertyClassLoader == null) && (bundle == null)) {
- throw EntityManagerSetupException.couldNotFindPersistenceUnitBundle(persistenceUnitName);
- }
-
- // Add the EclipseLink Core bundle loader so we can see classes
- // (such as platforms) in fragments,
- BundleContext context = Activator.getContext();
- if (context != null) {
- // context is set in the Activator which may might
- // not be called in an RCP application
- Bundle[] bundles = context.getBundles();
- Bundle coreBundle = null;
- for (int i = 0; i < bundles.length; i++) {
- if (ORG_ECLIPSE_PERSISTENCE_CORE.equals(bundles[i].getSymbolicName())) {
- coreBundle = bundles[i];
- loaders.add(new BundleProxyClassLoader(coreBundle));
- break;
- }
- }
- // Add the EclipseLink JPA bundle ClassLoader so that we can load
- // EclipseLink classes.
- ClassLoader eclipseLinkJpaClassLoader = new BundleProxyClassLoader(context.getBundle());
- loaders.add(eclipseLinkJpaClassLoader);
- }
-
- // If the only classloader is the one passes as a property
- // then no point building a composite--just use the one passed.
- ClassLoader puClassLoader = null;
- if ((loaders.size() == 1) && (loaders.get(0) == propertyClassLoader)) {
- puClassLoader = propertyClassLoader;
- } else {
- puClassLoader = new CompositeClassLoader(loaders);
- Object propertyValue = properties.get(PersistenceUnitProperties.CLASSLOADER);
- if ((propertyValue != null) && (propertyValue instanceof ClassLoader)) {
- properties.put(PersistenceUnitProperties.CLASSLOADER, puClassLoader);
- }
- }
-
- puClassLoaders.put(persistenceUnitName, puClassLoader); // cache to avoid reconstruction
- return puClassLoader;
- }
-
- public static boolean includesBundle(Bundle bundle) {
- return bundleToPUs.containsKey(bundle);
- }
-}
diff --git a/org.eclipse.jubula.project.configuration/target/definitions/juno+nightly.target b/org.eclipse.jubula.project.configuration/target/definitions/juno+nightly.target
index 5ca1f59ac..d47de04d1 100644
--- a/org.eclipse.jubula.project.configuration/target/definitions/juno+nightly.target
+++ b/org.eclipse.jubula.project.configuration/target/definitions/juno+nightly.target
@@ -27,7 +27,7 @@
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.persistence.jpa.feature.group" version="0.0.0"/>
-<repository location="http://download.eclipse.org/rt/eclipselink/milestone-updates/2.5.0.v20130425-368d603_RC1"/>
+<repository location="http://download.eclipse.org/releases/indigo"/>
</location>
</locations>
</target>
diff --git a/org.eclipse.jubula.project.configuration/target/definitions/juno.target b/org.eclipse.jubula.project.configuration/target/definitions/juno.target
index 16924acd9..b8013a941 100644
--- a/org.eclipse.jubula.project.configuration/target/definitions/juno.target
+++ b/org.eclipse.jubula.project.configuration/target/definitions/juno.target
@@ -30,7 +30,7 @@
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.persistence.jpa.feature.group" version="0.0.0"/>
-<repository location="http://download.eclipse.org/rt/eclipselink/milestone-updates/2.5.0.v20130425-368d603_RC1"/>
+<repository location="http://download.eclipse.org/releases/indigo"/>
</location>
</locations>
</target>
diff --git a/org.eclipse.jubula.releng.client/pom.xml b/org.eclipse.jubula.releng.client/pom.xml
index c2ee6730f..b59e86373 100644
--- a/org.eclipse.jubula.releng.client/pom.xml
+++ b/org.eclipse.jubula.releng.client/pom.xml
@@ -23,7 +23,6 @@
<module>../org.eclipse.jubula.feature</module>
<module>../org.eclipse.jubula.feature.source</module>
<module>../org.eclipse.jubula.client.core</module>
- <module>../org.eclipse.jubula.persistence.jpa.osgi</module>
<module>../org.eclipse.jubula.client.ui</module>
<module>../org.eclipse.jubula.client.ui.rcp</module>
<module>../org.eclipse.jubula.client.inspector.ui</module>

Back to the top