Classes in com.hammurapi.config.bootstrap package, which are packaged into com.hammurapi.config.bootstrap.jar allow to decouple service/component consumer from service/component implementation libraries and configurator libraries. The client classpath shall only contain the bootstrap jar and service/component interface classes.
com.hammurapi.config.bootstrap.jar is executable, and also contains an Ant task.
Bootstrapper<MyService> factory = new Bootstrapper<Object>(codebase); FactoryClosure<MyService> factoryClosure = factory.create(configUrl, tokens, profile, services, bindings); MyService service = factoryClosure.create(); try { ... use service ... } finally { Destroyable toDestroy=factoryClosure.getDestroyable(); if (toDestroy!=null) { toDestroy.destroy(); } }
java -jar com.hammurapi.config.bootstrap.jar --codebase http://myserver/myservicedefinition.hgconfig
<taskdef name="hgbootstrap" classname="com.hammurapi.config.bootstrap.BootstrapTask"> <classpath> <fileset dir="..." includes="com.hammurapi.config.bootstrap.jar"/> </classpath> </taskdef> <hgbootstrap configUrl="..." codebase="..."> <property name="..." value="..."/> </hgbootstrap>
Parameters:
Nested element: