Source:
<code>private <K, V> OffHeapDiskStore<K, V> createStoreInternal(Configuration<K, V> storeConfig, StoreEventDispatcher<K, V> eventDispatcher, ServiceConfiguration<?>... serviceConfigs) { if (serviceProvider == null) { throw new NullPointerException("ServiceProvider is null in OffHeapDiskStore.Provider."); } <START> if (diskPersistenceService == null) { <END> throw new IllegalStateException("No LocalPersistenceService could be found - did you configure it at the CacheManager level?"); } TimeSource timeSource = serviceProvider.getService(TimeSourceService.class).getTimeSource(); ExecutionService executionService = serviceProvider.getService(ExecutionService.class); SizedResourcePool diskPool = storeConfig.getResourcePools().getPoolForResource(ResourceType.Core.DISK); if (!(diskPool.getUnit() instanceof MemoryUnit)) { throw new IllegalArgumentException("OffHeapDiskStore only supports resources configuration expressed in \"memory\" unit"); } MemoryUnit unit = (MemoryUnit)diskPool.getUnit(); String threadPoolAlias; int writerConcurrency; OffHeapDiskStoreConfiguration config = findSingletonAmongst(OffHeapDiskStoreConfiguration.class, serviceConfigs); if (config == null) { threadPoolAlias = defaultThreadPool; writerConcurrency = 1; } else { threadPoolAlias = config.getThreadPoolAlias(); writerConcurrency = config.getWriterConcurrency(); } PersistenceSpaceIdentifier space = findSingletonAmongst(PersistenceSpaceIdentifier.class, (Object[]) serviceConfigs); try { FileBasedPersistenceContext persistenceContext = diskPersistenceService.createPersistenceContextWithin(space , "offheap-disk-store"); OffHeapDiskStore<K, V> offHeapStore = new OffHeapDiskStore<K, V>(persistenceContext, executionService, threadPoolAlias, writerConcurrency, storeConfig, timeSource, eventDispatcher, unit.toBytes(diskPool.getSize())); createdStores.add(offHeapStore); return offHeapStore; } catch (CachePersistenceException cpex) { throw new RuntimeException("Unable to create persistence context in " + space, cpex); } }</code><technical_language>error sense - do check in start instead</technical_language>

Target:
private <K, V> OffHeapDiskStore<K, V> createStoreInternal(Configuration<K, V> storeConfig, StoreEventDispatcher<K, V> eventDispatcher, ServiceConfiguration<?>... serviceConfigs) { if (serviceProvider == null) { throw new NullPointerException("ServiceProvider is null in OffHeapDiskStore.Provider."); } TimeSource timeSource = serviceProvider.getService(TimeSourceService.class).getTimeSource(); ExecutionService executionService = serviceProvider.getService(ExecutionService.class); SizedResourcePool diskPool = storeConfig.getResourcePools().getPoolForResource(ResourceType.Core.DISK); if (!(diskPool.getUnit() instanceof MemoryUnit)) { throw new IllegalArgumentException("OffHeapDiskStore only supports resources configuration expressed in \"memory\" unit"); } MemoryUnit unit = (MemoryUnit)diskPool.getUnit(); String threadPoolAlias; int writerConcurrency; OffHeapDiskStoreConfiguration config = findSingletonAmongst(OffHeapDiskStoreConfiguration.class, (Object[]) serviceConfigs); if (config == null) { threadPoolAlias = defaultThreadPool; writerConcurrency = 1; } else { threadPoolAlias = config.getThreadPoolAlias(); writerConcurrency = config.getWriterConcurrency(); } PersistenceSpaceIdentifier<?> space = findSingletonAmongst(PersistenceSpaceIdentifier.class, (Object[]) serviceConfigs); if (space == null) { throw new IllegalStateException("No LocalPersistenceService could be found - did you configure it at the CacheManager level?"); } try { FileBasedPersistenceContext persistenceContext = diskPersistenceService.createPersistenceContextWithin(space , "offheap-disk-store"); OffHeapDiskStore<K, V> offHeapStore = new OffHeapDiskStore<K, V>(persistenceContext, executionService, threadPoolAlias, writerConcurrency, storeConfig, timeSource, eventDispatcher, unit.toBytes(diskPool.getSize())); createdStores.put(offHeapStore, space); return offHeapStore; } catch (CachePersistenceException cpex) { throw new RuntimeException("Unable to create persistence context in " + space, cpex); } }