@Override public <T extends Config> T getConfig(Class<T> configInterface) { ConfigHandler handler = cache.get(configInterface); if (handler == null) { handler = new ConfigHandler(createPersister(), configInterface); cache.put(configInterface, handler); } ClassLoader classLoader = configInterface.getClassLoader(); Object proxy = Proxy.newProxyInstance(classLoader, new Class[]{configInterface}, handler); return configInterface.cast(proxy); }
/** * {@inheritDoc} * This implementation invokes {@link #setProperty} with the * filed value. */ @Override public Object invoke(ConfigHandler handler, Object[] args, Object proxy) { setProperty(handler.getPersister(), args[0]); return null; }
@Override public <T extends Config> T getConfigCached(Class<T> configInterface) { ConfigHandler handler = new ConfigHandler(createConfigPersister(true), configInterface); Object proxy = Proxy.newProxyInstance(configInterface.getClassLoader(), new Class[]{configInterface}, handler); return configInterface.cast(proxy); }
ConfigPersister configuration = handler.getPersister(); String str; if ((args == null) || (args.length == 0)) {
@Override public <T extends Config> T getConfig(Class<T> configInterface) { ConfigHandler handler = handlersCache.get(configInterface); if (handler == null) { handler = new ConfigHandler(createConfigPersister(false), configInterface); handlersCache.put(configInterface, handler); } ClassLoader classLoader = configInterface.getClassLoader(); Object proxy = Proxy.newProxyInstance(classLoader, new Class[]{configInterface}, handler); return configInterface.cast(proxy); }