private void calculateHashes(){ Class[] cfInterfaces = cf.getClass().getInterfaces(); for (int i = 0; i < cfInterfaces.length; i++) { Class clazz = cfInterfaces[i]; Method[] methods = clazz.getMethods(); for (int j = 0; j < methods.length; j++) { Method m = methods[j]; Long hash = new Long(MarshalledInvocation.calculateHash(m)); marshalledInvocationMapping.put(hash, m); } } }
protected void setupMarshalledInvocationMapping() throws Exception { // Create method mappings for container invoker if (homeInterface != null) { Method [] m = homeInterface.getMethods(); for (int i = 0 ; i<m.length ; i++) { marshalledInvocationMapping.put( new Long(MarshalledInvocation.calculateHash(m[i])), m[i]); } } if (remoteInterface != null) { Method [] m = remoteInterface.getMethods(); for (int j = 0 ; j<m.length ; j++) { marshalledInvocationMapping.put( new Long(MarshalledInvocation.calculateHash(m[j])), m[j]); } } // Get the getEJBObjectMethod Method getEJBObjectMethod = Class.forName("javax.ejb.Handle").getMethod("getEJBObject", new Class[0]); // Hash it marshalledInvocationMapping.put(new Long(MarshalledInvocation.calculateHash(getEJBObjectMethod)),getEJBObjectMethod); }
/** * sets up marshalled invocation mappings * @throws Exception */ protected void setupMarshalledInvocationMapping() throws Exception { // Create method mappings for container invoker if (homeInterface != null) { Method[] m = homeInterface.getMethods(); for (int i = 0; i < m.length; i++) { marshalledInvocationMapping.put(new Long(MarshalledInvocation.calculateHash(m[i])), m[i]); } } if (remoteInterface != null) { Method[] m = remoteInterface.getMethods(); for (int j = 0; j < m.length; j++) { marshalledInvocationMapping.put(new Long(MarshalledInvocation.calculateHash(m[j])), m[j]); } } // Get the getEJBObjectMethod Method getEJBObjectMethod = Class.forName("javax.ejb.Handle").getMethod("getEJBObject", new Class[0]); // Hash it marshalledInvocationMapping.put(new Long(MarshalledInvocation.calculateHash(getEJBObjectMethod)), getEJBObjectMethod); }
Long hash = new Long(MarshalledInvocation.calculateHash(method)); tmpMap.put(hash, method); Long hash = new Long(MarshalledInvocation.calculateHash(method)); tmpMap.put(hash, method);
Long hash = new Long(MarshalledInvocation.calculateHash(method)); tmpMap.put(hash, method);
@Override protected void createService() throws Exception { if (this.clusterPartition == null) { throw new IllegalStateException("HAPartition property must be set before starting HAJNDI service"); } if (this.distributedTreeManager == null) { throw new IllegalStateException("DistributedTreeManager property must be set before starting HAJNDI service"); } this.log.debug("Initializing HAJNDI server on partition: " + this.clusterPartition.getPartitionName()); // Start HAJNDI service this.theServer = new HAJNDI(this.clusterPartition, this.distributedTreeManager, localNamingInstance); // Build the Naming interface method map Map<Long, Method> map = new HashMap<Long, Method>(13); Method[] methods = Naming.class.getMethods(); for (Method method: methods) { Long hash = new Long(MarshalledInvocation.calculateHash(method)); map.put(hash, method); } this.marshalledInvocationMapping = Collections.unmodifiableMap(map); // share instance for in-vm discovery NamingContext.setHANamingServerForPartition(this.clusterPartition.getPartitionName(), this.theServer); }
Long hash = new Long(MarshalledInvocation.calculateHash(method)); tmpMap.put(hash, method);
if(methodHash == 0) methodHash = calculateHash(this.method);
for(int i = 0; i < methods.length; i++) long hash = MarshalledInvocation.calculateHash(methods[i]); beanMethodInvokerMap.put(new Long(hash), methods[i]); for(int i = 0; i < methods.length; i++) long hash = MarshalledInvocation.calculateHash(methods[i]); homeMethodInvokerMap.put(new Long(hash), methods[i]);
for(int j = 0; j < methods.length; ++j) methodMap.put(new Long(MarshalledInvocation.calculateHash(methods[j])), methods[j]);
Long hash = new Long(MarshalledInvocation.calculateHash(method)); marshalledInvocationMapping.put(hash, method);
invocationCopy.setMethodHash(MarshalledInvocation.calculateHash(invocation.getMethod())); invocationCopy.setMarshalledArguments(value); invocationCopy.setArguments(null);