1
2
3
4
5
6
7
8
9
10
11 package org.astrogrid.jes.component.production;
12
13 import org.astrogrid.component.descriptor.SimpleComponentDescriptor;
14 import org.astrogrid.config.Config;
15 import org.astrogrid.jes.jobscheduler.locator.RegistryToolLocator.RegistryEndpoint;
16
17 import java.net.URL;
18
19 /*** Configuration component that retreives registry endpoint from the configuration.
20 * Used by {@link org.astrogrid.jes.jobscheduler.locator.RegistryToolLocator}
21 * @author Noel Winstanley nw@jb.man.ac.uk 08-Mar-2004
22 * @todo add unit test, fallback registry endpoint..
23 */
24 public class RegistryEndpointFromConfig extends SimpleComponentDescriptor implements RegistryEndpoint {
25 /*** key to look in config for registry endpoint.
26 * @todo replace by proper constant, once its made public */
27 public static final String REGISTRY_ENDPOINT_KEY = "org.astrogrid.registry.query.endpoint";
28 public RegistryEndpointFromConfig(Config c) {
29 url = c.getUrl(REGISTRY_ENDPOINT_KEY);
30 name="Registry Tool Locator - registry endpoint configuration";
31 description="key: " + REGISTRY_ENDPOINT_KEY
32 + "\nvalue: " + url.toString();
33 }
34 protected final URL url;
35 /***
36 * @see org.astrogrid.jes.jobscheduler.locator.RegistryToolLocator.RegistryEndpoint#getURL()
37 */
38 public URL getURL() {
39 return url;
40 }
41 }
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61