private void calculateHashes(Class clazz){ Class[] interfaces = clazz.getInterfaces(); for (int i = 0; i < interfaces.length; i++) { Class target = interfaces[i]; Map m = MarshalledInvocation.methodToHashesMap(target); marshalledInvocationMapping.putAll(m); } }
public RMIServerImpl(String replicantName, Class intf, Object handler) throws Exception { this.handler = handler; this.log = Logger.getLogger(this.getClass()); this.intf = intf; this.key = "/" + replicantName; // Obtain the hashes for the supported handler interfaces Class[] ifaces = handler.getClass().getInterfaces(); for (int i = 0; i < ifaces.length; i++) { Map tmp = MarshalledInvocation.methodToHashesMap(ifaces[i]); invokerMap.putAll(tmp); } this.rmistub = (RemoteStub) UnicastRemoteObject.exportObject(this, 0, null, null);// casting is necessary because interface has // changed in JDK>=1.2 RMIServer.rmiServers.put(key, this); }
Map m = MarshalledInvocation.methodToHashesMap(Connection.class); displayHashes(m); marshalledInvocationMapping.putAll(m); m = MarshalledInvocation.methodToHashesMap(Statement.class); displayHashes(m); marshalledInvocationMapping.putAll(m); m = MarshalledInvocation.methodToHashesMap(CallableStatement.class); displayHashes(m); marshalledInvocationMapping.putAll(m); m = MarshalledInvocation.methodToHashesMap(PreparedStatement.class); displayHashes(m); marshalledInvocationMapping.putAll(m); m = MarshalledInvocation.methodToHashesMap(ResultSet.class); displayHashes(m); marshalledInvocationMapping.putAll(m); m = MarshalledInvocation.methodToHashesMap(DatabaseMetaData.class); displayHashes(m); marshalledInvocationMapping.putAll(m);
Map<Long, Method> tmp = MarshalledInvocation.methodToHashesMap(ifaces[i]); invokerMap.putAll(tmp);