Package java.util.concurrent

Examples of java.util.concurrent.Callable


        EJBContainer.createEJBContainer(p).getContext().bind("inject", this);
    }

    public void testAsManager() throws Exception {
        manager.call(new Callable() {
            public Object call() throws Exception {

                movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
                movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
                movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
View Full Code Here


            }
        });
    }

    public void testAsEmployee() throws Exception {
        employee.call(new Callable() {
            public Object call() throws Exception {

                movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
                movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
                movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
View Full Code Here

        EJBContainer.createEJBContainer(p).getContext().bind("inject", this);
    }

    public void testAsManager() throws Exception {
        manager.call(new Callable() {
            public Object call() throws Exception {

                movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
                movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
                movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
View Full Code Here

            }
        });
    }

    public void testAsEmployee() throws Exception {
        employee.call(new Callable() {
            public Object call() throws Exception {

                movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
                movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
                movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
View Full Code Here

    @AroundTimeout
    @AroundInvoke
    public Object aroundInvoke(final InvocationContext ejbContext) throws Exception {

        Callable callable = new Callable() {
            @Override
            public Object call() throws Exception {
                return invoke(ejbContext);
            }
        };

//        callable = new ScopeActivator(callable, ApplicationScoped.class);
//        callable = new ScopeActivator(callable, RequestScoped.class);
        return callable.call();
    }
View Full Code Here

     * @param cfId    the column family ID that was flushed
     * @param context the replay position of the flush
     */
    public void discardCompletedSegments(final Integer cfId, final ReplayPosition context) throws IOException
    {
        Callable task = new Callable()
        {
            public Object call() throws IOException
            {
                logger.debug("discard completed log segments for {}, column family {}", context, cfId);

View Full Code Here

     */
    public void forceNewSegment() throws ExecutionException, InterruptedException
    {
        logger.debug("Forcing new segment creation");

        Callable<?> task = new Callable()
        {
            public Object call() throws IOException
            {
                if (activeSegment.position() > 0)
                    activateNextSegment();
View Full Code Here

     * The bit flag associated with this column family is set in the
     * header and this is used to decide if the log file can be deleted.
    */
    void onMemtableFlush(final String tableName, final String cf, final CommitLog.CommitLogContext cLogCtx) throws IOException
    {
        Callable task = new Callable()
        {
            public Object call() throws IOException
            {
                Table table = Table.open(tableName);
                int id = table.getColumnFamilyId(cf);
View Full Code Here

            Bundle bundle = FrameworkUtil.getBundle(CommandsCompleter.class);
            BundleContext bc = bundle.getBundleContext();
            ServiceReference<ProxyManager> ref = bc.getServiceReference(ProxyManager.class);
            ProxyManager pm = ref != null ? bc.getService(ref) : null;
            if (pm != null) {
                Callable call = pm.unwrap(function);
                if (call != null) {
                    return unProxy((Function) call.call());
                }
                bc.ungetService(ref);
            }
        } catch (Throwable t) {
        }
View Full Code Here

   
    // helper method to apply migration on the migration stage. typical migration failures will throw an
    // InvalidRequestException. atypical failures will throw a RuntimeException.
    private static void applyMigrationOnStage(final Migration m)
    {
        Future f = StageManager.getStage(Stage.MIGRATION).submit(new Callable()
        {
            public Object call() throws Exception
            {
                m.apply();
                m.announce();
View Full Code Here

TOP

Related Classes of java.util.concurrent.Callable

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.