AWT System Event Queue

Hello all,
I'm interested in how the AWT system event queue works. I'm talking about the EventQueue we can all retrieve using Toolkit.getDefaultToolkit().getSystemEventQueue().
My main questions are:
1) What happens to events once they get on the queue?
2) How do the AWT Components get notified of the events?
3) How is the correct AWT Component to notify determined?
I've done a little bit of Googling but haven't found anything explaining how the event queue actually works.
In case you're wondering, I'd like to know all this because I'm in a position where I need to mimick the system event queue's behaviour without actually touching it.
Any links to further reading, suggestions or comments are most welcome.
Thanks in advance,
Sam

Hello Sam,
Your questions could be answered by the following documents:
http://java.sun.com/j2se/1.3/docs/guide/awt/designspec/events.html
http://download.java.net/jdk6/docs/api/java/awt/doc-files/AWTThreadIssues.html
http://java.sun.com/j2se/1.4.2/docs/api/java/awt/doc-files/FocusSpec.html
Cheers,
Sam

Similar Messages

  • Specifying Event Queue for EventQueue.invokeAndWait().

    Javadoc says EventQueue.invokeAndWait(Runnable runnable) / invokeLater are static methods causing the Runnable executed in the system event queue thread. But I found that my applet appli. running under IE has 3 event dispatching threads AWT-EventQueue-0, AWT-EventQueue-1 and AWT-EventQueue-2. The system event queue (the one returned by Toolkit.getSystemEventQueue() ) is inside AWT-EventQueue-0 but by testing my applet's event queue should be in AWT-EventQueue-2.
    My question is, is it possible to specify which event queue's thread to run the Runnable? Since I found that the 3 event dispatching threads are of different thread groups and only the AWT-EventQueue-2 is in the same thread group as my applet and I want my Runnable to be in the same thread group of my applet thread. The thread groups of the 3 dispatching threads are :
        Thread[] threads=new Thread[100];
        int threadsReturned=Thread.enumerate(threads);
        for (int i=0; i<threadsReturned ; i++) {
            System.out.println("thread name:" + threads);
    System.out.println("thread group class name:" + threads[i].getThreadGroup().getClass().getName()) ;
    System.out.println("thread group name:" + threads[i].getThreadGroup().getName());
    1.
    thread name:Thread[AWT-EventQueue-0,6,main]
    thread group class name:java.lang.ThreadGroup
    thread group name:main
    2.
    thread name:Thread[AWT-EventQueue-1,6,Plugin Thread Group]
    thread group class name:java.lang.ThreadGroup
    thread group name:Plugin Thread Group
    3.
    thread name:Thread[AWT-EventQueue-2,4,http://(my url)/-threadGroup]
    thread group class name:sun.plugin2.applet.Applet2ThreadGroup
    thread group name:http://(my url)/-threadGroup                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Please continue in [the thread where you first posted this problem|http://forums.sun.com/thread.jspa?threadID=5431496]. I'm locking this.
    db
    edit Thread unlocked on clarification from OP in the other thread.
    Edited by: DarrylBurke

  • Flushing the Event Queue

    I need to go through the System Event Queue (reached by calling Toolkit.getSystemEventQueue()) and run all the registered listeners for each of these events. I need to do this in the event dispatcher thread, so it will wait until all the events have been flushed, and then continue normal execution.
    I can't find a way to do this... Any suggestions?

    I am not sure how you would be able to do whay you described, however, you can ensure that code gets executed after all of the event currently in the queue by placing the code into the run method of a Runnable object and passing that object to the SwingUtilities.invokeLater(Runnable) method. This will queue an event and when the event is processed, the run method of the runnable will be executed. Maybe that will serve your purposes.
    E. West

  • How to "kill" AWT Event Queue thread without using System.exit()?

    When I run my program and the first GUI window is displayed a new thread is created - "AWT-Event Queue". When my program finishes, this thread stays alive and I think it causes some problems I have experienced lately.
    Is there any possibility to "kill" this thread without using System.exit() (I can't use it for some specific reasons)

    All threads are kept alive by the JVM session. When you use System.exit(int) you kill the current session, thus killing all threads. I'm not sure, though...
    What you could do, to make sure all threads die, is to make ever thread you start member of a thread group. When you want to exit you app, you kill all the threads in the thread group before exit.
    A small example:
    //Should be declared somewhere
    static ThreadGroup threadGroup = new ThreadGroup("My ThreadGroup");
    class MyClass extends Thread {
    super(threadGroup, "MyThread");
    Thread thread = new Thread(threadGroup, "MySecondThread");
    void exit() {
    //Deprecated, seek alternative
    threadGroup.stop();
    System.exit(0);
    }

  • What is the difference in the System Event triggers: Any queue limit set to zero and System queue reached its job limit

    My co-worker and I are not sure what the difference between Any queue limit set to zero and System queue reached its job limit are in the System Events.

    Hi jlayton,
    System queue limit is the sum of all queue limits you have defined. For example, if you have a system queue limit of, say, 100 -- queue A has 50 jobs active, and queue B also has 50 jobs active, then you will receive an alert System queue reached its job limit since it is set to 100.
    Any queue limit set to zero. Note, this may also include the System queue. For example, if you want to gracefully stop Tidal, you may want to set system queue = 0 so that there are no active jobs. When you do this, you will receive an alert queue limit set to zero.
    BR,
    Derrick Au

  • Can I queue a system event?

    I have an application where the event handling is processed in the RunUserInterface() loop.
    I would like to simulate pressing a sequence of command buttons and thus activate their callbacks, hence I would like to add a system event (EVENT_COMMIT on a given control) to the event queue to be handled in the event loop, (or just call their callback directly) - and then I need to add an event to the system queue to get back to my "simulation" subroutine (which I just implement as a call back as well).
    I can of course add user events, but if I understand correctly, these events are not handled in the RunUserInterface() loop?
    (How) can I add events to the system(?) event queue to be handled in the RunUserInterface() loop? Or do I need to set up my own event handling loop?

    Sure - I just tried it, and it works as expected.
    I created a MIDI region at about 3 1 1 1, selected it, opened up the event list, clicked on "Create" to enter the create events mode, and clicked on the "Meta Events" button to create a meta event inside that region (which by default, goes to the current position, which in my case is 3 1 1 1).
    Change the "Num" value of the event to 52 ("Stop Playback" is displayed in the Length/Info event column).
    Now, playing the song from 1 1 1 1 plays until it reaches 3 1 1 1 (where the stop event is) and Logic stops.
    You can of course move the region containing the stop event to wherever you need it.
    Simple as that - there isn't any more detail I can go into

  • MACOS 10.4: Solve AWT Event queue hangup

    Hi,
    I'm having trouble with the AWT eventqueu. On MacOS 10.4, using Java 5 Runtime, my applet sometimes blocks. When looking at the threadstack, the deadlock always appears in the Event Loop, dispatching an AWT event, blocking in the CGlobalCursorManager._updateCursor call. In fact the CGlobalCursorManager.findHeavyweightUnderCursor Native call.
    I already tried some workarounds:
    - overwrite the validate method of my custom AWT components. Making sure that they do not block forever. This solves the problem for events coming through the overidden component, but it has to work for every event that might trigger the GlobalCursorManager.
    I had some possible solutions for which I would like some pro's and con's in this forum:
    1. I could try to kill the event loop. Is it possible to quit the event loop and restart it from within the applet ?
    2. Can I force each AWT container to use another implementation of the validate method ?
    3. Can I set another, customized, CGlogalCursorManager ?
    4. Other possibilities ?
    Thanks in advance for all those responding.

    I think you mean that I can override the validate method for each custom UI object separately.
    That's a possibility, but I was looking for a more general solution. If possible, I would to extends one
    class. E.g. can I set another event queue ? That way, I could make a custom event queue in case of a Mac OS browser.

  • AWT-Event queue not responding

    Hi all! I have already posted a message with similar problem wich was solved but this now is a different one.
    I have following situation:
    I have a class that is called from somewhere (I don't know where from) and that displays a JFrame. After it calls setVisible(true) it calls function synchronized lock() which does wait(). After the JFrame is done it calls synchronized unlock() which does notifyAll().
    The purpose is that my JFrame should do some checking and then let the code that called it resume it's work normaly.
    Te problem is that this only works with JDK version 1.3. If I do it on 1.4 the frame doesn't respond to clicks and doesn't repaint. If I remove lock() and unlock() the frame works ok but the main program is not suspended.
    I suppose that the frame needs to make new threads for user clicks or repainting (I have noticed a Timer thread) but it can't do it for some reason.
    Any help?

    Yeah, as the doctor said to the patient who said "Doctor, it hurts when I do this" .. "So don't do that" ... don't do that. That is, it sounds as if your application is posting huge numbers of events? So if your application didn't post so many events, would the event queue not be filled up?
    - David

  • Seeing " Warning The event queue appears to be stuck."

    I'm seeing some strange things since I changed to v3.6.1. Could be due to other changes made at roughly the same time but I suspect it's the new jars. I was reading what Patrick wrote here:
    http://blackbeanbag.net/wp/2009/07/20/coherence-3-5-service-guardian-deadlock-detection/...and I'm wondering now if my app is just not keeping up with the flow of events...?
    Thanks,
    Andrew
    2010-12-15 14:34:08.609/26.953 Oracle Coherence GE 3.6.1.0 <Info> (thread=AWT-EventQueue-0, member=34): null
    2010-12-15 14:34:08.609/26.953 Oracle Coherence GE 3.6.1.0 <Info> (thread=AWT-EventQueue-0, member=34): null
    2010-12-15 14:34:08.609/26.953 Oracle Coherence GE 3.6.1.0 <Info> (thread=AWT-EventQueue-0, member=34): null
    2010-12-15 14:34:08.609/26.953 Oracle Coherence GE 3.6.1.0 <Info> (thread=AWT-EventQueue-0, member=34): null
    2010-12-15 14:34:08.984/27.328 Oracle Coherence GE 3.6.1.0 <Warning> (thread=AWT-EventQueue-0, member=34): The event queue appears to be stuck.
    2010-12-15 14:34:08.984/27.328 Oracle Coherence GE 3.6.1.0 <Error> (thread=AWT-EventQueue-0, member=34): Full Thread Dump
    Thread[testASocketToServerThread1,5,main]
         java.lang.Thread.sleep(Native Method)
         testAbook.binary.client.testASocketToServerBinary$1.run(testASocketToServerBinary.java:99)
         java.lang.Thread.run(Thread.java:619)
    Thread[IpMonitor,6,Cluster]
         java.net.Inet4AddressImpl.isReachable0(Native Method)
         java.net.Inet4AddressImpl.isReachable(Inet4AddressImpl.java:52)
         java.net.InetAddress.isReachable(InetAddress.java:419)
         java.net.InetAddress.isReachable(InetAddress.java:378)
         com.tangosol.coherence.component.util.daemon.IpMonitor.onNotify(IpMonitor.CDB:12)
         com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
         java.lang.Thread.run(Thread.java:619)
    Thread[threadtestIMsgBase,1,main]
         java.lang.Object.wait(Native Method)
         java.lang.Object.wait(Object.java:485)
         testIbook2.common.testIOrderRepository$1.run(testIOrderRepository.java:54)
         java.lang.Thread.run(Thread.java:619)
    Thread[AWT-EventQueue-0,6,main]
         java.lang.Thread.dumpThreads(Native Method)
         java.lang.Thread.getAllStackTraces(Thread.java:1487)
         com.tangosol.net.GuardSupport.logStackTraces(GuardSupport.java:810)
         com.tangosol.coherence.component.util.daemon.queueProcessor.Service$EventDispatcher.drainOverflow(Service.CDB:45)
         com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid$EventDispatcher.drainOverflow(Grid.CDB:9)
         com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.post(Grid.CDB:17)
         com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$BinaryMap.sendPartitionedRequest(PartitionedCache.CDB:64)
         com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$BinaryMap.getAll(PartitionedCache.CDB:12)
         com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$BinaryMap$EntryAdvancer.entrySetPage(PartitionedCache.CDB:31)
         com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$BinaryMap$EntryAdvancer.nextPage(PartitionedCache.CDB:18)
         com.tangosol.util.PagedIterator.hasNext(PagedIterator.java:71)
         com.tangosol.util.ConverterCollections$ConverterEntrySet$ConverterIterator.hasNext(ConverterCollections.java:3201)
         quoteclient.QuoteClient.addQuoteListener(QuoteClient.java:263)
         bbo.RediQuotes.<init>(RediQuotes.java:42)
         bbo.RediQuotes.getRediQuotes(RediQuotes.java:18)
         bbo.BBOTableRecord.getValue(BBOTableRecord.java:102)
         bbo.BBORecordsModel.getValueAt(BBORecordsModel.java:78)
         javax.swing.JTable.getValueAt(JTable.java:2685)
         javax.swing.JTable.prepareRenderer(JTable.java:5702)
         javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:2072)
         javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:1974)
         javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:1770)
         javax.swing.plaf.ComponentUI.update(ComponentUI.java:143)
         javax.swing.JComponent.paintComponent(JComponent.java:752)
         javax.swing.JComponent.paint(JComponent.java:1029)
         javax.swing.JComponent.paintChildren(JComponent.java:862)
         javax.swing.JComponent.paint(JComponent.java:1038)
         javax.swing.JViewport.paint(JViewport.java:747)
         javax.swing.JComponent.paintChildren(JComponent.java:862)
         javax.swing.JComponent.paint(JComponent.java:1038)
         javax.swing.JComponent.paintToOffscreen(JComponent.java:5124)
         javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:278)
         javax.swing.RepaintManager.paint(RepaintManager.java:1224)
         javax.swing.JComponent._paintImmediately(JComponent.java:5072)
         javax.swing.JComponent.paintImmediately(JComponent.java:4882)
         javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:785)
         javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:713)
         javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:693)
         javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:125)
         java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
         java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
         java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
         java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
         java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
         java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
         java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    Thread[Java2D Disposer,10,system]
         java.lang.Object.wait(Native Method)
         java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
         java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
         sun.java2d.Disposer.run(Disposer.java:125)
         java.lang.Thread.run(Thread.java:619)
    Thread[PacketListener1P,8,Cluster]
         java.net.PlainDatagramSocketImpl.receive0(Native Method)
         java.net.PlainDatagramSocketImpl.receive(PlainDatagramSocketImpl.java:136)
         java.net.DatagramSocket.receive(DatagramSocket.java:712)
         com.tangosol.coherence.component.net.socket.UdpSocket.receive(UdpSocket.CDB:22)
         com.tangosol.coherence.component.net.UdpPacket.receive(UdpPacket.CDB:1)
         com.tangosol.coherence.component.util.daemon.queueProcessor.packetProcessor.PacketListener.onNotify(PacketListener.CDB:20)
         com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
         java.lang.Thread.run(Thread.java:619)
    Thread[autoRetrieveBtNews,6,main]
         java.lang.Thread.sleep(Native Method)
         testAbook.report.testABookBtNews$1.run(testABookBtNews.java:53)
         java.lang.Thread.run(Thread.java:619)
    Thread[Signal Dispatcher,9,system]
    Thread[D3D Screen Updater,7,system]
         java.lang.Object.wait(Native Method)
         sun.java2d.d3d.D3DScreenUpdateManager.run(D3DScreenUpdateManager.java:421)
         java.lang.Thread.run(Thread.java:619)
    Thread[Invocation:Management,6,Cluster]
         java.lang.Object.wait(Native Method)
         com.tangosol.coherence.component.util.Daemon.onWait(Daemon.CDB:18)
         com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onWait(Grid.CDB:6)
         com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:39)
         java.lang.Thread.run(Thread.java:619)
    Thread[AWT-Windows,6,main]
         sun.awt.windows.WToolkit.eventLoop(Native Method)
         sun.awt.windows.WToolkit.run(WToolkit.java:295)
         java.lang.Thread.run(Thread.java:619)
    Thread[DistributedCache:DistributedStatsCacheService,6,Cluster]
         java.lang.Object.wait(Native Method)
         com.tangosol.coherence.component.util.Daemon.onWait(Daemon.CDB:18)
         com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onWait(Grid.CDB:6)
         com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:39)
         java.lang.Thread.run(Thread.java:619)
    Thread[testASocketToServerThread2,5,main]
         java.net.SocketInputStream.socketRead0(Native Method)
         java.net.SocketInputStream.read(SocketInputStream.java:129)
         sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264)
         sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306)
         sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)
         java.io.InputStreamReader.read(InputStreamReader.java:167)
         java.io.BufferedReader.fill(BufferedReader.java:136)
         java.io.BufferedReader.read1(BufferedReader.java:187)
         java.io.BufferedReader.read(BufferedReader.java:261)
         testAbook.binary.client.testASocketToServerBinary$2.run(testASocketToServerBinary.java:167)
         java.lang.Thread.run(Thread.java:619)
    Thread[PacketReceiver,7,Cluster]
         java.lang.Object.wait(Native Method)
         com.tangosol.coherence.component.util.Daemon.onWait(Daemon.CDB:18)
         com.tangosol.coherence.component.util.daemon.queueProcessor.packetProcessor.PacketReceiver.onWait(PacketReceiver.CDB:2)
         com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:39)
         java.lang.Thread.run(Thread.java:619)
    Thread[PacketPublisher,6,Cluster]
         java.lang.Object.wait(Native Method)
         com.tangosol.coherence.component.util.Daemon.onWait(Daemon.CDB:18)
         com.tangosol.coherence.component.util.daemon.queueProcessor.packetProcessor.PacketPublisher.onWait(PacketPublisher.CDB:2)
         com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:39)
         java.lang.Thread.run(Thread.java:619)
    Thread[Logger@9254847 3.6.1.0,3,main]
         java.lang.Integer.toString(Integer.java:308)
         java.sql.Timestamp.toString(Timestamp.java:301)
         com.tangosol.coherence.component.util.daemon.queueProcessor.Logger.formatParameter(Logger.CDB:13)
         com.tangosol.coherence.component.application.console.Coherence$Logger.formatParameter(Coherence.CDB:40)
         com.tangosol.coherence.component.util.daemon.queueProcessor.Logger.formatMessage(Logger.CDB:23)
         com.tangosol.coherence.component.util.daemon.queueProcessor.Logger.onNotify(Logger.CDB:57)
         com.tangosol.coherence.component.application.console.Coherence$Logger.onNotify(Coherence.CDB:4)
         com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
         java.lang.Thread.run(Thread.java:619)
    Thread[DistributedCache:DistributedQuotesCacheService,6,Cluster]
         java.lang.Object.wait(Native Method)
         com.tangosol.coherence.component.util.Daemon.onWait(Daemon.CDB:18)
         com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onWait(Grid.CDB:6)
         com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:39)
         java.lang.Thread.run(Thread.java:619)
    Thread[EventQueue:ContinuousQueryCache{Cache=stats._1_DAY_PERCENT_CHANGED, Filter=AlwaysFilter},5,EventQueue:ContinuousQueryCache{Cache=stats._1_DAY_PERCENT_CHANGED, Filter=AlwaysFilter}]
         java.lang.Object.wait(Native Method)
         java.lang.Object.wait(Object.java:485)
         com.tangosol.util.TaskDaemon.takeNextRipeTask(TaskDaemon.java:345)
         com.tangosol.util.TaskDaemon.run(TaskDaemon.java:103)
         com.tangosol.util.Daemon$DaemonWorker.run(Daemon.java:781)
         java.lang.Thread.run(Thread.java:619)
    Thread[PacketListenerN,8,Cluster]
         java.net.PlainDatagramSocketImpl.receive0(Native Method)
         java.net.PlainDatagramSocketImpl.receive(PlainDatagramSocketImpl.java:136)
         java.net.DatagramSocket.receive(DatagramSocket.java:712)
         com.tangosol.coherence.component.net.socket.UdpSocket.receive(UdpSocket.CDB:22)
         com.tangosol.coherence.component.net.UdpPacket.receive(UdpPacket.CDB:1)
         com.tangosol.coherence.component.util.daemon.queueProcessor.packetProcessor.PacketListener.onNotify(PacketListener.CDB:20)
         com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
         java.lang.Thread.run(Thread.java:619)
    Thread[Cluster|Member(Id=34, Timestamp=2010-12-15 14:34:28.185, Address=192.168.3.26:8088, MachineId=27418, Location=machine:dab1,process:4020,member:s1, Role=BboBBOClientMain),6,Cluster]
         sun.nio.ch.WindowsSelectorImpl$SubSelector.poll0(Native Method)
         sun.nio.ch.WindowsSelectorImpl$SubSelector.poll(WindowsSelectorImpl.java:273)
         sun.nio.ch.WindowsSelectorImpl$SubSelector.access$400(WindowsSelectorImpl.java:255)
         sun.nio.ch.WindowsSelectorImpl.doSelect(WindowsSelectorImpl.java:136)
         sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:69)
         sun.nio.ch.SelectorImpl.select(SelectorImpl.java:80)
         com.tangosol.coherence.component.net.TcpRing.select(TcpRing.CDB:11)
         com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.ClusterService.onWait(ClusterService.CDB:6)
         com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:39)
         java.lang.Thread.run(Thread.java:619)
    Thread[threadAutoRefreshBBO,5,main]
         java.lang.Thread.sleep(Native Method)
         bbo.BBORecordsModel$1.run(BBORecordsModel.java:152)
         java.lang.Thread.run(Thread.java:619)
    Thread[PacketListener1,8,Cluster]
         java.net.PlainDatagramSocketImpl.receive0(Native Method)
         java.net.PlainDatagramSocketImpl.receive(PlainDatagramSocketImpl.java:136)
         java.net.DatagramSocket.receive(DatagramSocket.java:712)
         com.tangosol.coherence.component.net.socket.UdpSocket.receive(UdpSocket.CDB:22)
         com.tangosol.coherence.component.net.UdpPacket.receive(UdpPacket.CDB:1)
         com.tangosol.coherence.component.util.daemon.queueProcessor.packetProcessor.PacketListener.onNotify(PacketListener.CDB:20)
         com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
         java.lang.Thread.run(Thread.java:619)
    Thread[testAOrderRepositoryBinaryThread,5,main]
         java.lang.Object.wait(Native Method)
         java.lang.Object.wait(Object.java:485)
         testAbook.binary.common.testAOrderRepositoryBinary$1.run(testAOrderRepositoryBinary.java:47)
         java.lang.Thread.run(Thread.java:619)
    Thread[Reference Handler,10,system]
         java.lang.Object.wait(Native Method)
         java.lang.Object.wait(Object.java:485)
         java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
    Thread[Thread-16,5,main]
         java.lang.Thread.sleep(Native Method)
         bbo.udp.BBOUDPRecords.refreshBBOUDP(BBOUDPRecords.java:299)
         bbo.udp.BBOUDPRecordsModel.refreshBBOUDP(BBOUDPRecordsModel.java:90)
         bbo.udp.BBOUDPRecordsModel$1.run(BBOUDPRecordsModel.java:107)
         java.lang.Thread.run(Thread.java:619)
    Thread[testASocketToServerThread3,5,main]
         java.net.SocketOutputStream.socketWrite0(Native Method)
         java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
         java.net.SocketOutputStream.write(SocketOutputStream.java:136)
         sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:202)
         sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:272)
         sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:276)
         sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:122)
         java.io.OutputStreamWriter.flush(OutputStreamWriter.java:212)
         java.io.BufferedWriter.flush(BufferedWriter.java:236)
         testAbook.binary.client.testASocketToServerBinary$3.run(testASocketToServerBinary.java:248)
         java.lang.Thread.run(Thread.java:619)
    Thread[Attach Listener,5,system]
    Thread[DistributedCache:DistributedQuotesCacheService:EventDispatcher,6,Cluster]
         quoteclient.QuoteClient.p(QuoteClient.java:48)
         quoteclient.QuoteClient.entryUpdated(QuoteClient.java:95)
         com.tangosol.util.MapEvent.dispatch(MapEvent.java:270)
         com.tangosol.util.MapEvent.dispatch(MapEvent.java:226)
         com.tangosol.util.MapListenerSupport.fireEvent(MapListenerSupport.java:556)
         com.tangosol.coherence.component.util.SafeNamedCache.translateMapEvent(SafeNamedCache.CDB:7)
         com.tangosol.coherence.component.util.SafeNamedCache.entryUpdated(SafeNamedCache.CDB:1)
         com.tangosol.util.MapEvent.dispatch(MapEvent.java:270)
         com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$ViewMap$ProxyListener.dispatch(PartitionedCache.CDB:22)
         com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$ViewMap$ProxyListener.entryUpdated(PartitionedCache.CDB:1)
         com.tangosol.util.MapEvent.dispatch(MapEvent.java:270)
         com.tangosol.coherence.component.util.CacheEvent.run(CacheEvent.CDB:18)
         com.tangosol.coherence.component.util.daemon.queueProcessor.Service$EventDispatcher.onNotify(Service.CDB:26)
         com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
         java.lang.Thread.run(Thread.java:619)
    Thread[DistributedCache:DistributedStatsCacheService:EventDispatcher,6,Cluster]
         java.lang.Object.wait(Native Method)
         com.tangosol.coherence.component.util.Daemon.onWait(Daemon.CDB:18)
         com.tangosol.coherence.component.util.daemon.queueProcessor.Service$EventDispatcher.onWait(Service.CDB:7)
         com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:39)
         java.lang.Thread.run(Thread.java:619)
    Thread[AWT-Shutdown,5,main]
         java.lang.Object.wait(Native Method)
         java.lang.Object.wait(Object.java:485)
         sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:265)
         java.lang.Thread.run(Thread.java:619)
    Thread[EventQueue:ContinuousQueryCache{Cache=stats.OPEN_PRICE, Filter=AlwaysFilter},5,EventQueue:ContinuousQueryCache{Cache=stats.OPEN_PRICE, Filter=AlwaysFilter}]
         java.lang.Object.wait(Native Method)
         java.lang.Object.wait(Object.java:485)
         com.tangosol.util.TaskDaemon.takeNextRipeTask(TaskDaemon.java:345)
         com.tangosol.util.TaskDaemon.run(TaskDaemon.java:103)
         com.tangosol.util.Daemon$DaemonWorker.run(Daemon.java:781)
         java.lang.Thread.run(Thread.java:619)
    Thread[readerThread,6,main]
         java.lang.Object.wait(Native Method)
         java.util.TimerThread.mainLoop(Timer.java:509)
         java.util.TimerThread.run(Timer.java:462)
    Thread[Thread-11,5,main]
         java.lang.Thread.sleep(Native Method)
         testIbook2.client.testIBBOSocketToServer$1.run(testIBBOSocketToServer.java:82)
         java.lang.Thread.run(Thread.java:619)
    Thread[threadReceive,5,main]
         java.net.SocketInputStream.socketRead0(Native Method)
         java.net.SocketInputStream.read(SocketInputStream.java:129)
         sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264)
         sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306)
         sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)
         java.io.InputStreamReader.read(InputStreamReader.java:167)
         java.io.BufferedReader.fill(BufferedReader.java:136)
         java.io.BufferedReader.readLine(BufferedReader.java:299)
         java.io.BufferedReader.readLine(BufferedReader.java:362)
         testIbook2.client.testIBBOSocketToServer$2.run(testIBBOSocketToServer.java:171)
         java.lang.Thread.run(Thread.java:619)
    Thread[main,5,main]
         java.awt.Component.resize(Component.java:2045)
         java.awt.Component.setSize(Component.java:2035)
         java.awt.Window.setSize(Window.java:791)
         strategies.layout.LayoutViewer.openLayout(LayoutViewer.java:319)
         bbo.BBOClientMain.main(BBOClientMain.java:74)
    Thread[TimerQueue,5,system]
         java.lang.Object.wait(Native Method)
         javax.swing.TimerQueue.run(TimerQueue.java:232)
         java.lang.Thread.run(Thread.java:619)
    Thread[PacketSpeaker,8,Cluster]
         java.lang.Object.wait(Native Method)
         com.tangosol.coherence.component.util.queue.ConcurrentQueue.waitForEntry(ConcurrentQueue.CDB:16)
         com.tangosol.coherence.component.util.queue.ConcurrentQueue.remove(ConcurrentQueue.CDB:7)
         com.tangosol.coherence.component.util.Queue.remove(Queue.CDB:1)
         com.tangosol.coherence.component.util.daemon.queueProcessor.packetProcessor.PacketSpeaker.onNotify(PacketSpeaker.CDB:21)
         com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
         java.lang.Thread.run(Thread.java:619)
    Thread[Invocation:Management:EventDispatcher,6,Cluster]
         java.lang.Object.wait(Native Method)
         com.tangosol.coherence.component.util.Daemon.onWait(Daemon.CDB:18)
         com.tangosol.coherence.component.util.daemon.queueProcessor.Service$EventDispatcher.onWait(Service.CDB:7)
         com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:39)
         java.lang.Thread.run(Thread.java:619)
    Thread[Finalizer,8,system]
         java.lang.Object.wait(Native Method)
         java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
         java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
         java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)
    2010-12-15 14:34:09.000/27.344 Oracle Coherence GE 3.6.1.0 <Info> (thread=AWT-EventQueue-0, member=34): null
    2010-12-15 14:34:09.015/27.359 Oracle Coherence GE 3.6.1.0 <Info> (thread=AWT-EventQueue-0, member=34): null
    2010-12-15 14:34:09.015/27.359 Oracle Coherence GE 3.6.1.0 <Info> (thread=AWT-EventQueue-0, member=34): null
    2010-12-15 14:34:09.015/27.359 Oracle Coherence GE 3.6.1.0 <Info> (thread=AWT-EventQueue-0, member=34): null
    2010-12-15 14:34:09.031/27.375 Oracle Coherence GE 3.6.1.0 <Info> (thread=AWT-EventQueue-0, member=34): null
    2010-12-15 14:34:09.046/27.390 Oracle Coherence GE 3.6.1.0 <Info> (thread=AWT-EventQueue-0, member=34): null
    2010-12-15 14:34:09.046/27.390 Oracle Coherence GE 3.6.1.0 <Info> (thread=AWT-EventQueue-0, member=34): null
    2010-12-15 14:34:12.203/30.547 Oracle Coherence GE 3.6.1.0 <Info> (thread=AWT-EventQueue-0, member=34): null
    2010-12-15 14:34:12.218/30.562 Oracle Coherence GE 3.6.1.0 <Info> (thread=AWT-EventQueue-0, member=34): null
    2010-12-15 14:34:12.218/30.562 Oracle Coherence GE 3.6.1.0 <Info> (thread=AWT-EventQueue-0, member=34): null
    2010-12-15 14:34:12.218/30.562 Oracle Coherence GE 3.6.1.0 <Info> (thread=AWT-EventQueue-0, member=34): null
    2010-12-15 14:34:12.218/30.562 Oracle Coherence GE 3.6.1.0 <Info> (thread=AWT-EventQueue-0, member=34): null
    2010-12-15 14:34:12.296/30.640 Oracle Coherence GE 3.6.1.0 <Info> (thread=DistributedCache:DistributedQuotesCacheService:EventDispatcher, member=34): null
    2010-12-15 14:34:12.296/30.640 Oracle Coherence GE 3.6.1.0 <Info> (thread=DistributedCache:DistributedQuotesCacheService:EventDispatcher, member=34): null
    2010-12-15 14:34:12.296/30.640 Oracle Coherence GE 3.6.1.0 <Info> (thread=DistributedCache:DistributedQuotesCacheService:EventDispatcher, member=34): null
    2010-12-15 14:34:12.312/30.656 Oracle Coherence GE 3.6.1.0 <Info> (thread=DistributedCache:DistributedQuotesCacheService:EventDispatcher, member=34): null

    Hi Tarun
    Please see the discussion in this thread GuardSupport logging thread dumps without giving a reason
    Paul

  • Swing event queue, modal dialogs, event threads, etc...

    Hey all,
    So I am playing around with the focus manager, swing event thread and event queue, etc. Learned quite a bit. I am also playing around with test automation of our UI, using jfcUnit. I have written a few simple apps to play aorund with record/playback, coding tests, etc. What this thread is about though, is figuring out how modal and non-modal dialogs "take over" the event thread/queue? The reason I ask is, if I put a simple test harness like tool embeded in my app as a separate pop-up modal dialog, and from within it there is a GUI that I can use to select a "Test" to run. Now, when I run this test, jfcUnit needs to run on the main window, not within my non-modal dialog. What I am not sure of, however, is that if by using a non-modal dialog all events will go to the main event thread? I mean, I know if I mouse over my second non-modal frame (spawned from the application frame), that events will trigger for that dialog. I remember reading somewhere that modal dialogs "block" the main event queue, all left over events are given to the newly added event queue (presumably by the modal dialog) and existing left-over events get moved to the event queue. If that is the case, I am curious why events for the "old" queue are moved to the new queue if they were orginally intended for the old queue? I would think a "flush" before adding a new queue would be more appropriate so that the old queue can process all of its intended events.
    Now, I am just about to try this, but I am hoping a non-modal pop-up will not interfere with the jfcUnit running the UI of the main window. I am guessing, however, that it might. How are non-modal dialogs handled in terms of events and the event queue? Is it the same as modal dialogs? Or is there no blockage of the mainwindow event queue? If there is no blockage, than any sort of automation based on relative positions to a window may occur on the non-modal dialog, in which case it's best to hide the non-modal dialog during running of these tests.
    What are your thoughts, or better yet, knowledge of this topic? A decent explanation from a developer standpoint and not from the API's which dont give some of the more detailed info I am seeking is what I am hoping to get out of this.
    Thanks.

    Check this out. First, AWTListener has a LOT of
    different types you can register it for. I ORd all
    them together and when I ran my app, it took almost 30
    minutes for it to show up because of the huge stream
    of events being spit out via System.out. ...Yes, that doesn't surprise me in the least. There's hundreds of events that are fired around, usually unbeknownst to the user for every little thing. Lots of component and container events, in particular.
    Just make sure you OR ( using | not || ) ALL the
    "mask" values you want to watch for. That may be why
    you aren't seeing anything. When I did all that, and
    opened a menu, a ton of events came out.Maybe, I'll try that again, but I did specifically add an ActionEvent mask to get action events, and that should be all I need to get action events on buttons or menu items, and it wasn't getting them for either. It was only getting events on buttons when I used SwingEventMonitor, but not menu items.
    So I don't quite understand enough of the underlying event handling. Although, I suspect it could have something to do with the fact that these are Swing components, not AWT components (which their native peers) and it's pretty clear from AbstractButton (or was it DefaultButtonModel) how ActionEvents are fired, and they don't seem to have any connection to the code that deals with AWTListeners.
    My problem is that I kinda need a way to catch events without having a listener attached directly. Normally, I would have a listener, but there's this situation whereby an action may be triggered before I can get hold of the component to attach my listener to it. Perhaps I can get mouse press/release and just deal with it that way.
    Let me know if you did that and still didn't see what
    you were looking for. After playing with this, I am
    guessing the main reason for AWTListener is to
    register a listener for a specific type of event,
    instead of listening to them all, hence avoiding lots
    of extra overhead. Then again, the main event
    dispatcher must do a decent amount of work to fire off
    events to listeners of specific awt event types.Yes, it's definitely that. There's no point in sending events if no one is listening for it, so it does save some time.
    You are right, popup menus I think are dialogs, I
    don't know for sure, but you can access them via the
    JMenu.getPopupMenu() and JMenu.isPopupShowin().
    However, I am still not getting my test stuff working
    quite right.
    Yes, for menu popups. For a JPopupMenu on a right-click on any component (tree or whatever), I had a need to know about that from any arbitrary application (it's this GU testing app I'm working on), and since the popup menu doesn't belong to any component before it's shown, I couldn't necessarily know about it til it was displayed. I managed to use a combination of HierarchyEvents (using an AWTEventListener) and "component added" ContainerEvents. Not a simple matter, but it seems to work well.

  • Additional event queue appearing after RMI callback

    Hi,
    I am working on a client-server applicaion in which the client passes the server a callback object so it can be notified if shared data is changed so it can refresh.
    After receiving the notification from server the processing is moved to a Runnable executed on the dispatch tread with SwingUtilities.invokeLater(Runnable).
    But a case arose in which there there seems to appear an additional event queue.
    The original event queue (Thread name is AWT-EventQueue-2) is busy. Then in a thread named "RMI TCP Connection(3)-192.168.1.4" a notification comes but it is dispatched on a thread named "AWT-EventQueue-0". But I want the notification processing happen after AWT-EventQueue-2 has finished its current task.
    How can I avoid the additonal queue creation and what wrong am I doing so it is created(Swing is single-threaded as I have read everywhere)?
    Thanks
    Mike

    I found a way to solve this but I am not sure it is good.
    I save reference to the event queue the application uses on startup and instead of
    SwingUtilities.invokeLater(changeRunnable)
    use
    systemQueue.postEvent(new java.awt.event.InvocationEvent(Toolkit.getDefaultToolkit(), changeRunnable));
    Currently that works fine and change events are dispatched synchronously to the other things happening. But I wonder if there is a chance that the system queue is substituted in runtime by another queue and my reference will become invalid.
    Mike

  • AWT + Positon On Queue

    Greetings,
    I would like to share this script modified by me. My need was create a script where is displayed the position on queue and the average time waiting (AWT) if the person stay on queue. I found the AWT in a old post here (shared by another collaborator) in CSC and I added the position on queue.
    It work fine. please if you have a suggestion to improve, let me know.
    Some terms are in portuguese, but is easy to interpret.
    Regards.

    Hello Sam,
    Your questions could be answered by the following documents:
    http://java.sun.com/j2se/1.3/docs/guide/awt/designspec/events.html
    http://download.java.net/jdk6/docs/api/java/awt/doc-files/AWTThreadIssues.html
    http://java.sun.com/j2se/1.4.2/docs/api/java/awt/doc-files/FocusSpec.html
    Cheers,
    Sam

  • Triggering events from event queue

    Can anyone tell me if events triggered FROM the event queue execute immediatly before returning to the place where the trigger occured (as it seems to when I follow the code in the debugger).
    for example in my code I am:
    1) capturing a tab change event so I'm on the AWT event queue.
    2) calling stopcellediting() on a table which eventually triggers a losefocus event on a control within the table.
    3) the program flow seems to go straight to the focuslost event before returning to process the rest of tab change event.
    is this behaviour reliable? or is it just a timing coincidence?
    thanks in advance.

    This behaviour is reliable.
    All the code that executes these events is performed in the same thread, so it has no means to do something in parallel.
    SwingUtilities.invokeLater method does provide an ability to postpone execution of some code but inside Swing package it is used mainly for paint related tasks (for example the painting of the focus change will most likely occur only after the rest of tab change event processing will be executed).

  • Integration Event Queue Fields

    Getting starting on an integration project between Siebel OnPremise 8.1 HOR and OnDemand and I am seeing some conflicting information in the documentation versus what really happens with fields of data in the Event Queue.
    I cannot remember exactly where but I came across documentation indicating that not all "tracked fields" may appear in a given integration queue event. It seemed to indicate that only the user key data and system fields like operation, created, created by etc would be recorded in the queue.
    However in testing I have found that all my tracked fields are appearing in the queue except for custom fields and custom fields do appear when that field changes. I done only very limited testing but wanted to get others input on how this works.
    If all the data I need will be in the queue then I can just map that data to my OnPremise data and apply the update.
    If I should only expect a small subset of data then I'll have to use the event queue data to query the full record and then apply an update from the query result.
    Thoughts?

    Two things need to happen for a Workflow to trigger the creation of an Integration Event:
    1) The Workflow condition (if a condition exists) needs to evaluate to true.
    2) One of the "tracked" fields need to be udpated.
    An Event may be missed when the Workflow condtion is true but no tracked field is updated. When you configure Integration Event fields to be tracked, what you are doing is telling the system to create an Event record if one of the tracked fields has been modified. A common misconception is that the tracking fields are the fields that will be returned in the Event record, this is not the case, only a few unconfigurable audit fields are returned in an Event record.

  • Does a CQC really need a separate thread/event queue per instance?

    Does a ContinousQueryCache really need a separate thread/event queue per instance?
    Is it possible to get multiple cqc's to share a single event queue?

    Test case to reproduce shown below, i.e. new thread per CQC.
    Sample code:
    =====================================
    NamedCache dummyCache = CacheFactory.getCache("A");
    dummyCache.put("hello", "B");
    dummyCache.put("world", "C");
    ContinuousQueryCache cqcA = new ContinuousQueryCache(dummyCache, new EqualsFilter("toString", "B"), new MultiplexingMapListener() {
    @Override
    protected void onMapEvent(MapEvent mapEvent) {
    System.out.println(Thread.currentThread().getName());
    ContinuousQueryCache cqcB = new ContinuousQueryCache(dummyCache, new EqualsFilter("toString", "C"), new MultiplexingMapListener() {
    @Override
    protected void onMapEvent(MapEvent mapEvent) {
    System.out.println(Thread.currentThread().getName());
    =================================
    Output:
    EventQueue:ContinuousQueryCache{Cache=A, Filter=EqualsFilter(.toString(), B)}
    EventQueue:ContinuousQueryCache{Cache=A, Filter=EqualsFilter(.toString(), C)}
    =================================
    Thread dump:
    Full thread dump Java HotSpot(TM) Client VM (11.2-b01 mixed mode, sharing):
    "EventQueue:ContinuousQueryCache{Cache=A, Filter=EqualsFilter(.toString(), C)}" daemon prio=6 tid=0x034d8800 nid=0x16b4 in Object.wait() [0x03b2f000..0x03b2fa94]
    java.lang.Thread.State: WAITING (on object monitor)
         at java.lang.Object.wait(Native Method)
         - waiting on <0x22d80068> (a com.tangosol.util.TaskDaemon)
         at java.lang.Object.wait(Object.java:485)
         at com.tangosol.util.TaskDaemon.takeNextRipeTask(TaskDaemon.java:345)
         - locked <0x22d80068> (a com.tangosol.util.TaskDaemon)
         at com.tangosol.util.TaskDaemon.run(TaskDaemon.java:103)
         at com.tangosol.util.Daemon$DaemonWorker.run(Daemon.java:714)
         at java.lang.Thread.run(Thread.java:619)
    "EventQueue:ContinuousQueryCache{Cache=A, Filter=EqualsFilter(.toString(), B)}" daemon prio=6 tid=0x034d7400 nid=0x1370 in Object.wait() [0x03adf000..0x03adfb14]
    java.lang.Thread.State: WAITING (on object monitor)
         at java.lang.Object.wait(Native Method)
         - waiting on <0x22d80138> (a com.tangosol.util.TaskDaemon)
         at java.lang.Object.wait(Object.java:485)
         at com.tangosol.util.TaskDaemon.takeNextRipeTask(TaskDaemon.java:345)
         - locked <0x22d80138> (a com.tangosol.util.TaskDaemon)
         at com.tangosol.util.TaskDaemon.run(TaskDaemon.java:103)
         at com.tangosol.util.Daemon$DaemonWorker.run(Daemon.java:714)
         at java.lang.Thread.run(Thread.java:619)

Maybe you are looking for

  • How do I export bookmarks in 3.6.6. Exporting via the Boomarks menu does NOT work.

    <blockquote>Locked by Moderator as a duplicate/re-post. Please continue the discussion in this thread: [tiki-view_forum_thread.php?comments_parentId=710076&forumId=1] Thanks - c</blockquote> == Issue == I have another kind of problem with Firefox ==

  • Connecter mon MAC et la TV

    bonjour j'ai une vielle tele SONY WEGA en un MAC avec la version 10.9.3 Depuis l'instalation de la fibre SFR il y a plus d'un an, impossible de connecter la télé et le mac SFR n'a pas de solution pour le problème. Peut-être quelqu'un peut m'aider? JM

  • Palm desktop to ical to iphone

    call me clueless, but i cannot figure out how to export my calendar (or my contacts) to an apple application that can then up synched with the iPhone. when i choose export in palm, neither iCal nor address book show up as an option.

  • ICal 3.0.1 + Palm TX + 10.5.1 won't sync at all.  Ideas?

    HotSync 3.2.1 Palm TX 10.5.1 iCal 3.0.1 Initiated from HotSync. Of course, initiating from iSync has never worked. First sync went fine. Second and all subsequent syncs failed. Here's the log. HotSync 3.2.1 started 11/15/07 6:00:49 PM Local Synchroni

  • How to restore lost emails from iCloud on iPhone 5

    how do you restore lost emails  icloud iphone 5