public void destroy() { if(getReflectionBuilder() != null) { getReflectionBuilder().destroy(); } }
private BeanConfiguration(AssignmentStatement as) { this.instantiationStatement = null; this.beanName = as.getRootBeanName(); add(as); }
/** * Returns the value of the specified section property, or {@code null} if the section or property do not exist. * * @param sectionName the name of the section to retrieve to acquire the property value * @param propertyName the name of the section property for which to return the value * @return the value of the specified section property, or {@code null} if the section or property do not exist. */ public String getSectionProperty(String sectionName, String propertyName) { Section section = getSection(sectionName); return section != null ? section.get(propertyName) : null; }
public SecurityManagerProvider(String shiroConfig) { this.securityManager = null; IniSecurityManagerFactory factory = new IniSecurityManagerFactory("classpath:" + shiroConfig); // we will need to make sure that shiro uses a case sensitive permission resolver Ini.Section main = factory.getIni().addSection("main"); main.put("geodePermissionResolver", GeodePermissionResolver.class.getName()); if (!main.containsKey("iniRealm.permissionResolver")) { main.put("iniRealm.permissionResolver", "$geodePermissionResolver"); } shiroManager = factory.getInstance(); }
@Provides Ini loadShiroIni() { return Ini.fromResourcePath("classpath:shiro.ini"); } }
protected Object resolveValue(String stringValue) { Object value; if (isReference(stringValue)) { value = resolveReference(stringValue); } else { value = unescapeIfNecessary(stringValue); } return value; }
private SecurityManager getSecurityManagerBean() { return getReflectionBuilder().getBean(SECURITY_MANAGER_NAME, SecurityManager.class); }
private Map<String, ?> buildInstances(Ini.Section section) { return getReflectionBuilder().buildObjects(section); }
public Object execute() { if (!isExecuted()) { this.result = doExecute(); this.executed = true; } if (!getBeanConfiguration().isGlobalConfig()) { Assert.notNull(this.bean, "Implementation must set the root bean for which it executed."); } return this.result; }
/** * Creates a new instance. See the {@link #getInstance()} JavaDoc for detailed explanation of how an INI * source will be resolved to use to build the instance. */ public IniSecurityManagerFactory() { this.builder = new ReflectionBuilder(); }
@Override protected Object doExecute() { applyProperty(lhs, rhs, objects); Object bean = objects.get(this.rootBeanName); setBean(bean); return null; }
private Interpolator createInterpolator() { if (ClassUtils.isAvailable("org.apache.commons.configuration2.interpol.ConfigurationInterpolator")) { return new CommonsInterpolator(); } return new DefaultInterpolator(); }
public IniSecurityManagerFactory(Ini config) { this(); setIni(config); }
/** * Returns true if all configuration statements have been executed. * @return true if all configuration statements have been executed. */ public boolean isExecuted() { if (instantiationStatement != null && !instantiationStatement.isExecuted()) { return false; } for (AssignmentStatement as : assignments) { if (!as.isExecuted()) { return false; } } return true; } }
private BeanConfiguration(InstantiationStatement statement) { statement.setBeanConfiguration(this); this.instantiationStatement = statement; this.beanName = statement.lhs; }
@Override protected Cache createCache(String name) throws CacheException { return new HashMapCache<K, V>(name); }