Initialize the given class with the values from the specified message bundle.

@param bundleName fully qualified path of the class name
@param clazz the class where the constants will exist
558303
public static void initializeMessages(final String bundleName, final Class clazz) {
		if (System.getSecurityManager() == null) {
			load(bundleName, clazz);
			return;
		}
		AccessController.doPrivileged(new PrivilegedAction() {
			public Object run() {
				load(bundleName, clazz);
				return null;
			}
		});
	}
1231314
@Override
	public Bundle getBundle(String bundleName) {
		final String sourceMethod = "getBundle"; //$NON-NLS-1$
		boolean isTraceLogging = log.isLoggable(Level.FINER);
		if (isTraceLogging) {
			log.entering(FallbackBundleResolver.class.getName(), sourceMethod, new Object[]{bundleName});
		}
		Bundle result = Platform.getBundle(bundleName);
		if (isTraceLogging) {
			log.exiting(FallbackBundleResolver.class.getName(), sourceMethod, result);
		}
		return result;
	}
1167566
public void startBundle(Bundle bundle)
    {
        if (bundle != null)
            if ((bundle.getState() != Bundle.ACTIVE) && (bundle.getState() != Bundle.STARTING))
        {
            try {
                bundle.start();
            } catch (BundleException e) {
                e.printStackTrace();
            }
        }
    }
1210270
protected void addBundle (HashIntMap<TileSet> idmap, HashMap<String, Integer> namemap,
                              TileSetBundle bundle)
    {
        IMImageProvider improv = (_imgr == null) ?
            null : new IMImageProvider(_imgr, bundle);

        // map all of the tilesets in this bundle
        for (IntMap.IntEntry<TileSet> entry : bundle.intEntrySet()) {
            Integer tsid = entry.getKey();
            TileSet tset = entry.getValue();
            tset.setImageProvider(improv);
            idmap.put(tsid.intValue(), tset);
            namemap.put(tset.getName(), tsid);
        }
    }
788567
protected void initBundles (ResourceManager rmgr, String name)
    {
        // first we obtain the resource set from which we will load up our
        // tileset bundles
        ResourceBundle[] rbundles = rmgr.getResourceSet(name);

        // sanity check
        if (rbundles == null) {
            log.warning("Unable to fetch tileset resource set " +
                        "[name=" + name + "]. Perhaps it's not defined " +
                        "in the resource manager config?");
            return;
        }

        HashIntMap<TileSet> idmap = new HashIntMap<TileSet>();
        HashMap<String, Integer> namemap = Maps.newHashMap();

        // iterate over the resource bundles in the set, loading up the
        // tileset bundles in each resource bundle
        for (ResourceBundle rbundle : rbundles) {
            addBundle(idmap, namemap, rbundle);
        }

        // fill in our bundles array and wake up any waiters
        synchronized (this) {
            _idmap = idmap;
            _namemap = namemap;
            notifyAll();
        }
    }
1272280
public <C extends PreClassLoaderInitiator> void removePreInitiator(Class<C> clazz) {
    this.preInitiators.remove(clazz.getName());
  }
1238413
public synchronized void registerComponent(Class<?> _clazz) {
        if (_clazz == null) {
            return;
        }

        if (isIncluded(_clazz.getName()) || _clazz.getName().equals(this.getClass().getName())) {
            String classVersion = getVersionWithReflection(_clazz);
            if (classVersion != null) {
                componentVersions.put(_clazz.getName(), classVersion);
            }
        }
    }
637966
public void setUpToClass(final Class<?> clazz) {
        if (clazz != null) {
            final Object object = getObject();
            if (object != null && !clazz.isInstance(object)) {
                throw new IllegalArgumentException("Specified class is not a superclass of the object");
            }
        }
        this.upToClass = clazz;
    }
961500
protected void addBundle (HashIntMap<TileSet> idmap, HashMap<String, Integer> namemap,
        ResourceBundle bundle)
    {
        try {
            TileSetBundle tsb = BundleUtil.extractBundle(bundle);
            // initialize it and add it to the list
            tsb.init(bundle);
            addBundle(idmap, namemap, tsb);

        } catch (Exception e) {
            log.warning("Unable to load tileset bundle '" + BundleUtil.METADATA_PATH +
                        "' from resource bundle [rbundle=" + bundle + "].", e);
        }
    }
727276
public void storeBundle(String bundleName, StringBuffer bundledResources) {

		JoinableResourceBundleContent bundleResourcesContent = new JoinableResourceBundleContent(bundledResources);
		storeBundle(bundleName, bundleResourcesContent);
	}
41412
public static <T> void throwIllegalStateExceptionIfAlreadyInstantiated(Class<T> clazz) {
        if (isInstantiated(clazz)) {
            throw new IllegalStateException(clazz.getSimpleName() + " has already been instantiated. Call SingletonMap.getInstance(" + clazz.getSimpleName() + ".class) to get the initialized instance.");
        }
    }
961728
protected void initCommonGenerators() {
		commonGenerators.put(new PrefixedPathResolver(MESSAGE_BUNDLE_PREFIX), ResourceBundleMessagesGenerator.class);
		Class<?> classPathGeneratorClass = null;
		Class<?> webJarsGeneratorClass = null;

		boolean isWebJarsLocatorPresent = ClassLoaderResourceUtils.isClassPresent(WEBJARS_LOCATOR_CLASSNAME);

		if (resourceType.equals(JawrConstant.JS_TYPE)) {
			classPathGeneratorClass = ClasspathJSGenerator.class;
			if (isWebJarsLocatorPresent) {
				webJarsGeneratorClass = WebJarsLocatorJSGenerator.class;
			} else {
				webJarsGeneratorClass = WebJarsJSGenerator.class;
			}
		} else if (resourceType.equals(JawrConstant.CSS_TYPE)) {
			classPathGeneratorClass = ClassPathCSSGenerator.class;
			if (isWebJarsLocatorPresent) {
				webJarsGeneratorClass = WebJarsLocatorCssGenerator.class;
			} else {
				webJarsGeneratorClass = WebJarsCssGenerator.class;
			}
		} else {
			classPathGeneratorClass = ClassPathBinaryResourceGenerator.class;
			if (isWebJarsLocatorPresent) {
				webJarsGeneratorClass = WebJarsLocatorBinaryResourceGenerator.class;
			} else {
				webJarsGeneratorClass = WebJarsBinaryResourceGenerator.class;
			}
		}

		commonGenerators.put(new PrefixedPathResolver(CLASSPATH_RESOURCE_BUNDLE_PREFIX), classPathGeneratorClass);
		commonGenerators.put(new PrefixedPathResolver(WEBJARS_GENERATOR_PREFIX), webJarsGeneratorClass);

		if (resourceType.equals(JawrConstant.JS_TYPE)) {
			commonGenerators.put(new PrefixedPathResolver(COMMONS_VALIDATOR_PREFIX), CommonsValidatorGenerator.class);
			commonGenerators.put(new PrefixedPathResolver(SKIN_SWTICHER_GENERATOR_PREFIX),
					SkinSwitcherJsGenerator.class);
			commonGenerators.put(new SuffixedPathResolver(COFEESCRIPT_GENERATOR_SUFFIX), CoffeeScriptGenerator.class);
		}

		if (resourceType.equals(JawrConstant.CSS_TYPE)) {
			commonGenerators.put(new PrefixedPathResolver(IE_CSS_GENERATOR_PREFIX), IECssBundleGenerator.class);
			commonGenerators.put(new PrefixedPathResolver(SKIN_GENERATOR_PREFIX), CssSkinGenerator.class);
			commonGenerators.put(new SuffixedPathResolver(LESS_GENERATOR_SUFFIX), LessCssGenerator.class);

			String sassGenerator = config.getProperty(SASS_GENERATOR_TYPE, SASS_GENERATOR_VAADIN);
			if (!sassGenerator.equals(SASS_GENERATOR_VAADIN) && !sassGenerator.equals(SASS_GENERATOR_RUBY)) {
				throw new BundlingProcessException("The value '" + sassGenerator + "' is not allowed for property '"
						+ SASS_GENERATOR_TYPE + "'. Please check your configuration.");
			}
			if (sassGenerator.equals(SASS_GENERATOR_VAADIN)) {
				commonGenerators.put(new SuffixedPathResolver(SASS_GENERATOR_SUFFIX), SassVaadinGenerator.class);
			} else {
				commonGenerators.put(new SuffixedPathResolver(SASS_GENERATOR_SUFFIX), SassRubyGenerator.class);
			}

		}

		if ((resourceType.equals(JawrConstant.CSS_TYPE) || resourceType.equals(JawrConstant.BINARY_TYPE))) {
			commonGenerators.put(new PrefixedPathResolver(SPRITE_GENERATOR_PREFIX), SpriteGenerator.class);
		}

	}
1035833
public void init(Configuration configuration)
			throws Exception
	{
		LOGGER.debug("Initializing AbstractBundleInterceptor");

		localizationBundleFactory = configuration.getLocalizationBundleFactory();

		findResourceBundleFactory(configuration);
	}
1223484
protected void initConfiguration(CmsObject cms, I_CmsWidgetParameter param) {

        // set the default bundle key
        m_bundleKey = param.getName();
        // set the default locale for XML contents
        m_locale = cms.getRequestContext().getLocale();
        try {
            I_CmsXmlContentValue value = (I_CmsXmlContentValue)param;
            m_locale = value.getLocale();
        } catch (Exception e) {
            // ignore, this is no XML content
        }

        // check the message bundle
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(getConfiguration())) {
            //initialize messages, the optional bundle key name and the optional locale from configuration String
            String bundleName = "";
            List<String> configs = CmsStringUtil.splitAsList(getConfiguration(), '|');
            Iterator<String> i = configs.iterator();
            while (i.hasNext()) {
                String config = i.next();
                if (config.startsWith(OPTION_KEY)) {
                    m_bundleKey = config.substring(OPTION_KEY.length());
                } else if (config.startsWith(OPTION_LOCALE)) {
                    m_locale = CmsLocaleManager.getLocale(config.substring(OPTION_LOCALE.length()));
                } else {
                    bundleName = config;
                }
            }
            // create messages object
            m_messages = new CmsMessages(bundleName, m_locale);
        } else {
            // initialize empty messages object to avoid NPE
            m_messages = new CmsMessages("", m_locale);
        }
    }
1212190
public <E> E initNextPage(Class<E> clazz) {
		return WisePageFactory.initElements(this.driver, clazz);
	}
157982
public function loadBundle($bundleName)
	{
		if (!preg_match('#^[A-Z][A-Za-z0-9]+$#D', $bundleName))
		{
			throw new InvalidArgumentException("Invalid bundle name '" . $bundleName . "'");
		}

		$className = __CLASS__ . '\\Bundles\\' . $bundleName;

		$bundle = new $className;
		$bundle->configure($this);
	}
368096
public static Class loadClass(String className, String bundleName, String bundleVersion, Identification id) throws ClassException, BundleException {
	if (StringUtil.isEmpty(bundleName)) return loadClass(className);
	return loadClassByBundle(className, bundleName, bundleVersion, id);
    }