EasyBeans is an open source implementation by ObjectWeb of the EJB3 container specification.

Project

Developer

Wiki

About

|
If you were logged in you would be able to see more operations.
|
|
|
|
Environment:
|
Eclipse Equinox 3.4, Red Hat Enterprise Linux 5.2
|
|
|
In the OSGI bundle org.ow2.easybeans.agent, its Activator class org.ow2.easybeans.osgi.agent.Activator looks for a Configuration filtered with "(service.pid=org.ow2.easybeans.configuration)". With the Eclipse Equinox Configuration Admin Service when a Configuration is created with the statement createFactoryConfiguration( "org.ow2.easybeans.configuration", null) the pid is the factoryPid (org.ow2.easybeans.configuration) plus some extra numbers, so the statement listConfigurations("(service.pid=org.ow2.easybeans.configuration)") in this Activator class does not find the Configuration. It would be nice to change this statement to filter on the factoryPid as follows: listConfigurations("(service.factoryPid=org.ow2.easybeans.configuration)"), so that it works with Eclipse Equinox.
|
|
Description
|
In the OSGI bundle org.ow2.easybeans.agent, its Activator class org.ow2.easybeans.osgi.agent.Activator looks for a Configuration filtered with "(service.pid=org.ow2.easybeans.configuration)". With the Eclipse Equinox Configuration Admin Service when a Configuration is created with the statement createFactoryConfiguration( "org.ow2.easybeans.configuration", null) the pid is the factoryPid (org.ow2.easybeans.configuration) plus some extra numbers, so the statement listConfigurations("(service.pid=org.ow2.easybeans.configuration)") in this Activator class does not find the Configuration. It would be nice to change this statement to filter on the factoryPid as follows: listConfigurations("(service.factoryPid=org.ow2.easybeans.configuration)"), so that it works with Eclipse Equinox. |
Show » |
|
An example of working code is:
ServiceReference configAdminReference = context
.getServiceReference(ConfigurationAdmin.class.getName());
if (configAdminReference == null)
throw new IllegalStateException(
"The OSGi ConfigAdmin Service is not available.");
Dictionary<String, String> props = new Hashtable<String, String>();
props.put("configuration.content", getXMLContent(context));
ConfigurationAdmin configAdminService = (ConfigurationAdmin) context
.getService(configAdminReference);
Configuration config = configAdminService
.getConfiguration("org.ow2.easybeans.configuration");
config.update(props);