Search in sources :

Example 1 with ConcourseServerAdvisor

use of com.cinchapi.concourse.server.aop.ConcourseServerAdvisor in project concourse by cinchapi.

the class ConcourseServer method create.

/**
 * Create a new {@link ConcourseServer} instance that uses the specified
 * port and storage locations.
 * <p>
 * In general, this factory should only be used by unit tests. Runtime
 * construction of the server should be done using the
 * {@link ConcourseServer#create()} method so that the preferences file is
 * used.
 * </p>
 *
 * @param port - the port on which to listen for client connections
 * @param bufferStore - the location to store {@link Buffer} files
 * @param dbStore - the location to store {@link Database} files
 * @return {@link ConcourseServer}
 * @throws TTransportException
 */
public static ConcourseServer create(int port, String bufferStore, String dbStore) throws TTransportException {
    Injector injector = Guice.createInjector(new ConcourseServerAdvisor());
    ConcourseServer server = injector.getInstance(ConcourseServer.class);
    server.init(port, bufferStore, dbStore);
    return server;
}
Also used : Injector(com.google.inject.Injector) ConcourseServerAdvisor(com.cinchapi.concourse.server.aop.ConcourseServerAdvisor)

Aggregations

ConcourseServerAdvisor (com.cinchapi.concourse.server.aop.ConcourseServerAdvisor)1 Injector (com.google.inject.Injector)1