Help coderanch get a
new server
by contributing to the fundraiser

Daniel Iwan

Greenhorn
+ Follow
since Sep 30, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Daniel Iwan

Hi all

I have a project/desktop app that I believe qualifies for serious refactoring and possibly OSGi transition.

The idea is to have several modules and plugins that 3rd parties can write by themselves and load it with our app.
This is the most interesting feature of OSGi for us at the moment.
Although we find it really interesting to have a hot-deployable modules it's not essential for us.


So the question really is:
Is it worth to move to OSGi and have many issues with it on the start (learning, native loaders, dependency hell)
Or would it be better to find a simple Java Plugin Framework that could satisfy our needs?

As a side effect of moving towards OSGi we would get a modularized application (not initially I guess).
That's a big plus. But amount of work that it requires is terrifying.

Any thoughts?

Daniel


Hi everyone

Is it possible to turn on the logging in this framework to show which thread added logging entry?
I believe log4j shows thread number in the log file. What about java.util.logging?
Changing property text file to do that would be nice...

If not possible is there alternative to do it without changing code (by using commons-logging for example)

Cheers
14 years ago
Cheers guys

That helps a lot

And thanks for the link Monu. Really helpful
Hi everyone
My first post on JavaRanch ;)

I've been looking for an answer to my question for quite some time. No luck though...

Let's say one thread waits for changes of variable int "state".
First it enters synchronized block synchronized(guard) modifies "state" and releases lock of the guard object via guard.wait().
Now second thread modifies variable "state" also in synchronized block notifies first thread and leaves the block.
First thread resumes from wait() and checks the value of "state"

My question is. Does the "state" variable is being flushed to original location in memory from CPU registers
when wait() is called? In other words does thread 2 sees changes made by thread 1 before calling wait()?

I know that variables are "flushed" when synchronized block is reached and leaved but I'm not sure
about that wait() call. In theory wait() releases lock so all variables that has been modified and are in registers
should be flushed...

To clarify I'm talking about non-volatile variables.

Hope you can help me
Cheers