Examples of ExecutionResult


Examples of com.apigee.flow.execution.ExecutionResult

    try {
            // message modification, IO operations, etc
            // do something here that might fail
            return ExecutionResult.SUCCESS;
        } catch (Exception ex) {
            ExecutionResult executionResult = new ExecutionResult(false, ExecutionResult.Action.ABORT);
            executionResult.setErrorResponse(ex.getMessage());
            executionResult.addErrorResponseHeader("ExceptionClass", ex.getClass().getName());
            return new ExecutionResult(false, ExecutionResult.Action.ABORT);
        }
  }
View Full Code Here

Examples of com.betfair.cougar.core.api.ev.ExecutionResult

        final NewHeapSubscription newHeapSubscription;
        try {
            newHeapSubscription = (NewHeapSubscription) in.getResult();
        } catch (Exception e) {
            logger.log(Level.WARNING, "Error unpacking subscription result", e);
            observer.onResult(new ExecutionResult(new CougarServiceException(ServerFaultCode.FrameworkError, "Error unpacking subscription result", e)));
            return;
        }
        nioLogger.log(NioLogger.LoggingLevel.TRANSPORT, currentSession, "Received a subscription response for heapId %s with subscriptionId %s", newHeapSubscription.getHeapId(), newHeapSubscription.getSubscriptionId());

        final String sessionId = NioUtils.getSessionId(currentSession);
        ConnectedHeaps heaps;
        heapSubMutationLock.lock();
        try {
            heaps = heapsByServer.get(sessionId);
            if (heaps == null) {
                heaps = new ConnectedHeaps();
                heapsByServer.put(sessionId, heaps);
            }
        } finally {
            heapSubMutationLock.unlock();
        }

        // new heap
        boolean newHeap = false;
        if (newHeapSubscription.getUri() != null) {
            nioLogger.log(NioLogger.LoggingLevel.TRANSPORT, currentSession, "Received a new heap definition, heapId = %s, heapUrl = %s", newHeapSubscription.getHeapId(), newHeapSubscription.getUri());
            newHeap = heaps.addHeap(newHeapSubscription.getHeapId(), newHeapSubscription.getUri());
            if (!newHeap) {
                nioLogger.log(NioLogger.LoggingLevel.TRANSPORT, currentSession, "Received a new heap definition, heapId = %s, even though we know about the heap already!", newHeapSubscription.getHeapId());
            }
        }
        final boolean preExistingHeap = !newHeap;

        // find heap uri
        final HeapState heapState = heaps.getHeapState(newHeapSubscription.getHeapId());
        if (heapState == null) {
            nioLogger.log(NioLogger.LoggingLevel.TRANSPORT, currentSession, "Couldn't find heap definition, heapId = %s", newHeapSubscription.getHeapId());
            logger.log(Level.WARNING, "Can't find the heap for this subscription result. Heap id = " + newHeapSubscription.getHeapId());
            observer.onResult(new ExecutionResult(new CougarServiceException(ServerFaultCode.FrameworkError, "Can't find the heap for this subscription result. Heap id = " + newHeapSubscription.getHeapId())));
        } else {
            if (preExistingHeap && heapState.haveSeenInitialUpdate()) {
                Subscription sub = heapState.addSubscription(this, currentSession, newHeapSubscription.getHeapId(), newHeapSubscription.getSubscriptionId());
                if (sub != null) {
                    observer.onResult(new ExecutionResult(new ConnectedResponseImpl(heapState.getHeap(), sub)));
                } else {
                    // null sub means we already had a subscription with that id, something's not in a good state in the server, so kill this connection as we don't know what's going on
                    nioLogger.log(NioLogger.LoggingLevel.TRANSPORT, currentSession, "Duplicate subscription returned by the server, id = %s - closing session", newHeapSubscription.getSubscriptionId());
                    logger.log(Level.WARNING, "Duplicate subscription returned by the server, id = " + newHeapSubscription.getSubscriptionId() + " - closing session");
                    observer.onResult(new ExecutionResult(new CougarServiceException(ServerFaultCode.FrameworkError, "Duplicate subscription returned by the server, id = " + newHeapSubscription.getSubscriptionId())));
                    currentSession.close();
                }
            } else {
                // split this off into it's own thread since the mina docs lie and we only have one ioprocessor thread and if we don't fork we'd block forever
                final ConnectedHeaps finalHeaps = heaps;
                new Thread(new Runnable() {
                    @Override
                    public void run() {
                        boolean resultSent = false;
                        // now we've got the heap
                        CountDownLatch initialPopulationLatch = finalHeaps.getInitialPopulationLatch(newHeapSubscription.getHeapId());
                        try {
                            boolean populated = false;
                            if (initialPopulationLatch != null) {
                                nioLogger.log(NioLogger.LoggingLevel.TRANSPORT, currentSession, "Waiting for initial heap population, heapUrl = %s", newHeapSubscription.getUri());
                                populated = initialPopulationLatch.await(maxInitialPopulationWait, TimeUnit.MILLISECONDS);
                                finalHeaps.removeInitialPopulationLatch(newHeapSubscription.getHeapId());
                            } else {
                                nioLogger.log(NioLogger.LoggingLevel.TRANSPORT, currentSession, "Initial heap population, heapUrl = %s", newHeapSubscription.getUri());

                            }
                            nioLogger.log(NioLogger.LoggingLevel.TRANSPORT, currentSession, "Returning heap to client, heapUrl = %s", newHeapSubscription.getUri());
                            if (populated) {
                                observer.onResult(new ExecutionResult(new ConnectedResponseImpl(heapState.getHeap(), heapState.addSubscription(ClientConnectedObjectManager.this, currentSession, newHeapSubscription.getHeapId(), newHeapSubscription.getSubscriptionId()))));
                                resultSent = true;
                            }
                        } catch (InterruptedException e) {
                            // we got interrupted waiting for the response, oh well..
                        } catch (RuntimeException e) {
                            logger.log(Level.WARNING, "Error processing initial heap population, treating as a failure", e);
                        } finally {
                            if (!resultSent) {
                                nioLogger.log(NioLogger.LoggingLevel.TRANSPORT, currentSession, "Didn't get initial population message for heap, heapUrl = %s", newHeapSubscription.getUri());
                                // we don't worry about the case where it was a preExisting heap since the thread where it wasn't received will deal with it
                                if (!preExistingHeap) {
                                    terminateSubscriptions(currentSession, newHeapSubscription.getHeapId(), Subscription.CloseReason.INTERNAL_ERROR);
                                }
                                logger.log(Level.WARNING, "Didn't get initial population message for heap id = " + newHeapSubscription.getHeapId());
                                observer.onResult(new ExecutionResult(new CougarServiceException(ServerFaultCode.FrameworkError, "Didn't get initial population message for heap id = " + newHeapSubscription.getHeapId())));
                            }
                        }
                    }
                }, "SubscriptionResponseHandler-InitialPopulation-" + initialPopulationThreadIdSource.incrementAndGet() + "-" + heapState.getHeapUri()).start();
            }
View Full Code Here

Examples of com.cloud.utils.ExecutionResult

        try {
            s_logger.debug("Executing command in VR:  /opt/cloud/bin/router_proxy.sh " + script + " " + routerIP + " " + args);
            result = SshHelper.sshExecute(_host.ip, 22, _username, null, _password.peek(), "/opt/cloud/bin/router_proxy.sh " + script + " " + routerIP + " " + args,
                    60000, 60000, timeout * 1000);
        } catch (Exception e) {
            return new ExecutionResult(false, e.getMessage());
        }
        return new ExecutionResult(result.first(), result.second());
    }
View Full Code Here

Examples of com.dci.intellij.dbn.execution.ExecutionResult

    @Override
    public void environmentConfigChanged(String environmentTypeId) {
        EnvironmentVisibilitySettings visibilitySettings = getEnvironmentSettings(project).getVisibilitySettings();
        for (TabInfo tabInfo : resultTabs.getTabs()) {
            ExecutionResult executionResult = (ExecutionResult) tabInfo.getObject();
            if (executionResult != null) {
                ConnectionHandler connectionHandler = executionResult.getConnectionHandler();
                if (connectionHandler.getSettings().getDetailSettings().getEnvironmentTypeId().equals(environmentTypeId)) {
                    if (visibilitySettings.getExecutionResultTabs().value()){
                        tabInfo.setTabColor(connectionHandler.getEnvironmentType().getColor());
                    } else {
                        tabInfo.setTabColor(null);
View Full Code Here

Examples of com.dci.intellij.dbn.execution.ExecutionResult

    @Override
    public void environmentVisibilitySettingsChanged() {
        EnvironmentVisibilitySettings visibilitySettings = getEnvironmentSettings(project).getVisibilitySettings();
        for (TabInfo tabInfo : resultTabs.getTabs()) {
            ExecutionResult browserForm = (ExecutionResult) tabInfo.getObject();
            EnvironmentType environmentType = browserForm.getConnectionHandler().getEnvironmentType();
            if (visibilitySettings.getExecutionResultTabs().value()){
                tabInfo.setTabColor(environmentType.getColor());
            } else {
                tabInfo.setTabColor(null);
            }
View Full Code Here

Examples of com.dci.intellij.dbn.execution.ExecutionResult

            }
        }
    }

    public synchronized void removeTab(TabInfo tabInfo) {
        ExecutionResult executionResult = (ExecutionResult) tabInfo.getObject();
        if (executionResult == null) {
            removeMessagesTab();
        } else {
            removeResultTab(executionResult);
        }
View Full Code Here

Examples of com.intellij.execution.ExecutionResult

      XDebuggerManager.getInstance(module.getProject()).startSession(runner, env, contentToReuse, new XDebugProcessStarter() {
        @NotNull
        public XDebugProcess start(@NotNull final XDebugSession session) throws ExecutionException {
          try {
            NMERunningState runningState = new NMERunningState(env, module, false, true);
            final ExecutionResult executionResult = runningState.execute(executor, runner);
            final BCBasedRunnerParameters params = new BCBasedRunnerParameters();
            params.setModuleName(module.getName());
            return new HaxeDebugProcess(session, bc, params);
          }
          catch (IOException e) {
View Full Code Here

Examples of com.intellij.execution.ExecutionResult

      XDebuggerManager.getInstance(module.getProject()).startSession(runner, env, contentToReuse, new XDebugProcessStarter() {
        @NotNull
        public XDebugProcess start(@NotNull final XDebugSession session) throws ExecutionException {
          try {
            OpenFLRunningState runningState = new OpenFLRunningState(env, module, true, true);
            final ExecutionResult executionResult = runningState.execute(executor, runner);
            final BCBasedRunnerParameters params = new BCBasedRunnerParameters();
            params.setModuleName(module.getName());
            return new HaxeDebugProcess(session, bc, params);
          }
          catch (IOException e) {
View Full Code Here

Examples of com.vmware.aurora.composition.concurrent.ExecutionResult

      ExecutionResult[] result = new ExecutionResult[storedProcedures.length];
      for (int i = 0; i < result.length; i++) {
         VmOperation operation = getOperation(storedProcedures[i]);
         boolean flag = getFlag(operation);
         ExecutionResult r = null;
         if (flag) {
            r = new ExecutionResult(true, null);
            if (operation == VmOperation.CREATE_FOLDER) {
               CreateVMFolderSP sp = (CreateVMFolderSP)storedProcedures[i];
               setReturnFolder(sp);
            } else if (operation == VmOperation.CREATE_VM) {
               CreateVmSP sp = (CreateVmSP)storedProcedures[i];
               setReturnVM(sp);
            }
            r = new ExecutionResult(true, null);
         } else {
            r = new ExecutionResult(true, new Throwable("test failure"));
         }
         result[i] = r;
      }
      return result;
   }
View Full Code Here

Examples of fitnesse.testsystems.ExecutionResult

    else if (date.getTime() < minDate.getTime())
      minDate = date;
  }

  private void countResult(TestResultRecord summary) {
    ExecutionResult result = ExecutionResult.getExecutionResult(summary.getWikiPageName(), summary);
    if (result == ExecutionResult.FAIL || result == ExecutionResult.ERROR)
      failures++;
    else
      passes++;
  }
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.