Skip to content

Commit

Permalink
#1128 Reused existing product processor instance, removed duplicates,…
Browse files Browse the repository at this point in the history
… removed TODOs
  • Loading branch information
dilshat committed Sep 19, 2017
1 parent 809db09 commit 4a093db
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ public class HubManagerImpl implements HubManager, HostListener

private ContainerMetricsService containerMetricsService;

private ProductProcessor productProcessor;


public HubManagerImpl( DaoManager daoManager )
{
Expand Down Expand Up @@ -260,7 +262,7 @@ private void initHeartbeatProcessors()

StateLinkProcessor hubEnvironmentProcessor = new HubEnvironmentProcessor( ctx );

ProductProcessor productProcessor = new ProductProcessor( configManager, this.hubEventListeners, restClient );
productProcessor = new ProductProcessor( configManager, this.hubEventListeners, restClient );

AppScaleProcessor appScaleProcessor = new AppScaleProcessor( new AppScaleManager( peerManager ), restClient );

Expand Down Expand Up @@ -479,9 +481,6 @@ public void installPlugin( String url, String name, String uid ) throws HubManag

if ( isRegisteredWithHub() )
{
//TODO use already existing this.productProcessor
ProductProcessor productProcessor =
new ProductProcessor( this.configManager, this.hubEventListeners, this.restClient );
PeerProductDataDto peerProductDataDto = new PeerProductDataDto();
peerProductDataDto.setProductId( uid );
peerProductDataDto.setState( PeerProductDataDto.State.INSTALLED );
Expand Down Expand Up @@ -523,9 +522,6 @@ public void uninstallPlugin( final String name, final String uid )

if ( isRegisteredWithHub() )
{
//TODO use already existing this.productProcessor
ProductProcessor productProcessor =
new ProductProcessor( this.configManager, this.hubEventListeners, this.restClient );
PeerProductDataDto peerProductDataDto = new PeerProductDataDto();
peerProductDataDto.setProductId( uid );
peerProductDataDto.setState( PeerProductDataDto.State.REMOVE );
Expand Down

0 comments on commit 4a093db

Please sign in to comment.