Marcel Offermans wrote:
Enrique Rodriguez wrote:
...
Yes, we had talked with Michel about having store options for Prefs,
namely JNDI-backed and file-based. ApacheDS is admittedly overkill
for most scenarios.
Given the broad area of application of OSGi I think there is a
considerable interest in at least some type of "centralized" storage.
Interesting. We will certainly continue to support LDAP-backed stores.
The R3 code in Directory is sitting in my sandbox. Just got to get
around to moving it over, updating to R4 and M2.
Perhaps we can start by creating a sandbox in Felix to move all this
code to, and from there on try to work together to design an interface.
Yes, we can start setting up as soon as we have repo access back.
Regarding the use of JNDI as the store interface I don't recommend it,
as it won't be a simple CRUD interface for file or other database
stores. In fact, in my work with JNDI, such as the R3 services at
Directory, I still provide an additional "store" layer that
encapsulates the JNDI code. This is no different than the JDBC-DAO
relationship.
Do you already have a proposal for such a simple CRUD interface? If so
we can take that as a starting point.
Here's what I'm currently using, below. Note that the
ConfigurationListener is *NOT* the R4 ConfigurationListener. With our
JNDI-store you manage configuration with the LDAP-protocol so our CM
service needs a way to know about changes to configuration in the
directory (DIT). With JNDI's EventDirContext, changes to the DIT
generate an event which the CM listens for to trigger re-reads and
subsequent dispatching of possibly updated configuration.
public interface ConfigurationStore
{
public String getNewPid( String factoryPid ) throws IOException;
public Configuration getNewConfiguration( String bundleLocation,
String factoryPid, String servicePid );
public Configuration getNewConfiguration( String bundleLocation,
String factoryPid, String servicePid,
ConfigurationDictionary properties );
public List listPids();
public List listConfigurations( String filter ) throws IOException,
InvalidSyntaxException;
public ConfigurationDictionary load( String pid ) throws IOException;
public List loadAll( String factoryPid ) throws IOException;
public void store( String pid, String factoryPid, Dictionary
configuration ) throws IOException;
public ConfigurationDictionary delete( String pid ) throws IOException;
public void deleteAll( String factoryPid ) throws IOException;
public void setConfigurationListener( ConfigurationListener
configurationListener );
}
Enrique