Package javax.jdo.listener

Examples of javax.jdo.listener.InstanceLifecycleEvent


    {
        for (LifecycleListenerForClass listener : getListenersWorkingCopy())
        {
            if (listener.forClass(pc.getClass()) && listener.getListener() instanceof DetachLifecycleListener)
            {
                ((DetachLifecycleListener)listener.getListener()).preDetach(new InstanceLifecycleEvent(pc, InstanceLifecycleEvent.DETACH, null));
            }
        }

        if (pc instanceof DetachCallback)
        {
View Full Code Here


        for (LifecycleListenerForClass listener : getListenersWorkingCopy())
        {
            if (listener.forClass(pc.getClass()) && listener.getListener() instanceof DetachLifecycleListener)
            {
                ((DetachLifecycleListener)listener.getListener()).postDetach(new InstanceLifecycleEvent(detachedPC, InstanceLifecycleEvent.DETACH, pc));
            }
        }
    }
View Full Code Here

    {
        for (LifecycleListenerForClass listener : getListenersWorkingCopy())
        {
            if (listener.forClass(pc.getClass()) && listener.getListener() instanceof AttachLifecycleListener)
            {
                ((AttachLifecycleListener)listener.getListener()).preAttach(new InstanceLifecycleEvent(pc, InstanceLifecycleEvent.ATTACH, null));
            }
        }

        if (pc instanceof AttachCallback)
        {
View Full Code Here

        for (LifecycleListenerForClass listener : getListenersWorkingCopy())
        {
            if (listener.forClass(pc.getClass()) && listener.getListener() instanceof AttachLifecycleListener)
            {
                ((AttachLifecycleListener)listener.getListener()).postAttach(new InstanceLifecycleEvent(pc, InstanceLifecycleEvent.ATTACH, detachedPC));
            }
        }
    }
View Full Code Here

        InstanceLifecycleListener[] ls = null;
        if (event2lifecycleListeners != null) {
        ls = (InstanceLifecycleListener[])
      event2lifecycleListeners.get(new Integer(eventType));
        }
    InstanceLifecycleEvent ev;
    switch(eventType) {
        case HomeItf.POST_NEW: //makePersist
        if (ls != null) {
          ev = new InstanceLifecycleEvent(source, InstanceLifecycleEvent.CREATE, target);
          for(int i=0; i < ls.length; i++)
            ((CreateLifecycleListener) ls[i]).postCreate(ev);
            }
            break;
        case HomeItf.PRE_REMOVE: //deletePersistent
        if (source instanceof DeleteCallback) {
          ((DeleteCallback) source).jdoPreDelete();
        }
        if (ls != null) {
          ev = new InstanceLifecycleEvent(source, InstanceLifecycleEvent.DELETE, target);
          for(int i=0; i < ls.length; i++)
            ((DeleteLifecycleListener) ls[i]).preDelete(ev);
            }
            break;
        case HomeItf.POST_REMOVE://deletePersistent
        if (ls != null) {
          ev = new InstanceLifecycleEvent(source, InstanceLifecycleEvent.DELETE, target);
          for(int i=0; i < ls.length; i++)
            ((DeleteLifecycleListener) ls[i]).postDelete(ev);
            }
            break;
       
        case HomeItf.POST_LOAD:
        if (source instanceof LoadCallback) {
          ((LoadCallback) source).jdoPostLoad();
        }
        if (ls != null) {
          ev = new InstanceLifecycleEvent(source, InstanceLifecycleEvent.LOAD, target);
          for(int i=0; i < ls.length; i++)
            ((LoadLifecycleListener) ls[i]).postLoad(ev);
            }
            break;
        case HomeItf.PRE_DIRTY:
        if (ls != null) {
          ev = new InstanceLifecycleEvent(source, InstanceLifecycleEvent.DIRTY, target);
          for(int i=0; i < ls.length; i++)
            ((DirtyLifecycleListener) ls[i]).preDirty(ev);
            }
            break;
        case HomeItf.POST_DIRTY:
        if (ls != null) {
          ev = new InstanceLifecycleEvent(source, InstanceLifecycleEvent.DIRTY, target);
              for(int i=0; i < ls.length; i++)
                ((DirtyLifecycleListener) ls[i]).postDirty(ev);
            }
            break;

        case HomeItf.PRE_CREATE: //INSERT
        case HomeItf.PRE_UPDATE: //UPDATE
        case HomeItf.PRE_DELETE: //DELETE
        if (source instanceof StoreCallback) {
          ((StoreCallback) source).jdoPreStore();
        }
        if (ls != null) {
          ev = new InstanceLifecycleEvent(source, InstanceLifecycleEvent.STORE, target);
          for(int i=0; i < ls.length; i++)
            ((StoreLifecycleListener) ls[i]).preStore(ev);
            }
            break;
        case HomeItf.POST_CREATE:
        case HomeItf.POST_UPDATE:
        case HomeItf.POST_DELETE:
        if (ls != null) {
          ev = new InstanceLifecycleEvent(source, InstanceLifecycleEvent.STORE, target);
          for(int i=0; i < ls.length; i++)
            ((StoreLifecycleListener) ls[i]).postStore(ev);
            }
            break;

        case HomeItf.PRE_CLEAR:
        if (source instanceof ClearCallback) {
          ((ClearCallback) source).jdoPreClear();
        }
        if (ls != null) {
          ev = new InstanceLifecycleEvent(source, InstanceLifecycleEvent.CLEAR, target);
              for(int i=0; i < ls.length; i++)
                ((ClearLifecycleListener) ls[i]).preClear(ev);
            }
            break;
        case HomeItf.POST_CLEAR:
        if (ls != null) {
          ev = new InstanceLifecycleEvent(source, InstanceLifecycleEvent.CLEAR, target);
          for(int i=0; i < ls.length; i++)
            ((ClearLifecycleListener) ls[i]).postClear(ev);
            }
            break;
   
        case HomeItf.PRE_ATTACH:
        if (ls != null) {
              ev = new InstanceLifecycleEvent(source, InstanceLifecycleEvent.ATTACH, target);
              for(int i=0; i < ls.length; i++)
                ((AttachLifecycleListener) ls[i]).preAttach(ev);
            }
            break;
        case HomeItf.POST_ATTACH:
        if (ls != null) {
          ev = new InstanceLifecycleEvent(source, InstanceLifecycleEvent.ATTACH, target);
          for(int i=0; i < ls.length; i++)
            ((AttachLifecycleListener) ls[i]).postAttach(ev);
            }
            break;
        case HomeItf.PRE_DETACH:
        if (ls != null) {
          ev = new InstanceLifecycleEvent(source, InstanceLifecycleEvent.DETACH, target);
          for(int i=0; i < ls.length; i++)
            ((DetachLifecycleListener) ls[i]).preDetach(ev);
            }
            break;
        case HomeItf.POST_DETACH:
        if (ls != null) {
          ev = new InstanceLifecycleEvent(source, InstanceLifecycleEvent.DETACH, target);
              for(int i=0; i < ls.length; i++)
                ((DetachLifecycleListener) ls[i]).postDetach(ev);
            }
            break;
    }
View Full Code Here

            Collection oidsOfUpdateInstances = new HashSet();
           
            boolean hasDeleteEventBeenPassed = false;
            int size = events.size();
            for (int i = 0; i < size; i++) {
                InstanceLifecycleEvent event =
                    (InstanceLifecycleEvent) this.events.get(i);
                Object source = event.getSource();
                int eventType = event.getEventType();
                if (eventType == InstanceLifecycleEvent.DELETE) {
                    if (logger.isDebugEnabled()) {
                        logger.debug("Verifying delete event on " +
                                JDOHelper.getObjectId(source));
                    }
View Full Code Here

            Collection oidsOfUpdateInstances = new HashSet();
           
            boolean hasDeleteEventBeenPassed = false;
            int size = events.size();
            for (int i = 0; i < size; i++) {
                InstanceLifecycleEvent event =
                    (InstanceLifecycleEvent) this.events.get(i);
                Object source = event.getSource();
                int eventType = event.getEventType();
                if (eventType == InstanceLifecycleEvent.DELETE) {
                    if (logger.isDebugEnabled()) {
                        logger.debug("Verifying delete event on " +
                                JDOHelper.getObjectId(source));
                    }
View Full Code Here

        while (iter.hasNext())
        {
            LifecycleListenerForClass listener = (LifecycleListenerForClass) iter.next();
            if (listener.forClass(pc.getClass()) && listener.getListener() instanceof CreateLifecycleListener)
            {
                ((CreateLifecycleListener)listener.getListener()).postCreate(new InstanceLifecycleEvent(pc, InstanceLifecycleEvent.CREATE, null));
            }
        }
    }
View Full Code Here

        while (iter.hasNext())
        {
            LifecycleListenerForClass listener = (LifecycleListenerForClass) iter.next();
            if (listener.forClass(pc.getClass()) && listener.getListener() instanceof StoreLifecycleListener)
            {
                ((StoreLifecycleListener)listener.getListener()).postStore(new InstanceLifecycleEvent(pc, InstanceLifecycleEvent.STORE, null));
            }
        }
    }
View Full Code Here

        while (iter.hasNext())
        {
            LifecycleListenerForClass listener = (LifecycleListenerForClass) iter.next();
            if (listener.forClass(pc.getClass()) && listener.getListener() instanceof ClearLifecycleListener)
            {
                ((ClearLifecycleListener)listener.getListener()).preClear(new InstanceLifecycleEvent(pc, InstanceLifecycleEvent.CLEAR, null));
            }
        }

        if (pc instanceof ClearCallback)
        {
View Full Code Here

TOP

Related Classes of javax.jdo.listener.InstanceLifecycleEvent

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.