@Override @Nullable public Class<?> getType(ELContext elContext, @Nullable Object base, Object property) throws ELException { if (base == null) { String beanName = property.toString(); WebApplicationContext wac = getWebApplicationContext(elContext); if (wac.containsBean(beanName)) { elContext.setPropertyResolved(true); return wac.getType(beanName); } } return null; }
return wac.getType(beanName);
@Override @Nullable public Class<?> getType(ELContext elContext, @Nullable Object base, Object property) throws ELException { if (base == null) { String beanName = property.toString(); WebApplicationContext wac = getWebApplicationContext(elContext); if (wac.containsBean(beanName)) { elContext.setPropertyResolved(true); return wac.getType(beanName); } } return null; }
return wac.getType(beanName);
@Override @Nullable public Class<?> getType(ELContext elContext, @Nullable Object base, Object property) throws ELException { if (base == null) { String beanName = property.toString(); WebApplicationContext wac = getWebApplicationContext(elContext); if (wac.containsBean(beanName)) { elContext.setPropertyResolved(true); return wac.getType(beanName); } } return null; }
@Override @Nullable public Class<?> getType(ELContext elContext, @Nullable Object base, Object property) throws ELException { if (base == null) { String beanName = property.toString(); WebApplicationContext wac = getWebApplicationContext(elContext); if (wac.containsBean(beanName)) { elContext.setPropertyResolved(true); return wac.getType(beanName); } } return null; }
private void createSpringDestinations(Service remotingService) { WebApplicationContext wac = WebApplicationContextUtils.getWebApplicationContext(broker.getInitServletContext()); List<String> addedBeanNames = new ArrayList(); for(String beanName : wac.getBeanDefinitionNames()) { Class type = wac.getType(beanName); boolean isCreateSpringDestination = type.isAnnotationPresent(RemotingObject.class) || beanName.endsWith(includeEndsWithBeans) || isCreateDestination(beanName,type); if(isCreateSpringDestination) { createSpringDestination(remotingService, beanName); addedBeanNames.add(beanName); } } System.out.println("[Auto Export Spring to BlazeDS RemotingDestination],beanNames="+addedBeanNames); }
return wac.getType(beanName);
return wac.getType(beanName);
@Override @SuppressWarnings("unchecked") protected void detectUIs() { logger.info("Checking the application context for Vaadin UIs"); final String[] uiBeanNames = getWebApplicationContext().getBeanNamesForAnnotation(VaadinUI.class); for (String uiBeanName : uiBeanNames) { Class<?> beanType = getWebApplicationContext().getType(uiBeanName); if (UI.class.isAssignableFrom(beanType)) { logger.info("Found Vaadin UI [{}]", beanType.getCanonicalName()); final String path = getWebApplicationContext().findAnnotationOnBean(uiBeanName, VaadinUI.class).path(); Class<? extends UI> existingBeanType = getUIByPath(path); if (existingBeanType != null) { throw new IllegalStateException(String.format("[%s] is already mapped to the path [%s]", existingBeanType.getCanonicalName(), path)); } logger.debug("Mapping Vaadin UI [{}] to path [{}]", beanType.getCanonicalName(), path); mapPathToUI(path, (Class<? extends UI>) beanType); } } }
private synchronized void init() { if (restfulComponent != null) { return; } WebApplicationContext applicationContext = component.getApplicationContext(); ApplicationImpl config = new ApplicationImpl(); String[] beanNames = applicationContext.getBeanDefinitionNames(); for (String beanName : beanNames) { Class<?> beanClass = applicationContext.getType(beanName); Object bean = applicationContext.getBean(beanName); Path pathAnnotation = beanClass.getAnnotation(Path.class); if (pathAnnotation == null) { continue; } if (!ResourceUtils.isAcceptable(beanClass)) { continue; } buildResource(config, beanClass, bean); } restfulComponent = new RestfulComponent(config, applicationContext); }