Examples of ExecutionService


Examples of com.hazelcast.spi.ExecutionService

    private void handleRetryResponse() {
        if (invocationFuture.interrupted) {
            invocationFuture.set(INTERRUPTED_RESPONSE);
        } else {
            invocationFuture.set(WAIT_RESPONSE);
            final ExecutionService ex = nodeEngine.getExecutionService();
            // fast retry for the first few invocations
            if (invokeCount < MAX_FAST_INVOCATION_COUNT) {
                getAsyncExecutor().execute(this);
            } else {
                ex.schedule(ExecutionService.ASYNC_EXECUTOR, this, tryPauseMillis, TimeUnit.MILLISECONDS);
            }
        }
    }
View Full Code Here

Examples of com.hazelcast.spi.ExecutionService

    @Override
    public void loadKeys(List<Data> keys, boolean replaceExistingValues) {
        setLoaded(false);
        final NodeEngine nodeEngine = mapServiceContext.getNodeEngine();
        ExecutionService executionService = nodeEngine.getExecutionService();
        executionService.submit(ExecutionService.MAP_LOAD_ALL_KEYS_EXECUTOR, new LoadAllKeysTask(keys, replaceExistingValues));
    }
View Full Code Here

Examples of com.hazelcast.spi.ExecutionService

            return;
        }
        try {
            this.throwable = null;
            final AtomicInteger checkIfMapLoaded = new AtomicInteger(chunks.size());
            ExecutionService executionService = nodeEngine.getExecutionService();
            Map<Data, Object> chunkedKeys;
            while ((chunkedKeys = chunks.poll()) != null) {
                final Callback<Throwable> callback = createCallbackForThrowable();
                MapLoadAllTask task = new MapLoadAllTask(chunkedKeys, checkIfMapLoaded, callback);
                executionService.submit(ExecutionService.MAP_LOADER_EXECUTOR, task);
            }
        } catch (Throwable t) {
            throw ExceptionUtil.rethrow(t);
        }
    }
View Full Code Here

Examples of com.hazelcast.spi.ExecutionService

    @Override
    public void init(final NodeEngine nodeEngine, Properties properties) {
        long mergeFirstRunDelay = node.getGroupProperties().MERGE_FIRST_RUN_DELAY_SECONDS.getLong() * 1000;
        mergeFirstRunDelay = mergeFirstRunDelay <= 0 ? 100 : mergeFirstRunDelay; // milliseconds

        ExecutionService executionService = nodeEngine.getExecutionService();
        executionService.register(EXECUTOR_NAME, 2, 1000, ExecutorType.CACHED);

        long mergeNextRunDelay = node.getGroupProperties().MERGE_NEXT_RUN_DELAY_SECONDS.getLong() * 1000;
        mergeNextRunDelay = mergeNextRunDelay <= 0 ? 100 : mergeNextRunDelay; // milliseconds
        executionService.scheduleWithFixedDelay(EXECUTOR_NAME, new SplitBrainHandler(node),
                mergeFirstRunDelay, mergeNextRunDelay, TimeUnit.MILLISECONDS);

        long heartbeatInterval = node.groupProperties.HEARTBEAT_INTERVAL_SECONDS.getInteger();
        heartbeatInterval = heartbeatInterval <= 0 ? 1 : heartbeatInterval;
        executionService.scheduleWithFixedDelay(EXECUTOR_NAME, new Runnable() {
            public void run() {
                heartBeater();
            }
        }, heartbeatInterval, heartbeatInterval, TimeUnit.SECONDS);

        long masterConfirmationInterval = node.groupProperties.MASTER_CONFIRMATION_INTERVAL_SECONDS.getInteger();
        masterConfirmationInterval = masterConfirmationInterval <= 0 ? 1 : masterConfirmationInterval;
        executionService.scheduleWithFixedDelay(EXECUTOR_NAME, new Runnable() {
            public void run() {
                sendMasterConfirmation();
            }
        }, masterConfirmationInterval, masterConfirmationInterval, TimeUnit.SECONDS);

        long memberListPublishInterval = node.groupProperties.MEMBER_LIST_PUBLISH_INTERVAL_SECONDS.getInteger();
        memberListPublishInterval = memberListPublishInterval <= 0 ? 1 : memberListPublishInterval;
        executionService.scheduleWithFixedDelay(EXECUTOR_NAME, new Runnable() {
            public void run() {
                sendMemberListToOthers();
            }
        }, memberListPublishInterval, memberListPublishInterval, TimeUnit.SECONDS);
    }
View Full Code Here

Examples of org.arquillian.spacelift.execution.ExecutionService

        return ExecutionService.class.isAssignableFrom(type);
    }

    @Override
    public Object lookup(ArquillianResource resource, Annotation... qualifiers) {
        ExecutionService service = executionService.get();

        if (service == null) {
            throw new IllegalStateException("Unable to inject ExecutionService instance into the test.");
        }
View Full Code Here

Examples of org.jbpm.api.ExecutionService

    Environment env = ((EnvironmentFactory)processEngine).openEnvironment();

    try
    {

      ExecutionService execService = this.processEngine.getExecutionService();
      ProcessInstanceQuery query = execService.createProcessInstanceQuery();
      query.processDefinitionId(String.valueOf(procDefId));

      List<ProcessInstance> processInstances = query.list();

      List<ProcessInstanceRef> results = adoptProcessInstances(processInstances);
View Full Code Here

Examples of org.jbpm.api.ExecutionService

  {
    Environment env = ((EnvironmentFactory)processEngine).openEnvironment();

    try
    {
      ExecutionService execService = this.processEngine.getExecutionService();
      ProcessInstanceQuery query = execService.createProcessInstanceQuery();
      query.processInstanceId(instanceId);
      ProcessInstance processInstance = query.uniqueResult();
      return ModelAdaptor.adoptExecution( (ExecutionImpl)processInstance);
    }
    finally
View Full Code Here

Examples of org.jbpm.api.ExecutionService

    Environment env = ((EnvironmentFactory)processEngine).openEnvironment();

    try
    {
      ExecutionService execService = this.processEngine.getExecutionService();
      Set<String> keys = execService.getVariableNames(instanceId);
      data = execService.getVariables(instanceId, keys);
    }
    finally
    {
      env.close();
    }
View Full Code Here

Examples of org.jbpm.api.ExecutionService

  {
    Environment env = ((EnvironmentFactory)processEngine).openEnvironment();

    try
    {
      ExecutionService execService = this.processEngine.getExecutionService();
      Execution exec = execService.startProcessInstanceById(definitionId);
      return ModelAdaptor.adoptExecution((ExecutionImpl)exec);
    }
    finally{
      env.close();
    }
View Full Code Here

Examples of org.jbpm.api.ExecutionService

  {
    Environment env = ((EnvironmentFactory)processEngine).openEnvironment();

    try
    {
      ExecutionService execService = this.processEngine.getExecutionService();
      Execution exec = execService.startProcessInstanceById(definitionId);
      execService.setVariables(exec.getId(), processVars);
     
      return ModelAdaptor.adoptExecution((ExecutionImpl)exec);
    }
    finally{
      env.close();
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.