Package com.shop.cache.api.server

Examples of com.shop.cache.api.server.SCServerFactory


  public static void internalMain(Arguments arguments) throws Exception
  {
    /**
     * This is a server, so get the server factory and a context
     */
    SCServerFactory     factory = ShopComCacheFactory.getServerFactory();
    SCServerContext     context = factory.newContext();

    /**
     * The context is where startup parameters are set. They must be
     * set before the server is started
     */
    context.port(arguments.portInt);
    if ( arguments.monitorPortInt != 0 )
    {
      context.monitorPort(arguments.monitorPortInt);
    }
    if ( arguments.logPath != null )
    {
      context.logPath(new File(getFileFromPath(arguments.logPath), "log" + System.currentTimeMillis() + ".txt"));
    }

    /**
     * This server will overflow objects to disk. It uses the included
     * CCDB2 package to do this
     */
    SCStorage         db = CCDB2StorageFactory.create(new CCDB2Parameters());
    db.open(getFileFromPath(arguments.dbPath));

    /**
     * Everything's set up, we can now create the server
     */
    final SCServer       server = factory.newServer(context, db);

    /**
     * Set up a hook to handle CTRL-C shutdown requests
     */
    Thread           hook = new Thread
View Full Code Here

TOP

Related Classes of com.shop.cache.api.server.SCServerFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.