leosimons 01/04/14 08:06:32
Modified: proposal/4.0/src/java/org/apache/framework/context
Recontextualizable.java DefaultContext.java
Contextualizable.java Context.java
Added: proposal/4.0/src/java/org/apache/framework/context
ContextualizationException.java
ContextException.java
Log:
updating the lifecycle methods as discussed.
Revision Changes Path
1.2 +1 -1
jakarta-avalon/proposal/4.0/src/java/org/apache/framework/context/Recontextualizable.java
Index: Recontextualizable.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon/proposal/4.0/src/java/org/apache/framework/context/Recontextualizable.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Recontextualizable.java 2001/03/15 04:35:06 1.1
+++ Recontextualizable.java 2001/04/14 15:06:29 1.2
@@ -15,5 +15,5 @@
public interface Recontextualizable
extends Contextualizable
{
- void recontextualizable( Context context ) ;
+ void recontextualizable( Context context ) throws ContextException ;
}
1.2 +10 -9
jakarta-avalon/proposal/4.0/src/java/org/apache/framework/context/DefaultContext.java
Index: DefaultContext.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon/proposal/4.0/src/java/org/apache/framework/context/DefaultContext.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DefaultContext.java 2001/04/03 23:18:04 1.1
+++ DefaultContext.java 2001/04/14 15:06:29 1.2
@@ -19,14 +19,15 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Pierpaolo Fumagalli</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Stefano Mazzocchi</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Peter Donald</a>
+ * @author <a href="mailto:[EMAIL PROTECTED]">Leo Simons</a>
*/
-public class DefaultContext
- implements Context
+public class DefaultContext
+ implements Context
{
protected final Map m_contextData;
protected final Context m_parent;
- public DefaultContext( final Map contextData, final Context parent )
+ public DefaultContext( final Map contextData, final Context parent )
{
m_parent = parent;
m_contextData = contextData;
@@ -36,18 +37,18 @@
{
this( contextData, null );
}
-
- public DefaultContext( final Context parent )
+
+ public DefaultContext( final Context parent )
{
this( new Hashtable(), parent );
}
- public DefaultContext()
+ public DefaultContext()
{
this( (Context)null );
}
-
- public Object get( final Object key )
+
+ public Object get( final Object key ) throws ContextException
{
final Object data = m_contextData.get( key );
@@ -59,7 +60,7 @@
return m_parent.get( key );
}
- public void put( final Object key, final Object value )
+ public void put( final Object key, final Object value )
{
m_contextData.put( key, value );
}
1.2 +4 -4
jakarta-avalon/proposal/4.0/src/java/org/apache/framework/context/Contextualizable.java
Index: Contextualizable.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon/proposal/4.0/src/java/org/apache/framework/context/Contextualizable.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Contextualizable.java 2001/03/15 04:35:06 1.1
+++ Contextualizable.java 2001/04/14 15:06:30 1.2
@@ -8,8 +8,8 @@
package org.apache.framework.context;
/**
- * This inteface should be implemented by classes that need
- * a Context to work. Context contains runtime generated object
+ * This inteface should be implemented by classes that need
+ * a Context to work. Context contains runtime generated object
* provided by the parent to this class.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Federico Barbieri</a>
@@ -20,9 +20,9 @@
{
/**
* Pass the Context to the contextualizable class. This method
- * is always called after the constructor and, if present,
+ * is always called after the constructor and, if present,
* after configure but before any other method.
*
*/
- void contextualize( Context context );
+ void contextualize( Context context ) throws ContextException;
}
1.2 +2 -1
jakarta-avalon/proposal/4.0/src/java/org/apache/framework/context/Context.java
Index: Context.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon/proposal/4.0/src/java/org/apache/framework/context/Context.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Context.java 2001/03/15 04:35:06 1.1
+++ Context.java 2001/04/14 15:06:30 1.2
@@ -12,8 +12,9 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Federico Barbieri</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Pierpaolo Fumagalli</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Stefano Mazzocchi</a>
+ * @author <a href="mailto:[EMAIL PROTECTED]">Leo Simons</a>
*/
public interface Context
{
- Object get( Object key );
+ Object get( Object key ) throws ContextException;
}
1.1
jakarta-avalon/proposal/4.0/src/java/org/apache/framework/context/ContextualizationException.java
Index: ContextualizationException.java
===================================================================
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE file.
*/
package org.apache.framework.context;
/**
* Thrown when a <code>Contextualizable</code> component cannot be contextualized
* properly, or if a value cannot be retrieved properly.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Leo Simons</a>
*/
public final class ContextualizationException
extends ContextException
{
/**
* Construct a new <code>ContextualizationException</code> instance.
*
* @param message The detail message for this exception.
*/
public ContextualizationException( final String message )
{
this( message, null );
}
/**
* Construct a new <code>ContextualizationException</code> instance.
*
* @param message The detail message for this exception.
* @param throwable the root cause of the exception
*/
public ContextualizationException( final String message, final Throwable
throwable )
{
super( message, throwable );
}
}
1.1
jakarta-avalon/proposal/4.0/src/java/org/apache/framework/context/ContextException.java
Index: ContextException.java
===================================================================
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE file.
*/
package org.apache.framework.context;
import org.apache.framework.CascadingException;
/**
* Thrown when an error regarding a <code>Context</code> occurs.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Leo Simons</a>
*/
public class ContextException
extends CascadingException
{
/**
* Construct a new <code>ContextualizationException</code> instance.
*
* @param message The detail message for this exception.
*/
public ContextException( final String message )
{
this( message, null );
}
/**
* Construct a new <code>ContextualizationException</code> instance.
*
* @param message The detail message for this exception.
* @param throwable the root cause of the exception
*/
public ContextException( final String message, final Throwable throwable )
{
super( message, throwable );
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]