01: /*
02: * MessageQueueClient: The message queue client library
03: * Copyright (C) 2006 Rift IT Contracting
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public
07: * License as published by the Free Software Foundation; either
08: * version 2.1 of the License, or (at your option) any later version.
09: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General Public
16: * License along with this library; if not, write to the Free Software
17: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18: *
19: * AsyncCallbackHandler.java
20: */
21:
22: // package path
23: package com.rift.coad.daemon.messageservice;
24:
25: // java imports
26: import java.rmi.Remote;
27: import java.rmi.RemoteException;
28:
29: /**
30: * The interface that must be implemented by any daemon dealing with async RPC
31: * results.
32: *
33: * @author Brett Chaldecott
34: */
35: public interface AsyncCallbackHandler extends Remote {
36: /**
37: * This method will be called to deal with a successfull result.
38: *
39: * @param messageId The id of the message.
40: * @param correllationId The correllation id.
41: * @param result The object containing the result of the processing.
42: */
43: public void onSuccess(String messageId, String correllationId,
44: Object result) throws RemoteException;
45:
46: /**
47: * This method will be called to deal with an exception that gets thrown
48: * when dealing with a RPC acync method.
49: *
50: * @param messageId The id of the message.
51: * @param correllationId The correllation id.
52: * @param caught The exception that got caught.
53: */
54: public void onFailure(String messageId, String correllationId,
55: Throwable caught) throws RemoteException;
56: }
|