KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > server > TCServerMain


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright
3  * notice. All rights reserved.
4  */

5 package com.tc.server;
6
7 import com.tc.config.schema.setup.FatalIllegalConfigurationChangeHandler;
8 import com.tc.config.schema.setup.StandardTVSConfigurationSetupManagerFactory;
9 import com.tc.config.schema.setup.TVSConfigurationSetupManagerFactory;
10 import com.tc.lang.TCThreadGroup;
11 import com.tc.lang.ThrowableHandler;
12 import com.tc.logging.TCLogging;
13
14 public class TCServerMain {
15
16   public static void main(final String JavaDoc[] args) {
17     ThrowableHandler throwableHandler = new ThrowableHandler(TCLogging.getLogger(TCServerMain.class));
18
19     try {
20       TCThreadGroup threadGroup = new TCThreadGroup(throwableHandler);
21
22       TVSConfigurationSetupManagerFactory factory = new StandardTVSConfigurationSetupManagerFactory(
23                                                                                                     args,
24                                                                                                     true,
25                                                                                                     new FatalIllegalConfigurationChangeHandler());
26       AbstractServerFactory serverFactory = AbstractServerFactory.getFactory();
27       TCServer server = serverFactory.createServer(factory.createL2TVSConfigurationSetupManager(null), threadGroup);
28       server.start();
29
30     } catch (Throwable JavaDoc t) {
31       throwableHandler.handleThrowable(Thread.currentThread(), t);
32     }
33   }
34 }
35
Popular Tags