/*********************************************************************
* HttpServer.java
* created on 04.04.2006 by netseeker
* $Source: /cvsroot/ejoe/EJOE/examples/de/netseeker/ejoe/examples/http/HttpServer.java,v $
* $Date: 2006/11/27 22:58:23 $
* $Revision: 1.1 $
*
* ====================================================================
*
* Copyright 2006 netseeker aka Michael Manske
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ====================================================================
*
* This file is part of the de.netseeker.ejoe.examples.http framework.
* For more information on the author, please see
* <http://www.manskes.de/>.
*
*********************************************************************/
package de.netseeker.ejoe.examples.http;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import de.netseeker.ejoe.EJServer;
import de.netseeker.ejoe.examples.echo.EchoHandler;
/**
* @author netseeker
* @since
*/
public class HttpServer
{
/**
* Logger for this class
*/
private static final Logger logger = Logger.getLogger( HttpServer.class.getName() );
/**
* @param args
*/
public static void main( String[] args )
{
EJServer server = new EJServer( new EchoHandler(), 80 );
server.setMaxReadProcessors( 1 );
server.setMaxWriteProcessors( 1 );
server.enableNonBlockingIO( true );
server.enablePersistentConnections( true );
server.enableHttpPackaging( true );
server.enableCompression( true );
try
{
server.start();
}
catch ( IOException e )
{
logger.log( Level.SEVERE, "Exception while starting server!", e );
}
}
}