public void visitMethod(CompositeComponent parent, Method method,
PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> type,
DeploymentContext context)
throws ProcessingException {
Init annotation = method.getAnnotation(Init.class);
if (annotation == null) {
return;
}
if (method.getParameterTypes().length != 0) {
IllegalInitException e = new IllegalInitException("Initializer must not have argments");
e.setIdentifier(method.toString());
throw e;
}
if (type.getInitMethod() != null) {
throw new DuplicateInitException("More than one initializer found on implementaton");
}
if (Modifier.isProtected(method.getModifiers())) {
method.setAccessible(true);
}
type.setEagerInit(annotation.eager());
type.setInitMethod(method);
}