Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.Questo contenuto non è disponibile nella lingua selezionata.
12.14. Using @Initialize and @Uninitialize
Overview
In this example, assume we have a component that opens multiple connections to a database on initialization and then needs to release all those database resources when we close the Smooks instance.
@Initialize
and @Uninitialize
annotations above, the following should be noted:
- The
@Initialize
and@Uninitialize
methods must be public, zero-arg methods. - The
@ConfigParam
properties are all initialized before the first@Initialize
method is called. Therefore, you can use the@ConfigParam
component properties as input to the initialization process. - The
@Uninitialize
methods are all called in response to a call to theSmooks.close
method.