Package java.util

Examples of java.util.Properties$XmlSupport


  }
 
  protected static void processGUIEditorsProps(File propsFile) {
    GenericObjectEditor.registerEditors();
    try {
      Properties editorProps = new Properties();
      BufferedInputStream bi = new BufferedInputStream(new FileInputStream(propsFile));
      editorProps.load(bi);
      bi.close();
      bi = null;
     
      Enumeration enm = editorProps.propertyNames();
      while (enm.hasMoreElements()) {
        String name = enm.nextElement().toString();
        String value = editorProps.getProperty(name, "");
        System.err.println("Registering " + name + " " +value);
        GenericObjectEditor.registerEditor(name, value);
      }
     
    } catch (Exception ex) {
View Full Code Here


            handleException(ExecutorConstants.PRIORITY_EXECUTOR +
                    " configuration is mandatory for priority based routing");
        }

        executor = PriorityExecutorFactory.createExecutor(
                null, executorElem, false, new Properties());
        OMElement conditionsElem = definitions.getFirstChildWithName(
                new QName(EvaluatorConstants.CONDITIONS));
        if (conditionsElem == null) {
            handleException("Conditions configuration is mandatory for priority based routing");
        }
View Full Code Here

            URLConnection connection;
            if (url.getProtocol().equalsIgnoreCase("http") ||
                    url.getProtocol().equalsIgnoreCase("https")) {

                Properties synapseProperties = SynapsePropertiesLoader.loadSynapseProperties();

                String proxyHost = synapseProperties.getProperty(
                        SynapseConstants.SYNPASE_HTTP_PROXY_HOST);
                String proxyPort = synapseProperties.getProperty(
                        SynapseConstants.SYNPASE_HTTP_PROXY_PORT);

                // get the list of excluded hosts for proxy
                List<String> excludedHosts = getExcludedHostsForProxy(synapseProperties);

                if (proxyHost != null && proxyPort != null && !excludedHosts.contains(proxyHost)) {
                    SocketAddress sockaddr = new InetSocketAddress(
                            proxyHost, Integer.parseInt(proxyPort));
                    Proxy proxy = new Proxy(Proxy.Type.HTTP, sockaddr);

                    if (url.getProtocol().equalsIgnoreCase("https")) {
                        connection = getHttpsURLConnection(url, synapseProperties, proxy);
                    } else {
                        connection = url.openConnection(proxy);
                    }
                } else {
                    if (url.getProtocol().equalsIgnoreCase("https")) {
                        connection = getHttpsURLConnection(url, synapseProperties, null);
                    } else {
                        connection = url.openConnection();
                    }
                }

                // try to see weather authentication is required
                String userName = synapseProperties.getProperty(
                        SynapseConstants.SYNPASE_HTTP_PROXY_USER);
                String password = synapseProperties.getProperty(
                        SynapseConstants.SYNPASE_HTTP_PROXY_PASSWORD);
                if (userName != null && password != null) {
                    String header = userName + ":" + password;
                    byte[] encodedHeaderBytes = new Base64().encode(header.getBytes());
                    String encodedHeader = new String(encodedHeaderBytes);
View Full Code Here

     *
     * @return a SynapseConfiguration instance
     */
    public static SynapseConfiguration newConfiguration() {
        SynapseConfiguration synConfig = new SynapseConfiguration();
        Properties synapseProps = SynapsePropertiesLoader.loadSynapseProperties();
        String propValue = synapseProps.getProperty("synapse.observers");
        if (propValue != null) {
            String[] observerNames = propValue.split(",");
            for (String observer : observerNames) {
                try {
                    Class clazz = SynapseConfigUtils.class.getClassLoader().
View Full Code Here

        config.addSequence(org.apache.synapse.SynapseConstants.FAULT_SEQUENCE_KEY, fault);
    }

    public static boolean isFailSafeEnabled(String componentName) {
        Properties synapseProps = SynapsePropertiesLoader.loadSynapseProperties();
        String failSafeStr = synapseProps.getProperty(SynapseConstants.FAIL_SAFE_MODE_STATUS);
        if (failSafeStr != null) {
            String[] failSafeComponents = failSafeStr.split(",");
            List<String> componentList = Arrays.<String>asList(failSafeComponents);
            if (componentList.indexOf(SynapseConstants.FAIL_SAFE_MODE_ALL) >= 0
                    || componentList.indexOf(componentName) >= 0) {
View Full Code Here

   *            a String of this form: 'key1="value1"; key2="value2";...
   *            keyN="valueN" '
   * @return a Properties object
   */
  public static Properties parseAttributes(String string) {
    Properties result = new Properties();
    if (string == null)
      return result;
    StringTokenizer keyValuePairs = new StringTokenizer(string, ";");
    StringTokenizer keyValuePair;
    String key;
    String value;
    while (keyValuePairs.hasMoreTokens()) {
      keyValuePair = new StringTokenizer(keyValuePairs.nextToken(), ":");
      if (keyValuePair.hasMoreTokens())
        key = keyValuePair.nextToken().trim();
      else
        continue;
      if (keyValuePair.hasMoreTokens())
        value = keyValuePair.nextToken().trim();
      else
        continue;
      if (value.startsWith("\""))
        value = value.substring(1);
      if (value.endsWith("\""))
        value = value.substring(0, value.length() - 1);
      result.setProperty(key.toLowerCase(), value);
    }
    return result;
  }
View Full Code Here

   * @param props
   * @throws HibernateException
   */
  protected synchronized void initDataSource(Properties props) throws HibernateException {
    String dataSourceClass = null;
    Properties new_props = new Properties();
    Iterator keys = props.keySet().iterator();
    while(keys.hasNext()){
      String key = (String)keys.next();
      //System.out.println(key+"="+props.getProperty(key));
      if(ENCODING_KEY.equalsIgnoreCase(key)){
        encoding = "true".equalsIgnoreCase(props.getProperty(key));
        useProxy = true;
      }
      else if(DATASOURCE_KEY.equalsIgnoreCase(key)){
        dataSourceClass = props.getProperty(key);
      }
      else if(key.startsWith(BASE_KEY)){
        String value = props.getProperty(key);
        value = StringUtils.replace(value, "{DLOG4J}", Globals.WEBAPP_PATH);
        new_props.setProperty(key.substring(BASE_KEY.length()), value);
      }
    }
    if(dataSourceClass == null)
      throw new HibernateException("Property 'dscp.datasource' no defined.");
    try {
View Full Code Here

   */
  protected Properties startHandler(Properties prop) throws Exception {
    if (logger.isLoggable(BasicLevel.DEBUG)) {
      logger.log(BasicLevel.DEBUG, "AcquisitionQueue.startHandler(" + prop + ')');
    }
    Properties p = prop;
    if (p == null)
      p = properties;
    return acquisitionModule.startHandler(p);
  }
View Full Code Here

   */
  protected Properties stopHandler(Properties prop) throws Exception {
    if (logger.isLoggable(BasicLevel.DEBUG)) {
      logger.log(BasicLevel.DEBUG, "AcquisitionQueue.stopHandler(" + prop + ')');
    }
    Properties p = prop;
    if (p == null)
      p = properties;
    return acquisitionModule.stopHandler(p);
  }
View Full Code Here

  private void loadServiceSettings(TvDataServiceProxy service) {
    File f=new File(Settings.getUserSettingsDirName(),service.getId()+".service");
    if (f.exists()) {
      try {
        Properties p=new Properties();
        BufferedInputStream in = new BufferedInputStream(new FileInputStream(f), 0x1000);
        p.load(in);
        in.close();
        service.loadSettings(p);
      } catch (IOException exc) {
        String msg = mLocalizer.msg("error.3", "Loading settings for plugin {0} failed!\n({1})",
            service.getInfo().getName(), f.getAbsolutePath(), exc);
        ErrorHandler.handle(msg, exc);
      }
    }else{
      service.loadSettings(new Properties());
    }
  }
View Full Code Here

TOP

Related Classes of java.util.Properties$XmlSupport

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.