KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > clif > server > FractalRMIseed


1 /*
2 * CLIF is a Load Injection Framework
3 * Copyright (C) 2003 France Telecom R&D
4 * Copyright (C) 2003 INRIA
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20 * CLIF $Name: $
21 *
22 * Contact: clif@objectweb.org
23 */

24
25 package org.objectweb.clif.server;
26
27
28 import org.objectweb.fractal.rmi.registry.NamingService;
29 import org.objectweb.fractal.rmi.registry.Registry;
30 import org.objectweb.fractal.util.Fractal;
31 import java.net.InetAddress JavaDoc;
32
33
34 /**
35  * Generic (i.e. empty) FractalRMI component, capable of hosting any kind of
36  * fractal component. This components registers itself in the FracalRMI registry.
37  * The name can be passed as argument, or defaults to the local host name.
38  * Used to deploy CLIF servers (injectors and probes).
39  * @author Julien Buret
40  * @author Nicolas Droze
41  * @author Bruno Dillenseger
42  */

43 public class FractalRMIseed
44 {
45     static public void main(final String JavaDoc[] args)
46     {
47         System.setSecurityManager(new SecurityManager JavaDoc());
48         try
49         {
50             NamingService ns = Registry.getRegistry(
51                 System.getProperty("fractal.registry.host", "localhost"));
52             String JavaDoc name = args.length == 0 ? InetAddress.getLocalHost().getHostName() : args[0];
53             ns.rebind(name, Fractal.getBootstrapComponent());
54             System.out.println("Fractal seed " + name + " is ready.");
55         }
56         catch (Exception JavaDoc ex)
57         {
58             throw new Error JavaDoc("Could not instantiate Fractal seed", ex);
59         }
60     }
61 }
62
Popular Tags