summaryrefslogtreecommitdiff
path: root/java/src/Ice/Dispatcher.java
blob: 063ceb7fa63100aeb69d5c4252bf64800810e443 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// **********************************************************************
//
// Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************

package Ice;

/**
 * You can control which thread receives operation invocations and AMI
 * callbacks by implementing the <code>Dispatcher</code> interface and
 * supplying an instance in <code>InitializationData</code> when
 * initializing a communicator.
 * <p>
 * For example, you can use this dispatching facility to ensure that
 * all invocations and callbacks are dispatched in a GUI event loop
 * thread so that it is safe to invoke directly on GUI objects.
 **/
public interface Dispatcher
{
    /**
     * Responsible for dispatching an invocation or AMI callback.
     * The method must eventually invoke <code>run</code> on the
     * supplied <code>Runnable</code> object.
     *
     * @param runnable The object encapsulating the invocation or
     * callback to be dispatched.
     * @param con The connection associated with the dispatch.
     **/
    void dispatch(Runnable runnable, Ice.Connection con);
}