1 /*
2 *
3 * Fosstrak LLRP Commander (www.fosstrak.org)
4 *
5 * Copyright (C) 2008 ETH Zurich
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>
19 *
20 */
21
22 package org.fosstrak.llrp.adaptor;
23
24 import java.rmi.Remote;
25 import java.rmi.RemoteException;
26
27 import org.fosstrak.llrp.adaptor.exception.LLRPRuntimeException;
28
29 /**
30 * if you want to receive asynchronous message notifications
31 * you can implement this interface.
32 * @author sawielan
33 *
34 */
35 public interface AsynchronousNotifiable extends Remote {
36 /**
37 * when an asynchronous message arrived, this method will be invoked.
38 * @param message the LLRPMessage arrived asynchronously.
39 * @param readerName the nam eof the reader that read the message.
40 * @throws RemoteException when there has been an error in the communication.
41 */
42 public void notify(byte[] message, String readerName) throws RemoteException;
43
44 /**
45 * this method can be called asynchronously when
46 * there occurs an asynchronous error or exception.
47 * @param e the exception that was triggered.
48 * @param readerName the name of the reader that triggered the error.
49 * @throws RemoteException when there has been an error in the communication.
50 */
51 public void notifyError(LLRPRuntimeException e, String readerName) throws RemoteException;
52 }