else if (annType.isAnnotationPresent(ServiceType.class)) {
ServiceType serviceType
= (ServiceType) annType.getAnnotation(ServiceType.class);
Class factoryClass = serviceType.defaultFactory();
ProtocolServletFactory factory
= (ProtocolServletFactory) factoryClass.newInstance();
factory.setServiceType(ann);
factory.setAnnotated(annotated);
Method urlPatternMethod = annType.getMethod("urlPattern");
String urlPattern = (String) urlPatternMethod.invoke(ann);
ServletMapping mapping = new ServletMapping();
mapping.addURLPattern(urlPattern);
mapping.setBean(bean);
mapping.setProtocolFactory(factory);
mapping.init();
_webApp.addServletMapping(mapping);
// event.veto();
}
else if (annType.isAnnotationPresent(ProxyType.class)) {
ProxyType proxyType
= (ProxyType) annType.getAnnotation(ProxyType.class);
Class factoryClass = proxyType.defaultFactory();
ProtocolProxyFactory proxyFactory
= (ProtocolProxyFactory) factoryClass.newInstance();
proxyFactory.setProxyType(ann);
proxyFactory.setAnnotated(annotated);
Object proxy = proxyFactory.createProxy((Class) annotated.getBaseType());
AnnotatedTypeImpl annotatedType
= new AnnotatedTypeImpl((Class) annotated.getBaseType());
annotatedType.addAnnotation(EnhancedLiteral.ANNOTATION);
BeanFactory factory
= _beanManager.createBeanFactory(annotatedType);
/*
factory.name(bean.getName());
for (Type type : bean.getTypes()) {
factory.type(type);
}
*/
for (Annotation binding : annotated.getAnnotations()) {
Class bindingType = binding.annotationType();
if (bindingType.isAnnotationPresent(Qualifier.class))
factory.binding(binding);
}
_beanManager.addBean(factory.singleton(proxy));
event.veto();
}
}
} catch (Exception e) {