Package com.db4o.events

Examples of com.db4o.events.ObjectEventArgs.object()


      EventsMap.getInstance().putRemoveEvent(event);
  }

  private IEntity getEntity(EventArgs args) {
    ObjectEventArgs queryArgs = ((ObjectEventArgs) args);
    Object o = queryArgs.object();
    if (o instanceof IEntity) {
      IEntity entity = (IEntity) o;
      return entity;
    }
    return null;
View Full Code Here


      EventsMap.getInstance().putRemoveEvent(event);
  }

  private IEntity getEntity(EventArgs args) {
    ObjectEventArgs queryArgs = ((ObjectEventArgs) args);
    Object o = queryArgs.object();
    if (o instanceof IEntity) {
      IEntity entity = (IEntity) o;
      return entity;
    }
    return null;
View Full Code Here

      EventsMap.getInstance().putRemoveEvent(event);
  }

  private IEntity getEntity(EventArgs args) {
    ObjectEventArgs queryArgs = ((ObjectEventArgs) args);
    Object o = queryArgs.object();
    if (o instanceof IEntity) {
      IEntity entity = (IEntity) o;
      return entity;
    }
    return null;
View Full Code Here

    }

    @Override
    public void onEvent(Event4 e, EventArgs args) {
      final ObjectEventArgs queryArgs = ((ObjectEventArgs) args);
      final Object o = queryArgs.object();
      if(o instanceof ITimeStampEntity) {
        final Date now = new Date();
        if(creating) ((ITimeStampEntity) o).setDateCreated(now);
        ((ITimeStampEntity) o).setDateModified(now);
        log.debug("Timestamped entity: " + o);
View Full Code Here

    static final Logger log = LoggerFactory.getLogger(Versioner.class);

    @Override
    public void onEvent(Event4 e, EventArgs args) {
      final ObjectEventArgs queryArgs = ((ObjectEventArgs) args);
      final Object o = queryArgs.object();
      if(o instanceof IVersionSupport) {
        final Integer cv = ((IVersionSupport) o).getVersion();
        ((IVersionSupport) o).setVersion(Integer.valueOf(cv == null ? 0 : cv.intValue() + 1));
        log.debug("Versioned entity: " + o);
      }
View Full Code Here

    }

    @Override
    public void onEvent(Event4 e, EventArgs args) {
      final ObjectEventArgs queryArgs = ((ObjectEventArgs) args);
      final Object o = queryArgs.object();
      if(o instanceof ITimeStampEntity) {
        final Date now = new Date();
        if(creating) ((ITimeStampEntity) o).setDateCreated(now);
        ((ITimeStampEntity) o).setDateModified(now);
        log.debug("Timestamped entity: " + o);
View Full Code Here

  static class Versioner implements EventListener4 {

    @Override
    public void onEvent(Event4 e, EventArgs args) {
      final ObjectEventArgs queryArgs = ((ObjectEventArgs) args);
      final Object o = queryArgs.object();
      if(o instanceof IVersionSupport) {
        final Integer cv = ((IVersionSupport) o).getVersion();
        ((IVersionSupport) o).setVersion(cv == null ? 0 : cv.intValue() + 1);
        log.debug("Versioned entity: " + o);
      }
View Full Code Here

      EventsMap.getInstance().putRemoveEvent(event);
  }

  private IEntity getEntity(EventArgs args) {
    ObjectEventArgs queryArgs = ((ObjectEventArgs) args);
    Object o = queryArgs.object();
    if (o instanceof IEntity) {
      IEntity entity = (IEntity) o;
      return entity;
    }
    return null;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.