Hi,
*I have a program which registers,starts the repository and then
exposes it as remote repository by following code :
*
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"org.apache.jackrabbit.core.jndi.provider.DummyInitialContextFactory");
env.put(Context.PROVIDER_URL, "localhost");
InitialContext ctx = new InitialContext(env);
RegistryHelper.registerRepository(ctx, REPOSITORY_NAME,
REPOSITORY_CONFIG, REPOSITORY_DIR, true);
repository = (Repository) ctx.lookup(REPOSITORY_NAME);
//bind repository
ServerAdapterFactory factory = new ServerAdapterFactory();
RemoteRepository remote =
factory.getRemoteRepository(repository);
Registry reg = LocateRegistry.createRegistry(new
Integer(REPOSITORY_PORT).intValue());
reg.rebind("jackrabbit", remote);
*Now , I want a module to shutdown the above repository. I have tried
the following :*
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"org.apache.jackrabbit.core.jndi.provider.DummyInitialContextFactory");
env.put(Context.PROVIDER_URL, "localhost");
InitialContext ctx = new InitialContext(env);
repository = (Repository) ctx.lookup(REPOSITORY_NAME);
RegistryHelper.unregisterRepository(ctx,REPOSITORY_NAME);
*But the above is not able to do a lookup for the repository.
Then tried looking up as via RMI url :*
ClientRepositoryFactory factory = new ClientRepositoryFactory();
try{
repository =
factory.getRepository("rmi://localhost:1101/jackrabbit");
}catch(Exception e){
System.out.println(e.getMessage());
e.printStackTrace();
}
*But here RemoteRepository does not have a method to shutdown !!
Is there some other way to shutdown the repository ?*
Thanks,
Ruchi