Esempio n. 1
0
 /**
  * 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();
 }
Esempio n. 2
0
 /**
  * Returns the current parameter value (the default value if not reconfigured nor {@link
  * LocalContext#supersede superseded}).
  */
 public T get() {
   LocalContext ctx = current(LocalContext.class);
   return (ctx != null) ? ctx.getValue(this, super.get()) : super.get();
 }