How to enable assert in CQ5/ OSGi Bundle (Java)? -
We also enable But how to enable the OSGI bundle to emphasize. I have a bundle that I want to test with the claim and I want to disable them at the time of deployment (disable by default will be easy to disable) but how do you enable it? You can use in the java -ea xxx in a core Java application, I also To know that commandline options have been changed to eclipse.
ClassLoader # setDefaultAssertionStatus (Boolean) method Sets the claim status only for those sections which have not yet been loaded. Therefore, the best place to tell this statement would be a bundle activator:
implements the public class catalyst bundleactivator {@ Override Public Voode Start (Bundle Contact Bundle Concert) Exception {getClass () Throws GetClassLoader () .setDefaultAssertionStatus (right); } @ Override Public VoIP Stop (Bundle Contact Reference) exception to {}}
maven-bundle-plugin configuration to register the activator Remember for:
& lt; Project & gt; & Lt; Construction & gt; & Lt; Plugins & gt; & Lt; Plugin & gt; & Lt; Group & gt; Org.apache.felix & lt; / Group & gt; & Lt; ArtifactId & gt; Maven Wrap-Plugin & lt; / ArtifactId> & Lt; Configuration & gt; & Lt; Instructions & gt; & Lt; Bundle-catalyst & gt; my.project.Activator & lt; / Bundle-catalyst & gt; ...
Comments
Post a Comment