> On Aug. 21, 2014, 6:33 p.m., Nate Cole wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java,
> >  lines 345-347
> > <https://reviews.apache.org/r/24940/diff/1/?file=666228#file666228line345>
> >
> >     This seems a really strange construct.  You end up setting the instance 
> > value as 'this'?

It's a static method setting a static member so there is no 'this'.  I know 
it's a bit strange but I wanted to limit the refactoring for this patch.  There 
is an existing static method to get the singleton ViewRegistry instance that I 
want to support for now because it is used in a lot of places.  Eventually most 
if not all of the static getInstance() calls can be replaced with injection 
annotation.  For now, the singleton instance gets injected into AmbariServer 
and then set through this method on the ViewRegistry static member through this 
method.  It's also used by the unit tests to set the singleton for the unit 
tests.


- Tom


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


On Aug. 21, 2014, 6:05 p.m., Tom Beerbower wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/24940/
> -----------------------------------------------------------
> 
> (Updated Aug. 21, 2014, 6:05 p.m.)
> 
> 
> Review request for Ambari, Nate Cole and Sid Wagle.
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> If the Ambari configuration ApiAuthentication==false then all views and view 
> instances should be available.
> 
> 
> Diffs
> -----
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
>  7b93836 
>   ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java 
> d40eb0e 
>   
> ambari-server/src/test/java/org/apache/ambari/server/api/handlers/CreateHandlerTest.java
>  c2562bd 
>   
> ambari-server/src/test/java/org/apache/ambari/server/api/handlers/DeleteHandlerTest.java
>  3876058 
>   
> ambari-server/src/test/java/org/apache/ambari/server/api/handlers/UpdateHandlerTest.java
>  4140ce2 
>   
> ambari-server/src/test/java/org/apache/ambari/server/api/resources/BaseResourceDefinitionTest.java
>  aafe8ec 
>   
> ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AmbariPrivilegeResourceProviderTest.java
>  46e864e 
>   
> ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ViewPrivilegeResourceProviderTest.java
>  695ceea 
>   
> ambari-server/src/test/java/org/apache/ambari/server/view/ViewRegistryTest.java
>  277c739 
> 
> Diff: https://reviews.apache.org/r/24940/diff/
> 
> 
> Testing
> -------
> 
> Manual testing.
> 
> Added new unit test.  All tests pass.
> 
> 
> Results :
> 
> Tests run: 1945, Failures: 0, Errors: 0, Skipped: 15
> …
> 
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Total time: 28:44.048s
> [INFO] Finished at: Thu Aug 21 13:58:31 EDT 2014
> [INFO] Final Memory: 21M/123M
> [INFO] 
> ------------------------------------------------------------------------
> 
> 
> Thanks,
> 
> Tom Beerbower
> 
>

Reply via email to