raimondas zemaitis

Ranch Hand
+ Follow
since Feb 23, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by raimondas zemaitis

I use boolean lock with Thread syncronization in such cases.


your main thread needs to call waitUntilTrue() and your loading thread needs to modify value.
19 years ago
there is no way you can do that programmatically. In windows, activate console that Java app is running and hit Ctrl+Break. That will get Threads dumped to the screen. Very convienent for deadlock debugging.
when you define it yourself you can make modifications to your class and still maintain compatibility between old and new class. Without explicit UID if you recompile class with changes you will not be able to deserialize serialized instance of old class.
19 years ago
firewall might be the reason. If you are under the firewall RMI can't get through. You should get the idea about the problem if you look at Java plug-in console in the browser.
19 years ago
First option is about opening a DATA CHANNEL for data transmission. Received data would need to be interpreted in order to take appropriate action.
Second option is about invoking remote procedure, which in described scenario is much closer to required.
However, you say you will need to travel across firewalls and neither of these can do that without special effort (RMI tunneling and alike).
19 years ago
If there is not going to be firewall in between an applet and data source I would go with RMI. It is faster, simpler to pass parameters forth and back (you don't care about serialization etc, just pass the reference), you can have callbacks, i.a. app server or whatever is the data provider, can push data to the applet. However, if there is firewall there is no sense to use it.
19 years ago
You are basically wrong alltogether. I live all my life in Eastern Europe and we are going to join EU in 1st of May this year. Most part of young people (I would say 16...35) speak English and English is very popular here. Salaries much much higher than Indian, eg. I work as Java developer and get approx 1200 euros net per month. We also have highly developed infrastructure.
20 years ago
If you mean different processes - different JVMs then I think this is possible by introducing your custom file lock which would act like object lock, i.e. say first process creates some file (eg .lock) another process checks for presence of this file and vice versa. When access is finished lock file is removed.
Multiple polymorphism is a powerful feature, unfortunately not available with standard Java, consider example

if multiple polymorphism would be available, depending on Currency type appropriate method would be invoked, although IBankAccount has only one method declared. With current Java only deposit(Currency curr) is invoked always.
You can look into http://www.cyberdyne-object-sys.com/oofaq2/DynamicDispatch.htm (the above example is taken from their site), I once needed quite badly to have this functionality and stumbled onto this site. They say they've done Java implementation with this feature.
I think Sun could consider this as a future feature.
20 years ago
you should run rmic from the root of your code and specify fully classified class name (i.e. with package name), also, rmic takes -cp option for setting classpath.
20 years ago
It seems to me that you have wrong understanding about synchronization between threads. My strong suggestion for you would be - get at least basic understanding when synchronization is necessary and how it works. A very good example with explanations can be found in Sun's Java Tutorial
http://java.sun.com/docs/books/tutorial/essential/threads/multithreaded.html
After you work on this one get back to your task and you might see the solution.
post some code, it is not clear what you actually do.
20 years ago
Why you don't use java.text.NumberFormat ?
20 years ago
On a windows 2000 you should do in the following way to invoke external process (doesn't matter perl or other, BTW, I had to invoke Perl scripts in our current script and this works great):
String[] command = new String[3];
command[0] = "cmd.exe";
command[1] = "/C";
command[2] = "perl.exe";
Process proc = Runtime.getRuntime().exec(command);
20 years ago
usually you start Thread by calling start(), not run().