Sultan Al-Yahyai

Greenhorn
+ Follow
since Nov 07, 2004
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 Sultan Al-Yahyai

Hello,
I have a thread to process files ...


in the main class I defined a ThreadGroup "process_tasks",

then I call the thread for diffrent tasks. different tasks will take different times to finish processing.


in some conditions I need to know, the number of active threads in the system. I have used the activeCount method



the problem is that I'm geting number much larger than the number of threads I called.

for exampl, if I process 7 files and I call activeCount() many times then I get this secqunce of number , 0 2 6 23 22 2 . while the I only used the thread for processing 7 files only.

can any body explain this for me? may be I'm doing somthing wrong?!
please help

regards

Hello,
I wrote RMI application and it worked well and fine. then my supervisior asked me to change the client to applet. when I run the applet and it try to connect to the server I got the following error message:
********************************
java.security.AccessControl Exception: access denied (java.net.SocketPermission 172.23.11.206:1099 connect,resolve)
at java.security. AccessControlContext. checkPermission(AccessControlContext.java:264)
at java.security. AccessController. checkPermission(AccessController.java:427)
at java.lang.SecurityManager. checkPermission(SecurityManager.java:532)
at java.lang. SecurityManager.checkConnect(SecurityManager.java:1034)
at java.net.Socket. connect(Socket.java:501)
at java.net.Socket. connect(Socket.java:457)
at java.net.Socket. <init>(Socket.java:365)
at java.net.Socket. <init>(Socket.java:178)
at sun.rmi.transport. proxy.RMIDirectSocketFactory. createSocket
(RMIDirectSocketFactory.java:22)
at sun.rmi.transport.proxy. RMIMasterSocketFactory.createSocket
(RMIMasterSocketFactory.java:128)
.
.
.
*******************************************************

in the server side all allow all permisions
grant {
permission java.security.AllPermission;
};

what could be the problem and what is the soultion??
19 years ago
Hi,
Also I tried this one and it worked
Enumeration e=t1.elements();
Enumeration k=t1.keys();
while ( k.hasMoreElements() )
{ t2.put(k.nextElement(),e.nextElement());
}
19 years ago
Thank you all,

t1.putAll(t2); Didn't work
becuase method is not defined .putall(hashtable)!

but
Enumeration e = t2.keys();
while (e.hasMoreElements())
{Object o = e.nextElement();
t1.put(o, t2.get(o));
}
worked fine
thanks
19 years ago

Hell,
1) I have two hash tables say ht1, ht2
I need the contents of ht2 to me moved/coppied to the end of ht1, how to do so?

regards
19 years ago
Hi all,
I want to find the CPU usage of a machine in the network or the localhost. is that possible in Java? if so please help, otherwise if any one know a utility to do so please tell me. things also such as available memory / hard disk ... are intersting to me as well
19 years ago
Hi all,
I want to find the CPU usage of a machine in the network or the localhost. is that possible in Java? if so please help, otherwise if any one know a utility to do so please tell me. things also such as available memory / hard disk ... are intersting to me as well