01: /*
02: * All content copyright (c) 2003-2007 Terracotta, Inc., except as may otherwise be noted in a separate copyright
03: * notice. All rights reserved.
04: */
05: package com.tc.util;
06:
07: import com.tc.util.factory.AbstractFactory;
08:
09: import java.util.ResourceBundle;
10:
11: public abstract class AbstractResourceBundleFactory extends
12: AbstractFactory implements ResourceBundleFactory {
13: private static ResourceBundleFactory bundleFactory;
14: private static String FACTORY_SERVICE_ID = "com.tc.util.ResourceBundleFactory";
15: private static Class STANDARD_BUNDLE_FACTORY_CLASS = StandardResourceBundleFactory.class;
16:
17: public static AbstractResourceBundleFactory getFactory() {
18: return (AbstractResourceBundleFactory) getFactory(
19: FACTORY_SERVICE_ID, STANDARD_BUNDLE_FACTORY_CLASS);
20: }
21:
22: public abstract ResourceBundle createBundle(Class clas);
23:
24: public static ResourceBundle getBundle(Class clas) {
25: if (bundleFactory == null) {
26: bundleFactory = getFactory();
27: }
28: return bundleFactory.createBundle(clas);
29: }
30: }
|