Author: echatellier Date: 2011-03-24 12:47:56 +0100 (Thu, 24 Mar 2011) New Revision: 3082 Url: http://chorem.org/repositories/revision/lima/3082 Log: Add lima server main Added: trunk/lima-business/src/main/java/org/chorem/lima/LimaServer.java Added: trunk/lima-business/src/main/java/org/chorem/lima/LimaServer.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/LimaServer.java (rev 0) +++ trunk/lima-business/src/main/java/org/chorem/lima/LimaServer.java 2011-03-24 11:47:56 UTC (rev 3082) @@ -0,0 +1,77 @@ +/* + * #%L + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 Codelutin, Chatellier Eric + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +package org.chorem.lima; + +import java.util.Properties; + +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; + +import org.apache.openejb.client.LocalInitialContextFactory; + +/** + * Lima server class. + * + * Starts openejb server. + * + * @author chatellier + * @version $Revision$ + * + * Last update : $Date$ + * By : $Author$ + */ +public class LimaServer { + + /** + * Lima server. + * + * @param args + * @throws NamingException + */ + public static void main(String... args) throws NamingException { + Properties properties = new Properties(); + properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, LocalInitialContextFactory.class.getName()); + properties.setProperty("openejb.embedded.remotable", "true"); + // Uncomment these properties to change the defaults + //properties.setProperty("ejbd.port", "4202"); + properties.setProperty("ejbd.bind", "0.0.0.0"); + //properties.setProperty("ejbd.threads", "200"); + //properties.setProperty("ejbd.disabled", "false"); + //properties.setProperty("ejbd.only_from", "127.0.0.1,192.168.1.1"); + + new InitialContext(properties); + + // block main otherwize, main will end + synchronized (properties) { + try { + properties.wait(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + System.out.println("Server shutdown"); + } +} Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/LimaServer.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL