private FileStore fileStore;
+ private ExecutorService executorService;
+
public enum StoreType
{
SEGMENT_FILE_TYPE,
IN_MEMORY_TYPE;
}
-
private StoreType storeType = SEGMENT_FILE_TYPE;
- Path repositoryPath = Paths.get( "repository" );
+ private Path repositoryPath = Paths.get( "repository" );
public Repository createRepository()
throws IOException, InvalidFileStoreVersionException
{
+ createExecutor();
NodeStore nodeStore;
if ( SEGMENT_FILE_TYPE == storeType )
{
}
} );
- ExecutorService executorService = createExecutor();
StatisticsProvider statsProvider = StatisticsProvider.NOOP;
int queueSize = Integer.getInteger( "queueSize", 10000 );
File indexDir = Files.createTempDirectory( "archiva_index" ).toFile();
{
fileStore.close();
}
+ if (executorService != null)
+ {
+ executorService.shutdownNow();
+ }
}
public StoreType getStoreType()
}
}
- private ExecutorService createExecutor()
+ private void createExecutor()
{
- return Executors.newCachedThreadPool();
+ if (executorService ==null )
+ {
+ executorService = Executors.newCachedThreadPool();
+ }
+
//
// ThreadPoolExecutor executor =
// new ThreadPoolExecutor( 0, 5, 60L, TimeUnit.SECONDS, new LinkedBlockingQueue<>(),
RepositoryFactory repositoryFactory = new RepositoryFactory();
repositoryFactory.setRepositoryPath( dir.getPath() );
- session = repositoryFactory.createRepository().login(new SimpleCredentials( "admin", "admin".toCharArray()));
+ repositoryFactory.setStoreType( RepositoryFactory.StoreType.IN_MEMORY_TYPE );
+ session = repositoryFactory.createRepository() //
+ .login(new SimpleCredentials( "admin", "admin".toCharArray()));
// TODO: perhaps have an archiva-jcr-utils module shared by these plugins that does this and can contain