public void activateOptions()

in src/main/java/org/apache/log4j/receivers/xml/LogFileXMLReceiver.java [181:241]


    public void activateOptions() {
        Runnable runnable = new Runnable() {
            public void run() {
                try {
                    URL url = new URL(fileURL);
                    host = url.getHost();
                    if (host != null && host.equals("")) {
                        host = FILE_KEY;
                    }
                    path = url.getPath();
                } catch (MalformedURLException e1) {
                    // TODO Auto-generated catch block
                    e1.printStackTrace();
                }

                try {
                    if (filterExpression != null) {
                        expressionRule = ExpressionRule.getRule(filterExpression);
                    }
                } catch (Exception e) {
                    getLogger().warn("Invalid filter expression: " + filterExpression, e);
                }

                Class c;
                try {
                    c = Class.forName(decoder);
                    Object o = c.newInstance();
                    if (o instanceof Decoder) {
                        decoderInstance = (Decoder) o;
                    }
                } catch (ClassNotFoundException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                } catch (InstantiationException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                } catch (IllegalAccessException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }

                try {
                    reader = new InputStreamReader(new URL(getFileURL()).openStream());
                    process(reader);
                } catch (FileNotFoundException fnfe) {
                    getLogger().info("file not available");
                } catch (IOException ioe) {
                    getLogger().warn("unable to load file", ioe);
                    return;
                }
            }
        };
        if (useCurrentThread) {
            runnable.run();
        } else {
            Thread thread = new Thread(runnable, "LogFileXMLReceiver-" + getName());

            thread.start();

        }
    }