this.rpcService = rpcService;
this.dbCreator = dbCreator;
this.initialContextInitializer = initialContextInitializer;
// register commands
reserveRepositoryName = rpcService.registerCommand(new RemoteCommand()
{
public String getId()
{
return "org.exoplatform.services.jcr.ext.repository.creation.RepositoryCreationServiceImpl-reserveRepositoryName";
}
public Serializable execute(Serializable[] args) throws Throwable
{
String repositoryName = (String)args[0];
return reserveRepositoryNameLocally(repositoryName);
}
});
createRepository = rpcService.registerCommand(new RemoteCommand()
{
public String getId()
{
return "org.exoplatform.services.jcr.ext.repository.creation.RepositoryCreationServiceImpl-createRepository";
}
public Serializable execute(Serializable[] args) throws Throwable
{
//String backupId, RepositoryEntry rEntry, String rToken
String backupId = (String)args[0];
String stringRepositoryEntry = (String)args[1];
String rToken = (String)args[2];
try
{
RepositoryEntry rEntry =
(RepositoryEntry)(getObject(RepositoryEntry.class, stringRepositoryEntry
.getBytes(Constants.DEFAULT_ENCODING)));
createRepositoryLocally(backupId, rEntry, rToken);
return null;
}
finally
{
// release tokens
pendingRepositories.remove(rToken);
}
}
});
startRepository = rpcService.registerCommand(new RemoteCommand()
{
public String getId()
{
return "org.exoplatform.services.jcr.ext.repository.creation.RepositoryCreationServiceImpl-startRepository";
}