| 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 ; | 
|     } | 
|   | 
| } |