Class ResolverHelper

java.lang.Object
org.apache.camel.support.ResolverHelper

public final class ResolverHelper extends Object
Some helper methods for new resolvers (like ComponentResolver, DataFormatResolver, etc.).
  • Field Details

  • Method Details

    • lookupComponentInRegistryWithFallback

      public static org.apache.camel.Component lookupComponentInRegistryWithFallback(org.apache.camel.CamelContext context, String name)
    • lookupComponentInRegistryWithFallback

      public static org.apache.camel.Component lookupComponentInRegistryWithFallback(org.apache.camel.CamelContext context, String name, ResolverHelper.LookupExceptionHandler exceptionHandler)
    • lookupDataFormatInRegistryWithFallback

      public static org.apache.camel.spi.DataFormat lookupDataFormatInRegistryWithFallback(org.apache.camel.CamelContext context, String name)
    • lookupDataFormatInRegistryWithFallback

      public static org.apache.camel.spi.DataFormat lookupDataFormatInRegistryWithFallback(org.apache.camel.CamelContext context, String name, ResolverHelper.LookupExceptionHandler exceptionHandler)
    • lookupDataFormatFactoryInRegistryWithFallback

      public static org.apache.camel.spi.DataFormatFactory lookupDataFormatFactoryInRegistryWithFallback(org.apache.camel.CamelContext context, String name)
    • lookupDataFormatFactoryInRegistryWithFallback

      public static org.apache.camel.spi.DataFormatFactory lookupDataFormatFactoryInRegistryWithFallback(org.apache.camel.CamelContext context, String name, ResolverHelper.LookupExceptionHandler exceptionHandler)
    • lookupLanguageInRegistryWithFallback

      public static org.apache.camel.spi.Language lookupLanguageInRegistryWithFallback(org.apache.camel.CamelContext context, String name)
    • lookupLanguageInRegistryWithFallback

      public static org.apache.camel.spi.Language lookupLanguageInRegistryWithFallback(org.apache.camel.CamelContext context, String name, ResolverHelper.LookupExceptionHandler exceptionHandler)
    • resolveService

      public static <T> Optional<T> resolveService(org.apache.camel.CamelContext camelContext, String factoryPath, String factoryKey, Class<T> factoryClass)
      Create an instance of the given factory.
      Parameters:
      camelContext - the CamelContext
      factoryPath - the path of the factory file
      factoryKey - the key used to lookup the factory class
      factoryClass - the type of the class
      Returns:
      an instance of the given factory
    • resolveMandatoryService

      public static <T> T resolveMandatoryService(org.apache.camel.CamelContext camelContext, String factoryKey, Class<T> factoryClass, String jarName) throws org.apache.camel.NoSuchServiceException
      Create an instance of the given factory using the default factory finder
      Parameters:
      camelContext - the CamelContext
      factoryKey - the key used to lookup the factory class
      factoryClass - the type of the class
      jarName - the JAR to add to the classpath if service is missing
      Returns:
      an instance of the given factory
      Throws:
      org.apache.camel.NoSuchServiceException - is thrown if service is not found
    • resolveMandatoryBootstrapService

      public static <T> T resolveMandatoryBootstrapService(org.apache.camel.CamelContext camelContext, String factoryKey, Class<T> factoryClass, String jarName) throws org.apache.camel.NoSuchServiceException
      Create an instance of the given factory using the bootstrap factory finder
      Parameters:
      camelContext - the CamelContext
      factoryKey - the key used to lookup the factory class
      factoryClass - the type of the class
      jarName - the JAR to add to the classpath if service is missing
      Returns:
      an instance of the given factory
      Throws:
      org.apache.camel.NoSuchServiceException - is thrown if service is not found
    • resolveMandatoryService

      public static <T> T resolveMandatoryService(org.apache.camel.CamelContext camelContext, org.apache.camel.spi.FactoryFinder factoryFinder, String factoryKey, Class<T> factoryClass, String jarName) throws org.apache.camel.NoSuchServiceException
      Create an instance of the given factory using the default factory finder
      Parameters:
      camelContext - the CamelContext
      factoryFinder - the factory finder to use
      factoryKey - the key used to lookup the factory class
      factoryClass - the type of the class
      jarName - the JAR to add to the classpath if service is missing
      Returns:
      an instance of the given factory
      Throws:
      org.apache.camel.NoSuchServiceException - is thrown if service is not found
    • resolveBootstrapService

      public static <T> Optional<T> resolveBootstrapService(org.apache.camel.CamelContext camelContext, String factoryKey, Class<T> factoryClass)
      Create an instance of the given factory using the bootstrap factory finder.
      Parameters:
      camelContext - the CamelContext
      factoryKey - the key used to lookup the factory class
      factoryClass - the type of the class
      Returns:
      an instance of the given factory
    • resolveService

      public static <T> Optional<T> resolveService(org.apache.camel.CamelContext camelContext, String factoryKey, Class<T> factoryClass)
      Create an instance of the given factory using the default factory finder
      Parameters:
      camelContext - the CamelContext
      factoryKey - the key used to lookup the factory class
      factoryClass - the type of the class
      Returns:
      an instance of the given factory
    • resolveService

      public static <T> Optional<T> resolveService(org.apache.camel.CamelContext camelContext, org.apache.camel.spi.FactoryFinder factoryFinder, String factoryKey, Class<T> factoryClass)
      Create an instance of the given factory.
      Parameters:
      camelContext - the CamelContext
      factoryFinder - the FactoryFinder to use
      factoryKey - the key used to lookup the factory class
      factoryClass - the type of the class
      Returns:
      an instance of the given factory