This tutorials explain writing OSGi configuration in separate java file. How to refer osgi configuration in any other back end component. how to write osgi configuration values in code base in nt:file or in sling:OsgiConfig node.
Demo code : https://github.com/aemgeeks1212/aemgeeks