Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
Showing
16 changed files
with
733 additions
and
713 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.