1 /**
2 *
3 */
4 package test.crispy.example.service;
5
6 import java.rmi.RemoteException;
7 import java.rmi.server.UnicastRemoteObject;
8
9 /**
10 * @author Linke
11 *
12 */
13 public class RemoteCalculatorImpl extends UnicastRemoteObject implements RemoteCalculator {
14
15 private static final long serialVersionUID = 92837464L;
16
17 public RemoteCalculatorImpl() throws RemoteException {
18 super();
19 }
20
21
22 public int add(int pvA, int pvB) throws RemoteException { return pvA + pvB; }
23 public long add (long a, long b) throws RemoteException { return a + b; }
24 public double add (double a, double b) throws RemoteException { return a + b; }
25
26 public int subtract(int pvA, int pvB) throws RemoteException { return pvA - pvB; }
27
28 public long addLong (long a, long b) throws RemoteException { return a + b; }
29 public Long addLong (Long a, Long b) throws RemoteException {
30 if (a == null || b == null) {
31 return null;
32 } else {
33 return new Long(a.longValue() + b.longValue());
34 }
35 }
36
37
38 public String[] echoArray(String[] pvArray) throws RemoteException { return pvArray; }
39 public Integer[] echoArray(Integer[] pvArray) throws RemoteException { return pvArray; }
40 public Long[] echoArray(Long[] pvArray) throws RemoteException { return pvArray; }
41 public Object[] echoArray(Object[] pvArray) throws RemoteException { return pvArray; }
42
43
44
45 }