Skip to content
Permalink
Browse files
added fixcrlf to ant build file.
apart from that, no effective code changes, just format adjustments and copyright header

git-svn-id: https://svn.apache.org/repos/asf/james/postage/trunk@450409 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Bernd Fondermann committed Sep 27, 2006
1 parent 5ef01be commit b0e52531b84ac4cce56e01a3978524990086983e
Show file tree
Hide file tree
Showing 16 changed files with 733 additions and 713 deletions.
@@ -86,6 +86,8 @@
</target>

<target name="init-compiler-sources">
<fixcrlf srcdir="${dir.source.classes}" includes="**/*.java" eol="lf" tab="remove" tablength="4" />

<copy todir="${dir.build.source}" >
<fileset dir="${dir.source.classes}" >
<include name="**/*.java" />
@@ -81,7 +81,7 @@ public class PostageRunner implements Runnable {
private static String m_messageIdPrefix = null;

public static String getMessageIdPrefix() {
return m_messageIdPrefix + "-";
return m_messageIdPrefix + "-";
}

/**
@@ -96,9 +96,9 @@ public static String getMessageIdPrefix() {
* @param postageConfiguration
*/
public PostageRunner(PostageConfiguration postageConfiguration) {
m_messageIdPrefix = "" + System.currentTimeMillis();
m_messageIdPrefix = "" + System.currentTimeMillis();

m_postageConfiguration = postageConfiguration;
m_postageConfiguration = postageConfiguration;

int totalMailsPerMin = m_postageConfiguration.getTotalMailsPerMin();
int durationMinutes = m_postageConfiguration.getDurationMinutes();
@@ -1,40 +1,40 @@
/****************************************************************
* Licensed to the Apache Software Foundation (ASF) under one *
* or more contributor license agreements. See the NOTICE file *
* distributed with this work for additional information *
* regarding copyright ownership. The ASF licenses this file *
* to you under the Apache License, Version 2.0 (the *
* "License"); you may not use this file except in compliance *
* with the License. You may obtain a copy of the License at *
* *
* http://www.apache.org/licenses/LICENSE-2.0 *
* *
* Unless required by applicable law or agreed to in writing, *
* software distributed under the License is distributed on an *
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
* KIND, either express or implied. See the License for the *
* specific language governing permissions and limitations *
* under the License. *
****************************************************************/
package org.apache.james.postage;

/**
* base exception for Postage
*/
public class PostageRuntimeException extends RuntimeException {
public PostageRuntimeException() {
super();
}

public PostageRuntimeException(String message) {
super(message);
}

public PostageRuntimeException(Throwable cause) {
super(cause);
}

public PostageRuntimeException(String message, Throwable cause) {
super(message, cause);
}
}
/****************************************************************
* Licensed to the Apache Software Foundation (ASF) under one *
* or more contributor license agreements. See the NOTICE file *
* distributed with this work for additional information *
* regarding copyright ownership. The ASF licenses this file *
* to you under the Apache License, Version 2.0 (the *
* "License"); you may not use this file except in compliance *
* with the License. You may obtain a copy of the License at *
* *
* http://www.apache.org/licenses/LICENSE-2.0 *
* *
* Unless required by applicable law or agreed to in writing, *
* software distributed under the License is distributed on an *
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
* KIND, either express or implied. See the License for the *
* specific language governing permissions and limitations *
* under the License. *
****************************************************************/
package org.apache.james.postage;

/**
* base exception for Postage
*/
public class PostageRuntimeException extends RuntimeException {
public PostageRuntimeException() {
super();
}

public PostageRuntimeException(String message) {
super(message);
}

public PostageRuntimeException(Throwable cause) {
super(cause);
}

public PostageRuntimeException(String message, Throwable cause) {
super(message, cause);
}
}
@@ -1,58 +1,58 @@
/****************************************************************
* Licensed to the Apache Software Foundation (ASF) under one *
* or more contributor license agreements. See the NOTICE file *
* distributed with this work for additional information *
* regarding copyright ownership. The ASF licenses this file *
* to you under the Apache License, Version 2.0 (the *
* "License"); you may not use this file except in compliance *
* with the License. You may obtain a copy of the License at *
* *
* http://www.apache.org/licenses/LICENSE-2.0 *
* *
* Unless required by applicable law or agreed to in writing, *
* software distributed under the License is distributed on an *
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
* KIND, either express or implied. See the License for the *
* specific language governing permissions and limitations *
* under the License. *
****************************************************************/
package org.apache.james.postage.classloading;

import java.util.HashMap;
import java.util.Map;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class CachedInstanceFactory {

private static Log log = LogFactory.getLog(CachedInstanceFactory.class);

private final static Map m_classes = new HashMap();

public static Object createInstance(String classname) {
Object object = null;

Class clazz = null;
// class is configured, but not yet loaded
if (classname != null && m_classes.get(classname) == null) {
try {
clazz = Class.forName(classname);
} catch (ClassNotFoundException e) {
log.error("failed to load class " + classname, e);
}
}

// create instance, if custom class is given
if (clazz != null) {
try {
object = clazz.newInstance();
} catch (Exception e) {
log.error("failed to create instance of class " + classname, e);
}
}

return object;
}

}
/****************************************************************
* Licensed to the Apache Software Foundation (ASF) under one *
* or more contributor license agreements. See the NOTICE file *
* distributed with this work for additional information *
* regarding copyright ownership. The ASF licenses this file *
* to you under the Apache License, Version 2.0 (the *
* "License"); you may not use this file except in compliance *
* with the License. You may obtain a copy of the License at *
* *
* http://www.apache.org/licenses/LICENSE-2.0 *
* *
* Unless required by applicable law or agreed to in writing, *
* software distributed under the License is distributed on an *
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
* KIND, either express or implied. See the License for the *
* specific language governing permissions and limitations *
* under the License. *
****************************************************************/
package org.apache.james.postage.classloading;

import java.util.HashMap;
import java.util.Map;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class CachedInstanceFactory {

private static Log log = LogFactory.getLog(CachedInstanceFactory.class);

private final static Map m_classes = new HashMap();

public static Object createInstance(String classname) {
Object object = null;

Class clazz = null;
// class is configured, but not yet loaded
if (classname != null && m_classes.get(classname) == null) {
try {
clazz = Class.forName(classname);
} catch (ClassNotFoundException e) {
log.error("failed to load class " + classname, e);
}
}

// create instance, if custom class is given
if (clazz != null) {
try {
object = clazz.newInstance();
} catch (Exception e) {
log.error("failed to create instance of class " + classname, e);
}
}

return object;
}

}
@@ -121,10 +121,10 @@ private void findAllMatchingTestMail(String username) throws SamplingException {
POP3MessageInfo entry = entries[i];

try {
new POP3MailAnalyzeStrategy("pop3", m_results, pop3Client, entry.number, i).handle();
} catch (Exception exception) {
log.warn("error processing pop3 mail", exception);
}
new POP3MailAnalyzeStrategy("pop3", m_results, pop3Client, entry.number, i).handle();
} catch (Exception exception) {
log.warn("error processing pop3 mail", exception);
}
}

closeSession(pop3Client);

0 comments on commit b0e5253

Please sign in to comment.