//ignore
}
}
private void addPolicies(AbstractServiceFactoryBean factory, OperationInfo inf, Method m) {
Policy p = m.getAnnotation(Policy.class);
Policies ps = m.getAnnotation(Policies.class);
if (p != null || ps != null) {
List<Policy> list = new ArrayList<Policy>();
if (p != null) {
list.add(p);
}
if (ps != null) {
list.addAll(Arrays.asList(ps.value()));
}
ListIterator<Policy> it = list.listIterator();
while (it.hasNext()) {
p = it.next();
Policy.Placement place = p.placement();
if (place == Policy.Placement.DEFAULT) {
place = Policy.Placement.BINDING_OPERATION;
}
ServiceInfo service = inf.getInterface().getService();
Class<?> cls = m.getDeclaringClass();
switch (place) {
case PORT_TYPE_OPERATION:
addPolicy(inf, service, p, cls,
inf.getName().getLocalPart() + "PortTypeOpPolicy");
it.remove();
break;
case PORT_TYPE_OPERATION_INPUT:
addPolicy(inf.getInput(), service, p, cls,
inf.getName().getLocalPart() + "PortTypeOpInputPolicy");
it.remove();
break;
case PORT_TYPE_OPERATION_OUTPUT:
addPolicy(inf.getOutput(), service, p, cls,
inf.getName().getLocalPart() + "PortTypeOpOutputPolicy");
it.remove();
break;
case PORT_TYPE_OPERATION_FAULT: {
for (FaultInfo f : inf.getFaults()) {
if (p.faultClass().equals(f.getProperty(Class.class.getName()))) {
addPolicy(f, service, p, cls,
f.getName().getLocalPart() + "PortTypeOpFaultPolicy");
it.remove();
}
}