KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > avalon > repository > provider > InitialContext


1 /*
2  * Copyright 2004 Apache Software Foundation
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12  * implied.
13  *
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17
18 package org.apache.avalon.repository.provider;
19
20 import java.net.URL JavaDoc;
21 import java.io.File JavaDoc;
22 import java.util.jar.Manifest JavaDoc;
23
24 import org.apache.avalon.repository.Artifact;
25 import org.apache.avalon.repository.Repository;
26 import org.apache.avalon.repository.RepositoryException;
27
28
29 /**
30  * The initial context established by an initial repository factory.
31  *
32  * @author <a HREF="mailto:dev@avalon.apache.org">Avalon Development Team</a>
33  * @version $Revision: 1.14 $ $Date: 2004/03/04 03:26:41 $
34  */

35 public interface InitialContext
36 {
37    /**
38     * The property key used when resolving the default implementation
39     * artifact spec.
40     */

41     String JavaDoc IMPLEMENTATION_KEY = "avalon.repository.implementation";
42
43    /**
44     * The property key used declare the online connection policy.
45     */

46     String JavaDoc ONLINE_KEY = "avalon.repository.online";
47
48    /**
49     * The property key used when resolving a sequence of factory
50     * artifact references.
51     */

52     String JavaDoc FACTORY_ARTIFACTS_KEY = "avalon.repository.artifacts";
53
54    /**
55     * The property key used when resolving the default cache directory.
56     */

57     String JavaDoc CACHE_KEY = "avalon.repository.cache";
58
59    /**
60     * The property key used when evaluating the default remote hosts. The
61     * value assigned to this property is a comma seperated list of urls.
62     */

63     String JavaDoc HOSTS_KEY = "avalon.repository.hosts";
64
65     String JavaDoc PROXY_HOST_KEY = "avalon.repository.proxy.host";
66     String JavaDoc PROXY_PORT_KEY = "avalon.repository.proxy.port";
67     String JavaDoc PROXY_USERNAME_KEY = "avalon.repository.proxy.username";
68     String JavaDoc PROXY_PASSWORD_KEY = "avalon.repository.proxy.password";
69
70     String JavaDoc LINE =
71       "\n-----------------------------------------------------------";
72
73    /**
74     * Return the application key. The value of the key may be used
75     * to resolve property files by using the convention
76     * [key].properties.
77     *
78     * @return the application key.
79     */

80     String JavaDoc getApplicationKey();
81
82     /**
83      * Return the online mode.
84      *
85      * @return the online mode
86      */

87     boolean getOnlineMode();
88
89     /**
90      * Return cache root directory.
91      *
92      * @return the cache directory
93      */

94     File JavaDoc getInitialCacheDirectory();
95
96     /**
97      * Return the base working directory.
98      *
99      * @return the base directory
100      */

101     File JavaDoc getInitialWorkingDirectory();
102
103     /**
104      * Return the initial set of host names.
105      * @return the host names sequence
106      */

107     String JavaDoc[] getInitialHosts();
108
109    /**
110     * Return the initial repository factory.
111     * @return the initial repository factory
112     */

113     Factory getInitialFactory();
114
115    /**
116     * Return the repository.
117     * @return the repository
118     */

119     Repository getRepository();
120
121    /**
122     * Create a factory builder using a supplied artifact.
123     * @param artifact the factory artifact
124     * @return the factory builder
125     * @exception Exception if a builder creation error occurs
126     */

127     Builder newBuilder( Artifact artifact )
128       throws Exception JavaDoc;
129
130    /**
131     * Create a factory builder using a supplied artifact.
132     * @param classloader the parent classloader
133     * @param artifact the factory artifact
134     * @return the factory
135     * @exception Exception if a factory creation error occurs
136     */

137     Builder newBuilder( ClassLoader JavaDoc classloader, Artifact artifact )
138       throws Exception JavaDoc;
139
140    /**
141     * Install a block archive into the repository.
142     * @param url the block archive url
143     * @return the block manifest
144     */

145     Manifest JavaDoc install( URL JavaDoc url ) throws RepositoryException;
146   
147 }
148
Popular Tags