mcconnell 2002/08/19 20:30:08 Modified: assembly/src/java/org/apache/excalibur/merlin/kernel DefaultKernel.java Log: Minor correction - legacy managenent when dealing with Phoenix based context inside an emdeded Merlin kenel. Revision Changes Path 1.41 +27 -3 jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/kernel/DefaultKernel.java Index: DefaultKernel.java =================================================================== RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/kernel/DefaultKernel.java,v retrieving revision 1.40 retrieving revision 1.41 diff -u -r1.40 -r1.41 --- DefaultKernel.java 19 Aug 2002 23:05:06 -0000 1.40 +++ DefaultKernel.java 20 Aug 2002 03:30:08 -0000 1.41 @@ -252,8 +252,32 @@ */ public void contextualize( Context context ) throws ContextException { - m_context = context; - context.get( DIR_KEY ); + try + { + context.get( DIR_KEY ); + m_context = context; + } + catch( ContextException contextException ) + { + // this situation is possible if the Merlin Kernel is being + // execution inside a container such a Phoenix which does not + // provide ontext management - the only solution is to attempt + // to guess the environment - otherwise we will throw a context + // exception + + try + { + File appHome = (File) context.get("app.home"); + DefaultContext c = new DefaultContext( context ); + c.put( DIR_KEY, appHome ); + c.makeReadOnly(); + m_context = c; + } + catch( Throwable e ) + { + throw contextException; + } + } } //=======================================================================
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>