Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Security 1224-how-to-control-program how to control program/thread 's access authority£¿
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


guohualee
how to control program/thread 's access authority£¿
1 Answer(s)      6 years and 5 months ago
Posted in : Security



Advertisement
View Answers

May 20, 2008 at 6:43 PM


Hi

import java.util.*;

public class ThreadAccessExam implements Runnable{
static int ThreadCount = 1;
public void run(){
String s = "This is thread " + ThreadCount++;
Vector<String> vec = new Vector<String>();
vec.addElement(s);
vec.addElement(s);
try{
Thread.sleep(1000);
}
catch(Exception e){}
vec.addElement(s);
System.out.println(vec);

}
public static void main(String[] args){
try{
System.out.println("Display the thread massage here:");
for(int i = 0; i < 8; i++){
(new Thread(new ThreadAccessExam())).start();
try{
Thread.sleep(500);
}
catch(Exception e){
System.out.println(e);
}
}
}
catch(Exception e){
e.printStackTrace();
}
}
private static ThreadLocal<Vector> vectors = new ThreadLocal<Vector>();
public static Vector getVector(){
Vector v = (Vector) vectors.get();
if (v == null){
v = new Vector();
vectors.set(v);
}
return v;
}
private static Hashtable<Thread,Vector> vector = new Hashtable<Thread,Vector>();
public static Vector getVectorPriorToJDK12(){
Vector v = (Vector) vector.get(Thread.currentThread());
if(v == null){
v = new Vector();
vector.put(Thread.currentThread(), v);
}
return v;
}
}


---------------------------------------------------------

Read for more information.

http://www.roseindia.net/java/


Related Tutorials/Questions & Answers:
how to control program/thread 's access authority - Security
how to control program/thread 's access authority£¿  how to control program/thread 's access authority like program can't change I/O and change...(){ String s = "This is thread " + ThreadCount++; Vector vec = new
How to access the "Add/Remove Programs" list in Control Panel using Java Program? - Java Beginners
How to access the "Add/Remove Programs" list in Control Panel using Java Program?  Dear Sir, I'm very interested in creating java programs... Programs list in the Control Panel. I don't know, how can i access it? Kindly give me
Advertisements
How to Access MS Access in jar.
How to Access MS Access in jar.  how do i access my Ms-Access file... to access it via Code or is their any alter-native?? Do i need any Driver to do this ... i m able to access a Ms-access via JDBC but cant find the file wen
MySQL Access Control
MySQL Access Control       MySQL Security Access Control Most users concentrate on MySQL's databases... - and they don't usually look deeper to understand how it handles access privileges
How to access Subclass?
How to access Subclass?  How to access subclass in java? please tell me the syntex with an example
How to take control of diffrent system or computer
How to take control of diffrent system or computer  I want to connect to different computers and want have full control remotely. How can java help me in this?   Hello Shubhangam For implementing Remote access client
how to access the MS ACCESS database with java
how to access the MS ACCESS database with java   how to access the MS ACCESS database with java how can we insert,delete,update,search records of ms access with java   Java MS Access database connectivity Follow
In Struts 2 how to pass the <s: property value=''
In Struts 2 how to pass the s: property value'  In Struts 2 how to pass the s: property value' I have page where i display the list of treasury... this data.jsp from that DB and display the same in a page. How do i send
how to design control panel for web applications
how to design control panel for web applications  how to design control panel for web applications
j2me- how to subtract time s in j2me???
j2me- how to subtract time s in j2me???  hello everyone!! Am a final... with the coding part!! **i want to know as to how exactly to subtract time or time zones?? like if i want to find the time of America being in india... how
how to access database in applet
how to access database in applet  HI... I'm having an applet where we should display the database values in the applet... It works fine in the local system(same network)... but when its in the server, we r getting null values
How to forward the control from one jsp to another?
How to forward the control from one jsp to another?  Hi! This is Prasad Jandrajupalli. I have the 3 JSP's, but I want communicate with each... is not communicate with the Third JSP. I want forward the control from first jsp to second
how to access the MS ACCESS database with java - Java Beginners
how to access the MS ACCESS database with java  how can we insert,delete,update,search records of ms access with java
how to access the details - Java Beginners
how to access the details  how to access the detailsclass E { String name; String no;string place; E(String n,String n,String p.... Please write the program
How to convert java BigDecimal to normal byte array not 2 s complement
How to convert java BigDecimal to normal byte array not 2 s complement  How to convert java BigDecimal to normal byte array not 2 s complement
How to use JTable with MS-Access
How to use JTable with MS-Access   I have Three Column in Database (MS-Access). 1. Name 2. City 3. Contact I want to Display this data in JTable. How can I do it. I also want to EDIT and DELETE this Data
How to use JTable with MS-Access
How to use JTable with MS-Access   I have Three Column in Database (MS-Access). 1. Name 2. City 3. Contact I want to Display this data in JTable. How can I do it. I also want to EDIT and DELETE this Data
Scroller control in Flex4
:Scroller>. The scrollbars control's the viewport's horizontal and vertical... see how we can use a Scroller control in Flex4. Output: Running...Scroller component in Flex4: The Scroller control is the Spark component
how to insert values from jsp into ms access
how to insert values from jsp into ms access   how to insert values using jsp into ms access database
How to access Enterprise Beans
How to access Enterprise Beans In this tutorial you will learn that how to access Enterprise Beans (applicable only to session beans not to message-driven... to clients. Using this view enterprise bean implemented class's or any super
How to access session values through Ajax?
How to access session values through Ajax?  Suppose in a servlet a variable userName is kept in session. How can I access this variable from JSP through AJAX? Is it possible
how to access windows registry information using java?
how to access windows registry information using java?  can any one help me how to access windows registry information using java
How to use Arraylist object in <s:dobleselect> .... struts 2? - Struts
How to use Arraylist object in .... struts 2?  Hi Members, I saw the example of tag in roseindia, its very useful. But I have to use my ArrayList object with that tag. Im retrieving the values for arraylist object from
how to connect to MS access database in JSP?
how to connect to MS access database in JSP?  how to connect to MS access database in JSP? Any seetings/drivers need to be set or installed before....   Hello Friend, Follow these steps: 1)Go to the start<<Control
How to make session control using only JSP programming language
How to make session control using only JSP programming language  Could i do Controlling session using only JSP programming language without using anylanguage
How to access the Title tag from xml to jsp
How to access the Title tag from xml to jsp  How to access the Title tag from xml to jsp   Please visit the following link: http://www.roseindia.net/jsp/parsing-xml.shtml The above link will provide you an example
How to access (MySQL)database from J2ME?
How to access (MySQL)database from J2ME?  I am new to J2ME. I am using NetBeans. Can anyone help me? How to access (MySQL)database from J2ME? ( I search a lot I found that there is need to access database through servlet
how to access JQuery array in jsp page?
how to access JQuery array in jsp page?  JQury Array: var elems =this.value; var arr = jQuery.makeArray(elems); How to get in jsp page
how to delete the access database value in jsp
how to delete the access database value in jsp  i loaded my database data into the dropdown list box...now i want to delete the value..plz send the source code to delete the value in dropdown list box and also from database
how to delete the access database value in jsp
how to delete the access database value in jsp  i loaded my database data into the dropdown list box...now i want to delete the value..plz send the source code to delete the value in dropdown list box and also from database
how to use web services to access hardware units ?
how to use web services to access hardware units ?  Hi I am suresh raja i am doing a project on electronic meter i have to get meter reading with the help of web services and store it to database is it possible to do ! please
Advertisements
 

 

 

DMCA.com