how to control program/thread 's access authority£¿

how to control program/thread 's access authority£¿

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
ModuleNotFoundError: No module named 'trytonacs_party_access_control'
: No module named 'trytonacs_party_access_control' How to remove the ModuleNotFoundError: No module named 'trytonacs_party_access_control' error...ModuleNotFoundError: No module named 'trytonacs_party_access_control
Advertisements
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
ModuleNotFoundError: No module named 'trytonacs_party_access_control_isonas'
: ModuleNotFoundError: No module named 'trytonacs_party_access_control_isonas' How to remove the ModuleNotFoundError: No module named 'trytonacs_party_access_control...ModuleNotFoundError: No module named 'trytonacs_party_access_control_isonas
ModuleNotFoundError: No module named 'Chinese-RFID-Access-Control-Library'
: ModuleNotFoundError: No module named 'Chinese-RFID-Access-Control-Library' How to remove the ModuleNotFoundError: No module named 'Chinese-RFID-Access-Control...ModuleNotFoundError: No module named 'Chinese-RFID-Access-Control-Library' 
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
ModuleNotFoundError: No module named 'django-authority'
ModuleNotFoundError: No module named 'django-authority'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'django-authority' How to remove the ModuleNotFoundError: No module
ModuleNotFoundError: No module named 'Flask-Authority'
ModuleNotFoundError: No module named 'Flask-Authority'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'Flask-Authority' How to remove the ModuleNotFoundError: No module named
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 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
ModuleNotFoundError: No module named 'django-object-authority'
ModuleNotFoundError: No module named 'django-object-authority'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'django-object-authority' How to remove the ModuleNotFoundError
data science authority
authority Try to provide me good examples or tutorials links so that I can learn... Courses: Data Science for beginners - a complete beginner's guide to learn
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 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 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
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 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 access the database from JSP?
How to access the database from JSP?  Hi, What is the process of accessing the database from JSP page? Thanks   Hi, In the JSP program... database from JSP which explains you how to access the database by embedding
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 design control panel for web applications
how to design control panel for web applications  how to design control panel for web applications
how to access python dictionary elements
how to access python dictionary elements  Hi, I am new to Python... a collection object in my program. Now I want to access value of a key from python...? How to access python dictionary elements? Thanks   Hello, Python
how to access python dictionary elements
how to access python dictionary elements  Hi, I am new to Python... a collection object in my program. Now I want to access value of a key from python...? How to access python dictionary elements? Thanks   Hello, Python
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
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 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 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 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 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
access
access   This is Nitha Sriram i am having a problem that, i am having a combo box in the JSP page when i select an item from that i am calling the onchange function. In javascript i am getting the value now i want to pass
How to access Widows" Add/Remove Programs List"? - Java Beginners
How to access Widows" Add/Remove Programs List"?  Dear Friends, How to access the Windows' Add/Remove Program List? Is there any special jar.../developer_guide/control_panel.html
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 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 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
How to access data yearly from DB in C# ?
How to access data yearly from DB in C# ?  how to access data yearly from database in C#. I have code but i m not able to retrieve data yearly from DB table. string date1 = dateTimePicker1.Value.Date.ToString("dd/MMM/yyyy
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
Scroller control in Flex4
:Scroller>. The scrollbars control's the viewport's horizontal and vertical... In this example you can see how we can use a Scroller control...Scroller component in Flex4: The Scroller control is the Spark component
How to access the following tag from xml to jsp
How to access the following tag from xml to jsp  How can i get the title where cat="1" and "My Title" from XML File?   Please visit the following link: http://www.roseindia.net/jsp/parsing-xml.shtml The above link
how to access javascript in mozilla - Java Beginners
how to access javascript in mozilla  i have written javascript code in .js file and i am calling that file in .jsp file as but the script is working in IE but not working in Mozilla. can u plz solve my problem  
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 MS ACCESS 2003 Database in C Program with Graphics.
How To Connect MS ACCESS 2003 Database in C Program with Graphics.  How To Connect MS ACCESS 2003 Database in C Program with Graphics
How to find MAC(Hardware address) address of access point
How to find MAC(Hardware address) address of access point  How can i find out MAC address of Access Point using java
Access Specifiers and Access Modifiers
Access Specifiers and Access Modifiers  What are Access Specifiers and Access Modifiers
How to access session value using OGNL.
How to access session value using OGNL. In this example, you will see how to access value of session using OGNL expression language in struts2.  1-index.jsp <html>ADS_TO_REPLACE_1 <head> <title>Access
How to access sub class member using super class object
How to access sub class member using super class object  class A{ } class B extends A{ int b=1; } class Test{ public static void main(String args[]) { what to do here to access sub class variable b using super class object

Ads