Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #11000

Re: Java listener

From "John B. Matthews" <nospam@nospam.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Java listener
Date 2011-12-26 10:58 -0500
Organization The Wasteland
Message-ID <nospam-BE0DF7.10580026122011@news.aioe.org> (permalink)
References <9a7gf750th7582hnjvfv9n0iko35omb57o@4ax.com>

Show all headers | View raw


In article <9a7gf750th7582hnjvfv9n0iko35omb57o@4ax.com>,
 Jim Lee <jimlee2907@yahoo.com> wrote:

> I have a java interface "ConnectionListener" ...
> 
> And a method "httpPost" which pass a "ConnectionListener" as 
> parameter
> 
> How do I implement the ConnectionListener interface and how do I pass 
> it into "httpPost" method to get invoked when "listener event" get 
> response from the httpPost?

The approach outlined in the EventListenerList [1] API may be suitable. 
It's used throughout Swing and related libraries such as JFreeChart. 
The scheme is a fairly general example of using a class literal as a 
run time type token [2].

Also consider an existing Java HTTP connection library [3].

[1] <http://docs.oracle.com/javase/7/docs/api/javax/swing/event/EventListenerList.html>
[2] <http://docs.oracle.com/javase/tutorial/extra/generics/literals.html>
[3] <http://www.google.com/search?q=java+http+connection+library>

-- 
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Java listener Jim Lee <jimlee2907@yahoo.com> - 2011-12-25 23:12 -0800
  Re: Java listener "John B. Matthews" <nospam@nospam.invalid> - 2011-12-26 10:58 -0500
    Re: Java listener Arne Vajhøj <arne@vajhoej.dk> - 2011-12-27 17:59 -0500
  Re: Java listener markspace <-@.> - 2011-12-26 08:12 -0800
  Re: Java listener Roedy Green <see_website@mindprod.com.invalid> - 2011-12-27 12:33 -0800

csiph-web