private WriteOwner requireOwner() {
   final WriteOwner owner = WRITE_OWNER.peek();
   if (owner == null) {
     throw MESSAGES.readOnlyNamingContext();
   }
   return owner;
 }
Exemplo n.º 2
0
 /**
  * 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));
 }
Exemplo n.º 5
0
 /**
  * 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();
 }
Exemplo n.º 6
0
 /**
  * Set the current context selector for the current thread.
  *
  * @param selector The current selector
  */
 public static void pushCurrentSelector(final NamespaceContextSelector selector) {
   currentSelector.push(selector);
 }