cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From blorit...@apache.org
Subject cvs commit: cocoon-2.2/src/java/org/apache/cocoon/components RequestLifestyleComponentHandler.java ComponentLocatorImpl.java ParentAware.java CocoonContainer.java ContextHelper.java RequestLifecycleComponent.java LifecycleHelper.java RequestLifecycleHelper.java GlobalRequestLifecycleComponent.java CocoonComponentManager.java ComponentLocator.java DefaultSitemapConfigurationHolder.java ComponentContext.java EnvironmentStack.java
Date Wed, 22 Oct 2003 15:13:56 GMT
bloritsch    2003/10/22 08:13:56

  Modified:    src/java/org/apache/cocoon/components
                        ComponentLocatorImpl.java ParentAware.java
                        CocoonContainer.java ContextHelper.java
                        RequestLifecycleComponent.java LifecycleHelper.java
                        RequestLifecycleHelper.java
                        GlobalRequestLifecycleComponent.java
                        CocoonComponentManager.java ComponentLocator.java
                        DefaultSitemapConfigurationHolder.java
                        ComponentContext.java EnvironmentStack.java
  Added:       src/java/org/apache/cocoon/components
                        RequestLifestyleComponentHandler.java
  Log:
  Add the RequestLifestyleComponentHandler, and simplify some of the handling code.
  
  Revision  Changes    Path
  1.4       +1 -1      cocoon-2.2/src/java/org/apache/cocoon/components/ComponentLocatorImpl.java
  
  Index: ComponentLocatorImpl.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/ComponentLocatorImpl.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  
  
  
  1.3       +1 -1      cocoon-2.2/src/java/org/apache/cocoon/components/ParentAware.java
  
  Index: ParentAware.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/ParentAware.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  
  
  
  1.4       +0 -0      cocoon-2.2/src/java/org/apache/cocoon/components/CocoonContainer.java
  
  Index: CocoonContainer.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/CocoonContainer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  
  
  
  1.6       +1 -1      cocoon-2.2/src/java/org/apache/cocoon/components/ContextHelper.java
  
  Index: ContextHelper.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/ContextHelper.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  
  
  
  1.7       +1 -1      cocoon-2.2/src/java/org/apache/cocoon/components/RequestLifecycleComponent.java
  
  Index: RequestLifecycleComponent.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/RequestLifecycleComponent.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  
  
  
  1.8       +1 -1      cocoon-2.2/src/java/org/apache/cocoon/components/LifecycleHelper.java
  
  Index: LifecycleHelper.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/LifecycleHelper.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  
  
  
  1.2       +12 -64    cocoon-2.2/src/java/org/apache/cocoon/components/RequestLifecycleHelper.java
  
  Index: RequestLifecycleHelper.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/RequestLifecycleHelper.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RequestLifecycleHelper.java	22 Oct 2003 14:13:52 -0000	1.1
  +++ RequestLifecycleHelper.java	22 Oct 2003 15:13:55 -0000	1.2
  @@ -49,9 +49,9 @@
   */
   package org.apache.cocoon.components;
   
  +import org.apache.avalon.fortress.impl.handler.ComponentHandler;
   import org.apache.avalon.framework.logger.Logger;
   import org.apache.avalon.framework.service.ServiceManager;
  -import org.apache.avalon.framework.service.ServiceSelector;
   import org.apache.cocoon.ProcessingException;
   import org.apache.cocoon.Processor;
   import org.apache.cocoon.environment.Environment;
  @@ -84,7 +84,7 @@
        * parameters are not set!
        */
       static void enterEnvironment(Environment      env,
  -                                        ServiceManager manager,
  +                                 ComponentHandler manager,
                                           Processor        processor) {
           if ( null == env || null == manager || null == processor) {
               throw new IllegalArgumentException("CocoonComponentManager.enterEnvironment:
all parameters must be set: " + env + " - " + manager + " - " + processor);
  @@ -103,7 +103,7 @@
   
       /**
        * This hook must be called by the sitemap each time a sitemap is left.
  -     * It's the counterpart to {@link #enterEnvironment(Environment, ServiceManager, Processor)}.
  +     * It's the counterpart to {@link #enterEnvironment(Environment, ComponentHandler,
Processor)}.
        */
       static void leaveEnvironment() {
           final EnvironmentStack stack = (EnvironmentStack)environmentStack.get();
  @@ -230,27 +230,7 @@
       /**
        * Add an automatically released component
        */
  -    static void addComponentForAutomaticRelease(final ServiceSelector selector,
  -                                                       final Object         component,
  -                                                       final ServiceManager  manager)
  -    throws ProcessingException {
  -        final EnvironmentStack stack = (EnvironmentStack)environmentStack.get();
  -        if ( null != stack && !stack.empty()) {
  -            final Object[] objects = (Object[])stack.get(0);
  -            final Map objectModel = ((Environment)objects[0]).getObjectModel();
  -            EnvironmentDescription desc = (EnvironmentDescription)objectModel.get(PROCESS_KEY);
  -            if ( null != desc ) {
  -                desc.addToAutoRelease(selector, component, manager);
  -            }
  -        } else {
  -            throw new ProcessingException("Unable to add component for automatic release:
no environment available.");
  -        }
  -    }
  -
  -    /**
  -     * Add an automatically released component
  -     */
  -    static void addComponentForAutomaticRelease(final ServiceManager manager,
  +    static void addComponentForAutomaticRelease(final ComponentHandler manager,
                                                          final Object        component)
       throws ProcessingException {
           final EnvironmentStack stack = (EnvironmentStack)environmentStack.get();
  @@ -314,10 +294,8 @@
       }
   }
   
  -
   final class EnvironmentDescription
   {
  -
       Environment environment;
       Map objectModel;
       Map requestLifecycleComponents;
  @@ -357,7 +335,7 @@
               {
                   final Object[] o = (Object[]) iter.next();
                   final Object component = o[0];
  -                ( (CocoonComponentManager) o[1] ).releaseRLComponent( component );
  +                ((ComponentHandler)o[1]).put(component);
               }
               this.requestLifecycleComponents.clear();
           }
  @@ -366,18 +344,8 @@
           {
               final Object[] o = (Object[]) autoreleaseComponents.get( i );
               final Object component = o[0];
  -            if ( o[1] instanceof ServiceManager )
  -            {
  -                ( (ServiceManager) o[1] ).release( component );
  -            }
  -            else
  -            {
  -                ( (ServiceSelector) o[1] ).release( component );
  -                if ( o[2] != null )
  -                {
  -                    ( (ServiceManager) o[2] ).release( o[1] );
  -                }
  -            }
  +            final ComponentHandler handler = (ComponentHandler)o[1];
  +            handler.put(component);
           }
           this.autoreleaseComponents.clear();
           this.environment = null;
  @@ -390,7 +358,7 @@
        */
       void addRequestLifecycleComponent( final String role,
                                          final Object co,
  -                                       final ServiceManager manager )
  +                                       final ComponentHandler manager )
       {
           if ( this.requestLifecycleComponents == null )
           {
  @@ -404,7 +372,7 @@
        */
       void addGlobalRequestLifecycleComponent( final String role,
                                                final Object co,
  -                                             final ServiceManager manager )
  +                                             final ComponentHandler manager )
       {
           this.getGlobalRequestLifcecycleComponents().put( role, new Object[]{co, manager}
);
       }
  @@ -462,17 +430,7 @@
       /**
        * Add an automatically released component
        */
  -    void addToAutoRelease( final ServiceSelector selector,
  -                           final Object component,
  -                           final ServiceManager manager )
  -    {
  -        this.autoreleaseComponents.add( new Object[]{component, selector, manager} );
  -    }
  -
  -    /**
  -     * Add an automatically released component
  -     */
  -    void addToAutoRelease( final ServiceManager manager,
  +    void addToAutoRelease( final ComponentHandler manager,
                              final Object component )
       {
           this.autoreleaseComponents.add( new Object[]{component, manager} );
  @@ -492,18 +450,8 @@
               if ( o[0] == component )
               {
                   found = true;
  -                if ( o[1] instanceof ServiceManager )
  -                {
  -                    ( (ServiceManager) o[1] ).release( component );
  -                }
  -                else
  -                {
  -                    ( (ServiceSelector) o[1] ).release( component );
  -                    if ( o[2] != null )
  -                    {
  -                        ( (ServiceManager) o[2] ).release( o[1] );
  -                    }
  -                }
  +                final ComponentHandler handler = (ComponentHandler)o[1];
  +                handler.put(component);
                   this.autoreleaseComponents.remove( i );
               }
               else
  
  
  
  1.6       +1 -1      cocoon-2.2/src/java/org/apache/cocoon/components/GlobalRequestLifecycleComponent.java
  
  Index: GlobalRequestLifecycleComponent.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/GlobalRequestLifecycleComponent.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  
  
  
  1.24      +1 -63     cocoon-2.2/src/java/org/apache/cocoon/components/CocoonComponentManager.java
  
  Index: CocoonComponentManager.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/CocoonComponentManager.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- CocoonComponentManager.java	22 Oct 2003 14:13:52 -0000	1.23
  +++ CocoonComponentManager.java	22 Oct 2003 15:13:55 -0000	1.24
  @@ -54,7 +54,6 @@
   import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.avalon.framework.service.ServiceException;
   import org.apache.avalon.framework.service.ServiceManager;
  -import org.apache.cocoon.environment.Environment;
   import org.apache.excalibur.source.SourceResolver;
   
   import java.util.ArrayList;
  @@ -127,67 +126,6 @@
               return this;
           }
   
  -        final EnvironmentStack stack = RequestLifecycleHelper.getTopEnvironmentStack();
  -        if ( null != stack && !stack.empty()) {
  -            final Object[] objects = (Object[])stack.getCurrent();
  -            final Map objectModel = ((Environment)objects[0]).getObjectModel();
  -            EnvironmentDescription desc = (EnvironmentDescription)objectModel.get(RequestLifecycleHelper.PROCESS_KEY);
  -            if ( null != desc ) {
  -                Object component = desc.getRequestLifecycleComponent(role);
  -                if (null != component) {
  -                    return component;
  -                }
  -                component = desc.getGlobalRequestLifecycleComponent(role);
  -                if (null != component) {
  -                    return component;
  -                }
  -            }
  -        }
  -
  -        final Object component = parentManager.lookup( role );
  -        if (null != component && component instanceof RequestLifecycleComponent)
{
  -            if (stack == null || stack.empty()) {
  -                throw new ServiceException(role, "ComponentManager has no Environment Stack.");
  -            }
  -            final Object[] objects = (Object[]) stack.getCurrent();
  -            final Map objectModel = ((Environment)objects[0]).getObjectModel();
  -            EnvironmentDescription desc = (EnvironmentDescription)objectModel.get(RequestLifecycleHelper.PROCESS_KEY);
  -            if ( null != desc ) {
  -
  -                // first test if the parent CM has already initialized this component
  -                if ( !desc.containsRequestLifecycleComponent( role ) ) {
  -                    try {
  -                        ((RequestLifecycleComponent) component).setup((org.apache.cocoon.environment.SourceResolver)objects[0],
  -                                                                      objectModel);
  -                    } catch (Exception local) {
  -                        throw new ServiceException(role, "Exception during setup of RequestLifecycleComponent.",
local);
  -                    }
  -                    desc.addRequestLifecycleComponent(role, component, this);
  -                }
  -            }
  -        }
  -
  -        if (null != component && component instanceof GlobalRequestLifecycleComponent)
{
  -            if (stack == null || stack.empty()) {
  -                throw new ServiceException(role, "ComponentManager has no Environment Stack.");
  -            }
  -            final Object[] objects = (Object[]) stack.getCurrent();
  -            final Map objectModel = ((Environment)objects[0]).getObjectModel();
  -            EnvironmentDescription desc = (EnvironmentDescription)objectModel.get(RequestLifecycleHelper.PROCESS_KEY);
  -            if ( null != desc ) {
  -
  -                // first test if the parent CM has already initialized this component
  -                if ( !desc.containsGlobalRequestLifecycleComponent( role ) ) {
  -                    try {
  -                        ((GlobalRequestLifecycleComponent) component).setup((org.apache.cocoon.environment.SourceResolver)objects[0],
  -                                                                      objectModel);
  -                    } catch (Exception local) {
  -                        throw new ServiceException(role, "Exception during setup of RequestLifecycleComponent.",
local);
  -                    }
  -                    desc.addGlobalRequestLifecycleComponent(role, component, this);
  -                }
  -            }
  -        }
   
           if ( null != component && component instanceof SitemapConfigurable) {
   
  
  
  
  1.4       +1 -1      cocoon-2.2/src/java/org/apache/cocoon/components/ComponentLocator.java
  
  Index: ComponentLocator.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/ComponentLocator.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  
  
  
  1.5       +1 -1      cocoon-2.2/src/java/org/apache/cocoon/components/DefaultSitemapConfigurationHolder.java
  
  Index: DefaultSitemapConfigurationHolder.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/DefaultSitemapConfigurationHolder.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  
  
  
  1.4       +1 -1      cocoon-2.2/src/java/org/apache/cocoon/components/ComponentContext.java
  
  Index: ComponentContext.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/ComponentContext.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  
  
  
  1.4       +1 -1      cocoon-2.2/src/java/org/apache/cocoon/components/EnvironmentStack.java
  
  Index: EnvironmentStack.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/EnvironmentStack.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  
  
  
  1.1                  cocoon-2.2/src/java/org/apache/cocoon/components/RequestLifestyleComponentHandler.java
  
  Index: RequestLifestyleComponentHandler.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, are permitted provided that the following conditions are met:
  
   1. Redistributions of  source code must  retain the above copyright  notice,
      this list of conditions and the following disclaimer.
  
   2. Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
  
   3. The end-user documentation included with the redistribution, if any, must
      include  the following  acknowledgment:  "This product includes  software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Jakarta", "Avalon", "Excalibur" and "Apache Software Foundation"
      must not be used to endorse or promote products derived from this  software
      without  prior written permission. For written permission, please contact
      apache@apache.org.
  
   5. Products  derived from this software may not  be called "Apache", nor may
      "Apache" appear  in their name,  without prior written permission  of the
      Apache Software Foundation.
  
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
   This software  consists of voluntary contributions made  by many individuals
   on  behalf of the Apache Software  Foundation. For more  information on the
   Apache Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.components;
  
  import org.apache.avalon.fortress.impl.handler.AbstractComponentHandler;
  import org.apache.avalon.framework.configuration.Configurable;
  import org.apache.avalon.framework.configuration.Configuration;
  import org.apache.avalon.framework.configuration.ConfigurationException;
  import org.apache.avalon.framework.service.ServiceException;
  import org.apache.avalon.framework.service.ServiceManager;
  import org.apache.cocoon.environment.Environment;
  import org.apache.excalibur.mpool.Pool;
  import org.apache.excalibur.mpool.PoolManager;
  
  import java.util.Map;
  
  /**
   * RequestLifestyleComponentHandler does XYZ
   *
   * @author <a href="bloritsch.at.apache.org">Berin Loritsch</a>
   * @version CVS $ Revision: 1.1 $
   */
  public class RequestLifestyleComponentHandler extends AbstractComponentHandler implements
Configurable
  {
      private static int lastInstance = 0;
  
      /** The instance of the PoolManager to create the Pool for the Handler */
      private PoolManager m_poolManager;
  
      /** The pool of components for <code>Poolable</code> Components */
      private Pool m_pool;
  
      /** The Config element for the poolable */
      private int m_poolMin;
  
      private String m_role = generateRole();
  
      /**
       * Application of suporting services to the handler.
       * @param serviceManager the service manager
       * @exception ServiceException if a service related error occurs
       * @avalon.dependency type="PoolManager"
       */
      public void service( final ServiceManager serviceManager )
              throws ServiceException
      {
          super.service( serviceManager );
          m_poolManager =
          (PoolManager) serviceManager.lookup( PoolManager.ROLE );
      }
  
      /**
       * Configuration of the handler under which the minimum pool size
       * is established.
       * @param configuration the configuration fragment
       * @exception ConfigurationException if the supplied configuration attribute
       *    for 'pool-min' cannot be resolved to an integer value
       */
      public void configure( final Configuration configuration )
              throws ConfigurationException
      {
          m_poolMin = configuration.getAttributeAsInteger( "pool-min", 10 );
      }
  
      /**
       * Initialize the ComponentHandler.
       * @exception Exception if an error occurs
       */
      protected void doPrepare()
              throws Exception
      {
          m_pool = m_poolManager.getManagedPool( m_factory, m_poolMin );
      }
  
      /**
       * Get a reference of the desired Component
       * @exception Exception if an error occurs
       */
      protected Object doGet()
              throws Exception
      {
          final EnvironmentStack stack = RequestLifecycleHelper.getTopEnvironmentStack();
          if ( null != stack && !stack.empty() )
          {
              final Object[] objects = (Object[]) stack.getCurrent();
              final Map objectModel = ( (Environment) objects[0] ).getObjectModel();
              EnvironmentDescription desc = (EnvironmentDescription) objectModel.get( RequestLifecycleHelper.PROCESS_KEY
);
              if ( null != desc )
              {
                  Object component = desc.getRequestLifecycleComponent( m_role );
                  if ( null != component )
                  {
                      return component;
                  }
                  component = desc.getGlobalRequestLifecycleComponent( m_role );
                  if ( null != component )
                  {
                      return component;
                  }
              }
          }
  
          final Object component = m_pool.acquire();
          if ( null != component && component instanceof RequestLifecycleComponent
)
          {
              if ( stack == null || stack.empty() )
              {
                  throw new ServiceException( m_role, "ComponentManager has no Environment
Stack." );
              }
              final Object[] objects = (Object[]) stack.getCurrent();
              final Map objectModel = ( (Environment) objects[0] ).getObjectModel();
              EnvironmentDescription desc = (EnvironmentDescription) objectModel.get( RequestLifecycleHelper.PROCESS_KEY
);
              if ( null != desc )
              {
  
                  // first test if the parent CM has already initialized this component
                  if ( !desc.containsRequestLifecycleComponent( m_role ) )
                  {
                      try
                      {
                          ( (RequestLifecycleComponent) component ).setup(
                                  (org.apache.cocoon.environment.SourceResolver) objects[0],
                                  objectModel );
                      }
                      catch ( Exception local )
                      {
                          throw new ServiceException( m_role, "Exception during setup of RequestLifecycleComponent.",
local );
                      }
                      desc.addRequestLifecycleComponent( m_role, component, this );
                  }
              }
          }
  
          if ( null != component && component instanceof GlobalRequestLifecycleComponent
)
          {
              if ( stack == null || stack.empty() )
              {
                  throw new ServiceException( m_role, "ComponentManager has no Environment
Stack." );
              }
              final Object[] objects = (Object[]) stack.getCurrent();
              final Map objectModel = ( (Environment) objects[0] ).getObjectModel();
              EnvironmentDescription desc = (EnvironmentDescription) objectModel.get( RequestLifecycleHelper.PROCESS_KEY
);
              if ( null != desc )
              {
  
                  // first test if the parent CM has already initialized this component
                  if ( !desc.containsGlobalRequestLifecycleComponent( m_role ) )
                  {
                      try
                      {
                          ( (GlobalRequestLifecycleComponent) component ).setup(
                                  (org.apache.cocoon.environment.SourceResolver) objects[0],
                                  objectModel );
                      }
                      catch ( Exception local )
                      {
                          throw new ServiceException( m_role, "Exception during setup of RequestLifecycleComponent.",
local );
                      }
                      desc.addGlobalRequestLifecycleComponent( m_role, component, this );
                  }
              }
          }
  
          return component;
      }
  
      /**
       * Return a reference of the desired Component
       * @param component the component to return to the handler
       */
      protected void doPut( final Object component )
      {
          m_pool.release( component );
      }
  
      private static synchronized String generateRole()
      {
          return "component" + lastInstance++;
      }
  }
  
  
  

Mime
View raw message