All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.activiti.engine.impl.event.logger.handler.EngineCreatedEventHandler Maven / Gradle / Ivy

There is a newer version: 3.0.Beta
Show newest version
package org.activiti.engine.impl.event.logger.handler;

import org.activiti.engine.impl.interceptor.CommandContext;
import org.activiti.engine.impl.persistence.entity.EventLogEntryEntity;

import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.HashMap;
import java.util.Map;

/**

 */
public class EngineCreatedEventHandler extends AbstractDatabaseEventLoggerEventHandler {

  @Override
  public EventLogEntryEntity generateEventLogEntry(CommandContext commandContext) {
    Map data = new HashMap();
    try {
      data.put("ip", InetAddress.getLocalHost().getHostAddress()); // Note
                                                                   // that
                                                                   // this
                                                                   // might
                                                                   // give
                                                                   // the
                                                                   // wrong
                                                                   // ip
                                                                   // address
                                                                   // in
                                                                   // case
                                                                   // of
                                                                   // multiple
                                                                   // network
                                                                   // interfaces
                                                                   // -
                                                                   // but
                                                                   // it's
                                                                   // better
                                                                   // than
                                                                   // nothing.
    } catch (UnknownHostException e) {
      // Best effort
    }
    return createEventLogEntry(data);
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy