Start virtual circuit
@param executorFactory
@throws IOException
973966
@Override
    public void start(Supplier<ExecutorService> executorFactory) throws IOException
    {
        future = executorFactory.get().submit(this);
    }
499294
public void runIntoJTP(final JRebirthRunnable runnable) {

        if (getFacade().executorService().checkAvailability(runnable.priority())) {
            getFacade().executorService().execute(runnable);
            LOGGER.log(JTP_QUEUED, runnable.toString());
        } else {
            getFacade().highPriorityExecutorService().execute(runnable);
            LOGGER.log(HPTP_QUEUED, runnable.toString());
        }

    }
669796
void start(Future<DataPort> dataPortFuture) {
        this.dataPortFuture = dataPortFuture;
        this.running.set(true);
        this.stopped = connection.getExecutor().submit(this, Boolean.TRUE);
    }
949072
@GwtIncompatible
    public static void start() {
        computation().start();
        io().start();
        newThread().start();
        single().start();
        trampoline().start();
        SchedulerPoolFactory.start();
    }
962390
@Override
  public void start(CoprocessorEnvironment e) throws IOException {
    if (e instanceof RegionCoprocessorEnvironment) {
      RegionCoprocessorEnvironment env = (RegionCoprocessorEnvironment) e;
      Supplier<TransactionStateCache> cacheSupplier = getTransactionStateCacheSupplier(env);
      this.cache = cacheSupplier.get();

      HTableDescriptor tableDesc = env.getRegion().getTableDesc();
      for (HColumnDescriptor columnDesc : tableDesc.getFamilies()) {
        String columnTTL = columnDesc.getValue(TxConstants.PROPERTY_TTL);
        long ttl = 0;
        if (columnTTL != null) {
          try {
            ttl = Long.parseLong(columnTTL);
            LOG.info("Family " + columnDesc.getNameAsString() + " has TTL of " + columnTTL);
          } catch (NumberFormatException nfe) {
            LOG.warn("Invalid TTL value configured for column family " + columnDesc.getNameAsString() +
                       ", value = " + columnTTL);
          }
        }
        ttlByFamily.put(columnDesc.getName(), ttl);
      }

      this.allowEmptyValues = env.getConfiguration().getBoolean(TxConstants.ALLOW_EMPTY_VALUES_KEY,
                                                                TxConstants.ALLOW_EMPTY_VALUES_DEFAULT);
      this.readNonTxnData = Boolean.valueOf(tableDesc.getValue(TxConstants.READ_NON_TX_DATA));
      if (readNonTxnData) {
        LOG.info("Reading pre-existing data enabled for table " + tableDesc.getNameAsString());
      }
    }
  }
136130
public void start() throws IOException {
        myServerSocket = new ServerSocket();
        myServerSocket.bind((hostname != null) ? new InetSocketAddress(
                hostname, myPort) : new InetSocketAddress(myPort));

        myThread = new Thread(new Runnable() {
            @Override
            public void run() {
                do {
                    try {
                        final Socket finalAccept = myServerSocket.accept();
                        registerConnection(finalAccept);
                        finalAccept.setSoTimeout(SOCKET_READ_TIMEOUT);
                        final InputStream inputStream = finalAccept
                                .getInputStream();
                        asyncRunner.exec(new Runnable() {
                            @Override
                            public void run() {
                                OutputStream outputStream = null;
                                try {
                                    outputStream = finalAccept
                                            .getOutputStream();
                                    TempFileManager tempFileManager = tempFileManagerFactory
                                            .create();
                                    HTTPSession session = new HTTPSession(
                                            tempFileManager, inputStream,
                                            outputStream, finalAccept
                                                    .getInetAddress());
                                    while (!finalAccept.isClosed()) {
                                        session.execute();
                                    }
                                } catch (Exception e) {
                                    // When the socket is closed by the client,
                                    // we throw our own SocketException
                                    // to break the "keep alive" loop above.
                                    if (!(e instanceof SocketException && "NanoHttpd Shutdown"
                                            .equals(e.getMessage()))) {
                                        e.printStackTrace();
                                    }
                                } finally {
                                    safeClose(outputStream);
                                    safeClose(inputStream);
                                    safeClose(finalAccept);
                                    unRegisterConnection(finalAccept);
                                }
                            }
                        });
                    } catch (IOException e) {
                    }
                } while (!myServerSocket.isClosed());
            }
        });
        myThread.setDaemon(true);
        myThread.setName("NanoHttpd Main Listener");
        myThread.start();
    }
463242
def start(dispatcher, future, *, loop=None, skip_updates=None,
          on_startup=None, on_shutdown=None):
    
    executor = Executor(dispatcher, skip_updates=skip_updates, loop=loop)
    _setup_callbacks(executor, on_startup, on_shutdown)

    return executor.start(future)
1001679
@Override
	public final void start() throws JMSException
    {
    	externalAccessLock.readLock().lock();
    	try
		{
	        checkNotClosed();
	        if (started)
	            return;
	        started = true;
	        
	        // Wake up waiting consumers
	        wakeUpLocalConsumers();
		}
    	finally
    	{
    		externalAccessLock.readLock().unlock();
    	}
    }
689614
public void setExecutorService(ExecutorService v)
   {
      if (v != null)
      {
         executorService = v;
         isExternal = true;
      }
      else
      {
         executorService = null;
         isExternal = false;
      }
   }
633855
@Override
	public void start(BundleContext context) throws Exception {
		final String sourceMethod = "start"; //$NON-NLS-1$
		boolean isTraceLogging = log.isLoggable(Level.FINER);
		if (isTraceLogging) {
			log.entering(Activator.class.getName(), sourceMethod, new Object[]{context});
		}
		super.start(context);

		// Verify the bundle id.
		if (!context.getBundle().getSymbolicName().equals(BUNDLE_NAME)) {
			throw new IllegalStateException();
		}
		serviceRegistrations = new LinkedList<ServiceRegistration<?>>();
		Activator.context = context;
		Dictionary<String, String> dict = new Hashtable<String, String>();
		dict.put("name", BUNDLE_NAME); //$NON-NLS-1$

		ServiceRegistration<?> commandProviderReg = registerCommandProvider();
		if (commandProviderReg != null) {
			serviceRegistrations.add(commandProviderReg);
		}
		// Create the executors provider.  The executors provider is created by the
		// activator primarily to allow executors to be shared by all of the
		// aggregators created by this bundle.
		dict = new Hashtable<String, String>();
		dict.put("name", BUNDLE_NAME); //$NON-NLS-1$
		executors = newExecutors();
		serviceRegistrations.add(
				context.registerService(IExecutors.class.getName(), executors, dict));

		if (isTraceLogging) {
			log.exiting(Activator.class.getName(), sourceMethod);
		}
	}
1128230
public void begin() throws ResourceException {
        if (tc.isEntryEnabled())
            Tr.entry(this, tc, "begin", ivMC);

        // if the MC marked Stale, it means the user requested a purge pool with an immediate option
        // so don't allow any work on the mc
        if (ivMC._mcStale) {
            if (tc.isDebugEnabled())
                Tr.debug(this, tc, "MC is stale");
            throw new DataStoreAdapterException("INVALID_CONNECTION", AdapterUtil.staleX(), WSRdbSpiLocalTransactionImpl.class);
        }

        if (dsConfig.get().enableMultithreadedAccessDetection) 
            ivMC.detectMultithreadedAccess(); 

        if (!ivMC.isTransactional()) { // do nothing if no enlistment
            if (tc.isEntryEnabled())
                Tr.exit(this, tc, "begin", "no-op.  Enlistment disabled");
            return;
        }

        if (tc.isDebugEnabled()) {
            String cId = null;
            try {
                cId = ivMC.mcf.getCorrelator(ivMC); 
            } catch (SQLException x) {
                // will just log the exception here and ignore it since its in trace
                Tr.debug(
                         tc,
                         "got an exception trying to get the correlator, exception is: ",
                         x);
            }

            if (cId != null) {
                StringBuffer stbuf = new StringBuffer(200);
                stbuf.append("Correlator: DB2, ID: ");
                stbuf.append(cId);
                stbuf.append(" Transaction : ");
                stbuf.append(this);
                stbuf.append(" BEGIN");

                Tr.debug(this, tc, stbuf.toString());
            }
        }

        ResourceException re;

        // Remove synchronization. 

        re = ivStateManager.isValid(WSStateManager.LT_BEGIN);

        if (re == null) {
            //Note the MC handles all notification of connection error event and such on setAutoCommit
            // also, it sets it only when necessary

            try {
                if (ivMC.getAutoCommit())
                    ivMC.setAutoCommit(false);
            } catch (SQLException sqle) {
                FFDCFilter.processException(
                                            sqle,
                                            currClass.getName() + ".begin",
                                            "126",
                                            this);

                throw new DataStoreAdapterException(
                                "DSA_ERROR",
                                sqle,
                                currClass);
            }

            //Note this exception is not caught - This is because
            //  1)  it is of type ResourceException so it can be thrown from the method
            //  2)  if isValid is okay, this should never fail.  If isValid is not okay
            //     an exception is thrown from there
            // We already validated the state in this sync block, so just set it. 
            ivStateManager.transtate = WSStateManager.LOCAL_TRANSACTION_ACTIVE;
        } else 
        {
            // state change was not valid         

            LocalTransactionException local_tran_excep =
                            new LocalTransactionException(re.getMessage());

            DataStoreAdapterException dsae = new DataStoreAdapterException(
                                            "WS_INTERNAL_ERROR",
                                            local_tran_excep,
                                            currClass,
                                            "Cannot start SPI local transaction.",
                                            "",
                                            local_tran_excep.getMessage());

            // Use FFDC to log the possible components list. 
            FFDCFilter.processException(
                                        dsae,
                                        "com.ibm.ws.rsadapter.spi.WSRdbSpiLocalTransactionImpl.begin",
                                        "127",
                                        this,
                                        new Object[] { "Possible components: WebSphere J2C Implementation" });
            if (tc.isEntryEnabled())
                Tr.exit(this, tc, "begin", "Exception"); 
            throw dsae;
        }

        if (tc.isEventEnabled())
            Tr.event(
                     tc,
                     "SpiLocalTransaction started.  ManagedConnection state is "
                                     + ivMC.getTransactionStateAsString());

        if (tc.isEntryEnabled())
            Tr.exit(this, tc, "begin");
    }
293979
public void startup() {
        if (isRunning) return;

        Executors.getInstance().execute(new Runnable() {
            @Override
            public void run() {
                DispatcherHandler handler = new DispatcherHandler(AndServer.getContext());
                ComponentRegister register = new ComponentRegister(AndServer.getContext());
                register.register(handler, mGroup);

                mHttpServer = ServerBootstrap.bootstrap()
                    .setSocketConfig(SocketConfig.custom()
                        .setSoKeepAlive(true)
                        .setSoReuseAddress(true)
                        .setSoTimeout(mTimeout)
                        .setTcpNoDelay(true)
                        .build())
                    .setConnectionConfig(
                        ConnectionConfig.custom().setBufferSize(4 * 1024).setCharset(Charsets.UTF_8).build())
                    .setLocalAddress(mInetAddress)
                    .setListenerPort(mPort)
                    .setSslContext(mSSLContext)
                    .setSslSetupHandler(new SSLInitializerWrapper(mSSLInitializer))
                    .setServerInfo("AndServer/2.0.0")
                    .registerHandler("*", handler)
                    .setExceptionLogger(ExceptionLogger.NO_OP)
                    .create();
                try {
                    isRunning = true;
                    mHttpServer.start();

                    Executors.getInstance().post(new Runnable() {
                        @Override
                        public void run() {
                            if (mListener != null) mListener.onStarted();
                        }
                    });
                    Runtime.getRuntime().addShutdownHook(new Thread() {
                        @Override
                        public void run() {
                            mHttpServer.shutdown(3, TimeUnit.SECONDS);
                        }
                    });
                } catch (final Exception e) {
                    Executors.getInstance().post(new Runnable() {
                        @Override
                        public void run() {
                            if (mListener != null) mListener.onException(e);
                        }
                    });
                }
            }
        });
    }
280526
static StartResult start(final ExecutionContext context, final Iterable<SagaModule> modules) {
        Exception possibleStartException = null;
        List<Supplier<Optional<Exception>>> finishers = new ArrayList<>();
        List<BiFunction<Object, Throwable, Optional<Exception>>> errorHandlers = new ArrayList<>();

        try {
            for (final SagaModule module : modules) {
                finishers.add(createFinisher(module, context));
                errorHandlers.add(createErrorHandler(module, context));

                module.onStart(context);
            }
        } catch (Exception ex) {
            possibleStartException = ex;
        }

        return new StartResult(possibleStartException, new ModulesInvoker(finishers, errorHandlers));
    }
655914
public RingBuffer<T> start(final Executor executor)
    {
        if (!started.compareAndSet(false, true))
        {
            throw new IllegalStateException("WorkerPool has already been started and cannot be restarted until halted.");
        }

        final long cursor = ringBuffer.getCursor();
        workSequence.set(cursor);

        for (WorkProcessor<?> processor : workProcessors)
        {
            processor.getSequence().set(cursor);
            executor.execute(processor);
        }

        return ringBuffer;
    }
960104
public void run(Runnable runnable, Executor executor)
    {
        if (this.goForward())
        {
            for (int i = this.from; i <= this.to; i += this.step)
            {
                executor.execute(runnable);
            }
        }
        else
        {
            for (int i = this.from; i >= this.to; i += this.step)
            {
                executor.execute(runnable);
            }
        }
    }
1254060
private void init() throws IOException {
        if (initialized.compareAndSet(false, true)) {
            log.debug("Init: {}", mode);
            // instance an executor for queue handling
            scheduledExecutorService = Executors.newScheduledThreadPool(schedulerThreadSize, new CustomizableThreadFactory("FileConsumerExecutor-"));
            // if the path is null, the consumer has been uninitialized
            if (path != null) {
                if (log.isDebugEnabled()) {
                    Path parent = path.getParent();
                    log.debug("Parent abs: {} dir: {}", parent.isAbsolute(), Files.isDirectory(parent));
                }
                if (IClientStream.MODE_APPEND.equals(mode)) {
                    if (Files.notExists(path)) {
                        throw new IOException("File to be appended doesnt exist, verify the record mode");
                    }
                    log.debug("Path: {}\nRead: {} write: {} size: {}", path, Files.isReadable(path), Files.isWritable(path), Files.size(path));
                    writer = new FLVWriter(path, true);
                } else if (IClientStream.MODE_RECORD.equals(mode)) {
                    try {
                        // delete existing file
                        if (Files.deleteIfExists(path)) {
                            log.debug("File deleted");
                        }
                        // ensure parent dirs exist
                        Files.createDirectories(path.getParent());
                        // create the file
                        path = Files.createFile(path);
                    } catch (IOException ioe) {
                        log.error("File creation error: {}", ioe);
                    }
                    if (!Files.isWritable(path)) {
                        throw new IOException("File is not writable");
                    }
                    log.debug("Path: {}\nRead: {} write: {}", path, Files.isReadable(path), Files.isWritable(path));
                    writer = new FLVWriter(path, false);
                    if (audioConfigurationTag != null) {
                        writer.writeTag(audioConfigurationTag);
                    }
                    if (videoConfigurationTag != null) {
                        writer.writeTag(videoConfigurationTag);
                        gotVideoKeyframe = true;
                    }
                } else {
                    //throw new IllegalStateException(String.format("Illegal mode type: %s", mode));
                    try {
                        // delete existing file since we're not recording nor appending
                        if (Files.deleteIfExists(path)) {
                            log.debug("File deleted");
                        }
                    } catch (IOException ioe) {
                        log.error("File creation error: {}", ioe);
                    }
                }
            } else {
                log.warn("Consumer is uninitialized");
            }
            log.debug("Init - complete");
        }
    }
226169
public void execute() {

        ExecutorService executorService = MoreExecutors.sameThreadExecutor();

        for (Transaction<V, R> transaction : transactions) {
            if (!transaction.isComplete()) {
                executorService.execute(transaction);
            }
        }

        try {
            executorService.shutdown();
            executorService.awaitTermination(Long.MAX_VALUE, TimeUnit.MILLISECONDS);
        } catch (InterruptedException e) {
            throw new TransfuseTransactionException("Pool executor interrupted", e);
        }
    }