コード例 #1
0
ファイル: LocalContext.java プロジェクト: sirinath/Javolution
 /**
  * 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();
 }
コード例 #2
0
ファイル: LocalContext.java プロジェクト: sirinath/Javolution
 /**
  * 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();
 }