You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by bl...@apache.org on 2005/09/29 19:33:02 UTC
svn commit: r292486 - in
/cocoon/trunk/src/java/org/apache/cocoon/components: ContextHelper.java
ContextResourceNotFoundException.java
Author: bloritsch
Date: Thu Sep 29 10:32:59 2005
New Revision: 292486
URL: http://svn.apache.org/viewcvs?rev=292486&view=rev
Log:
add ContextResourceNotFoundException
Added:
cocoon/trunk/src/java/org/apache/cocoon/components/ContextResourceNotFoundException.java
Modified:
cocoon/trunk/src/java/org/apache/cocoon/components/ContextHelper.java
Modified: cocoon/trunk/src/java/org/apache/cocoon/components/ContextHelper.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/components/ContextHelper.java?rev=292486&r1=292485&r2=292486&view=diff
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/components/ContextHelper.java (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/components/ContextHelper.java Thu Sep 29 10:32:59 2005
@@ -17,7 +17,6 @@
import java.util.Map;
-import org.apache.avalon.framework.CascadingRuntimeException;
import org.apache.avalon.framework.context.Context;
import org.apache.avalon.framework.context.ContextException;
import org.apache.avalon.framework.service.ServiceManager;
@@ -64,7 +63,7 @@
try {
return (Request)context.get(CONTEXT_REQUEST_OBJECT);
} catch (ContextException ce) {
- throw new CascadingRuntimeException("Unable to get the request object from the context.", ce);
+ throw new ContextResourceNotFoundException("Unable to get the request object from the context.", ce);
}
}
@@ -78,7 +77,7 @@
try {
return (Response)context.get(CONTEXT_RESPONSE_OBJECT);
} catch (ContextException ce) {
- throw new CascadingRuntimeException("Unable to get the response object from the context.", ce);
+ throw new ContextResourceNotFoundException("Unable to get the response object from the context.", ce);
}
}
@@ -92,7 +91,7 @@
try {
return (Map)context.get(CONTEXT_OBJECT_MODEL);
} catch (ContextException ce) {
- throw new CascadingRuntimeException("Unable to get the object model from the context.", ce);
+ throw new ContextResourceNotFoundException("Unable to get the object model from the context.", ce);
}
}
@@ -107,7 +106,7 @@
try {
return (ServiceManager)context.get(CONTEXT_SITEMAP_SERVICE_MANAGER);
} catch (ContextException ce) {
- throw new CascadingRuntimeException("Unable to get the service manager from the context.", ce);
+ throw new ContextResourceNotFoundException("Unable to get the service manager from the context.", ce);
}
}
Added: cocoon/trunk/src/java/org/apache/cocoon/components/ContextResourceNotFoundException.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/components/ContextResourceNotFoundException.java?rev=292486&view=auto
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/components/ContextResourceNotFoundException.java (added)
+++ cocoon/trunk/src/java/org/apache/cocoon/components/ContextResourceNotFoundException.java Thu Sep 29 10:32:59 2005
@@ -0,0 +1,35 @@
+/*
+ * Copyright 1999-2005 The Apache Software Foundation.
+ *
+ * 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.apache.cocoon.components;
+
+import org.apache.avalon.framework.CascadingRuntimeException;
+
+/**
+ * The exception thrown when the ContextHelper can't find the necessary
+ * resource.
+ */
+public final class ContextResourceNotFoundException extends CascadingRuntimeException
+{
+ public ContextResourceNotFoundException(String message)
+ {
+ super(message, null);
+ }
+
+ public ContextResourceNotFoundException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+}