Example usage for java.util.concurrent Callable interface-usage

List of usage examples for java.util.concurrent Callable interface-usage

Introduction

In this page you can find the example usage for java.util.concurrent Callable interface-usage.

Usage

From source file CallableTask.java

class CallableTask implements Callable<Integer> {
    private int taskId;

    public CallableTask(int taskId) {
        this.taskId = taskId;
    }

From source file WordLengthCallable.java

class WordLengthCallable implements Callable<Integer> {
    private Random random = new Random();

    public Integer call() throws InterruptedException {
        int sleepTime = (2 + random.nextInt(16)) * 500;
        Thread.sleep(sleepTime);

From source file org.wso2.carbon.inbound.endpoint.protocol.hl7.core.CallableTask.java

/**
 * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
 *
 * WSO2 Inc. licenses this file to you under the Apache License,
 * Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License.

From source file Main.java

class Task1 implements Callable<Double> {
    Task1() {
    }

    public Double call() {
        return 0.0;

From source file Main.java

class Avg implements Callable<Double> {
    Avg() {
    }

    public Double call() {
        return 0.0;

From source file commands.Command.java

/**
 * An interface for any command which is to be interpreted by a {@link shells.Shell Shell}. 
 * 
 * @author Jason Campos <jcampos8782@gmail.com>
 */
public interface Command extends Callable<Void> {

From source file gov.nih.nci.integration.invoker.ServiceBroadcasterTask.java

/**
 * This class provide method to call the invoke method of a strategy class.
 * @author Vinodh
 *
 */
public class ServiceBroadcasterTask implements Callable<ServiceInvocationResult> {

From source file Main.java

class Task2<String> implements Callable<String> {
    @Override
    public String call() throws Exception {
        Thread.sleep(1000 * 2);
        int i = 3;
        if (i == 3)

From source file io.github.apfelcreme.Guilds.UUIDFetcher.java

/**
 * Guilds
 * Copyright (C) 2015 Lord36 aka Apfelcreme
 * <p/>
 * This program is free software;
 * you can redistribute it and/or modify it under the terms of the GNU General

From source file gmailclientfx.models.FetchMessageCallable.java

/**
 *
 * @author zeljko94
 */
public class FetchMessageCallable implements Callable<MyMessage> {
    private MimeMessage msg;