KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > hivemind > impl > StartupImpl


1 // Copyright 2004, 2005 The Apache Software Foundation
2
//
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 implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14

15 package org.apache.hivemind.impl;
16
17 import java.util.Iterator JavaDoc;
18 import java.util.List JavaDoc;
19
20 /**
21  * Startup service for the HiveMind Registry. This service is invoked as the
22  * {@link org.apache.hivemind.internal.RegistryInfrastructure#startup() last step} of the
23  * {@link org.apache.hivemind.impl.RegistryBuilder#constructRegistry(java.util.Locale) registry construction}.
24  * All contributions (java.lang.Runnable objects) to the <code>hivemind.Startup</code>
25  * configuration point are executed serially in an arbitrary order. Note that the contributions are
26  * <em>not</em> executed in separate Threads.
27  * <p>
28  * HiveMind contributes the <code>hivemind.EagerLoad</code> (see
29  * {@link org.apache.hivemind.service.impl.EagerLoader}) service to the
30  * <code>hivemind.Startup</code> configuration.
31  *
32  * @author Howard Lewis Ship
33  */

34 public class StartupImpl extends BaseLocatable implements Runnable JavaDoc
35 {
36     private List JavaDoc _runnables;
37
38     public void run()
39     {
40         Iterator JavaDoc i = _runnables.iterator();
41         while (i.hasNext())
42         {
43             Runnable JavaDoc r = (Runnable JavaDoc) i.next();
44
45             r.run();
46         }
47     }
48
49     public void setRunnables(List JavaDoc list)
50     {
51         _runnables = list;
52     }
53
54 }
55
Popular Tags