Package com.opengamma.engine.calcnode

Examples of com.opengamma.engine.calcnode.JobInvoker


        private boolean _busy;
        private JobInvokerRegister _callback;

        @Override
        public boolean invoke(final CalculationJob job, final JobInvocationReceiver receiver) {
          final JobInvoker instance = this;
          synchronized (instance) {
            if (_busy) {
              return false;
            }
            _executorService.execute(new Runnable() {
              @Override
              public void run() {
                try {
                  Thread.sleep(rnd.nextInt(50));
                } catch (InterruptedException e) {
                  s_logger.warn("invoker {} interrupted", getInvokerId ());
                }
                s_logger.debug("invoker {} completed job {}", getInvokerId (), job.getSpecification());
                receiver.jobCompleted(createTestJobResult(job.getSpecification(), 0L, instance.toString()));
                synchronized (instance) {
                  _busy = false;
                  if (_callback != null) {
                    s_logger.debug("re-registering invoker {} with dispatcher", getInvokerId ());
                    final JobInvokerRegister callback = _callback;
View Full Code Here

TOP

Related Classes of com.opengamma.engine.calcnode.JobInvoker

Copyright © 2018 www.massapicom. 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.