View Javadoc

1   package org.apache.turbine.services.avaloncomponent;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import org.apache.avalon.framework.component.Component;
23  import org.apache.avalon.framework.component.ComponentException;
24  
25  import org.apache.turbine.services.Service;
26  
27  /***
28   * This service allows access to avalon components.
29   *
30   * @author <a href="mailto:quintonm@bellsouth.net">Quinton McCombs</a>
31   * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
32   * @version $Id: AvalonComponentService.java 534527 2007-05-02 16:10:59Z tv $
33   */
34  public interface AvalonComponentService
35          extends Service
36  {
37      /*** The publically visible name of the service */
38      String SERVICE_NAME = "AvalonComponentService";
39  
40      /*** Where we write the Avalon Logger messages */
41      String AVALON_LOG_CATEGORY = "avalon";
42  
43      /*** property specifing file name of the component config file */
44      String COMPONENT_CONFIG_KEY = "componentConfiguration";
45  
46      /*** property specifing file name of the component config file */
47      String COMPONENT_CONFIG_VALUE = "/WEB-INF/conf/componentConfiguration.xml";
48  
49      /*** property specifing file name of the component role file */
50      String COMPONENT_ROLE_KEY = "componentRoles";
51  
52      /*** property specifing file name of the component role file */
53      String COMPONENT_ROLE_VALUE = "/WEB-INF/conf/roleConfiguration.xml";
54  
55      /*** property for the Components to look up */
56      String COMPONENT_LOOKUP_KEY = "lookup";
57  
58      /*** Key used in the context for defining the application root */
59      String COMPONENT_APP_ROOT = "componentAppRoot";
60  
61      /***
62       * Returns an instance of the named component
63       *
64       * @param roleName Name of the role the component fills.
65       * @return an instance of the named component
66       * @throws ComponentException generic exception
67       */
68      Component lookup(String roleName)
69              throws ComponentException;
70  
71      /***
72       * Releases the component
73       *
74       * @param component the component to release
75       */
76      void release(Component component);
77  
78  }