Package org.apache.openejb.util

Examples of org.apache.openejb.util.SuperProperties


        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);
        if (a.classpath != null) {
            b.classpath = new URI[a.classpath.length];
            System.arraycopy(a.classpath, 0, b.classpath, 0, a.classpath.length);
        }
View Full Code Here


        final Properties props = PropertyPlaceHolderHelper.holds(serviceInfo.properties);
        if (serviceInfo.properties.containsKey("Definition")) {
            try { // we catch classcast etc..., if it fails it is not important
                final InputStream is = new ByteArrayInputStream(serviceInfo.properties.getProperty("Definition").getBytes());
                final Properties p = new SuperProperties();
                IO.readProperties(is, p);
                for (final Map.Entry<Object, Object> entry : p.entrySet()) {
                    final String key = entry.getKey().toString();
                    if (!props.containsKey(key)
                        // never override from Definition, just use it to complete the properties set
                        &&
                        !(key.equalsIgnoreCase("url") &&
View Full Code Here

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

        return b;
    }
View Full Code Here

            if (service.getId() == null) service.setId(provider.getId());

            logger.info("configureService.configuring", service.getId(), provider.getService(), provider.getId());

            Properties props = new SuperProperties();
            props.putAll(provider.getProperties());
            props.putAll(service.getProperties());
            props.putAll(getSystemProperties(service.getId(), provider.getService()));

            if (providerType != null && !provider.getService().equals(providerType)) {
                throw new OpenEJBException(messages.format("configureService.wrongProviderType", service.getId(), providerType));
            }
View Full Code Here

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

        return b;
    }
View Full Code Here

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


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

            p.put(info.id, uri);
           
            for (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(new Filter(System.out), null);

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

            }

            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

        }
        return "true".equalsIgnoreCase(property) || null == property;
    }

    private static Properties asProperties(final String definition) throws IOException {
        final SuperProperties properties = new SuperProperties();
        properties.caseInsensitive(true);
        properties.putAll(IO.readProperties(IO.read(definition), new Properties()));
        return properties;
    }
View Full Code Here

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

            Properties props = new SuperProperties();
            props.putAll(provider.getProperties());
            props.putAll(service.getProperties());
            props.putAll(overrides);

            if (providerType != null && !provider.getService().equals(providerType)) {
                throw new OpenEJBException(messages.format("configureService.wrongProviderType", service.getId(), providerType));
            }
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.