private Set getMethodDescriptorsOfNameAndParameters(String name, String[] parameterArray, Collection methodDescriptors) { Set methods = new HashSet(); for (Iterator itr = getMethodDescriptorsOfName(name, methodDescriptors).iterator(); itr.hasNext();) { MethodDescriptor next = (MethodDescriptor) itr.next(); next.setEjbName(getEjbName()); if (stringArrayEquals(parameterArray, next.getParameterClassNames())) { methods.add(next); } } return methods; }
private Set getMethodDescriptorsOfNameAndParameters(String name, String[] parameterArray, Collection methodDescriptors) { Set methods = new HashSet(); for (Iterator itr = getMethodDescriptorsOfName(name, methodDescriptors).iterator(); itr.hasNext();) { MethodDescriptor next = (MethodDescriptor) itr.next(); next.setEjbName(getEjbName()); if (stringArrayEquals(parameterArray, next.getParameterClassNames())) { methods.add(next); } } return methods; }
/** Indicates if a method descriptor implies the other one*/ public boolean implies(Object other) { if (other != null && other instanceof MethodDescriptor) { MethodDescriptor otherMethodDescriptor = (MethodDescriptor) other; if (getName().equals(ALL_METHODS) || getName().equals(otherMethodDescriptor.getName())) { if (getParameterClassNames() == null || stringArrayEquals(getParameterClassNames(), otherMethodDescriptor.getParameterClassNames())) { return true; } } } return false; }
/** Indicates if a method descriptor implies the other one*/ public boolean implies(Object other) { if (other != null && other instanceof MethodDescriptor) { MethodDescriptor otherMethodDescriptor = (MethodDescriptor) other; if (getName().equals(ALL_METHODS) || getName().equals(otherMethodDescriptor.getName())) { if (getParameterClassNames() == null || stringArrayEquals(getParameterClassNames(), otherMethodDescriptor.getParameterClassNames())) { return true; } } } return false; }
/** Equlity iff the parameter names match and the name matches.*/ public boolean equals(Object other) { if (other instanceof MethodDescriptor) { MethodDescriptor otherMethodDescriptor = (MethodDescriptor) other; if (otherMethodDescriptor.getName().equals(getName()) && stringArrayEquals(otherMethodDescriptor.getParameterClassNames(), getParameterClassNames())) { if (getEjbClassSymbol()!=null && otherMethodDescriptor.getEjbClassSymbol()!=null) { return getEjbClassSymbol().equals(otherMethodDescriptor.getEjbClassSymbol()); } // if the ejb class symbol is not defined in both descriptor, we consider // the method described being the same. return true; } } return false; }
/** Equlity iff the parameter names match and the name matches.*/ public boolean equals(Object other) { if (other instanceof MethodDescriptor) { MethodDescriptor otherMethodDescriptor = (MethodDescriptor) other; if (otherMethodDescriptor.getName().equals(getName()) && stringArrayEquals(otherMethodDescriptor.getParameterClassNames(), getParameterClassNames())) { // If method names and params match, it still can be a wild-card method-name... // And wild-card can be present with farious interfaces or no method-intf at all... if (getEjbClassSymbol()!=null && otherMethodDescriptor.getEjbClassSymbol()!=null) { // Method descriptors are equal if method-intf value is the same, even if they have // wild-card method names return getEjbClassSymbol().equals(otherMethodDescriptor.getEjbClassSymbol()); } else if (getName().equals(ALL_METHODS)) { // For wild-card method names, method descriptors are equal if method-intf value is not set in both return (getEjbClassSymbol() == null && otherMethodDescriptor.getEjbClassSymbol() == null); } // If method name is provided, and parameters match, we consider the method described being the same // if the ejb class symbol (method-intf) is not defined in one of the descriptors return true; } } return false; }