This project has retired. For details please refer to its
Attic page.
Registry xref
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.juddi;
18
19 import javax.naming.NamingException;
20
21 import org.apache.commons.configuration.ConfigurationException;
22 import org.apache.commons.logging.Log;
23 import org.apache.commons.logging.LogFactory;
24 import org.apache.juddi.config.AppConfig;
25 import org.apache.juddi.config.Property;
26 import org.apache.juddi.replication.ReplicationNotifier;
27 import org.apache.juddi.subscription.SubscriptionNotifier;
28
29 public class Registry {
30
31 private static Registry registry = null;
32 private static Log log = LogFactory.getLog(Registry.class);
33 private static SubscriptionNotifier subscriptionNotifier = null;
34 private static ReplicationNotifier replicationNotifier = null;
35
36
37
38
39 private Registry() {
40 super();
41 }
42
43
44
45
46
47
48 public synchronized static void stop() throws ConfigurationException {
49 if (registry != null) {
50 log.info("Stopping jUDDI registry...");
51 if (subscriptionNotifier != null) {
52 log.info("Shutting down SubscriptionNotifier");
53 subscriptionNotifier.cancel();
54 subscriptionNotifier = null;
55 }
56 if (replicationNotifier != null) {
57 replicationNotifier.cancel();
58 replicationNotifier = null;
59 }
60 registry = null;
61 log.info("jUDDI shutdown completed.");
62 }
63 }
64
65
66
67
68
69
70 public synchronized static void start() throws ConfigurationException {
71 if (registry == null) {
72 log.info("Starting jUDDI registry...This is node " + AppConfig.getConfiguration().getString(Property.JUDDI_NODE_ID, ""));
73 registry = new Registry();
74 replicationNotifier = new ReplicationNotifier();
75 AppConfig.triggerReload();
76 if (AppConfig.getConfiguration().getBoolean(Property.JUDDI_SUBSCRIPTION_NOTIFICATION, true)) {
77 subscriptionNotifier = new SubscriptionNotifier();
78 }
79 log.info("jUDDI registry started successfully.");
80 }
81 }
82
83 }