Skip to content

Commit

Permalink
Distributed Session Management #7529
Browse files Browse the repository at this point in the history
  • Loading branch information
rymsha committed Oct 28, 2019
1 parent d216ede commit f12f51a
Showing 1 changed file with 41 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,11 @@ public void activate( final BundleContext context, final IgniteSettings igniteSe
context.registerService( IgniteAdminClient.class, new IgniteAdminClientImpl( this.ignite ), new Hashtable<>() );
}

private void adjustLoggingVerbosity()
{
System.setProperty( IGNITE_NO_ASCII, "false" );
System.setProperty( IGNITE_PERFORMANCE_SUGGESTIONS_DISABLED, "true" );
System.setProperty( IGNITE_UPDATE_NOTIFIER, "false" );
System.setProperty( IGNITE_TROUBLESHOOTING_LOGGER, "false" );
}

@SuppressWarnings("unused")
@Deactivate
public void deactivate()
{
unregisterClient();
this.ignite.close();
}

Expand Down Expand Up @@ -136,13 +129,13 @@ private ClusterNodes doGetNodes()
@Override
public void enable()
{
// ignore
registerService();
}

@Override
public void disable()
{
// ignore
unregisterClient();
}

@Override
Expand All @@ -151,10 +144,48 @@ public boolean isEnabled()
return this.reg != null;
}

private void registerService()
{
if ( this.reg != null )
{
return;
}

LOG.info( "Cluster operational, register " + this.getId() );

this.reg = context.registerService( Ignite.class, ignite, new Hashtable<>() );
}

private void unregisterClient()
{
if ( this.reg == null )
{
return;
}

try
{
LOG.info( "Cluster not operational, unregister " + this.getId() );
this.reg.unregister();
}
finally
{
this.reg = null;
}
}

@SuppressWarnings("unused")
@Reference
public void setClusterConfig( final ClusterConfig clusterConfig )
{
this.clusterConfig = clusterConfig;
}

private static void adjustLoggingVerbosity()
{
System.setProperty( IGNITE_NO_ASCII, "false" );
System.setProperty( IGNITE_PERFORMANCE_SUGGESTIONS_DISABLED, "true" );
System.setProperty( IGNITE_UPDATE_NOTIFIER, "false" );
System.setProperty( IGNITE_TROUBLESHOOTING_LOGGER, "false" );
}
}

0 comments on commit f12f51a

Please sign in to comment.