Hi, I don't know anything about generics interface in java but I would like to make threads with name qorker (qorker<Someqork> qorker = new Someqorkqorker<Someqork>()) which has three states INIT, WORKING and END.
And I want this thread to call a web service like Web Service/tempconvert.asmx

I don't know where I have to begin.
Could you help me please ?

Recommended Answers

All 4 Replies

It looks like you're mixing enum and generics: "has three states"
Can you explain what you are trying to do?

It looks like you're mixing enum and generics: "has three states"
Can you explain what you are trying to do?

"A worker is an engine that uses its own threads to do its work.
Each worker should be able to process its own types of Work.
worker's operations : INIT, WORKING, END

The hosting application interacts with Worker implementations via interfaces.
Specifically :
- An interface control the life cycle of a Worker and submit Work units.
- An interface or abstract class as the root of the Work unit hierarchy.

The interfaces should be possible to be used as qorker<Someqork> qorker = new Someqorkqorker<Someqork>();

To test this mechanism implement a worker using the web service
to convert temperatures between Celcius and Fahrenheit. The temperature as well as the conversion to perform should be parameters of the corresponding Work unit.

The Worker should perform no more than 5 concurrent calls to the Web Service, but also should not be limited to one, and it should be able to queue up to 20 Work units.
The demostrating program should create an instance of the Worker, submit a few Work units with various combinations of temperatures and conversions (demonstrating normal operation) and then attempt to saturate the queue by rapid submission of many Work units. It should then demonstrate state transitions and exit."

I would like to lead me .. not solving this for me
as I said I don't know about generis but I know the basics of java.

I can't see where Generics comes into this - you just need a Worker class and a Work interface that work units all implement.
ps (Apart from when you create your queues etc, but that's just stuff like
Queue<Work> = new Queue<Work>();
what I meant was that I can't see any need for you to define your own generic classes or methods)

I can't see where Generics comes into this - you just need a Worker class and a Work interface that work units all implement.

You have right I forgot a sentence.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.