sonatype/nexus-oss — pull request #860 by cwilper (2014-11-12 18:59:07+00:00)
Title: [NEXUS-7657] Make rawcontent use ComponentStore

https://issues.sonatype.org/browse/NEXUS-7657

This gets rid of the direct orientdb/blobstore stuff and goes against the new ComponentStore.

Implementation note: With this change, AssetAdapters and ComponentAdapters are still registered automatically via sisu Mediators, but the storage classes are created lazily so we can be sure the requisite DatabaseInstance is initialized. However, note that we can't create them *too* late, because if a transaction is open against orient, it is not possible to make schema changes. So they are created by the new ComponentStore interface method, prepareStorage, so that components that need them to exist can request that they're created when the component initializes. See RawBinaryStoreImpl.on(NexusInitializedEvent) for example. Together, this ensures that the underlying storage classes are created at just the right time, if needed. Making this a bit cleaner should be possible after NEXUS-7303 (support for @PostConstruct and @PreDestroy) is implemented.