Package org.apache.openejb.util

Examples of org.apache.openejb.util.SuperProperties


                    logger.debug("Override [" + key + "=" + value + "]");
                }
            }

            final Properties props = new SuperProperties().caseInsensitive(true);

            // weird hack but sometimes we don't want default values when we want null for instance
            if (serviceProperties == null || "false".equals(serviceProperties.getProperty(IGNORE_DEFAULT_VALUES_PROP, "false"))) {
                props.putAll(provider.getProperties());
            }
View Full Code Here


            child.getTypes().clear();
            child.getTypes().addAll(types);
        }

        { // properties
            final SuperProperties properties = new SuperProperties();
            properties.putAll(parent.getProperties());
            properties.putAll(child.getProperties());

            child.getProperties().clear();
            child.getProperties().putAll(properties);
        }
    }
View Full Code Here

            if (!d.user().isEmpty()) dataSource.setUser(d.user());

            for (final String s : d.properties()) {
                final int equal = s.indexOf('=');
                if (equal < s.length() - 1) {
                    final SuperProperties props = new SuperProperties();
                    try {
                        props.load(new ByteArrayInputStream(s.getBytes()));
                        for (final String key : props.stringPropertyNames()) {
                            if (!key.isEmpty()) {
                                dataSource.property(key, props.getProperty(key));
                            }
                        }
                    } catch (final IOException e) {
                        final String key = s.substring(0, equal).trim();
                        final String value = s.substring(equal + 1).trim();
View Full Code Here

        b.description = a.description;
        b.factoryMethod = a.factoryMethod;
        b.constructorArgs.addAll(a.constructorArgs);
        b.originAppName = a.originAppName;
        b.types.addAll(a.types);
        b.properties = new SuperProperties();
        b.properties.putAll(a.properties);
        //b.aliases.addAll(a.aliases);

        return b;
    }
View Full Code Here

/**
* Converts a java.util.Properties object to a String in the XML file.
*/
public class PropertiesAdapter extends XmlAdapter<String, Properties> {
    public Properties unmarshal(String s) throws Exception {
        return IO.readProperties(IO.read(s), new SuperProperties());
    }
View Full Code Here

    }

    private static void printSystemProperties(final PrintStream out, final String cr) {

        try {
            final SuperProperties p = new SuperProperties();
            p.setSpaceBetweenProperties(false);
            p.setKeyValueSeparator(" = ");
            p.setLineSeparator(cr);
            copyOpenEjbProperties(System.getProperties(), p);
            copyOpenEjbProperties(SystemInstance.get().getProperties(), p);
            p.store(out, null);


            final Properties p2 = System.getProperties();
            final String[] misc = {"os.version", "os.name", "os.arch", "java.version", "java.vendor"};
            for (final String prop : misc) {
View Full Code Here

            comment(out, cr, info.service + "(id=" + info.id + ")");
            comment(out, cr, "className: " + info.className);
            // TODO: the codebase value usually isn't filled in, we should do that.
            // comment("codebase: " + info.codebase);
            comment(out, cr, "");
            final SuperProperties p = new SuperProperties();
            p.setSpaceBetweenProperties(false);
            p.setKeyValueSeparator(" = ");
            p.setLineSeparator(cr);

            String uri = "new://" + info.service;
            if (info.service.matches("Container|Resource|Connector")) {
                try {
                    final Map query = new HashMap();
                    query.put("type", info.types.get(0));
                    uri += "?" + URISupport.createQueryString(query);
                } catch (Exception e) {
                }
            }

            p.put(info.id, uri);

            for (final Map.Entry<Object, Object> entry : info.properties.entrySet()) {
                if (!(entry.getKey() instanceof String)) continue;
                if (!(entry.getValue() instanceof String)) continue;

                // If property name is 'password' replace value with 'xxxx' to protect it
                if ("password".equalsIgnoreCase((String) entry.getKey())) {
                    p.put(info.id + "." + entry.getKey(), "xxxx");
                } else {
                    p.put(info.id + "." + entry.getKey(), entry.getValue());
                }
            }
            p.store(out, null);

        } catch (IOException e) {
            out.println("# Printing service(id=" + info.id + ") failed.");
            e.printStackTrace(new PrintWriter(new CommentsFilter(out)));
        }
View Full Code Here

    private static final Logger LOGGER = Logger.getInstance(LogCategory.OPENEJB, TomEEDataSourceCreator.class);

    @Override
    public DataSource pool(final String name, final DataSource ds, Properties properties) {
        final Properties converted = new Properties();
        final SuperProperties prop = new SuperProperties().caseInsensitive(true);
        prop.putAll(properties);
        updateProperties(prop, converted, null);

        final PoolConfiguration config = build(PoolProperties.class, converted);
        config.setDataSource(ds);
        final ConnectionPool pool;
View Full Code Here

    @Override
    public CommonDataSource pool(final String name, final String driver, final Properties properties) {
        final Properties converted = new Properties();
        converted.setProperty("name", name);

        final SuperProperties prop = new SuperProperties().caseInsensitive(true);
        prop.putAll(properties);

        updateProperties(prop, converted, driver);
        final PoolConfiguration config = build(PoolProperties.class, converted);
        final TomEEDataSource ds = build(TomEEDataSource.class, new TomEEDataSource(config, name), converted);
View Full Code Here

     * <p/>
     * <p/>
     */
    public Properties getProperties() {
        if (properties == null) {
            properties = new SuperProperties();
        }
        return properties;
    }
View Full Code Here

TOP

Related Classes of org.apache.openejb.util.SuperProperties

Copyright © 2018 www.massapicom. 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.