Package org.springframework.security.core.context

# Class ObservationSecurityContextChangedListener

java.lang.Object
org.springframework.security.core.context.ObservationSecurityContextChangedListener

All Implemented Interfaces:
  `SecurityContextChangedListener`

public final class ObservationSecurityContextChangedListener extends Object implements SecurityContextChangedListener
A `SecurityContextChangedListener` that adds events to an existing `Observation` If no `Observation` is present when an event is fired, then the event is unrecorded.

Since:
  6.0

## Constructor Summary

Constructors
Constructor
Description
`ObservationSecurityContextChangedListener(io.micrometer.observation.ObservationRegistry registry)`
Create a `ObservationSecurityContextChangedListener`

## Method Summary

Modifier and Type
Method
Description
`void`
`securityContextChanged(SecurityContextChangedEvent event)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### ObservationSecurityContextChangedListener

public ObservationSecurityContextChangedListener(io.micrometer.observation.ObservationRegistry registry)
Create a `ObservationSecurityContextChangedListener`

Parameters:
  `registry` - the `ObservationRegistry` for looking up the surrounding `Observation`

## Method Details

### securityContextChanged

public void securityContextChanged(SecurityContextChangedEvent event)

Specified by:
  `securityContextChanged` in interface `SecurityContextChangedListener`