summaryrefslogtreecommitdiff
path: root/java/src/IceInternal/OutgoingAsyncMessageCallback.java
blob: 9c069918933e3471a47a1b7e62f0830f70862a0f (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// **********************************************************************
//
// Copyright (c) 2003-2014 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 IceInternal;

//
// This interface is used by the connection to handle OutgoingAsync
// and BatchOutgoingAsync messages.
//
public interface OutgoingAsyncMessageCallback
{
    //
    // Called by the request handler to send the request over the connection.
    //
    int send(Ice.ConnectionI conection, boolean compress, boolean response)
        throws RetryException;

    int invokeCollocated(CollocatedRequestHandler handler);

    //
    // Called by the connection when the message is confirmed sent. The
    // connection is locked when this is called so this method can't call the
    // sent callback. Instead, this method returns true if there's a sent
    // callback and false otherwise. If true is returned, the connection will
    // call the __invokeSent() method bellow (which in turn should call the sent
    // callback).
    //
    boolean sent();

    //
    // Called by the connection to call the user sent callback.
    //
    void invokeSent();

    //
    // Called by the connection when the request failed.
    //
    void finished(Ice.Exception ex);

    //
    // Called by the retry queue to process retry.
    //
    void processRetry(boolean destroyed);

    //
    // Helper to dispatch the cancellation exception.
    //
    void dispatchInvocationCancel(Ice.LocalException ex, ThreadPool threadPool, Ice.Connection connection);
}