Search in sources :

Example 1 with PartyLineCacheProvider

use of org.commonjava.maven.galley.cache.partyline.PartyLineCacheProvider in project galley by Commonjava.

the class FastLocalCacheProviderFactory method create.

@Override
public synchronized CacheProvider create(PathGenerator pathGenerator, TransferDecorator transferDecorator, FileEventManager fileEventManager) throws GalleyInitException {
    if (provider == null) {
        PartyLineCacheProvider pl = new PartyLineCacheProvider(cacheDir, pathGenerator, fileEventManager, transferDecorator);
        provider = new FastLocalCacheProvider(pl, nfsUsageCache, pathGenerator, fileEventManager, transferDecorator, executor, nfsDir.getPath());
    }
    return provider;
}
Also used : PartyLineCacheProvider(org.commonjava.maven.galley.cache.partyline.PartyLineCacheProvider)

Example 2 with PartyLineCacheProvider

use of org.commonjava.maven.galley.cache.partyline.PartyLineCacheProvider in project galley by Commonjava.

the class FastLocalCacheProviderTest method testConstructorWitNFSSysPath.

@Test
public void testConstructorWitNFSSysPath() throws IOException {
    System.setProperty(FastLocalCacheProvider.NFS_BASE_DIR_KEY, temp.newFolder().getCanonicalPath());
    new FastLocalCacheProvider(new PartyLineCacheProvider(temp.newFolder(), pathgen, events, decorator), new SimpleCacheInstance<>("test", cache), pathgen, events, decorator, executor, null);
}
Also used : PartyLineCacheProvider(org.commonjava.maven.galley.cache.partyline.PartyLineCacheProvider) Test(org.junit.Test)

Example 3 with PartyLineCacheProvider

use of org.commonjava.maven.galley.cache.partyline.PartyLineCacheProvider in project galley by Commonjava.

the class FastLocalCacheProviderTest method testConstructorWitNoNFSSysPath.

@Test(expected = java.lang.IllegalArgumentException.class)
public void testConstructorWitNoNFSSysPath() throws IOException {
    Properties props = System.getProperties();
    props.remove(FastLocalCacheProvider.NFS_BASE_DIR_KEY);
    System.setProperties(props);
    final String NON_EXISTS_PATH = "";
    new FastLocalCacheProvider(new PartyLineCacheProvider(temp.newFolder(), pathgen, events, decorator), new SimpleCacheInstance<>("test", cache), pathgen, events, decorator, executor, NON_EXISTS_PATH);
}
Also used : PartyLineCacheProvider(org.commonjava.maven.galley.cache.partyline.PartyLineCacheProvider) Properties(java.util.Properties) Test(org.junit.Test)

Example 4 with PartyLineCacheProvider

use of org.commonjava.maven.galley.cache.partyline.PartyLineCacheProvider in project galley by Commonjava.

the class TestCDIProvider method start.

@PostConstruct
public void start() {
    try {
        temp.create();
        cacheProvider = new PartyLineCacheProvider(temp.newFolder(), pathGenerator, eventManager, transferDecorator);
        fileTransportConfig = new FileTransportConfig(temp.newFolder(), pathGenerator);
    } catch (IOException e) {
        Assert.fail("Failed to init temp folder fro file cache.");
    }
    locationExpander = new NoOpLocationExpander();
    locationResolver = new SimpleUrlLocationResolver(locationExpander, transportManager);
    globalHttpConfiguration = new GlobalHttpConfiguration();
    weftConfig = new DefaultWeftConfig();
}
Also used : SimpleUrlLocationResolver(org.commonjava.maven.galley.transport.SimpleUrlLocationResolver) DefaultWeftConfig(org.commonjava.cdi.util.weft.config.DefaultWeftConfig) FileTransportConfig(org.commonjava.maven.galley.filearc.FileTransportConfig) GlobalHttpConfiguration(org.commonjava.maven.galley.transport.htcli.conf.GlobalHttpConfiguration) PartyLineCacheProvider(org.commonjava.maven.galley.cache.partyline.PartyLineCacheProvider) IOException(java.io.IOException) NoOpLocationExpander(org.commonjava.maven.galley.transport.NoOpLocationExpander) PostConstruct(javax.annotation.PostConstruct)

Example 5 with PartyLineCacheProvider

use of org.commonjava.maven.galley.cache.partyline.PartyLineCacheProvider in project galley by Commonjava.

the class FastLocalCacheProviderConcurrentTest method setup.

@Before
public void setup() throws Exception {
    final String nfsBasePath = createNFSBaseDir(temp.newFolder().getCanonicalPath());
    plProvider = new PartyLineCacheProvider(temp.newFolder(), pathgen, events, decorator);
    provider = new FastLocalCacheProvider(plProvider, new SimpleCacheInstance<>("test", cache), pathgen, events, decorator, executor, nfsBasePath);
}
Also used : PartyLineCacheProvider(org.commonjava.maven.galley.cache.partyline.PartyLineCacheProvider) Before(org.junit.Before)

Aggregations

PartyLineCacheProvider (org.commonjava.maven.galley.cache.partyline.PartyLineCacheProvider)5 Test (org.junit.Test)2 IOException (java.io.IOException)1 Properties (java.util.Properties)1 PostConstruct (javax.annotation.PostConstruct)1 DefaultWeftConfig (org.commonjava.cdi.util.weft.config.DefaultWeftConfig)1 FileTransportConfig (org.commonjava.maven.galley.filearc.FileTransportConfig)1 NoOpLocationExpander (org.commonjava.maven.galley.transport.NoOpLocationExpander)1 SimpleUrlLocationResolver (org.commonjava.maven.galley.transport.SimpleUrlLocationResolver)1 GlobalHttpConfiguration (org.commonjava.maven.galley.transport.htcli.conf.GlobalHttpConfiguration)1 Before (org.junit.Before)1