Class RpcServiceRegistry
java.lang.Object
ru.pathcreator.pyc.rpc.schema.RpcServiceRegistry
Optional startup-time registry for channel and method definitions.
The registry is intentionally separate from rpc.core transport
classes. It is meant for service bootstrapping, validation, and reporting:
conflict detection, channel and method inventory, protocol visibility, and
startup-time analysis. It does not participate in the request/response hot
path.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder для сборки immutable registry снимка до старта сервиса.static final classBuilder одной logical channel entry внутри registry. -
Method Summary
Modifier and TypeMethodDescriptionanalyze()Performs non-fatal startup-time analysis and returns advisory issues that may still be worth reviewing before a service starts taking traffic.static RpcServiceRegistry.Builderbuilder()Creates a new registry builder.intReturns the number of logical channels present in the registry.channels()Returns the immutable list of registered channel schema entries.intReturns the total number of registered methods across all channels.Renders the registry as a compact JSON document suitable for logging, diagnostics, or writing to a file.Renders a readable multi-line report for logs, startup diagnostics, or deployment review.voidwriteJsonReport(Path path) Writes the JSON report to the provided file path, creating parent directories when needed.voidwriteTextReport(Path path) Writes the text report to the provided file path, creating parent directories when needed.
-
Method Details
-
builder
Creates a new registry builder.- Returns:
- empty registry builder
-
channels
Returns the immutable list of registered channel schema entries.- Returns:
- immutable channel schema list
-
channelCount
public int channelCount()Returns the number of logical channels present in the registry.- Returns:
- channel count
-
methodCount
public int methodCount()Returns the total number of registered methods across all channels.- Returns:
- total method count
-
analyze
Performs non-fatal startup-time analysis and returns advisory issues that may still be worth reviewing before a service starts taking traffic.- Returns:
- immutable list of validation warnings
-
renderTextReport
Renders a readable multi-line report for logs, startup diagnostics, or deployment review.- Returns:
- human-readable registry report
-
renderJsonReport
Renders the registry as a compact JSON document suitable for logging, diagnostics, or writing to a file.- Returns:
- JSON report
-
writeTextReport
Writes the text report to the provided file path, creating parent directories when needed.- Parameters:
path- destination file path- Throws:
IOException- when the report cannot be written
-
writeJsonReport
Writes the JSON report to the provided file path, creating parent directories when needed.- Parameters:
path- destination file path- Throws:
IOException- when the report cannot be written
-