View Javadoc

1   /****************************************************************
2    * Licensed to the Apache Software Foundation (ASF) under one   *
3    * or more contributor license agreements.  See the NOTICE file *
4    * distributed with this work for additional information        *
5    * regarding copyright ownership.  The ASF licenses this file   *
6    * to you under the Apache License, Version 2.0 (the            *
7    * "License"); you may not use this file except in compliance   *
8    * with the License.  You may obtain a copy of the License at   *
9    *                                                              *
10   *   http://www.apache.org/licenses/LICENSE-2.0                 *
11   *                                                              *
12   * Unless required by applicable law or agreed to in writing,   *
13   * software distributed under the License is distributed on an  *
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
15   * KIND, either express or implied.  See the License for the    *
16   * specific language governing permissions and limitations      *
17   * under the License.                                           *
18   ****************************************************************/
19  
20  
21  
22  package org.apache.james.context;
23  
24  /**
25   * This class is a placeholder for Avalon Context keys.
26   *
27   * In order to decouple James from Phoenix, and to allow James
28   * to run in any Avalon Framework container it is necessary that
29   * James not depend on the BlockContext class from Phoenix, but
30   * rather only on the Context interface.  This requires that we
31   * look up context values directly, using String keys.  This
32   * class stores the String keys that are used by James to
33   * look up context values.
34   * 
35   * The lifetime of this class is expected to be limited.  At some
36   * point in the near future the Avalon folks will make a decision
37   * about how exactly to define, describe, and publish context
38   * values.  At that point we can replace this temporary mechanism
39   * with the Avalon mechanism.  Unfortunately right now that decision
40   * is still unmade, so we need to use this class as a temporary
41   * solution.
42   */
43  public class AvalonContextConstants {
44  
45      /**
46       * Private constructor to prevent instantiation or subclassing
47       */
48      private AvalonContextConstants() {}
49  
50      /**
51       * The context key associated with the home directory of the application
52       * being run.  The object returned on a 
53       * context.get(AvalonContextConstants.APPLICATION_HOME) should be of
54       * type <code>java.io.File</code> and should be the home directory
55       * for the application (in our case, James)
56       */
57      public static final String APPLICATION_HOME = "app.home";
58  }