Interface Service

All Superinterfaces:
AutoCloseable
All Known Subinterfaces:
ApiEndpoint, AsyncEndpoint, AsyncProcessorAwaitManager, AsyncProducer, BacklogDebugger, BatchConsumer, BeanIntrospection, BrowsableEndpoint, CamelClusterService, CamelClusterView, CamelPreemptiveClusterService, CamelPreemptiveClusterView, CamelTracingService, ClaimCheckRepository, CliConnector, Component, Consumer, ConsumerCache, ConsumerTemplate, ContextReloadStrategy, DataFormat, Debugger, DelegateEndpoint, DevConsoleRegistry, DevConsoleResolver, DumpRoutesStrategy, Endpoint, EndpointRegistry<K>, ExchangeFactory, ExchangeFactoryManager, ExecutorServiceManager, ExtendedRoutesBuilderLoader, FluentProducerTemplate, HealthCheckRegistry, IdempotentRepository, InflightRepository, InterceptSendToEndpoint, ManagementAgent, ManagementMBeanAssembler, ManagementStrategy, MessageHistoryFactory, PackageScanClassResolver, PackageScanResourceResolver, PollingConsumer, PooledObjectFactory<T>, ProcessorExchangeFactory, Producer, ProducerCache, ProducerTemplate, PropertiesComponent, ReloadStrategy, ResourceReloadStrategy, ResourceResolver, RestRegistry, ResumeStrategy, RouteController, RoutesBuilderLoader, RuntimeCamelCatalog, RuntimeEndpointRegistry, ScheduledPollConsumerScheduler, SendDynamicAware, ServiceRegistry, ShutdownableService, ShutdownStrategy, StartupStepRecorder, StatefulService, StateRepository<K,V>, StaticService, StreamCachingStrategy, SupervisingRouteController, SuspendableService, TimeoutMap<K,V>, Tracer, TransformerRegistry<K>, TypeConverterRegistry, ValidatorRegistry<K>
All Known Implementing Classes:
ServiceSupport, Transformer, Validator

public interface Service extends AutoCloseable
Represents the core lifecycle API for services which can be initialized, started and stopped
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Optional build phase which is executed by frameworks that supports pre-building projects (pre-compile) which allows special optimizations such as camel-quarkus.
    default void
    Delegates to stop() so it can be used in try-with-resources expression.
    default void
    Initialize the service
    void
    Starts the service
    void
    Stops the service
  • Method Details

    • build

      default void build()
      Optional build phase which is executed by frameworks that supports pre-building projects (pre-compile) which allows special optimizations such as camel-quarkus.
      Throws:
      RuntimeCamelException - is thrown if build failed
    • init

      default void init()
      Initialize the service
      Throws:
      RuntimeCamelException - is thrown if initialization failed
    • start

      void start()
      Starts the service
      Throws:
      RuntimeCamelException - is thrown if starting failed
    • stop

      void stop()
      Stops the service
      Throws:
      RuntimeCamelException - is thrown if stopping failed
    • close

      default void close() throws IOException
      Delegates to stop() so it can be used in try-with-resources expression.
      Specified by:
      close in interface AutoCloseable
      Throws:
      IOException - per contract of AutoCloseable if stop() fails