Package org.apache.pulsar.broker
Class ClassLoaderSwitcher
java.lang.Object
org.apache.pulsar.broker.ClassLoaderSwitcher
- All Implemented Interfaces:
AutoCloseable
Help to switch the class loader of current thread to the NarClassLoader, and change it back when it's done.
With the help of try-with-resources statement, the code would be cleaner than using try finally every time.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ClassLoaderSwitcher
-
-
Method Details
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-