Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A couple more new exceptions and conversion of exception generation t…
…o localized messages.
- Loading branch information
Showing
9 changed files
with
110 additions
and
11 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
impl/src/main/java/org/jboss/weld/InvalidObjectException.java
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source | ||
* Copyright 2008, Red Hat, Inc. and/or its affiliates, and individual contributors | ||
* by the @authors tag. See the copyright.txt in the distribution for a | ||
* full listing of individual contributors. | ||
* | ||
* Licensed 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.jboss.weld; | ||
|
||
import static org.jboss.weld.logging.LoggerFactory.loggerFactory; | ||
import ch.qos.cal10n.IMessageConveyor; | ||
|
||
/** | ||
* An extended version of {@link java.io.InvalidObjectException} that supports | ||
* localization. | ||
* | ||
* @author David Allen | ||
* | ||
*/ | ||
public class InvalidObjectException extends java.io.InvalidObjectException | ||
{ | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
// Exception messages | ||
private static final IMessageConveyor messageConveyer = loggerFactory().getMessageConveyor(); | ||
|
||
public <E extends Enum<?>> InvalidObjectException(E key, Object... args) | ||
{ | ||
super(messageConveyer.getMessage(key, args)); | ||
} | ||
|
||
} |
38 changes: 38 additions & 0 deletions
38
impl/src/main/java/org/jboss/weld/NullInstanceException.java
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source | ||
* Copyright 2008, Red Hat, Inc. and/or its affiliates, and individual contributors | ||
* by the @authors tag. See the copyright.txt in the distribution for a | ||
* full listing of individual contributors. | ||
* | ||
* Licensed 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.jboss.weld; | ||
|
||
/** | ||
* This exception occurs in cases where an object instance was expected, but | ||
* the reference was null. A typical example is with a producer method that | ||
* is not allowed to return null. | ||
* | ||
* @author David Allen | ||
* | ||
*/ | ||
public class NullInstanceException extends WeldException | ||
{ | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
public <E extends Enum<?>> NullInstanceException(E key, Object... args) | ||
{ | ||
super(key, args); | ||
} | ||
|
||
} |
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
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
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