Package java.util

Examples of java.util.Properties.entrySet()


        if(configurationManager==null) {
            configurationManager = new MemoryConfigurationManager();
            Properties defaultProperties = InjectHelper.instanceWithName(Properties.class, "smd-default-configuration");
            if(defaultProperties!=null) {
                List<ConfigurationParameter> parameters = new ArrayList<ConfigurationParameter>();
                for (Map.Entry<Object, Object> entry : defaultProperties.entrySet()) {
                    String property = entry.getKey().toString();
                    String value = entry.getValue().toString();
                    if(value.equalsIgnoreCase("true") || value.equalsIgnoreCase("false")) {
                        parameters.add(new ConfigurationParameterEntity(property, ConfigurationParameter.Type.BOOLEAN, value));
                    }else {
View Full Code Here


    // user may be using a zoo.cfg file.
    Properties zkProps = ZKConfig.makeZKProps(c);
    String host = null;
    String clientPort = null;
    List<String> hosts = new ArrayList<String>();
    for (Entry<Object, Object> entry: zkProps.entrySet()) {
      String key = entry.getKey().toString().trim();
      String value = entry.getValue().toString().trim();
      if (key.startsWith("server.")) {
        String[] parts = value.split(":");
        hosts.add(parts[0]);
View Full Code Here

        // Override with system properties
        String prefix = serviceName + ".";
        Properties sysProps = new Properties(System.getProperties());
        sysProps.putAll(SystemInstance.get().getProperties());
        for (Iterator iterator1 = sysProps.entrySet().iterator(); iterator1.hasNext();) {
            Map.Entry entry1 = (Map.Entry) iterator1.next();
            String key = (String) entry1.getKey();
            Object value = entry1.getValue();
            if (value instanceof String && key.startsWith(prefix)) {
                key = key.replaceFirst(prefix, "");
View Full Code Here

                        info.properties.put(property.getName(), property.getValue());
                    }
                }

                Properties overrides = ConfigurationFactory.getSystemProperties(info.name, "PersistenceUnit");
                for (Map.Entry<Object, Object> entry : overrides.entrySet()) {
                    Object property = entry.getKey();
                    Object value = entry.getValue();
                    if (info.properties.contains(property)){
                        logger.debug("Overriding persistence-unit "+info.name +" property " + property + "="+value);
                    } else {
View Full Code Here

                System.out.println("");
                System.out.println("_________________________________________________");
                System.out.println("CLIENT JNDI PROPERTIES");
                Properties env = TestManager.getServer().getContextEnvironment();
                for (Iterator iterator = env.entrySet().iterator(); iterator.hasNext();) {
                    Map.Entry entry = (Map.Entry) iterator.next();
                    String key = (String) entry.getKey();
                    Object value = entry.getValue();
                    System.out.println(key+" = "+value);
                }
View Full Code Here

    private void loadPropertiesDeclaredConfiguration(Openejb openejb) {

        Properties sysProps = new Properties(System.getProperties());
        sysProps.putAll(SystemInstance.get().getProperties());

        for (Map.Entry<Object, Object> entry : sysProps.entrySet()) {

            Object o = entry.getValue();
            if (!(o instanceof String)) continue;
            if (!((String) o).startsWith("new://")) continue;
View Full Code Here

        // Override with system properties
        Properties serviceProperties = new Properties();
        Properties sysProps = new Properties(System.getProperties());
        sysProps.putAll(SystemInstance.get().getProperties());
        for (Map.Entry<Object, Object> entry : sysProps.entrySet()) {

            String name = (String) entry.getKey();

            for (String prefix : Arrays.asList(fullPrefix, fullPrefix2, shortPrefix, shortPrefix2)) {
                if (name.toLowerCase().startsWith(prefix.toLowerCase())){
View Full Code Here

            InputStream in = new FileInputStream(absolutePath);
            Properties parameter = new Properties();
            parameter.load(in);
            in.close();

            Set<Entry<Object, Object>> entrySet = parameter.entrySet();

            for(Map.Entry entry : entrySet) {
                String key = (String)entry.getKey();
                String value = (String)entry.getValue();
                System.out.println(key + " = " + value);
View Full Code Here

    //-------------------------------------------------------------------------
   
    protected void setupFeatures(DocumentBuilderFactory factory) {
        Properties properties = System.getProperties();
        List<String> features = new ArrayList<String>();
        for (Map.Entry<Object, Object> prop : properties.entrySet()) {
            String key = (String) prop.getKey();
            if (key.startsWith(XmlConverter.DOCUMENT_BUILDER_FACTORY_FEATURE)) {
                String uri = ObjectHelper.after(key, ":");
                Boolean value = Boolean.valueOf((String)prop.getValue());
                try {
View Full Code Here

    private ConcurrentMap<String,String> loadConfiguration(final String name) throws IOException {
        final Properties properties = loadProperties(name);
        final ConcurrentMap<String, String> result =
            new ConcurrentHashMap<String, String>(properties.size(), 1.0f, initialConcurrencyLevel);
        for (final Map.Entry<Object, Object> entry: properties.entrySet()) {
            result.put(entry.getKey().toString(), entry.getValue().toString());
        }
        return result;
    }
   
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.