-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/44242/#review121586
-----------------------------------------------------------




geode-core/src/main/java/com/gemstone/gemfire/distributed/ServerLauncher.java 
(line 716)
<https://reviews.apache.org/r/44242/#comment183321>

    The assignment to the ServerLauncher.cache instance variable should be done 
here, outside of the createCache(:Properties) method.
    
    This both simplifies (unit) testing as well as subclassing, especially 
since the createCache(..) method is part of the ServerLauncher API.



geode-core/src/main/java/com/gemstone/gemfire/distributed/ServerLauncher.java 
(line 787)
<https://reviews.apache.org/r/44242/#comment183329>

    Ideally, the cache creation logic of this method should be consistent, i.e. 
always by way of Service Provider.
    
    In that case, even Geode could provide a "default" implementation based on 
the logic in "startWithGemFireApi(:Properties") rather than the 
createCache(:Properties) method delegating to this method directly.  So, 
replace the startWithGemFireApi(:Properties) with a, for example, 
GeodeApiServerLauncherCacheProvider.
    
    However, you would need additional logic to determine provider precedence, 
which could be based (partially) on which options the user selected in Gfsh 
when calling 'start server' (e.g. gfsh>start server --name=Example 
--spring-xml-location=..., thus use the 
SpringDataGemFireServerLauncherCacheProvider, or gfsh>start server 
--name=AnotherExample --cache-xml-file=..., so use the 
GeodeApiServerLauncherCacheProvider).



geode-core/src/main/java/com/gemstone/gemfire/distributed/ServerLauncher.java 
(line 792)
<https://reviews.apache.org/r/44242/#comment183323>

    The "provided" cache instance should be returned rather than assigned to 
the ServerLauncher's state for subclassing/testing purposes.



geode-core/src/main/java/com/gemstone/gemfire/distributed/ServerLauncherCacheProvider.java
 (line 32)
<https://reviews.apache.org/r/44242/#comment183333>

    Probably, we can simplify this interface to...
    
    Cache createCache(ServerLauncher serverLauncher);
    
    Since getProperties() as well as 
getDistributedSystemProperties(:Properties) methods are both public, along with 
other public methods, we can access everything we need from the ServerLauncher 
API itself.



geode-core/src/test/java/com/gemstone/gemfire/distributed/MockServerLauncherCacheProvider.java
 (line 36)
<https://reviews.apache.org/r/44242/#comment183332>

    Remove unecessary default constructor, especially since it only contains a 
TODO and no actual initialization logic.


- John Blum


On March 2, 2016, 12:57 a.m., Dan Smith wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/44242/
> -----------------------------------------------------------
> 
> (Updated March 2, 2016, 12:57 a.m.)
> 
> 
> Review request for geode, Jason Huynh, Jens Deppe, and John Blum.
> 
> 
> Repository: geode
> 
> 
> Description
> -------
> 
> Removing the direct use of Spring Data Gemfire from within the geode
> code. Replacing it with a SPI that allows the user to override the
> behavior of ServerLauncher.start with their own implementation that
> creates a cache.
> 
> Spring Data Gemfire can provide an implementation that bootstraps the
> cache using spring, if spring-xml-location is specified.
> 
> Users should implement ServerLauncherCacheProvider. The cache will be
> created by the first provider that returns a non null cache. If no
> providers create a cache, the cache will be created by the
> ServerLauncher itself.
> 
> It would be nice to move the spring-xml-location parameter itself into
> the interface, but this is hard to do because gfsh determines the
> parameters to start-server by looking at the arguments in the command
> class. So I left spring-xml-location alone.
> 
> Removing the spring data jar from the compile time dependencies. I've
> moved it to the geode-assembly project, so it is still shipped for the
> moment.
> 
> 
> Diffs
> -----
> 
>   geode-assembly/build.gradle 14febbdd6b7dd3c05f5c0aa12d86aa7cb7beccd1 
>   geode-core/build.gradle 1aa07eea733204386713e92fe7127c5303cb0d84 
>   
> geode-core/src/main/java/com/gemstone/gemfire/distributed/ServerLauncher.java 
> 4f43370d837542daeb99962cd419fdce937ca5ed 
>   
> geode-core/src/main/java/com/gemstone/gemfire/distributed/ServerLauncherCacheProvider.java
>  PRE-CREATION 
>   
> geode-core/src/test/java/com/gemstone/gemfire/distributed/LauncherTestSuite.java
>  73a23374b82f998780ae8c757d869446dcfaca71 
>   
> geode-core/src/test/java/com/gemstone/gemfire/distributed/MockServerLauncherCacheProvider.java
>  PRE-CREATION 
>   
> geode-core/src/test/java/com/gemstone/gemfire/distributed/ServerLauncherWithSpringJUnitTest.java
>  bf82af8268f0b35c6ed15b26783ef37c9c329c10 
>   
> geode-core/src/test/resources/META-INF/services/com.gemstone.gemfire.distributed.ServerLauncherCacheProvider
>  PRE-CREATION 
>   geode-core/src/test/resources/spring/spring-gemfire-context.xml 
> a728493be7ee2a960dc3c9e5e8c449686d6b09cd 
>   gradle/rat.gradle 68e04c498166d14301d1a257d6097b3b7bf8a029 
> 
> Diff: https://reviews.apache.org/r/44242/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Dan Smith
> 
>

Reply via email to