Path: csiph.com!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail From: Jan Burse Newsgroups: comp.lang.java.programmer Subject: Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Date: Tue, 13 Mar 2012 14:11:49 +0100 Organization: albasani.net Lines: 29 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.albasani.net Q2bTs9NecB37Y60sU/GCHYqrq6YTHSxlxqxkmRracQ5A16un/slxwyFIPaSZN+4I1Qn6qrFD3Z7p0xsJhhakdYH1IcSC/OsBgtK7RxkLaov4+U9QnxJhJc5X/44Io/zQ NNTP-Posting-Date: Tue, 13 Mar 2012 13:11:48 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="KXagPTuqCbhHgVxFWVUdjOLzR6DPML1iSa0mJsZ0vgyM1Bgc3iwIRHzK2AJUhJwQ1x9seydIGpT66ZaQMXqSSiflIa3zoMxnDKZHZ+LHGe3fTNZSDsvcz47ihtSldkpV"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20120216 Firefox/10.0.2 SeaMonkey/2.7.2 In-Reply-To: Cancel-Lock: sha1:HO+9A3QfP/bwiZjRBxIMCtkPv/o= Xref: csiph.com comp.lang.java.programmer:12951 Steven Simpson schrieb: > What class is this? Is it specified somewhere? Its a custom made wrapper for Signal & SignalHandler. In version 1 of the above class I used the package sun.misc.*. In version 2 of the above class I used reflection i.e. Proxy class etc.. It will noop when sun.misc.Signal is not present. See for example: http://stackoverflow.com/questions/2783595/dynamic-reflective-signalhandler-in-java It is not portable, since sun.misc.* is not official part of the JDK. But testing showed that the reflection stuff works fine for the cases when sun.misc.* is present. The reflection thing is also useful when the code by chance lands in an applet. Some verifier murne the use of sun.misc.* inside an applet, even if during the execution of the applet the package is not called. There is some post on the web where Oracle/Sun claims they never said they WILL remove sun.misc.*, they only said they MIGHT remove sun.misc.*. Best Regards