Re: start a thread in jini

Dan Creswell <[email protected]> Sat, 17 May 2008 10:30:09 +0100
Newsgroups gmane.comp.java.sun.jini
Message-ID <[email protected]>
Hello,

Blitz makes heavy use of Doug Lea's original concurrency library and is 
gradually being ported to backport-util-concurrent compatibility layer 
which provides util.concurrent emulation on JDK 1.4 and maps to the 
in-built implementation in JDK 5 and 6.

Thus much of Blitz's use of threads is based on this library - it 
doesn't actually do much in the way of periodic operation, almost 
everything is driven by external stimulus so it's threads are blocked on 
various conditions waiting to sprint into action.

There are one or two exceptions to this rule but they are simple cases 
and thus the threads are typically started and then sleep/wait for some 
period of time after which they perform some work and then sleep/wait again.

If you are handling simple cases, this approach (which you can see 
examples of in the Blitz source code) is likely sufficient.  For more 
complicated examples, you'll need to look in the Jini source code 
itself.  A simple search through the source code with something like 
Netbeans will do the job but I'd probably start with 
net.jini.lease.LeaseRenewalManager.

HTH,

Dan.

liang li wrote:
> thanks calum,
>     i found there are many threads in jini and blitz.but i can  NOT
> found when to start these threads in jini and blitz, i wana mock that
> way used in jini and blitz.
>     how to use TaskManager in jini, where can i find an example?
>  
>  
> best regards
> byron lee
> 
>  
> 2008/5/10, Calum Shaw-Mackay <[email protected] 
> <mailto:[email protected]>>:
> 
>     You can start a thread in whichever way you want, but it all depends
>     on what you're trying to achieve, and what is responsible for starting
>     that thread
> 
> 
> 
>     2008/5/10 liang li <[email protected] <mailto:[email protected]>>:
>      > hi,all
>      >
>      >    i wana start a thread which does something periodly in jini.
>      > there are to many way to start a thread, however, which is the
>      > right way.
>      >
>      > best regards
>      > byron lee
>      >
>     --------------------------------------------------------------------------
>      > Getting Started:
>     http://www.jini.org/wiki/Category:Getting_Started Community
>      > Web Site: http://jini.org jini-users Archive:
>      > http://archives.java.sun.com/archives/jini-users.html
>     Unsubscribing: email
>      > "signoff JINI-USERS" to [email protected]
>     <mailto:[email protected]>
> 
> 
> -------------------------------------------------------------------------- 
> Getting Started: http://www.jini.org/wiki/Category:Getting_Started 
> Community Web Site: http://jini.org jini-users Archive: 
> http://archives.java.sun.com/archives/jini-users.html Unsubscribing: 
> email "signoff JINI-USERS" to [email protected]

--------------------------------------------------------------------------
Getting Started:     http://www.jini.org/wiki/Category:Getting_Started
Community Web Site:  http://jini.org
jini-users Archive:  http://archives.java.sun.com/archives/jini-users.html
Unsubscribing:       email "signoff JINI-USERS"  to [email protected]