Map parameters = new HashMap(); parameters.put("com.vendor.address", "vendor://localhost:9999/repo"); Repository repo = null; for (RepositoryFactory factory : ServiceLoader.load(RepositoryFactory.class)) { repo = factory.getRepository(parameters); if (repo != null) { // factory accepted parameters break; } }
Note: on Java SE prior to version 6, one may use the {@link javax.imageio.spi.ServiceRegistry ServiceRegistry} class to look upthe available RepositoryFactory
implementations.
@since JCR 2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|