Interface DataFormatFactory

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 DataFormatFactory
Factory for creating fresh DataFormat instances on demand, used when a data format requires per-use instantiation rather than sharing a single instance across the route.

Most data formats are stateless singletons resolved directly from the registry or the META-INF service files. This factory is needed for formats that hold mutable per-invocation state (codec contexts, stream writers, etc.) and must therefore not be reused concurrently. When Camel encounters a DataFormatFactory in the registry, it calls newInstance() for each .marshal() or .unmarshal() call rather than reusing one instance.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates a new DataFormat instance.
  • Method Details

    • newInstance

      DataFormat newInstance()
      Creates a new DataFormat instance.
      Returns:
      the instance