Try to queue threads of clients but there is something wrong!

Hello. I have been trying to queue threads of clients in multithreaded server but there is a problem none of the threads is alive.
here is my code.
class queueClient extends Thread{
HandleServer sa1;
LinkedList queue = new LinkedList();
queueClient(){
super();
}//end of costructor
/**method in the queueClient class to put each client in the queue*/
public void queuethem(HandleServer s){
try{
s.wait();
queue.add(s);
catch(InterruptedException sleep){
System.exit(0);
}//end of queuethem
/**method in the queueClient class to manage the clients in the queue*/
public void manageQueue(HandleServer sa){
if(!queue.isEmpty() && (queue.size())==1){
sa= (HandleServer)queue.removeFirst();
sa.notify();
sa.start();
else if (!queue.isEmpty() && (queue.size()>1)){
sa= (HandleServer)queue.removeFirst();
sa.notify();
sa.start();
try {
if(sa.currentThread().isAlive()){
sa1= (HandleServer)queue.removeFirst();
sa1.join();
else{
sa1.notify();
sa1.start();
catch (InterruptedException join) {
System.exit(0);
else{
System.out.println("Queue is empty");
}//end manageQueue
}//queueClient class end

ok lets say that i have 3 clients connected to my server which is responsible to pass the messages from only one client to a robot.
Ok ?
Then this server must queue the other two clients and leave only one "Alive" and the other two must wait a certain amount of time untill the current client that speaks with the server and the robot to die and then to wake up the other one client and start to talk with the server and the robot
now is it more clear?

Similar Messages

  • Databse connected successfully but there are something wrong in my procedur

    hi
    i am writing a small java application that use Microsoft SQL Server 2000 .the test application show that i am successful connect to the database.
    But in my application when my press the query button ,the resulte cannot append on the textrea, i am double about it .Can anyone help me out of this??thanks !! the fllowing are my code:
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    public class jdbc //main class
    {  public static void main(String args[])
         GUI gui=new GUI();//GUI
         gui.pack(); //excute GUI
    class GUI extends Frame implements ActionListener
         TextArea text;Panel panel; TextField sno;Button btn;
         GUI()//
         super("made by yaowu");
              setLayout(new BorderLayout());
         setBackground(Color.cyan);
         setVisible(true); text=new TextArea();
         btn=new Button("query");
         sno=new TextField(16);
         panel=new Panel();
         panel.add(new Label("entre the id of student(include10number)"));
    panel.add(sno);panel.add(btn);
         add("North",panel);add("Center",text);
         text.setEditable(false);btn.addActionListener(this);
         addWindowListener(new WindowAdapter(){
         public void windowClosing(WindowEvent e)
              setVisible(false);
              System.exit(0);}});}
              public void actionPerformed(ActionEvent e){
              if(e.getSource()==btn)// when press
                   {text.setText("rusult"+'\n');
                   try{
                   Liststudent();
                   catch(SQLException ee){}
    public void Liststudent() throws SQLException//connct with database
         String xh,xm,xb,nl,em,tl;
         try{
         Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
         catch(ClassNotFoundException e){e.printStackTrace();
    System.out.println("Error Trace in getConnection() : " + e.getMessage());}
    catch(java.lang.InstantiationException e)
              catch(java.lang.IllegalAccessException e)
    String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=mydata";
    String user="";
    String password="";
    Connection con= DriverManager.getConnection(url,user,password); //
         Statement sql=con.createStatement();//creat Statement
         ResultSet rs=sql.executeQuery("select* from xsqk"); //xsqk table
         while(rs.next()) //ptint the result
              {   xh =rs.getString("id");
                   xm=rs.getString("name");
              xb=rs.getString("sex");
                   nl=rs.getString("age");
    em=rs.getString("E�Mail");
    tl=rs.getString("tl");
              if(xh.trim().equals(sno.getText().trim()))
                   text.append('\n'+"id"+" "+"name"+" "+"sex"+" "+"age"+" "+"E-Mail"+" "+"tl"+'\n');
                   text.append('\n'+xh+" "+xm+" "+xb+" "+nl+" "+em+" "+tl+'\n');
    }

    Something is wrong but your code doesn't care: catch(SQLException ee){}What happens if there is an SQL exception? Nothing. That's probably what happened. Try this to find out: catch(SQLException ee){ee.printStackTrace();}

  • Everytime I  try and sign into my iCloud account it tells me I can't log in due to a server error, but there is nothing wrong with my server . It also wont allow me to view any of my Photos or Documents that i have backed up.

    Everytime I  try and sign into my iCloud account it tells me I can't log in due to a server error, but there is nothing wrong with my server . It also wont allow me to view any of my Photos or Documents that I have backed up. Please help

    Hi,
    Are you running any Anti-virus software or do you have your firewall turned on? If so, disable them and try again. If that doesn't work, delete the iCloud account and then sign it back on again.
    Make sure you are running the most current version of the iCloud Control Panel:
    http://support.apple.com/kb/dl1455
    Cheers,
    GB

  • I am unable to install apps as my iTunes states my computer is already authorised, then it tells me to authorise it? Does anybody out there know how to fix this. I am sorry if there is already a thread regarding this but there is 224,613 running atm.

    I am unable to install apps as my iTunes states my computer is already authorised, then it tells me to authorise it? Does anybody out there know how to fix this. I am sorry if there is already a thread regarding this but there is 224,613 running atm.
    I have an iMac that has iTunes on it.
    My iPad is a first gen but its almost upto date, I haven't updated it for about a month.
    If anyone out there has some information I would appreciate it a lot.
    I am only doing this as iBooks isn't working
    Thanks in advance.

    Removing the SC Folder worked for me. But as an after thought and another potential problem although I do not think it is related, I had movies authorized thru my wifes Apple ID and she changed her ID a couple weeks ago. This, I think, could have had a contributing factor although not sure.
    You have to delete the SC Folder and then reboot and then go into iTunes, re-authorize if it asks, then I was able to sync the movies. Hope this helps a little.

  • I try to reset my securitey question but there is no link to press it to follow instruction

    i try to reset my securitey question but there is no link to press it to follow instruction

    To reset your security questions, contact iTunes Support online: http://apple.com/emea/support/itunes/contact.html (select Account Security as your help topic) or by phone: Apple Support Numbers

  • Match EQ. Good plug, but there's something that dosen't add up..

    I tried Match EQ plug and I find it useful to observe and compare Mixes and tracks, but there's something I can't understand. Here it is:
    I made a match EQ between a source and a destination Mix in 2 different way:
    1. The source Mix was louder than the destination one: I got, say, a certain match EQ
    2. The destination Mix was led up to the same level as the source one, and then a new matching passage was made: I got THE SAME MATCH EQ as before.
    How can it be possible? I thought it would have been obvious that raising destination Mix level would have changed the relationships between the 2 Mixes' Eq performance. Am I wrong?

    the Volume is related with evarage RMS ammont... (not eq because eq change if RMS change)
    but... for changing RMS you need to use Mid/Side Compressors that can change the original EQ of the "x" Mix
    so
    in order to got the "same" resulting Match EQ of "like as" "commercial mixer" you need to use a lot of different plugins... including Multiband Compressors, de-esser, EQ, EQ, and EQ again, Maximazer and on the last a great Limiter! (the order on the channel strips is related by your personal experience...
    you need to try by yoursef...
    as you understand after that the Match EQ can be used only after all mastering plugins in order to check if the EQ curve is similar!
    in any case Mastering is a art... there are no rules or better... the rules exist but for the maximum result those rules must be broken
    and is only the personal experience that brings your work to an acceptable result.
    Obviously a good mastering requir a perfect MIX...
    if your mix is defective ... adding compressors and so on.. should be a very dangerous experience..
    a good result require only little bit adjustments...
    a BAD MIX with a stromg mastering effects... will show only to increase its defects
    G

  • My iPhone is in recovery mode, But once it's done with the process a tab comes up saying there was something wrong restoring it (1015) error. Any suggestions of how I could fix this?

    My iPhone is in recovery mode, But once it's done with the process a tab comes up saying there was something wrong restoring it (1015) error. Any suggestions of how I could fix this?

    Error 1015: This error is typically caused by attempts to downgrade the iPhone, iPad, or iPod touch's software. This can occur when you attempt to restore using an older .ipsw file. Downgrading to a previous version is not supported. To resolve this issue, attempt to restore with the latest iPhone, iPad, or iPod touch software available from Apple. This error can also occur when an unauthorized modification of the iOS has occurred and you are now trying to restore to an authorized, default state.
    In other words:
    The backup to which you're trying to restore was created with a lower or previos version of iOS than the one installed on your iPhone during the recovery.  If this is the case then you'll be unable to restore your phone with that backup and you'll have to set your iPhone up as new.  Or,
    Your iPhone was/is jailbroken.  If this is the case, there is nothing anyone here or at Apple can do for you.

  • Safari tries repeatedly to open a page. The page partially opens but then Safari reports that there's something wrong with page and I get an error message. This is happening at too many web sites for one site to be having issues.

    Safari tries repeatedly to open a page. The page partially opens but then Safari reports that there's something wrong with page and I get an error message. This is happening at too many web sites for one site to be having issues.

    I have a similar problem, Safari cannot load a complet page. It stalls e.g. ["38 of 42"]. sometimes it will complete loading after a long wait. just as often it will never complete the page,
    The same thing happens in chrome and firefox but safari on my iPad works just fine.
    I have the latest version of everything
    I assume there is a system problem but cleaning up permissions does not help

  • I must close mu iCloud account on my iphone but can't came in. Have no password and can't get a new one, have not the emailadress any longer and there is something wrong with my securityquestions.

    i must close mu iCloud account on my iphone but can't came in. Have no password and can't get a new one, have not the emailadress any longer and there is something wrong with my securityquestions.

    Hello Malin1951,
    Thank you for contacting Apple Support Communities.
    The following article should guide you through resetting your iCloud password so that you can close it on your iPhone.
    iCloud: Account troubleshooting
    http://support.apple.com/kb/TS3988
    Regards,
    Jeff D.

  • Turned my iphone 4 off now I turned it on again and stuck on apple logo, after this i put it in recovery mode but it failed and itunes says there is something wrong with my iphone any ideas

    My iphone 4 stuck on the apple logo then it wont work in recovery mode. My iphone then wouldnt work in recovery mode, itunes said there is something wrong with my iphone. On my iphone it says connected to itunes any ideas what could be wrong

    You might have to get it serviced, or visit an Apple Store to get it looked at.
    Apple - Support - Service Answer Center

  • There is something wrong with the forum

    There is something wrong with the forum. it is messed up.!
    I been a little bit observant this past few days, I observed alot of problems..
    here are a few, ( there are actually alot more, but I could not describe it. its just very weird.
    I thought someone hacked to my profile and used it to ask that one, but when I clicked on it, it was just one of the questions I have responded to.
    sometimes I can not post to threads, an error would come up, most especially if I reply to a reply,
    sometimes, when I Post images it would work the first time I post it, but when I search for it again, only the links are given, no images anymore.
    sometimes I get booted out randomly, in the middle of writing a reply
    sometimes the posts switches from threaded to flat , flat to threaded, and sometimes both.
    sometimes when I checked on the stuffs>discussion, the post is highlighted but there is no new response or like, and even there was, I can see which one is it, especially to the posts that had many reply already
    sometimes it still sends email to my gmail eventhough i have unsubscribe to the post already,
    sometimes get error 504, and some other numbers I forgot.
    sometimes during writing a response the blinking thing that indicates where are you writing goes missing or on the wrong place.
    OH come on..! I am trying to help, you don't want one?
    and don't blame it on ,my browser ( i checked and used IE9, FIREFOX, and even CHROME), or to my internet connection.( i got the best there is for home connections), or to my laptop ( it's a little bit old, but it still kicks butt holes) and tried it already with other pc/internet connection/and whatnot.
    I am still sometimes visiting my previous home (NOKIA FORUM) and I don't experience those, and we even have live chat over there,
    this forum needs a revamp. and how I wish this could be repaired via Sony Update Service, or PC Companion, but of course if it was possible I would have done it already.
    We try to help users, make the forum conducive for users trying to help users. \m/
    best of luck,,
    MARLON LB :smileywink:

    This is how the forum looks for me.
    But during around midnight, (gmt +8) the forum changes to this

  • There's something wrong with my iphone 4s

    So there's something wrong with my iPhone 4s.
    Just recently it worked fine and all of a sudden it started going insane so what I did was turn my phone off for five minutes then back on. When I did my imessage won't work nor does my app called Line won't allow me to log in claiming my network is not working properly (when in fact it is because I used safari and searched five websites and it works fine) then I tried my imessage and it still won't work so I went to my settings and when I did it said my imessage was off so I switched it on and it was asking for my apple ID and I gave the correct information, making sure to type the password slowly so I won't make errors but still it claims I have the wrong password. I have other apple IDs and I used them and they all have the same password and still nothing. It's really annoying and I want it to be fixed soon because I've tried everything, I've tried putting it on airplane mode then putting it off, turning off imessage and restarting then turning it on again, I can't even log on to my apple ID here properly a few seconds ago and I restarted my phone already and shut it off too and still no difference.
    I'm hoping someone who can help me, please  nothing that requires deleting files because my files are important I do remember backing up on iCloud but I'm not quite sure when I did that and so I'm afraid of using that back up file.

    Hi Rsh Ahmed,
    Thanks for visiting Apple Support Communities.
    If you're not able to connect to wi-fi networks after updating, try the steps in our wi-fi troubleshooting article:
    iOS: Troubleshooting Wi-Fi networks and connections
    http://support.apple.com/kb/ts1398
    All the best,
    Jeremy

  • An Internal error has occurred: There is something wrong in CryptuprotectData

    When I try to upload to Facebook, I receive the following error message: "An Internal error has occurred: There is something wrong in CryptuprotectData". How do I fix it?

    Your client is CR R1, your server is XI R2. This is a known bug. To fix you need BOE XIR1 SP3 or above. I'm not sure this was fixed in a CR service pack. Sorry I can't find a link for that right now.
    Or use [this link|http://resources.businessobjects.com/support/additional_downloads/service_packs/crxir2.asp] to get CR R2, uninstall CR R1, and replace with CR R2. NOTE: they should still use the same license keys. If using CR to XIR2 you should always keep the same version so this is the preferred method.
    Regards,
    Tim

  • How do I import my photos from my iPhone to iPhoto, when I press import I just get a message saying there is something wrong with one of my photos and disconnects my iPhone.

    How do I import my photos from my iPhone to iPhoto, when I press import I just get a message saying there is something wrong with one of my photos and disconnects my iPhone.

    I couldn't find Image Capture at my first try, butI will try again. Do you inow how I can find the corrupted photo on my iPhone? Im a bit lost..
    Sorry, I just noticed, I made a mistake. "Image Capture" is in the Applications folder, not Utilities. And it may have a different name on your Mac, if your system language is not English:  Look for the icon with the camera:
    When Image Capture can import from your iPhone, spilt the folder with the imported photos in several small subfolders and try to import them separately to iPhoto. This way, you can identify a subset of photos with the corrupted one.
    Then try to import from that small subset one by one, until you hit the culprit. And then delete that photo or video from the phone.

  • There is something wrong with the volumes buttons in my macbook pro, every time i pressed the one who raises the volume, it leads me to the screen where (i do not no what its called) the background is black with the date and time and a calculator.

    There is something wrong with the volumes buttons in my macbook pro, every time i pressed the one who raises the volume, it leads me to the screen where (i do not no what its called) the background is black with the date and time and a calculator. However, when i lower it, my safari tab goes out of the screen. What do you guys think i should do? I'm getting very nervous.

    hey HAbrakian!
    You may want to try using the information in this article to adjust the behavior of your function keys to see if that resolves the behavior:
    Mac OS X: How to change the behavior of function keys
    http://support.apple.com/kb/ht3399
    Take care, and thanks for visiting the Apple Support Communities.
    -Braden

Maybe you are looking for

  • Arching of files is gone from the downloads and documents folder

    The arching list of files is gone when rolling over the downloads and documents folder. I removed the downloads folder by accident yesterday from the dock. Once I found it, I replaced it back on the dock and now the arching of files is gone on both f

  • Reformatting computer- what will happen to iTunes?

    So I have to reformat my hard drive, so I bought an external hard drive and I think I transferred my music to it. I just went through my iTunes and copied and pasted the songs that I don't have on CD onto my external hard drive...will that work? I co

  • How to send bulk email to contacts stored in SharePoint 2010 lists

    How do I send a group email to contacts stored in SP2010 List? I have a very large Customer List with various categories(supervisors, employees..etc). I would like to filter the list(say all supervisors) and send them an email directly from sharepoin

  • How can we Delete the Duplicate AUC or reverse AUC Valueswith out hiting GL

    Hi, we have the Dulicate AUC which are having  Duplicate AUC asset balances.   We have been excluding the AUC assets when we run reports ever since in order to tie out to GL.  It would be best if we can either reverse them out or load some offsetting

  • Crashes on Start Page

    I thought my users would like to try Safari, so I put it on a terminal server. Runs fine as the administrator, crashes on a null pointer as a regular user. Loading "Apple - Start": Safari.exe - Application Error The instruction at '0x6aab55a1" refere