Package java.util

Examples of java.util.Properties.containsKey()


                Class<? extends Driver> driver = (Class<? extends Driver>) loadClass(driverClass(j));

                Properties properties = properties(j.getProperties());
                if (!properties.containsKey("user"))
                    properties.put("user", defaultString(j.getUser()));
                if (!properties.containsKey("password"))
                    properties.put("password", defaultString(j.getPassword()));

                connection = driver.newInstance().connect(defaultString(j.getUrl()), properties);
                close = true;
            }
View Full Code Here


      String[] groups = match.getGroups();
      String key = groups[1].trim();
      String value = groups[2].trim();

      if (properties.containsKey(key)) {
        throw new IllegalArgumentException("The property "
            + StringUtils.quote(key) + " is specified more than once");
      }
      properties.setProperty(key, value);
    }
View Full Code Here

          if (CONTEXT_ELEMENT.equals(child.getNodeName())) {
            DaoContext daoContext = parseContext((Element) child, daoManager);
            daoManager.addContext(daoContext);
          } else if (PROPERTIES_ELEMENT.equals(child.getNodeName())) {
            Properties attributes = parseAttributes(child);
            if (attributes.containsKey("resource")) {
              String resource = attributes.getProperty("resource");
              if (properties == null) {
                properties = Resources.getResourceAsProperties(resource);
              } else {
                Properties tempProps = Resources.getResourceAsProperties(resource);
View Full Code Here

                                activationConfig = new ActivationConfig();
                                mdb.setActivationConfig(activationConfig);
                            }
                            Properties properties = activationConfig.toProperties();
                            for (javax.ejb.ActivationConfigProperty property : configProperties) {
                                if (!properties.containsKey(property.propertyName())) {
                                    activationConfig.addProperty(property.propertyName(), property.propertyValue());
                                }
                            }
                        }
View Full Code Here

                libToCopy.addAll(extract(realLocation(zip)));
            }
        }

        File destination;
        if (additionalLibProperties.containsKey(DESTINATION_KEY)) {
            destination = new File(additionalLibProperties.getProperty(DESTINATION_KEY));
        } else {
            destination = new File(SystemInstance.get().getBase().getDirectory(), Embedder.ADDITIONAL_LIB_FOLDER);
        }
        if (!destination.exists()) {
View Full Code Here

    public synchronized void setSharedCacheMode(SharedCacheMode mode) {
        PersistenceUnitInfoImpl info = entityManagerFactoryCallable.getUnitInfo();
        info.setSharedCacheMode(mode);

        Properties properties = entityManagerFactoryCallable.getUnitInfo().getProperties();
        if (properties.containsKey(JAVAX_PERSISTENCE_SHARED_CACHE_MODE)) {
            properties.setProperty(JAVAX_PERSISTENCE_SHARED_CACHE_MODE, mode.name());
        }
    }

    public synchronized void setValidationMode(ValidationMode mode) {
View Full Code Here

    public synchronized void setValidationMode(ValidationMode mode) {
        PersistenceUnitInfoImpl info = entityManagerFactoryCallable.getUnitInfo();
        info.setValidationMode(mode);

        Properties properties = entityManagerFactoryCallable.getUnitInfo().getProperties();
        if (properties.containsKey(JAVAX_PERSISTENCE_VALIDATION_MODE)) {
            properties.setProperty(JAVAX_PERSISTENCE_VALIDATION_MODE, mode.name());
        }
    }

    public synchronized void setProvider(String providerRaw) {
View Full Code Here

    public synchronized void setTransactionType(PersistenceUnitTransactionType type) {
        PersistenceUnitInfoImpl info = entityManagerFactoryCallable.getUnitInfo();
        info.setTransactionType(type);

        Properties properties = entityManagerFactoryCallable.getUnitInfo().getProperties();
        if (properties.containsKey(JAVAX_PERSISTENCE_TRANSACTION_TYPE)) {
            properties.setProperty(JAVAX_PERSISTENCE_TRANSACTION_TYPE, type.name());
        }
    }

    public synchronized void setProperty(String key, String value) {
View Full Code Here

                                mdb.setActivationConfig(activationConfig);
                            }

                            Properties properties = activationConfig.toProperties();
                            for (javax.ejb.ActivationConfigProperty property : configProperties) {
                                if (!properties.containsKey(property.propertyName())) {
                                    activationConfig.addProperty(property.propertyName(), property.propertyValue());
                                }
                            }
                        }
View Full Code Here

                    mdb.setMessageDestinationType(destinationType);
                }

                // topics need a clientId and subscriptionName
                if ("javax.jms.Topic".equals(destinationType)) {
                    if (!properties.containsKey("clientId")) {
                        mdb.getActivationConfig().addProperty("clientId", ejbDeployment.getDeploymentId());
                    }
                    if (!properties.containsKey("subscriptionName")) {
                        mdb.getActivationConfig().addProperty("subscriptionName", ejbDeployment.getDeploymentId() + "_subscription");
                    }
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.