On 07 Jun 2022, at 14:22, Graham Leggett <minf...@sharp.fm.INVALID> wrote:

>    <Resource 
>        name="jcr/GlobalRepository"
>        auth="Container"
>        type="javax.jcr.Repository" 
>        factory=“[Something undocumented goes here]" 
>        url="[The RMI URL of the repository]"
> 
> I am stuck at "Something undocumented goes here”.

Trying factories at random and following the exceptions I have worked out that 
a factory that is visible through JNDI has to implement the following interface:

javax.naming.spi.ObjectFactory

A search for implementations show up three options:

jackrabbit-core/src/main/java/org/apache/jackrabbit/core/jndi/BindableRepositoryFactory.java
 
<https://github.com/apache/jackrabbit/blob/ed3124e5fe223dada33ce6ddf53bc666063c3f2f/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/jndi/BindableRepositoryFactory.java>
 - useful for testing, not useful in my case.
jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientRepositoryFactory.java
 
<https://github.com/apache/jackrabbit/blob/ed3124e5fe223dada33ce6ddf53bc666063c3f2f/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientRepositoryFactory.java>
 - I understand RMI is obsolete.
jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/RepositoryImpl.java
 
<https://github.com/apache/jackrabbit/blob/ed3124e5fe223dada33ce6ddf53bc666063c3f2f/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/RepositoryImpl.java>
 - looks promising, but exposes weird internals that seems wrong (impl?)

Google is giving me endless copies of javadocs (the whole idea of factories is 
impossible to google) or copies of sources, so any docs if they exist are lost.

Am I on the right track, or does no one use the JCR API and instead just hard 
codes Jackrabbit directly into apps?

Regards,
Graham
—

Reply via email to