/** * Returns a list of all the bean compliant field names of a supplied type. * * @param beanClass * the bean type * @throws UnifyException * if an error occurs */ public static List<String> getBeanCompliantFieldNames(Class<?> beanClass) throws UnifyException { return beanFieldNamesMap.get(beanClass); }
@Override public void clear() throws UnifyException { cacheEntries.clear(); }
@Override public U remove(T key) throws UnifyException { return cacheEntries.remove(key).getObject(); }
@Override protected FactoryMap<U, V> create(final T mainKey, Object... params) throws Exception { return new FactoryMap<U, V>(checkStale) { @Override protected boolean stale(U key, V value) throws Exception { if (valueStale(key, value)) { removeSiblingKeys(mainKey, key); return true; } return false; } @Override protected V create(U key, Object... params) throws Exception { if (key == null) { throw new IllegalArgumentException("Parameter key can not be null!"); } return createObject(mainKey, key, params); } }; };
@Override @Expirable(cycleInSec = 20) public void removeExpiredCacheEntries() throws UnifyException { long currentTime = System.currentTimeMillis(); for (Iterator<Map.Entry<T, CacheEntry>> it = cacheEntries.entrySet().iterator(); it.hasNext();) { Map.Entry<T, CacheEntry> entry = it.next(); if (currentTime >= entry.getValue().getTimeToExpire()) { it.remove(); } } }
public V remove(T mainKey, U key) throws UnifyException { return get(mainKey).remove(key); }
/** * Returns all getter/setter information for a bean class. * * @param beanClass * the bean class * @return a list of getter/setter method info * @throws UnifyException * if an error occurs */ public static List<GetterSetterInfo> getGetterSetterList(Class<?> beanClass) throws UnifyException { return caseSensitiveGetterSetterList.get(beanClass); }
public Set<V> removeSubkeys(U key) throws UnifyException { Set<V> result = new HashSet<V>(); for (T siblingMainKey : keySet()) { V value = get(siblingMainKey).remove(key); if (value != null) { result.add(value); } } return result; }
/** * Returns all getter/setter information for a bean class. * * @param beanClass * the bean class * @return a map of getter/setter method info by property name * @throws UnifyException * if an error occurs */ public static Map<String, GetterSetterInfo> getGetterSetterMap(Class<?> beanClass) throws UnifyException { return caseSensitiveGetterSetterMap.get(beanClass); }
@Override public boolean reconfigure(DynamicSqlDataSourceConfig dynamicSqlDataSourceConfig) throws UnifyException { String configName = dynamicSqlDataSourceConfig.getName(); if (dynamicSqlDataSoureMap.isKey(configName)) { dynamicSqlDataSoureMap.get(configName).reconfigure(dynamicSqlDataSourceConfig); return true; } return false; }
@Override public void clear() { super.clear(); longNameByPageNameMap.clear(); }
public void removeSiblingKeys(T mainKey, U key) throws UnifyException { for (T siblingMainKey : keySet()) { if (!siblingMainKey.equals(mainKey)) { get(siblingMainKey).remove(key); } } }
@Override public List<? extends Listable> execute(Locale locale, ZeroParams params) throws UnifyException { return monthInYear.get(locale); } }