private void invokeDestroy(Object theProvider, Class<?> clazz) { for (Method m : ReflectionUtil.getDeclaredMethods(clazz)) { Destroy destroy = m.getAnnotation(Destroy.class); if (destroy != null) { invokeInitializeOrDestroyMethod(theProvider, m, "destroy"); } } Class<?> supertype = clazz.getSuperclass(); if (!Object.class.equals(supertype)) { invokeDestroy(theProvider, supertype); } }
private void invokeInitialize(Object theProvider, Class<?> clazz) { for (Method m : ReflectionUtil.getDeclaredMethods(clazz)) { Initialize initialize = m.getAnnotation(Initialize.class); if (initialize != null) { invokeInitializeOrDestroyMethod(theProvider, m, "initialize"); } } Class<?> supertype = clazz.getSuperclass(); if (!Object.class.equals(supertype)) { invokeInitialize(theProvider, supertype); } }
private void removeResourceMethods(Object theProvider, Class<?> clazz, Collection<String> resourceNames) throws ConfigurationException { for (Method m : ReflectionUtil.getDeclaredMethods(clazz)) { BaseMethodBinding<?> foundMethodBinding = BaseMethodBinding.bindMethod(m, getFhirContext(), theProvider); if (foundMethodBinding == null) { continue; // not a bound method } if (foundMethodBinding instanceof ConformanceMethodBinding) { myServerConformanceMethod = null; continue; } String resourceName = foundMethodBinding.getResourceName(); if (!resourceNames.contains(resourceName)) { resourceNames.add(resourceName); } } }
private int findResourceMethods(Object theProvider, Class<?> clazz) throws ConfigurationException { int count = 0; for (Method m : ReflectionUtil.getDeclaredMethods(clazz)) { BaseMethodBinding<?> foundMethodBinding = BaseMethodBinding.bindMethod(m, getFhirContext(), theProvider); if (foundMethodBinding == null) {
int count = 0; for (Method m : ReflectionUtil.getDeclaredMethods(theProviderInterface)) { BaseMethodBinding<?> foundMethodBinding = BaseMethodBinding.bindMethod(m, getFhirContext(), theProvider); if (foundMethodBinding == null) {
/** * The constructor * @param theProvider the provider which is an implementation of the theProviderClass * @param theProviderClass the class definition contaning the operations */ public JaxRsMethodBindings(AbstractJaxRsProvider theProvider, Class<? extends AbstractJaxRsProvider> theProviderClass) { for (final Method m : ReflectionUtil.getDeclaredMethods(theProviderClass)) { final BaseMethodBinding<?> foundMethodBinding = BaseMethodBinding.bindMethod(m, theProvider.getFhirContext(), theProvider); if (foundMethodBinding == null) { continue; } String bindingKey = getBindingKey(foundMethodBinding); addMethodBinding(bindingKey, foundMethodBinding); } }
private void invokeInitialize(Object theProvider, Class<?> clazz) { for (Method m : ReflectionUtil.getDeclaredMethods(clazz)) { Initialize initialize = m.getAnnotation(Initialize.class); if (initialize != null) { invokeInitializeOrDestroyMethod(theProvider, m, "initialize"); } } Class<?> supertype = clazz.getSuperclass(); if (!Object.class.equals(supertype)) { invokeInitialize(theProvider, supertype); } }
private void invokeDestroy(Object theProvider, Class<?> clazz) { for (Method m : ReflectionUtil.getDeclaredMethods(clazz)) { Destroy destroy = m.getAnnotation(Destroy.class); if (destroy != null) { invokeInitializeOrDestroyMethod(theProvider, m, "destroy"); } } Class<?> supertype = clazz.getSuperclass(); if (!Object.class.equals(supertype)) { invokeDestroy(theProvider, supertype); } }
private void removeResourceMethods(Object theProvider, Class<?> clazz, Collection<String> resourceNames) throws ConfigurationException { for (Method m : ReflectionUtil.getDeclaredMethods(clazz)) { BaseMethodBinding<?> foundMethodBinding = BaseMethodBinding.bindMethod(m, getFhirContext(), theProvider); if (foundMethodBinding == null) { continue; // not a bound method } if (foundMethodBinding instanceof ConformanceMethodBinding) { myServerConformanceMethod = null; continue; } String resourceName = foundMethodBinding.getResourceName(); if (!resourceNames.contains(resourceName)) { resourceNames.add(resourceName); } } }
private int findResourceMethods(Object theProvider, Class<?> clazz) throws ConfigurationException { int count = 0; for (Method m : ReflectionUtil.getDeclaredMethods(clazz)) { BaseMethodBinding<?> foundMethodBinding = BaseMethodBinding.bindMethod(m, getFhirContext(), theProvider); if (foundMethodBinding == null) {