View Javadoc

1   package test.crispy.example.service;
2   
3   import java.rmi.RemoteException;
4   import java.rmi.server.UnicastRemoteObject;
5   
6   import net.sf.crispy.InvocationException;
7   
8   import test.crispy.example.model.Kunde;
9   import test.crispy.example.model.Primitive;
10  
11  public class RemoteEchoImpl extends UnicastRemoteObject implements RemoteEcho {
12  
13  	private static final long serialVersionUID = 985378781246727L;
14  	
15  	public RemoteEchoImpl() throws RemoteException {
16  		super();
17  	}
18  
19  	public String ping() throws RemoteException { 
20  		return PING_STRING;
21  	}
22  
23  	public String echo(String pvEchoString) throws RemoteException {
24  		return pvEchoString;
25  	}
26  	
27  	public Primitive echoPrimitive(Primitive pvPrimitive) throws RemoteException {
28  		return pvPrimitive;
29  	}
30  
31  	public Kunde renameKunde(Kunde pvKunde, String pvNewName) throws RemoteException {
32  		if (pvKunde == null) { return null; }
33  		pvKunde.setName(pvNewName);
34  		return pvKunde;
35  	}
36  
37  	public String throwException(String pvMessage) throws RemoteException {
38  		throw new InvocationException("Test Remote-Exception: " + pvMessage);
39  	}
40  
41  }