private WriteOwner requireOwner() {
   final WriteOwner owner = WRITE_OWNER.peek();
   if (owner == null) {
     throw MESSAGES.readOnlyNamingContext();
   }
   return owner;
 }
 /**
  * Get the current context selector for the current thread.
  *
  * @return The current context selector.
  */
 public static NamespaceContextSelector getCurrentSelector() {
   NamespaceContextSelector selector = currentSelector.peek();
   if (selector != null) {
     return selector;
   }
   return defaultSelector;
 }
 public static void popOwner() {
   WRITE_OWNER.pop();
 }
 public static void pushOwner(final ServiceTarget target, final ServiceName... dependencies) {
   WRITE_OWNER.push(new WriteOwner(target, dependencies));
 }
 /**
  * Pops the current selector for the thread, replacing it with the previous selector
  *
  * @return selector The current selector
  */
 public static NamespaceContextSelector popCurrentSelector() {
   return currentSelector.pop();
 }
 /**
  * Set the current context selector for the current thread.
  *
  * @param selector The current selector
  */
 public static void pushCurrentSelector(final NamespaceContextSelector selector) {
   currentSelector.push(selector);
 }