/** * Enters and returns a new local context instance. * * @return Reference to the entered LocalContext */ public static LocalContext enter() { LocalContext ctx = current(LocalContext.class); if (ctx == null) { // Root. ctx = OSGiServices.getLocalContext(); } return (LocalContext) ctx.enterInner(); }