use of javax.annotation.PostConstruct in project indy by Commonjava.
the class InfinispanGalleyStorageProvider method setup.
@PostConstruct
public void setup() {
SpecialPathInfo infoSpi = SpecialPathInfo.from(new FilePatternMatcher(".+\\.info")).setDecoratable(false).setDeletable(false).setListable(false).setPublishable(false).setRetrievable(false).setStorable(false).build();
specialPathManager.registerSpecialPathInfo(infoSpi);
transferDecorator = new ChecksummingTransferDecorator(Collections.singleton(TransferOperation.GENERATE), specialPathManager, new Md5GeneratorFactory(), new Sha1GeneratorFactory());
this.cacheProvider = new GridFileSystemCacheProvider(pathGenerator, fileEventManager, transferDecorator, cacheFs);
}
use of javax.annotation.PostConstruct in project indy by Commonjava.
the class TestProvider method init.
@PostConstruct
public void init() {
try {
this.storageProviderConfig = new DefaultStorageProviderConfiguration(TEMP.newFolder("storage"));
this.dataConfig = new DataFileConfiguration(TEMP.newFolder("data"), TEMP.newFolder("work"));
} catch (final IOException e) {
e.printStackTrace();
Assert.fail("Failed to setup temporary directory structures: " + e.getMessage());
}
this.nfc = new MemoryNotFoundCache();
this.xmlInfra = new XMLInfrastructure();
this.typeMapper = new StandardTypeMapper();
this.indyConfig = new DefaultIndyConfiguration();
this.objectMapper = new IndyObjectMapper(true);
}
use of javax.annotation.PostConstruct in project indy by Commonjava.
the class RevisionsManager method setup.
@PostConstruct
public void setup() {
try {
final File dataDir = dataFileManager.getDetachedDataBasedir();
final File gitignore = new File(dataDir, ".gitignore");
dataDir.mkdirs();
FileUtils.write(gitignore, join(DATA_DIR_GITIGNORES, "\n"));
final GitConfig dataConf = new GitConfig(dataDir, revisionsConfig.getDataUpstreamUrl(), true).setRemoteBranchName(revisionsConfig.getBranchName()).setUserEmail(revisionsConfig.getUserEmail());
dataFileGit = new GitManager(dataConf);
} catch (GitSubsystemException | IOException e) {
throw new IllegalStateException("Failed to start revisions manager: " + e.getMessage(), e);
} finally {
}
}
use of javax.annotation.PostConstruct in project indy by Commonjava.
the class IndyMetricsManager method initMetric.
@PostConstruct
public void initMetric() {
if (!config.isMetricsEnabled())
return;
IndyJVMInstrumentation.init(metricRegistry);
IndyHealthCheckRegistrySet healthCheckRegistrySet = new IndyHealthCheckRegistrySet();
indyMetricsHealthChecks.forEach(indyHealthCheck -> {
healthCheckRegistrySet.register(indyHealthCheck.getName(), (HealthCheck) indyHealthCheck);
});
try {
metricRegistry.register(healthCheckRegistrySet.getName(), healthCheckRegistrySet);
reporter.initReporter(metricRegistry);
} catch (Exception e) {
logger.error(e.getMessage());
throw new RuntimeException(e);
}
}
use of javax.annotation.PostConstruct in project indy by Commonjava.
the class CoreServerProvider method init.
@PostConstruct
public void init() {
try {
folder.create();
this.nfc = new MemoryNotFoundCache();
this.dataFileManager = new DataFileManager(new DataFileConfiguration(folder.newFolder("indy-data")), dataFileEvents);
this.storeManager = new DataFileStoreDataManager(dataFileManager, objectMapper, storeDispatch, new DefaultIndyConfiguration());
storageConfig.setStorageRootDirectory(folder.newFolder("indy-storage"));
this.xml = new XMLInfrastructure();
this.typeMapper = new StandardTypeMapper();
} catch (IOException e) {
throw new IllegalStateException("Failed to start core server provider: " + e.getMessage(), e);
} finally {
}
}
Aggregations