@SuppressWarnings({ "unchecked" }) private <T extends Service> void processInjection(T service, Method injectionMethod, InjectService injectService) { if ( injectionMethod.getParameterTypes() == null || injectionMethod.getParameterCount() != 1 ) { throw new ServiceDependencyException( "Encountered @InjectService on method with unexpected number of parameters" ); } Class dependentServiceRole = injectService.serviceRole(); if ( dependentServiceRole == null || dependentServiceRole.equals( Void.class ) ) { dependentServiceRole = injectionMethod.getParameterTypes()[0]; } // todo : because of the use of proxies, this is no longer returning null here... final Service dependantService = getService( dependentServiceRole ); if ( dependantService == null ) { if ( injectService.required() ) { throw new ServiceDependencyException( "Dependency [" + dependentServiceRole + "] declared by service [" + service + "] not found" ); } } else { try { injectionMethod.invoke( service, dependantService ); } catch ( Exception e ) { throw new ServiceDependencyException( "Cannot inject dependency service", e ); } } }
@SuppressWarnings({ "unchecked" }) private <T extends Service> void processInjection(T service, Method injectionMethod, InjectService injectService) { if ( injectionMethod.getParameterTypes() == null || injectionMethod.getParameterTypes().length != 1 ) { throw new ServiceDependencyException( "Encountered @InjectService on method with unexpected number of parameters" ); } Class dependentServiceRole = injectService.serviceRole(); if ( dependentServiceRole == null || dependentServiceRole.equals( Void.class ) ) { dependentServiceRole = injectionMethod.getParameterTypes()[0]; } // todo : because of the use of proxies, this is no longer returning null here... final Service dependantService = getService( dependentServiceRole ); if ( dependantService == null ) { if ( injectService.required() ) { throw new ServiceDependencyException( "Dependency [" + dependentServiceRole + "] declared by service [" + service + "] not found" ); } } else { try { injectionMethod.invoke( service, dependantService ); } catch ( Exception e ) { throw new ServiceDependencyException( "Cannot inject dependency service", e ); } } }
@SuppressWarnings({ "unchecked" }) private <T extends Service> void processInjection(T service, Method injectionMethod, InjectService injectService) { if ( injectionMethod.getParameterTypes() == null || injectionMethod.getParameterCount() != 1 ) { throw new ServiceDependencyException( "Encountered @InjectService on method with unexpected number of parameters" ); } Class dependentServiceRole = injectService.serviceRole(); if ( dependentServiceRole == null || dependentServiceRole.equals( Void.class ) ) { dependentServiceRole = injectionMethod.getParameterTypes()[0]; } // todo : because of the use of proxies, this is no longer returning null here... final Service dependantService = getService( dependentServiceRole ); if ( dependantService == null ) { if ( injectService.required() ) { throw new ServiceDependencyException( "Dependency [" + dependentServiceRole + "] declared by service [" + service + "] not found" ); } } else { try { injectionMethod.invoke( service, dependantService ); } catch ( Exception e ) { throw new ServiceDependencyException( "Cannot inject dependency service", e ); } } }
@SuppressWarnings({ "unchecked" }) private <T extends Service> void processInjection(T service, Method injectionMethod, InjectService injectService) { if ( injectionMethod.getParameterTypes() == null || injectionMethod.getParameterTypes().length != 1 ) { throw new ServiceDependencyException( "Encountered @InjectService on method with unexpected number of parameters" ); } Class dependentServiceRole = injectService.serviceRole(); if ( dependentServiceRole == null || dependentServiceRole.equals( Void.class ) ) { dependentServiceRole = injectionMethod.getParameterTypes()[0]; } // todo : because of the use of proxies, this is no longer returning null here... final Service dependantService = getService( dependentServiceRole ); if ( dependantService == null ) { if ( injectService.required() ) { throw new ServiceDependencyException( "Dependency [" + dependentServiceRole + "] declared by service [" + service + "] not found" ); } } else { try { injectionMethod.invoke( service, dependantService ); } catch ( Exception e ) { throw new ServiceDependencyException( "Cannot inject dependency service", e ); } } }