Search in sources :

Example 76 with PostConstruct

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);
}
Also used : Sha1GeneratorFactory(org.commonjava.maven.galley.io.checksum.Sha1GeneratorFactory) GridFileSystemCacheProvider(org.commonjava.maven.galley.cache.infinispan.GridFileSystemCacheProvider) FilePatternMatcher(org.commonjava.maven.galley.model.FilePatternMatcher) SpecialPathInfo(org.commonjava.maven.galley.model.SpecialPathInfo) ChecksummingTransferDecorator(org.commonjava.maven.galley.io.ChecksummingTransferDecorator) Md5GeneratorFactory(org.commonjava.maven.galley.io.checksum.Md5GeneratorFactory) PostConstruct(javax.annotation.PostConstruct)

Example 77 with PostConstruct

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);
}
Also used : DefaultStorageProviderConfiguration(org.commonjava.indy.filer.def.conf.DefaultStorageProviderConfiguration) IndyObjectMapper(org.commonjava.indy.model.core.io.IndyObjectMapper) DataFileConfiguration(org.commonjava.indy.subsys.datafile.conf.DataFileConfiguration) XMLInfrastructure(org.commonjava.maven.galley.maven.parse.XMLInfrastructure) MemoryNotFoundCache(org.commonjava.maven.galley.nfc.MemoryNotFoundCache) IOException(java.io.IOException) StandardTypeMapper(org.commonjava.maven.galley.maven.internal.type.StandardTypeMapper) DefaultIndyConfiguration(org.commonjava.indy.conf.DefaultIndyConfiguration) PostConstruct(javax.annotation.PostConstruct)

Example 78 with PostConstruct

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 {
    }
}
Also used : GitManager(org.commonjava.indy.subsys.git.GitManager) GitConfig(org.commonjava.indy.subsys.git.GitConfig) GitSubsystemException(org.commonjava.indy.subsys.git.GitSubsystemException) IOException(java.io.IOException) DataFile(org.commonjava.indy.subsys.datafile.DataFile) File(java.io.File) PostConstruct(javax.annotation.PostConstruct)

Example 79 with PostConstruct

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);
    }
}
Also used : IndyHealthCheckRegistrySet(org.commonjava.indy.metrics.healthcheck.IndyHealthCheckRegistrySet) PostConstruct(javax.annotation.PostConstruct)

Example 80 with PostConstruct

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 {
    }
}
Also used : DataFileStoreDataManager(org.commonjava.indy.flat.data.DataFileStoreDataManager) DataFileManager(org.commonjava.indy.subsys.datafile.DataFileManager) DataFileConfiguration(org.commonjava.indy.subsys.datafile.conf.DataFileConfiguration) XMLInfrastructure(org.commonjava.maven.galley.maven.parse.XMLInfrastructure) MemoryNotFoundCache(org.commonjava.maven.galley.nfc.MemoryNotFoundCache) IOException(java.io.IOException) DefaultIndyConfiguration(org.commonjava.indy.conf.DefaultIndyConfiguration) StandardTypeMapper(org.commonjava.maven.galley.maven.internal.type.StandardTypeMapper) PostConstruct(javax.annotation.PostConstruct)

Aggregations

PostConstruct (javax.annotation.PostConstruct)248 IOException (java.io.IOException)28 File (java.io.File)18 SamlRegisteredService (org.apereo.cas.support.saml.services.SamlRegisteredService)17 Map (java.util.Map)15 ArrayList (java.util.ArrayList)12 ExternalResource (com.vaadin.server.ExternalResource)11 HashMap (java.util.HashMap)10 InitialContext (javax.naming.InitialContext)9 Label (com.vaadin.ui.Label)8 VerticalLayout (com.vaadin.ui.VerticalLayout)8 Request (com.nabalive.framework.web.Request)7 Response (com.nabalive.framework.web.Response)7 Route (com.nabalive.framework.web.Route)7 Link (com.vaadin.ui.Link)7 Properties (java.util.Properties)7 Method (java.lang.reflect.Method)5 InputStream (java.io.InputStream)4 URISyntaxException (java.net.URISyntaxException)4 Path (java.nio.file.Path)4