Example usage for org.apache.commons.logging.impl Jdk14Logger Jdk14Logger

List of usage examples for org.apache.commons.logging.impl Jdk14Logger Jdk14Logger

Introduction

In this page you can find the example usage for org.apache.commons.logging.impl Jdk14Logger Jdk14Logger.

Prototype

public Jdk14Logger(String name) 

Source Link

Document

Construct a named instance of this Logger.

Usage

From source file:io.smartspaces.service.comm.network.server.internal.netty.NettyUdpBroadcastMasterNetworkCommunicationEndpoint.java

public static void main(String[] args) throws Exception {
    ExecutorService executorService = Executors.newScheduledThreadPool(1000);
    NettyUdpBroadcastMasterNetworkCommunicationEndpoint endpoint = new NettyUdpBroadcastMasterNetworkCommunicationEndpoint(
            23867, executorService, new StandardExtendedLog("foo", new Jdk14Logger("foo")));
    endpoint.startup();/* w w  w . j  av a  2  s  .c o  m*/

    Thread.sleep(1000);
    for (int i = 0; i < 10; i++) {
        endpoint.writeBroadcastData("Hello".getBytes());
        Thread.sleep(1000);
    }

    endpoint.shutdown();
    executorService.shutdown();
}

From source file:interactivespaces.hardware.driver.gaming.wilddivine.IomDriver.java

public static void main(String[] args) {
    final SimpleInteractiveSpacesEnvironment spaceEnvironment = new SimpleInteractiveSpacesEnvironment();
    spaceEnvironment.setExecutorService(Executors.newScheduledThreadPool(100));
    SimpleServiceRegistry serviceRegistry = new SimpleServiceRegistry(spaceEnvironment);
    spaceEnvironment.setServiceRegistry(serviceRegistry);
    Configuration configuration = SimpleConfiguration.newConfiguration();
    spaceEnvironment.setLog(new Jdk14Logger("foo"));
    Usb4JavaUsbCommunicationEndpointService service = new Usb4JavaUsbCommunicationEndpointService();
    serviceRegistry.registerService(service);
    service.startup();// w w  w. java  2  s  . c o  m

    IomDriver driver = new IomDriver();
    driver.prepare(spaceEnvironment, configuration, spaceEnvironment.getLog());

    driver.addListener(new IomDeviceListener() {

        @Override
        public void onEvent(IomDriver driver, double heartRateValue, double skinConductivityLevel) {
            spaceEnvironment.getLog()
                    .info(String.format("Heart is %f, skin is %f", heartRateValue, skinConductivityLevel));
        }
    });

    try {
        driver.startup();

        InteractiveSpacesUtilities.delay(20000);
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        driver.shutdown();
        spaceEnvironment.getExecutorService().shutdown();
    }
}

From source file:com.github.veithen.ulog.Jdk14LogFactory.java

protected Log newInstance(String name) {
    return new Jdk14Logger(name);
}

From source file:interactivespaces.system.ActiveTestInteractiveSpacesEnvironment.java

/**
 * Create a new {@link ActiveTestInteractiveSpacesEnvironment}.
 *
 * @return the space environment//from ww w  .j  av a  2  s  .c o  m
 */
public static ActiveTestInteractiveSpacesEnvironment newActiveTestInteractiveSpacesEnvironment() {
    ActiveTestInteractiveSpacesEnvironment environment = new ActiveTestInteractiveSpacesEnvironment();

    environment.systemConfiguration = SimpleConfiguration.newConfiguration();
    environment.executorService = Executors.newScheduledThreadPool(100);
    environment.log = new Jdk14Logger("test.interactive.spaces");
    environment.serviceRegistry = new SimpleServiceRegistry(environment);
    environment.timeProvider = new SettableTimeProvider();

    return environment;
}

From source file:interactivespaces.system.StandaloneInteractiveSpacesEnvironment.java

/**
 * Create a new {@link StandaloneInteractiveSpacesEnvironment}.
 *
 * @return the space environment/*from  w ww .  ja  v  a  2  s.c  o m*/
 */
public static StandaloneInteractiveSpacesEnvironment newStandaloneInteractiveSpacesEnvironment() {
    StandaloneInteractiveSpacesEnvironment environment = new StandaloneInteractiveSpacesEnvironment();

    environment.systemConfiguration = SimpleConfiguration.newConfiguration();
    environment.executorService = Executors.newScheduledThreadPool(100);
    environment.log = new Jdk14Logger("test.interactive.spaces");
    environment.serviceRegistry = new SimpleServiceRegistry(environment);
    environment.timeProvider = new SettableTimeProvider();
    environment.managedResources = new ManagedResources(environment.log);
    environment.managedResources.startupResources();

    return environment;
}

From source file:io.smartspaces.system.StandaloneSmartSpacesEnvironment.java

/**
 * Create a new {@link StandaloneSmartSpacesEnvironment}.
 *
 * @return the space environment/*  w  ww  .  j av a 2  s .  co  m*/
 */
public static StandaloneSmartSpacesEnvironment newStandaloneSmartSpacesEnvironment() {
    StandaloneSmartSpacesEnvironment environment = new StandaloneSmartSpacesEnvironment();

    environment.systemConfiguration = SimpleConfiguration.newConfiguration();
    environment.executorService = Executors.newScheduledThreadPool(NUM_THREADS_IN_POOL);
    environment.log = new StandardExtendedLog("container", new Jdk14Logger("test.smartspaces"));
    environment.serviceRegistry = new StandardServiceRegistry(environment);
    environment.timeProvider = new SettableTimeProvider();
    environment.eventObservableRegistry = new StandardEventObservableRegistry(environment.log);
    environment.managedResources = new StandardManagedResources(environment.log);
    environment.managedTasks = new StandardManagedTasks(environment.executorService, environment.log);
    environment.managedScope = new StandardManagedScope(environment.managedResources, environment.managedTasks,
            environment.executorService);
    environment.managedResources.startupResources();

    return environment;
}

From source file:interactivespaces.workbench.devinfrastructure.StandaloneDevelopmentInfrastructure.java

@Override
public void startup() {
    log = new Jdk14Logger("InteractiveSpaces-Development-Infrastructure");
    try {//from w w w  .j a v  a2  s . c  om
        executorService = Executors.newScheduledThreadPool(NUMBER_THREADS_IN_POOL);

        initializeRosEnvironment();
        initializeRosMasterController();

    } catch (Throwable e) {
        InteractiveSpacesException.throwFormattedException(e,
                "Could not start up the Interactive Spaces Development Infrastructure");
    }
}

From source file:io.smartspaces.workbench.devinfrastructure.StandaloneDevelopmentInfrastructure.java

@Override
public void startup() {
    log = new Jdk14Logger("smartspaces-Development-Infrastructure");
    try {//ww  w  .  ja v  a2 s  .  c om
        executorService = Executors.newScheduledThreadPool(NUMBER_THREADS_IN_POOL);

        initializeRosEnvironment();
        initializeRosMasterController();

    } catch (Throwable e) {
        throw SmartSpacesException.newFormattedException(e,
                "Could not start up the Smart Spaces Development Infrastructure");
    }
}

From source file:interactivespaces.util.web.WebSocketTest.java

@Before
public void setup() {
    log = new Jdk14Logger("goober"); // Mockito.mock(Log.class);

    threadPool = Executors.newScheduledThreadPool(100);
}

From source file:interactivespaces.service.comm.network.NettyUdpSocketTest.java

@Before
public void setup() {
    log = new Jdk14Logger("goober");

    threadPool = Executors.newScheduledThreadPool(100);

    SimpleInteractiveSpacesEnvironment spaceEnvironment = new SimpleInteractiveSpacesEnvironment();
    spaceEnvironment.setExecutorService(threadPool);

    clientService = new NettyUdpClientNetworkCommunicationEndpointService();
    clientService.setSpaceEnvironment(spaceEnvironment);
    clientService.startup();/*w  ww .ja va 2 s  .  c  om*/

    serverService = new NettyUdpServerNetworkCommunicationEndpointService();
    serverService.setSpaceEnvironment(spaceEnvironment);
    serverService.startup();
}