Skip to content

Commit

Permalink
DATAGO-79228: mark beans as @nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
mayur-solace committed Jul 22, 2024
1 parent 5be87cd commit 557f95f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
import com.solacesystems.jcsmp.SolaceSessionOAuth2TokenProvider;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.lang.Nullable;

public class SolaceSessionEventHandler extends DefaultSolaceOAuth2SessionEventHandler {
private final SessionHealthIndicator sessionHealthIndicator;
private static final Log logger = LogFactory.getLog(SolaceSessionEventHandler.class);

public SolaceSessionEventHandler(JCSMPProperties jcsmpProperties,
SolaceSessionOAuth2TokenProvider solaceSessionOAuth2TokenProvider,
@Nullable SolaceSessionOAuth2TokenProvider solaceSessionOAuth2TokenProvider,
SessionHealthIndicator sessionHealthIndicator) {
super(jcsmpProperties, solaceSessionOAuth2TokenProvider);
this.sessionHealthIndicator = sessionHealthIndicator;
Expand All @@ -24,13 +25,11 @@ public void handleEvent(SessionEventArgs eventArgs) {
if (logger.isDebugEnabled()) {
logger.debug(String.format("Received Solace JCSMP Session event [%s]", eventArgs));
}
super.handleEvent(eventArgs);
switch (eventArgs.getEvent()) {
case RECONNECTED -> this.sessionHealthIndicator.up();
case DOWN_ERROR -> this.sessionHealthIndicator.down(eventArgs);
case RECONNECTING -> {
super.handleEvent(eventArgs);
this.sessionHealthIndicator.reconnecting(eventArgs);
}
case RECONNECTING -> this.sessionHealthIndicator.reconnecting(eventArgs);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public class SolaceMessageChannelBinderConfiguration {

private JCSMPSession jcsmpSession;
private Context context;

@Nullable
private SolaceSessionOAuth2TokenProvider solaceSessionOAuth2TokenProvider;

private static final Log logger = LogFactory.getLog(SolaceMessageChannelBinderConfiguration.class);
Expand Down

0 comments on commit 557f95f

Please sign in to comment.