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

 
 


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

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 Pages:
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 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
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 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
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
ToggleButtonBar Control in Flex4
;/fx:Script> <s:Panel title="ToggleButtonBar Control Example"... can see how we can use a ToggleButtonBar control in Flex4. Output: Running...ToggleButtonBar control in Flex4: The ButtonBar control
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
S - Java Terms
S - Java Terms       String to Int Conversion This section illustrates you how.... It is a small program that runs on a server.    Java Message
PopUpAnchor Control in Flex4
of PopUpAncher control is <s:PopUpAnchor>. Example: <?xml version...:transitions> <s:Panel title="PopUpAnchor Control Example"... control in Flex4. Output: In this example you can see how the pop up component
SWFLoader Control in Flex4
/mx"> <s:Panel title="SWFLoader Control Example"...SWFLoader control in Flex4: The SWFLoader control is a MX component. It has no Spark component. The SWFLoader control loads one application into another
LinkBar Control in Flex4
; </s:Application> In this example you can see how we...LinkBar control in Flex4: The LinkBar control is a MX component. It has no Spark component. The LinkBar control sets to Link Buttons in a horizontal
Alert Control in Flex4
; <s:Panel title="Alert control Example" width="215"... see how we can use a Alert control in Flex4. Output: Running Application...Alert control in Flex4: The Alert control is a MX component. It has no Spark
RichTextEditor control in Flex4
RichTextEditor control in Flex4: The RichTextEditor Control is a MX component... in RichTextEditor control. It contains so many control which are following..., center and justify 7. Bullets 8. URL links In this example you can see how we
MenuBar Control in Flex4
:Declarations> <s:Panel title="MenuBar control Example"...;/s:Application> In this example you can see how we can use...MenuBar control in Flex4: A MenuBar control displays a horizontal bar of menu
FlexNativeMenu Control in Flex4
. It's provide a data for menu control. It has no visual representation... control in AIR Application. First you will make a XML List for item and call it in a FlexNativeMenu control using dataProvider property for providing a data
PopUpMenuButton Control in Flex4
control is <mx:PopUpMenuButton>. In this example you can see how we use...PopUpMenuButton Control in Flex4: The PopUpMenuButton control is a  MX component. It  is a pop-up Button control. It contains two buttons. First
jsp to access query
jsp to access query  How to insert the values from jsp to access ?   Here is a jsp code that insert the values to MS access database. Follow these steps: 1)Go to the start>>Control Panel>>Administrative
Menu Control in Flex4
Menu Control  in Flex4: The Menu contol is a pop-up control. It containes a submenu. You can select a indivisual item from menu control. You use only Actionscript for create a pop-up Menu control. There is no MXMl tag. You can
J2ME Video Control Example
J2ME Video Control Example       This Application explain the use of Video Control. The work of video control is used to controls the display of video. In this example we
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
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
MS Access - JSP-Servlet
stepts 1.to configure the ms access database to your system control panel... problem is how to connect MS Acces database with servlets ... thank you... in Connectivity in MS Access : import java.sql.*; public class
HRule Control in Flex4
;955" minHeight="600"> <s:Panel title="HRule Control...; In this example you can see how we can use a HRule control in Flex4...HRule control in Flex4: The HRule control is a MX component. It has no Spark
VRule Control in Flex4
" minHeight="600"> <s:Panel title="VRule Control...; In this example you can see how we can use a VRule control in Flex4. Output...VRule control in Flex4: The VRule control is a MX component. It has no Spark
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
PopUpButton Control in Flex4
can see how we can use a PopUpButton control in Flex4. Output: Running...PopUpButton control in Flex4: The PopUpButton control is a MX component... is a button control. When the user clicked a small button then opens a second pop-up
dual control
dual control  how to get two controls on a single program at the same time
Tree Control in Flex4
:XMLList> </fx:Declarations> <s:Panel title="Tree Control...; In this example you can see how we can use a Tree control in Flex4. Output...Tree Control in Flex4: The Tree control is used for a hierarchical data which
Image Control in Flex4
:Declarations> <s:Panel title="Image Control Example" width="373...; In this example you can see how we can use a Image control in Flex4. Output: Running...Image control in Flex4: The Image Control is a MX component. It has no Spark
s:textfield - Struts
s:textfield  I am using the s:textfield tag in an appication and need to display % after the field on the same line. How would I go about doing this?  Hi friend, Textfield Tag Example
See What?s On with a Television Listing Mobile Application
See What’s On with a Television Listing Mobile Application Anyone who... night should check one’s television listings. However, not all people will have access to a television set or a print guide at all times. This is why
Struts control data flow
Struts control data flow  How Struts control data flow
How to access Subclass?
How to access Subclass?  How to access subclass in java? please tell me the syntex with an example
Menu s - JSP-Servlet
Menu s  How to create menubar & menus & submenus in jsp
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
admin login control page - JSP-Servlet
admin login control page  how to encrypted password by using jsp... adminPage.jsp?  JSP Example code for encrypted passwordJSP Encrypted... (SQLException s){ System.out.println("SQL statement is not executed
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> <head> <title>Access_Value_bean_from
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
ms access
ms access  how to delete the autonumber from ms access using java delete code
AdvancedDataGrid Control in Flex4
; <s:Panel title="AdvancedDataGrid Control Example" height...AdvancedDataGrid control in Flex4: The AdvancedDataGrid control is same as a DataGrid control. It has a functionality of the standard DataGrid control
piracy control - Java Beginners
piracy control  how can i make a program that can control piracy in java? piracy control program means that in which we can only run any text file, mp3 file but it cant be copy from there. can u please help me in making that its
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
connectivity with access
connectivity with access  how to connect with data base with access...; Is this Access database or excel sheet. Do you want to display the values...;Is this Access database or excel sheet. Do you want to display the values in Textarea
MS access
MS access  how do i access my Ms-Access file placed in the same jar file where my application code/class file r present??? Want to access it via Code. Can anyone help me ? Please give reply urgent...   give me reply
asp.net calendar control
asp.net calendar control  I have used 2 text box to display calendar control... one is fromdate and another is todate... In database also fromdate... If user enters from date then next day todate should be closed.. How we can do
Ms Access
Ms Access   How to get query for Primary key from MsAccess?   SELECT column_name FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE table_name = 'data';   SELECT column_name FROM INFORMATION_SCHEMA.KEY_COLUMN
Access specifiers
Access specifiers  Why we are giving "public static void main"? How... as it provides the "entry point" for the program. Whenever the program executes, the main method is always called. It is defined once in a program. public
Control Tags-If / Else If / Else
Control Tags-If / Else If / Else       In this section we are going to discuss the various control tags ( The Control Tags are used for flow control such as if, else and iterate.)  'If' tag could
Flex tree control
of the Tree control and process to access the value of the tree control. ... label. user can use methods for access the data of that Tree control. you can...Tree Control in Flex:- The name suggest the behavior of that control

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.