Class MultiTelemetryBackend
java.lang.Object
org.wpilib.telemetry.MultiTelemetryBackend
- All Implemented Interfaces:
AutoCloseable, TelemetryBackend
A telemetry backend that forwards logged data to multiple child backends.
-
Constructor Summary
ConstructorsConstructorDescriptionMultiTelemetryBackend(Collection<? extends TelemetryBackend> backends) Constructs a telemetry backend that forwards to multiple child backends.MultiTelemetryBackend(TelemetryBackend... backends) Constructs a telemetry backend that forwards to multiple child backends. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Create an entry for the given path.booleanownsBackend(TelemetryBackend backend) Returns whether this backend is or owns the given backend instance for lifecycle purposes.voidremoveEntry(String path) Removes an entry for the given path.booleansharesBackendWith(TelemetryBackend backend) Returns whether this backend shares lifecycle ownership with another backend.
-
Constructor Details
-
MultiTelemetryBackend
Constructs a telemetry backend that forwards to multiple child backends.- Parameters:
backends- child backends
-
MultiTelemetryBackend
Constructs a telemetry backend that forwards to multiple child backends.- Parameters:
backends- child backends
-
-
Method Details
-
ownsBackend
Description copied from interface:TelemetryBackendReturns whether this backend is or owns the given backend instance for lifecycle purposes.Composite backends should override this and recursively check child backends that are closed when this backend is closed. The registry uses this to avoid closing a displaced backend that is now retained by another registered backend.
- Specified by:
ownsBackendin interfaceTelemetryBackend- Parameters:
backend- backend instance- Returns:
- True if this backend is or owns the given backend
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
getEntry
Description copied from interface:TelemetryBackendCreate an entry for the given path.Backend implementations must not throw from this method. Recoverable failures should be reported through
TelemetryRegistry.reportWarning(String, String)and represented with a discard entry.- Specified by:
getEntryin interfaceTelemetryBackend- Parameters:
path- full name- Returns:
- telemetry entry
-
removeEntry
Description copied from interface:TelemetryBackendRemoves an entry for the given path.Backend implementations must not throw from this method.
- Specified by:
removeEntryin interfaceTelemetryBackend- Parameters:
path- normalized full name
-