Examples of ThreadContext


Examples of org.araneaframework.framework.ThreadContext

  protected void action(Path path, InputData input, OutputData output) throws Exception {
    super.action(path, input, output);
  }
 
  protected void event(Path path, InputData input) throws Exception {
    ThreadContext currentThreadCtx = ((ThreadContext)getEnvironment().getEntry(ThreadContext.class));
    HttpServletRequest request = ((ServletInputData) input).getRequest();
   
    if (request.getParameter(POPUPS_CLOSE_KEY) != null) {
      if (log.isDebugEnabled())
        log.debug("Should be closing myself now, threadId  = '" + currentThreadCtx.getCurrentId() + "'" );
      currentThreadCtx.close(currentThreadCtx.getCurrentId());
    }
    else {
      super.event(path, input);
    }
  }
View Full Code Here

Examples of org.araneaframework.framework.ThreadContext

    service.setDefaultServiceId("child1");
  }
 
  public void testCloseRemoves() throws Exception {
    service._getService().action(MockUtil.getPath(), input, output);
    ThreadContext sess =
      (ThreadContext)child1.getTheEnvironment().getEntry(ThreadContext.class);
    sess.close("child1");
    assertTrue(child1.getDestroyCalled());
  }
View Full Code Here

Examples of org.eclim.plugin.jdt.command.debug.context.ThreadContext

    DebuggerContext ctx = DebuggerContextManager.getDefault();
    if (ctx == null) {
      return Services.getMessage("debugging.session.absent");
    }

    ThreadContext threadCtx = ctx.getThreadContext();
    String threadIdStr = commandLine.getValue(Options.THREAD_ID_OPTION);
    long threadId;

    if (threadIdStr == null) {
      ctx.resume();
      return Services.getMessage("debugging.session.resumed");
    } else {
      // Select the currently stepping thread if an empty thread ID is given.
      if (threadIdStr.isEmpty()) {
        IJavaThread steppingThread = (IJavaThread) threadCtx.getSteppingThread();
        if (steppingThread != null) {
          threadId = steppingThread.getThreadObject().getUniqueId();
        } else {
          return Services.getMessage("debugging.resume.thread.absent");
        }
      } else {
        threadId = Long.parseLong(threadIdStr);
      }

      if (logger.isDebugEnabled()) {
        logger.debug("Resuming thread ID: " + threadId);
      }
      threadCtx.resume(threadId);
      return Services.getMessage("debugging.thread.resumed");
    }
  }
View Full Code Here

Examples of org.exoplatform.container.component.ThreadContext

   /**
    * {@inheritDoc}
    */
   public ThreadContext getThreadContext()
   {
      return new ThreadContext(currentRepositoryName);
   }
View Full Code Here

Examples of org.jboss.weld.environment.se.contexts.ThreadContext

        if (ignoreEvent(event)) {
            return;
        }

        // set up this thread's bean store
        this.threadContext = new ThreadContext(BeanManagerProxy.unwrap(manager).getContextId());

        // activate and add context
        event.addContext(threadContext);
    }
View Full Code Here

Examples of org.jruby.runtime.ThreadContext

public class InvokeDynamicSupport {
    public static Object bootstrap(final CallSite site, Object... args) {
        // dynamic call
        IRubyObject self = (IRubyObject) args[0];
        ThreadContext context = (ThreadContext) args[1];
        String methodName = (String) args[2];
        CallType callType = CallType.NORMAL;
        String siteName = site.name();
        boolean iterator = siteName.length() == 2 && siteName.charAt(1) == 'b';
       
        switch (siteName.charAt(0)) {
        case 'c':
            callType = CallType.NORMAL;
            break;
        case 'f':
            callType = CallType.FUNCTIONAL;
            break;
        case 'v':
            callType = CallType.VARIABLE;
            break;
        }

        DynamicMethod method = self.getMetaClass().searchMethod(methodName);
        IRubyObject caller = context.getFrameSelf();
        if (shouldCallMethodMissing(method, methodName, caller, callType)) {
            return RuntimeHelpers.callMethodMissing(context, self, method, methodName, callType, Block.NULL_BLOCK);
        }

        String dispatcherName = iterator ? "invokeDynamicIter" : "invokeDynamic";
View Full Code Here

Examples of org.jruby.runtime.ThreadContext

    public static RubyHash unmarshalFrom(UnmarshalStream input, boolean defaultValue) throws IOException {
        RubyHash result = newHash(input.getRuntime());
        input.registerLinkTarget(result);
        int size = input.unmarshalInt();
        ThreadContext context = input.getRuntime().getCurrentContext();
        for (int i = 0; i < size; i++) {
            result.op_aset(context, input.unmarshalObject(), input.unmarshalObject());
        }
        if (defaultValue) result.default_value_set(input.unmarshalObject());
        return result;
View Full Code Here

Examples of org.jruby.runtime.ThreadContext

        public BlockComparator(Block block) {
            this.block = block;
        }

        public int compare(Object o1, Object o2) {
            ThreadContext context = getRuntime().getCurrentContext();
            IRubyObject obj1 = (IRubyObject) o1;
            IRubyObject obj2 = (IRubyObject) o2;
            IRubyObject ret = block.yield(context, getRuntime().newArray(obj1, obj2), null, null, true);
            int n = RubyComparable.cmpint(context, ret, obj1, obj2);
            //TODO: ary_sort_check should be done here
View Full Code Here

Examples of org.jruby.runtime.ThreadContext

            }
            return 0;
        }

        private int compareOthers(IRubyObject o1, IRubyObject o2) {
            ThreadContext context = o1.getRuntime().getCurrentContext();
            IRubyObject ret = o1.callMethod(context, "<=>", o2);
            int n = RubyComparable.cmpint(context, ret, o1, o2);
            //TODO: ary_sort_check should be done here
            return n;
        }
View Full Code Here

Examples of org.jruby.runtime.ThreadContext

    public static RubyBinding newBinding(Ruby runtime, Binding binding) {
        return new RubyBinding(runtime, runtime.getBinding(), binding);
    }

    public static RubyBinding newBinding(Ruby runtime) {
        ThreadContext context = runtime.getCurrentContext();
       
        // FIXME: We should be cloning, not reusing: frame, scope, dynvars, and potentially iter/block info
        Frame frame = context.getCurrentFrame();
        Binding binding = new Binding(frame, context.getImmediateBindingRubyClass(), context.getCurrentScope());
       
        return new RubyBinding(runtime, runtime.getBinding(), binding);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.