Examples of ConfigurationProvider


Examples of com.opensymphony.xwork2.config.ConfigurationProvider

        testProvider("xwork - jar2.xml");
        testProvider("xwork - zip2.xml");
    }

    private void testProvider(String configFile) throws Exception {
        ConfigurationProvider provider = buildConfigurationProvider(configFile);
        assertTrue(!provider.needsReload());

        String fullPath = ClassLoaderUtil.getResource(configFile, ConfigurationProvider.class).toString();

        int startIndex = fullPath.indexOf(":file:/");
        int endIndex = fullPath.indexOf("!/");

        String jar = fullPath.substring(startIndex + (":file:/".length() - 1), endIndex).replaceAll("%20", " ");

        File file = new File(jar);

        assertTrue("File [" + file + "] doesn't exist!", file.exists());
        file.setLastModified(System.currentTimeMillis());

        assertTrue(!provider.needsReload());
    }
View Full Code Here

Examples of com.opensymphony.xwork2.config.ConfigurationProvider

    private static void initXWork() {
        String configFilePath = configDir + "/struts.xml";
        File configFile = new File(configFilePath);
        try {
            ConfigurationProvider configProvider = new StrutsXmlConfigurationProvider(configFile.getCanonicalPath(), true, null);
            cm = new ConfigurationManager();
            cm.addConfigurationProvider(new DefaultPropertiesProvider());
            cm.addConfigurationProvider(new StrutsXmlConfigurationProvider("struts-default.xml", false, null));
            cm.addConfigurationProvider(configProvider);
            cm.addConfigurationProvider(new LegacyPropertiesConfigurationProvider());
View Full Code Here

Examples of com.opensymphony.xwork2.config.ConfigurationProvider

        if (configProvs != null) {
            String[] classes = configProvs.split("\\s*[,]\\s*");
            for (String cname : classes) {
                try {
                    Class cls = ClassLoaderUtils.loadClass(cname, this.getClass());
                    ConfigurationProvider prov = (ConfigurationProvider)cls.newInstance();
                    configurationManager.addConfigurationProvider(prov);
                } catch (InstantiationException e) {
                    throw new ConfigurationException("Unable to instantiate provider: "+cname, e);
                } catch (IllegalAccessException e) {
                    throw new ConfigurationException("Unable to access provider: "+cname, e);
View Full Code Here

Examples of com.opensymphony.xwork2.config.ConfigurationProvider

        provider.loadPackages();
   */
    }

    private void init_FilterInitParameters() {
        configurationManager.addConfigurationProvider(new ConfigurationProvider() {
            public void destroy() {}
            public void init(Configuration configuration) throws ConfigurationException {}
            public void loadPackages() throws ConfigurationException {}
            public boolean needsReload() { return false; }

View Full Code Here

Examples of com.opensymphony.xwork2.config.ConfigurationProvider

        if (configProvs != null) {
            String[] classes = configProvs.split("\\s*[,]\\s*");
            for (String cname : classes) {
                try {
                    Class cls = ClassLoaderUtils.loadClass(cname, this.getClass());
                    ConfigurationProvider prov = (ConfigurationProvider)cls.newInstance();
                    configurationManager.addConfigurationProvider(prov);
                } catch (InstantiationException e) {
                    throw new ConfigurationException("Unable to instantiate provider: "+cname, e);
                } catch (IllegalAccessException e) {
                    throw new ConfigurationException("Unable to access provider: "+cname, e);
View Full Code Here

Examples of org.apache.axis.ConfigurationProvider

     *
     */
    public AxisServer getServer(Map environment)
        throws AxisFault
    {
        ConfigurationProvider provider = null;
        try {
            provider = (ConfigurationProvider)environment.get("provider");
        } catch (ClassCastException e) {
            // Just in case, fall through here.
        }
View Full Code Here

Examples of org.apache.cxf.configuration.ConfigurationProvider

    }
   
    public void testProviders() {
        DatatypeConverter.setDatatypeConverter(new DatatypeConverterImpl());
        Foo foo = new org.apache.cxf.configuration.foo.ObjectFactory().createFoo();
        ConfigurationProvider provider = new ConfigurationProvider() {

            public Object getObject(String name) {
                if ("integerAttr".equals(name) || "integerAttrNoDefault".equals(name)) {
                    return BigInteger.TEN;
                }
View Full Code Here

Examples of org.apache.hadoop.yarn.conf.ConfigurationProvider

      setStateStore(nullStore);
    } catch (Exception e) {
      assert false;
    }

    ConfigurationProvider provider = new LocalConfigurationProvider();
    setConfigurationProvider(provider);
  }
View Full Code Here

Examples of org.apache.james.container.spring.lifecycle.ConfigurationProvider

      
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        ConfigurationProvider confProvider = factory.getBean(ConfigurationProvider.class);
        HierarchicalConfiguration config = confProvider.getConfiguration(getComponentName());

        // Get the configuration for the class
        configuredClass = config.getString("[@class]");
        if (context != null) {
            context.addBundleListener(this);
View Full Code Here

Examples of org.apache.openjpa.lib.conf.ConfigurationProvider

        if (str != null && str.length() > 0) {
            // cache system properties to reduce load on file system
            Properties loaded = (Properties) _sysprops.get(str);
            if (loaded == null) {
                loaded = new Properties();
                ConfigurationProvider cp =
                    (ConfigurationProvider) Configurations
                        .getProperty(str, null);
                if (cp != null)
                    loaded.putAll(cp.getProperties());
                _sysprops.put(str, loaded);
            }
            p.putAll(loaded);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.