Interface DescribableComponent

All Known Subinterfaces:
AvroConverterStrategy, AxonConfiguration, CommandBus, CommandBusConnector, CommandDispatcher, CommandGateway, CommandHandlingComponent, Component<C>, ComponentFactory<C>, ComponentRegistry, Configuration, Converter, DispatchInterceptorRegistry, EntityMetamodel<E>, EventAppender, EventBus, EventConverter, EventHandlingComponent, EventProcessor, EventSink, EventStorageEngine, EventStore, HandlerInterceptorRegistry, MessageConverter, MessageMonitorRegistry, QueryBus, QueryBusConnector, QueryGateway, QueryHandlingComponent, QueryUpdateEmitter, Repository<ID,E>, Repository.LifecycleManagement<ID,E>, RetryPolicy, StreamingEventProcessor
All Known Implementing Classes:
AbstractComponent, AccessSerializingRepository, AggregateBasedAxonServerEventStorageEngine, AggregateBasedJpaEventStorageEngine, AnnotatedCommandHandlingComponent, AnnotatedEntityIdResolver, AnnotatedEntityMetamodel, AnnotatedEventHandlingComponent, AnnotatedQueryHandlingComponent, AnnotationBasedEventCriteriaResolver, AsyncRetryScheduler, AvroConverter, AxonServerCommandBusConnector, AxonServerEventStorageEngine, AxonServerEventStorageEngineFactory, AxonServerQueryBusConnector, ChainingContentTypeConverter, Components, ConcreteEntityMetamodel, ContextAwareCommandDispatcher, ConvertingCommandGateway, DefaultCommandGateway, DefaultComponentRegistry, DefaultDispatchInterceptorRegistry, DefaultHandlerInterceptorRegistry, DefaultMessageMonitorRegistry, DefaultQueryGateway, DelegatingCommandBusConnector, DelegatingEventBus, DelegatingEventConverter, DelegatingEventHandlingComponent, DelegatingMessageConverter, DelegatingQueryBusConnector, DistributedCommandBus, DistributedQueryBus, EntityCommandHandlingComponent, EventProcessorConfiguration, EventSourcingRepository, ExponentialBackOffRetryPolicy, FieldChildEntityFieldDefinition, FilteringRetryPolicy, InMemoryEventStorageEngine, InMemoryRepository, InstantiatedComponentDefinition, InterceptingCommandBus, InterceptingEventBus, InterceptingEventHandlingComponent, InterceptingEventSink, InterceptingEventStore, InterceptingQueryBus, JacksonConverter, LazyInitializedComponentDefinition, MaxAttemptsPolicy, PassThroughConverter, PayloadConvertingCommandBusConnector, PayloadConvertingQueryBusConnector, PolymorphicEntityMetamodel, PooledStreamingEventProcessor, PooledStreamingEventProcessorConfiguration, ProcessingContextEventAppender, RecordingCommandBus, RecordingCommandBus, RecordingEventBus, RecordingEventSink, RecordingEventStore, RetryingCommandBus, SequenceCachingEventHandlingComponent, SequenceOverridingEventHandlingComponent, SequencingEventHandlingComponent, SimpleCommandBus, SimpleCommandHandlingComponent, SimpleEntityEvolvingComponent, SimpleEventBus, SimpleEventHandlingComponent, SimpleQueryBus, SimpleQueryHandlingComponent, SimpleQueryUpdateEmitter, SimpleRepository, SimpleStateManager, SpecificRecordBaseConverterStrategy, SpringComponentRegistry, StorageEngineBackedEventStore, SubscribingEventProcessor, SubscribingEventProcessorConfiguration, TaggedEventConverter, TracingCommandBus, TracingEventHandlingComponent
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface DescribableComponent
Contract allowing components to describe themselves with a given ComponentDescriptor.

Components should focus on providing their internal state and structure to the Component without concern for how that information will be serialized or displayed. This separation of concerns allows for multiple output formats from the same component hierarchy.

Since:
5.0.0
Author:
Allard Buijze, Mitchell Herrijgers, Steven van Beelen
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Describe the properties of this DescribableComponent with the given descriptor.
  • Method Details

    • describeTo

      void describeTo(@Nonnull ComponentDescriptor descriptor)
      Describe the properties of this DescribableComponent with the given descriptor.

      Components should call the appropriate describeProperty methods on the descriptor to register their properties. The descriptor is responsible for determining how these properties are formatted and structured in the final output.

      Best Practices: As a general rule, all relevant fields of a DescribableComponent implementation should be described in this method. However, developers have discretion to include only the fields that make sense in the context. Not every field may be meaningful for description purposes, especially internal implementation details. Furthermore, components might want to expose different information based on their current state. The final decision on what properties to include lies with the person implementing the describeTo method, who should focus on providing information that is useful for understanding the component's configuration and state.

      Example implementation:

       public void describeTo(ComponentDescriptor descriptor) {
           descriptor.describeProperty("name", this.name);
           descriptor.describeProperty("enabled", this.enabled);
           descriptor.describeProperty("configuration", this.configuration); // A nested component
           descriptor.describeProperty("handlers", this.eventHandlers);      // A collection
       }
       
      Parameters:
      descriptor - The component descriptor to describe this DescribableComponentn its properties in.