use of org.exist.storage.BrokerPoolServiceException in project exist by eXist-db.
the class SecurityManagerImpl method prepare.
@Override
public void prepare(final BrokerPool brokerPool) throws BrokerPoolServiceException {
try {
this.defaultRealm = new RealmImpl(null, this, null);
realms.add(defaultRealm);
this.systemSubject = new AtomicLazyVal<>(() -> new SubjectAccreditedImpl(defaultRealm.ACCOUNT_SYSTEM, this));
this.guestSubject = new AtomicLazyVal<>(() -> new SubjectAccreditedImpl((AccountImpl) defaultRealm.getAccount(SecurityManager.GUEST_USER), this));
} catch (final EXistException e) {
throw new BrokerPoolServiceException(e);
}
}
use of org.exist.storage.BrokerPoolServiceException in project exist by eXist-db.
the class ExistRepository method prepare.
@Override
public void prepare(final BrokerPool brokerPool) throws BrokerPoolServiceException {
if (!Files.exists(expathDir)) {
moveOldRepo(brokerPool.getConfiguration().getExistHome(), expathDir);
}
try {
Files.createDirectories(expathDir);
} catch (final IOException e) {
throw new BrokerPoolServiceException("Unable to access EXPath repository", e);
}
LOG.info("Using directory {} for expath package repository", expathDir.toAbsolutePath().toString());
try {
final FileSystemStorage storage = new FileSystemStorage(expathDir);
storage.setErrorIfNoContentDir(false);
this.myParent = new Repository(storage);
myParent.registerExtension(new ExistPkgExtension());
} catch (final PackageException e) {
throw new BrokerPoolServiceException("Unable to prepare EXPath Package Repository: " + expathDir.toAbsolutePath().toString(), e);
}
}
use of org.exist.storage.BrokerPoolServiceException in project exist by eXist-db.
the class QuartzSchedulerImpl method prepare.
@Override
public void prepare(final BrokerPool brokerPool) throws BrokerPoolServiceException {
// NOTE: we create the scheduler in a separate thread with its own thread-group so that the thread group is used by Quartz
final ThreadGroup instanceQuartzThreadGroup = newInstanceSubThreadGroup(brokerPool, "scheduler.quartz-simple-thread-pool");
final QuartzSchedulerCreator creator = new QuartzSchedulerCreator(getQuartzProperties());
final Thread schedulerCreatorThread = new Thread(instanceQuartzThreadGroup, creator, nameInstanceThread(brokerPool, "prepare-quartz-scheduler"));
schedulerCreatorThread.start();
try {
schedulerCreatorThread.join();
this.scheduler = creator.getScheduler().valueOrThrow(e -> new BrokerPoolServiceException("Unable to create Scheduler: " + e.getMessage(), e));
} catch (final InterruptedException e) {
// restore interrupted state
Thread.currentThread().interrupt();
throw new BrokerPoolServiceException("Unable to create Scheduler: " + e.getMessage(), e);
}
}
Aggregations