Examples of SuperProperties


Examples of com.acelet.lib.SuperProperties

    return mailHostname;
  }

  public static void init() {
    try {
      SuperProperties superProperties = new SuperProperties();
      MailServerData.postmaster = superProperties.get(SuperProperties.MAIL_POSTMASTER);
      MailServerData.alertEmail = superProperties.get(SuperProperties.MAIL_ALERT);
      MailServerData.mailHostname = superProperties.get(SuperProperties.MAIL_HOSTNAME);
      MailServerData.mailHostUserName = superProperties.get(SuperProperties.MAIL_HOST_USER_NAME);
      MailServerData.mailHostPassword = superProperties.get(SuperProperties.MAIL_HOST_PASSWORD);
      MailServerData.mailDebug = superProperties.getBoolean(SuperProperties.MAIL_DEBUG, false);

      if (MailServerData.mailHostUserName != null) {
        MailServerData.mailHostUserName = MailServerData.mailHostUserName.trim();
        if (MailServerData.mailHostUserName.length() == 0)
          MailServerData.mailHostUserName = null;
View Full Code Here

Examples of org.apache.openejb.util.SuperProperties

    }

    private static void printSystemProperties() {

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


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

Examples of org.apache.openejb.util.SuperProperties

            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("");
            SuperProperties p = new SuperProperties();
            p.setSpaceBetweenProperties(false);
            p.setKeyValueSeparator(" = ");


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

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

    }

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

        try {
            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);


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

Examples of org.apache.openejb.util.SuperProperties

            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, "");
            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 {
                    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(out, null);

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

Examples of org.apache.openejb.util.SuperProperties

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

            final 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

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

        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

Examples of org.apache.openejb.util.SuperProperties

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