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
package com.dy.testServer.forRmi;
 
import java.rmi.RemoteException;
 
import com.dy.common.mw.channel.rmi.RmiRequestCallback;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
 
public class RmiRequestedCallback implements RmiRequestCallback {
 
    @SuppressWarnings("unused")
    private static Logger log = LogManager.getLogger(RmiRequestedCallback.class.getName()) ;
 
    @Override
    public Object syncRequest(Object obj) throws RemoteException {
        String json ;
        try {
            json = Manager.dealRequest(obj);
        } catch (Exception e) {
            throw new RemoteException("服务端异常" , e) ;
        }
        return json ;
    }
 
    @Override
    public String asyncRequest(Object obj) throws RemoteException {
        String json ;
        try {
            json = Manager.dealRequest(obj);
        } catch (Exception e) {
            throw new RemoteException("服务端异常" , e) ;
        }
        return json ;
    }
 
}