This is the mail archive of the frysk@sources.redhat.com mailing list for the frysk project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Announcing new interface: FindProc


Nurdin Premji wrote:
There is a test case TestFindProc that uses the interface. It's pretty
basic, just stops the eventLoop on success or fail.

It looks similar to this:

class MyFinder implements Host.FindProc
{

public void procFound(Proc Proc)
{
Manager.eventLoop.requestStop();
}

public void procFoundFailed(int pid)
{
Manager.eventLoop.requestStop();
fail();
}
}

and in the code you would write:

Host.requestFindProc(pid, new MyFinder());

Ah, thanks!


Is a ProcId better here?
Should procFoundFailed be parameterized with what was not found?
For the names (esp. procFoundFailed), check the Java libraries, or the patterns book, to see if there's similar code, and hence a naming guildeline.


BTW, some implementation nits in the above: for the failing case, no need to request that the event loop stop; however fail() should be parameterized with more meaningful information, such as what failed, and say the ProcId it was looking for. And for the found case, should it check that things match what was being searched for?

Andrew

On Mon, 2006-11-20 at 10:01 -0500, Andrew Cagney wrote:
Nurdin,

Would it be possible to post an example of how this new interface is used?

Andrew

Nurdin Premji wrote:
I've just committed a new Interface with some test methods for finding a
process.

Currently this just brute forces a refresh of the Host's procPool
(exactly as requestRefreshXXX), but this will eventually become more
specialized to find a specific pid and add it to the pool and notify the
interface upon success (or failure).

I would like some input on the design of this interface as it will
eventually be replacing most if not all references to requestRefreshXXX.

Also specific opinion: Should the FindProc be under Host.java or get its
own .java file?




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]