1 package org.apache.fulcrum.testcontainer;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 import java.io.File;
20
21 import org.apache.avalon.framework.logger.AbstractLogEnabled;
22 import org.apache.avalon.framework.activity.Initializable;
23 import org.apache.avalon.framework.activity.Disposable;
24 import org.apache.avalon.framework.context.Contextualizable;
25 import org.apache.avalon.framework.context.Context;
26 import org.apache.avalon.framework.context.ContextException;
27
28 /**
29 * Interface of the component
30 *
31 * @author <a href="mailto:quintonm@bellsouth.net">Quinton McCombs</a>
32 * @author <a href="mailto:epugh@opensourceconnections.com">Eric Pugh</a>
33 * @version $Id: AlternativeComponentImpl.java 223140 2004-11-01 13:29:25Z epugh $
34 */
35 public class AlternativeComponentImpl
36 extends AbstractLogEnabled
37 implements Initializable, Disposable, SimpleComponent,
38 Contextualizable
39 {
40 private String appRoot;
41 private String appRoot2;
42
43 public void initialize() throws Exception
44 {
45 }
46
47 public void dispose()
48 {
49 }
50
51 public void test()
52 {
53 setupLogger(this, "AlternativeSimpleComponent");
54 getLogger().debug("test");
55 getLogger().debug("ComponentAppRoot = "+appRoot);
56 }
57
58 public void contextualize(Context context) throws ContextException
59 {
60 appRoot = (String) context.get("componentAppRoot");
61 if (context.get("urn:avalon:home") instanceof File){
62 appRoot2 = ((File)(context.get("urn:avalon:home"))).toString();
63 }
64 else {
65 appRoot2 = (String)context.get("urn:avalon:home");
66 }
67
68 }
69 /**
70 * @return Returns the appRoot.
71 */
72 public String getAppRoot()
73 {
74 return appRoot;
75 }
76
77 /**
78 * @return Returns the appRoot2.
79 */
80 public String getAppRoot2()
81 {
82 return appRoot2;
83 }
84
85 }