Author: nbelaevski
Date: 2010-03-07 13:24:15 -0500 (Sun, 07 Mar 2010)
New Revision: 16533
Modified:
root/framework/trunk/api/src/main/java/org/richfaces/application/ServiceTracker.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/CacheManager.java
Log:
TODOs for ServiceTracker
Small fix for CacheManager
Modified:
root/framework/trunk/api/src/main/java/org/richfaces/application/ServiceTracker.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/application/ServiceTracker.java 2010-03-06
00:18:24 UTC (rev 16532)
+++
root/framework/trunk/api/src/main/java/org/richfaces/application/ServiceTracker.java 2010-03-07
18:24:15 UTC (rev 16533)
@@ -21,12 +21,13 @@
*/
package org.richfaces.application;
-import javax.faces.context.FacesContext;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
+import javax.faces.context.FacesContext;
+
/**
* <p>Tracker class to provide access to various framework implementation
services.
* Examples of such services are: {@link org.richfaces.skin.SkinFactory}, TBD</p>
@@ -71,6 +72,7 @@
serviceImplementation = (T) servicesMap.get(serviceInterfaceClass);
}
+ //TODO - factories support
//TODO - null?
return serviceImplementation;
}
@@ -100,6 +102,7 @@
}
private static Map<Class<?>, Object> getServicesMap(FacesContext
facesContext, boolean createIfNull) {
+ //TODO replicate in FacesContext map for better performance
Map<String, Object> applicationMap =
facesContext.getExternalContext().getApplicationMap();
@SuppressWarnings("unchecked")
Map<Class<?>, Object> servicesMap = (Map<Class<?>,
Object>) applicationMap.get(SERVICES_MAP_ATTRIBUTE);
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/CacheManager.java
===================================================================
---
root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/CacheManager.java 2010-03-06
00:18:24 UTC (rev 16532)
+++
root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/CacheManager.java 2010-03-07
18:24:15 UTC (rev 16533)
@@ -16,22 +16,23 @@
package org.ajax4jsf.cache;
-import org.ajax4jsf.cache.lru.LRUMapCacheFactory;
-import org.ajax4jsf.resource.util.URLToStreamHelper;
-import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
-
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
+import java.text.MessageFormat;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
+import org.ajax4jsf.cache.lru.LRUMapCacheFactory;
+import org.ajax4jsf.resource.util.URLToStreamHelper;
+import org.richfaces.log.RichfacesLogger;
+import org.slf4j.Logger;
+
/**
* TODO stop caches on application stop
* CacheManager is used in J2SE environments for looking up named caches.
@@ -89,7 +90,7 @@
String configuredFactoryName = findFactory(FACTORY_PROPERTY_NAME, env);
if (configuredFactoryName != null) {
- LOG.info("Configured to use [{0}] cache factory",
configuredFactoryName);
+ LOG.info(MessageFormat.format("Configured to use [{0}] cache
factory", configuredFactoryName));
factories = new String[]{configuredFactoryName};
} else {
factories = DEFAULT_FACTORIES_CHAIN;
@@ -102,7 +103,7 @@
Class<?> spiClass = Class.forName(factoryName, true, loader);
CacheFactory cacheFactory =
CacheFactory.class.cast(spiClass.newInstance());
- LOG.info("Selected [{0}]", factoryName);
+ LOG.info(MessageFormat.format("Selected [{0}]", factoryName));
return cacheFactory;
} catch (Throwable iae) {
Show replies by date