Copying part of one of Martin's responses on mailing list...
Ok, to give some background information, I will cite a section of the
"OSGI Service Platform Release 4, Enterprise Specification Version 4.2":
127.5.1 Managed Model
A JPA Provider that supports running in managed mode should register a
specific service for the Java EE Containers: the Persistence Provider
service. The interface is the standard JPA PersistenceProvider interface.
See Dependencies on page 402 for the issues around the multiple versions
that this specification supports.
The service must be registered with the following service property:
javax.persistence.provider – The JPA Provider implementation class name, a
documented name for all JPA Providers.
The Persistence Provider service enables a Java EE Container to find a
particular JPA Provider. This service is intended for containers only, not
for Client Bundles because there are implicit assumptions
in the JPA Providers about the Java EE environment. A Java EE Container
must obey the life cycle of the Persistence Provider service. If this
service is unregistered then it must close all connections and
clean up the corresponding resources.
This means we need to generate a service which announces the existence of
a new persistence provider. There are in general two ways:
The programmatic way:
Create a BundleActivator.class which generates the service.
Add the Bundle-Activator (needed) and Export-Service (only informative
nature) manifest headers
A non complete example could be:
--------------------------
Create a blueprint.xml file to describe and announce the service (See
OSGI Enterprise Specification Version 4.2 - Section 121 for more
information about blueprint)
The file must be located under OSGI-INF/blueprint
Add the Export-Service manifest headers (only informative nature)
Some background about blueprint bundles:
121.3 Blueprint Life-Cycle
A bundle is a Blueprint bundle if it contains one or more blueprint XML
definition resources in the OSGI-INF/blueprint directory or it contains
the Bundle-Blueprint manifest header referring to existing resources.
A non complete Example could be:
--------------------------
Copying part of one of Martin's responses on mailing list...
Ok, to give some background information, I will cite a section of the
"OSGI Service Platform Release 4, Enterprise Specification Version 4.2":
This means we need to generate a service which announces the existence of
a new persistence provider. There are in general two ways:
The programmatic way:
nature) manifest headers
A non complete example could be:
--------------------------
--------------------------
The descriptive way:
OSGI Enterprise Specification Version 4.2 - Section 121 for more
information about blueprint)
Some background about blueprint bundles:
A non complete Example could be:
--------------------------
--------------------------
I prefer the descriptive way - but I am open for discussions.