Package org.itsnat.core.event

Examples of org.itsnat.core.event.ItsNatTimerHandle.cancel()


                                ItsNatTimerEvent timerEvt = (ItsNatTimerEvent)evt;
                                ItsNatTimerHandle handle = timerEvt.getItsNatTimerHandle();
                                long firstTime = handle.getFirstTime();
                                if ((new Date().getTime() - firstTime) > 30*60*1000) // 30 minutes
                                {
                                    handle.cancel();
                                    clientOwner.addCodeToSend("The timer for updating the client has finished");
                                }
                            }
                        };
                        ItsNatTimer timer = clientOwner.createItsNatTimer();
View Full Code Here


    {
         ItsNatTimerEvent timerEvt = (ItsNatTimerEvent)evt;
         ItsNatTimerHandle handle = timerEvt.getItsNatTimerHandle();
         long lastNonTimerEvent = parent.getLastNonTimerEvent();
         if ((new Date().getTime() - lastNonTimerEvent) > 2*60*1000) // to avoid never ending pages
             handle.cancel();
    }
}
View Full Code Here

                ItsNatTimerEvent timerEvt = (ItsNatTimerEvent)evt;
                ItsNatTimerHandle handle = timerEvt.getItsNatTimerHandle();
                long firstTime = handle.getFirstTime();
                if ((new Date().getTime() - firstTime) > 10000) // to avoid never ending ticks
                {
                    handle.cancel();
                    log("Scheduled task canceled, id: " + handle.hashCode());
                }
                else log("Tick, id: " + handle.hashCode() + " next execution: " + new Date(handle.scheduledExecutionTime()));
            }
        };
View Full Code Here

                ItsNatTimerEvent timerEvt = (ItsNatTimerEvent)evt;
                ItsNatTimerHandle handle = timerEvt.getItsNatTimerHandle();
                long firstTime = handle.getFirstTime();
                if ((new Date().getTime() - firstTime) > 10000) // to avoid never ending ticks
                {
                    handle.cancel();
                    System.out.println("Timer canceled");
                }
                else System.out.println("Tick, next execution: " + new Date(handle.scheduledExecutionTime()));
            }
        };
View Full Code Here

                finally
                {
                    ItsNatDocument itsNatDoc = getItsNatDocument();
                    synchronized(itsNatDoc)
                    {
                        timerHnd.cancel();
                    }
                }
            }
        };
        iframeUpload.addItsNatServletRequestListener(listener);
View Full Code Here

        else if (currentTarget == removeTimerElem)
        {
            ItsNatTimerHandle timerHandle = getFirstTimerHandle();
            if (timerHandle != null)
            {
                boolean res = timerHandle.cancel();
                if (res)
                    outText("OK timer canceled "); // Para que se vea
                removeFirstTimerHandle();
            }
        }
View Full Code Here

            ItsNatTimerEvent timerEvt = (ItsNatTimerEvent)evt;
            ItsNatTimerHandle handle = timerEvt.getItsNatTimerHandle();
            long firstTime = handle.getFirstTime();
            if ((new Date().getTime() - firstTime) > 10000) // to avoid never ending ticks
            {
                handle.cancel();
                outText("Timer canceled (timeout)");
            }
            else
            {
                long delay = System.currentTimeMillis() - timerEvt.getItsNatTimerHandle().scheduledExecutionTime();
View Full Code Here

                }
                finally
                {
                    synchronized(itsNatDoc)
                    {
                        timerHnd.cancel();
                    }
                }
            }
        };
        iframeUpload.addItsNatServletRequestListener(listener);
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.