Examples of SuperProperties


Examples of org.apache.openejb.util.SuperProperties

//
//        if (provider.getFactoryName() != null) {
//            out.println("    factory-method: " + provider.getFactoryName());
//        }

        SuperProperties properties = (SuperProperties) provider.getProperties();
        if (properties.size() > 0) {
            out.println("    || Property Name || Description ||");

            for (Object key : properties.keySet()) {
                if (key instanceof String) {
                    String name = (String) key;

                    Map<String, String> attributes = properties.getAttributes(name);
                    if (!attributes.containsKey("hidden")) {
                        String value = properties.getProperty(name);
                        String comment = properties.getComment(name);

                        comment = scrubText(comment);

                        if (value != null && value.length() > 0) {
                            if (comment.length() > 0) {
View Full Code Here

Examples of org.apache.openejb.util.SuperProperties

            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

Examples of org.apache.openejb.util.SuperProperties

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

Examples of org.apache.openejb.util.SuperProperties

        out.println();
        out.println("Declarable in properties via");
        out.println();
        out.println("    Foo = new://" + provider.getService() + "?type=" + type);
        out.println();
        final SuperProperties properties = (SuperProperties) provider.getProperties();

        final Map<String, String> defaults = new LinkedHashMap<String, String>();

        if (properties.size() > 0) {
            out.println("## Properties");
            out.println();
            for (final Object key : properties.keySet()) {
                if (key instanceof String) {
                    final String name = (String) key;

                    final Map<String, String> attributes = properties.getAttributes(name);

                    if (attributes.containsKey("hidden")) {
                        continue;
                    }

                    out.println("### " + key);
                    out.println();

                    final String value = properties.getProperty(name);

                    String comment = properties.getComment(name);

                    comment = scrubText(comment);

                    defaults.put(name, String.valueOf(value));
View Full Code Here

Examples of org.apache.openejb.util.SuperProperties

        final Properties base = new Properties();
        base.putAll(SystemInstance.get().getProperties());
        base.putAll(appModule.getProperties());

        for (final EjbModule module : appModule.getEjbModules()) {
            final Properties overrides = new SuperProperties().caseInsensitive(true);
            overrides.putAll(base);
            overrides.putAll(module.getProperties());

            if (module.getOpenejbJar() == null) {
                module.setOpenejbJar(new OpenejbJar());
            }

            final OpenejbJar openejbJar = module.getOpenejbJar();

            final Map<String, EjbDeployment> deploymentMap = openejbJar.getDeploymentsByEjbName();
            for (final EnterpriseBean bean : module.getEjbJar().getEnterpriseBeans()) {
                final SuperProperties properties = new SuperProperties().caseInsensitive(true);

                properties.putAll(globalProperties);

                final String additionalKey = bean.getEjbName();
                if (additionalProperties.containsKey(additionalKey)) {
                    for (final Map.Entry<Object, Object> entry : additionalProperties.get(additionalKey).entrySet()) {
                        properties.put(entry.getKey().toString(), entry.getValue().toString());
                    }
                }

                final EjbDeployment deployment = deploymentMap.get(bean.getEjbName());
                if (deployment != null) {
                    properties.putAll(deployment.getProperties());
                    deployment.getProperties().clear();
                }

                final String id = bean.getEjbName() + ".";

                for (final Map.Entry<Object, Object> entry : overrides.entrySet()) {
                    final String key = entry.getKey().toString();

                    if (key.startsWith(id)) {
                        final String property = key.substring(id.length());

                        if (properties.containsKey(property)) {
                            log.debug("Overriding ejb " + bean.getEjbName() + " property " + property + "=" + entry.getValue());
                        } else {
                            log.debug("Adding ejb " + bean.getEjbName() + " property " + property + "=" + entry.getValue());
                        }

                        properties.put(property, entry.getValue());
                    }
                }

                if (properties.size() > 0) {
                    if (deployment == null) {
                        final EjbDeployment ejbDeployment = openejbJar.addEjbDeployment(bean);
                        ejbDeployment.getProperties().putAll(properties);
                    } else {
                        deployment.getProperties().putAll(properties);
View Full Code Here

Examples of org.apache.openejb.util.SuperProperties

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

Examples of org.apache.openejb.util.SuperProperties

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

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

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

Examples of org.apache.openejb.util.SuperProperties

    }

    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
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.