code: @SuppressWarnings("unchecked")
     public void pushContext(Object contextKey, Set unsharableResources) throws ResourceException
     {
        LinkedList<Context> stack = threadContexts.get();
        Context context = new Context(contextKey);
  
        if (stack == null)
        {
           log.tracef("push: new stack for context: %s", context);
  
           stack = new LinkedList<Context>();
           threadContexts.set(stack);
        }
        else if (stack.isEmpty())
        {
           log.tracef("push: new stack for context: %s", context);
        }
        else
        {
           log.tracef("push: old stack for context: %s", stack.getLast());
           log.tracef("push: new stack for context: %s", context);
        }
  
        if (Tracer.isEnabled())
           Tracer.pushCCMContext(context.toString(), new Throwable("CALLSTACK"));
  
        stack.addLast(context);
     }
docs: {@inheritDoc}