Stop() and suspend()

Hi,
stop() and suspend() methods are depricated nd we wont prefer
System.exit(0) ,then how can v stop a thread execution.
thanks

The thread should periodically check a flag that indicates whether that thread should stop or keep going. Roughly something like this: public void run() {
    while (!done()) {
        // do a unit of work
}

Similar Messages

  • Shell script to start, stop and restart a JAR

    Hi everyone,
    Does anyone have idea to write a shell script to start, stop and restart a JAR under linux? it can indicate a method or parameter? Thanks!
    this JAR inculdes a class with main method like this:
    public class Client(){
      public Client(String name){
      public void stopClient(){
      public static void main(String[] args){
         new Client("/tmp/text.log");
    }

    Does anyone have idea to write a shell script to
    start, stop and restart a JAR under linux? That part isn't really clear.
    Start would be java -jar myjar.jar.
    Stop could either be kill, which kills the whole process; kill -TSTP, which suspends the process, or some application-specific communication such as sending something over a port; or putting something into a file or something.
    Restart could just be the same as start (if stop is just kill); kill -CONT, if stop was kill -TSTP; or some other app-specific communication.

  • Shell script to start, stop and restart a JAR under linux

    Hi everyone,
    Does anyone have idea to write a shell script to start, stop and restart a JAR under linux? it can also indicate a method or parameter? Thanks!
    this JAR inculdes a class with main method like this:
    public class Client(){
    public Client(String name){
    public void stopClient(){
    public static void main(String[] args){
    new Client("/tmp/text.log");
    }

    Does anyone have idea to write a shell script to
    start, stop and restart a JAR under linux? That part isn't really clear.
    Start would be java -jar myjar.jar.
    Stop could either be kill, which kills the whole process; kill -TSTP, which suspends the process, or some application-specific communication such as sending something over a port; or putting something into a file or something.
    Restart could just be the same as start (if stop is just kill); kill -CONT, if stop was kill -TSTP; or some other app-specific communication.

  • Stop and re-start JCo Idoc Server

    Hi
    I created a JCO IDoc server (using the JCoIDocServer class) , so far it works fine for me to send and receive IDocs to R/3. The only issue is when I try to start and stop the JCO Idoc server at runtime. When I call the Stop method(). It seems like the service is stopped but if i call a Start method after that( even on a completely new class instance) I'm getting a nullpointer exception. I have seen documents on JCOServer says that use suspend method for stop the server, but this is not available for the JCoIDocServer class. How can I stop a server which is running, programaticalluy and restart it again ? (I dont mind if I have to reinstantiate the whole server class) . I use JCO and  IDoc libaray version 3.0 . Please help
    Thanks

    Hi,
    Try using the abort() after your stop in a "if" condition. You need to provide a message as a parameter for the abort() method, so that the remote SAP System (in case the IDoc Server is still connected to it) knows the reason why the IDoc server shutdown without any warning.
    So your code should look something like this (warning pseudo-code ) -
    server.stop();
    if(server.alive())
           server.abort("Forcing shutdown because its wakey wakey eggs and beccy time!");
    Try logging the status of the server after the stop() and abort() methods to know what the server is doing. I hate people using the suspend() method to "stop" the server, because it does not stop the server. It only suspends operations, so your connection and session to the remote SAP System remains open.
    After the time out (can be hours) on the remote System, the connection is closed, but until then, the remote SAP System keeps expecting your server to talk back to it. Open sessions are of course more dangerous than runaway trains, so avoid the suspend() method if you can.
    T00th
    Edited by: Sameer Jagirdar on Jan 21, 2010 1:14 PM --> fixed the code display thingy.
    Edited by: Sameer Jagirdar on Jan 21, 2010 1:15 PM

  • Hmph. (Jumpy) Touchpad issues and Suspend idiosyncrasies.

    (I'll try not to turn this into a novel, but I guess when I have a problem it just happens that I naturally try to describe everything that goes on for full disclosure.  Bear with me.)
    I just got a hold of an older laptop, a Dell Latitude C640, and to my dismay setting up Linux on it hasn't been the walk in the park I'd hoped it'd be.  I read a bunch of articles about Linux on this machine before I got it and most seemed to have a pretty easy time of everything.  Of course this might be because the laptop is quite a few years old and older Linux kernels acted different ways, but I guess I assumed that things would be even easier using a modern distro.
    The Touchpad
    It worked fine on the install of Windows XP that came installed on it, with no problems at all.  Before installing any flavor of Linux I ran Knoppix on it just kind of to make sure things would go OK.  It was a little dated, being Knoppix 5.10, but I figured it'd do for my purposes.
    The first time I booted it seemed to work OK, with the mouse cursor behaving mostly as it should, with a little lag.  I've used this same Knoppix disk on another laptop and it did much the same thing.  After another boot, however, I saw that things weren't going to be so easy.  The cursor immediately drifted off into one of the screen's corners (it didn't seem to care much which one it was in, as long as it was in one) and would refuse to come out.  I could move the cursor a little ways off of the edge of the screen, but not far enough to click anything, and it would immediately go back as soon as I released my finger.  So I tried a few other disks.  First I tried a CD I have for Crunchbang Linux (just a minimalist, Openbox-based Ubuntu flavor), and then Knoppix 4.  Both gave very similar results.  Crunchbang let me have a little bit more control over the cursor for a little while after booting, maybe for about a minute, and then the same behavior cropped up.  I only booted with Knoppix 4 once, but it was pretty much the same deal.
    I started reading up on what might be going on and came across a thread on the Linux Mint forums that seemed to be describing an issue very close to mine (though mine is completely unrelated to the AC adapter and persists whether it's plugged in or not).  Someone in the thread suggested it was a kernel issue, since it's definitely not a hardware issue, so I then booted into a copy of DSL I had lying around, which uses the 2.4 kernel.  Sure enough everything worked without problems.  This caused me to believe, going by some of the conclusions from the Lnux Mint thread and apparently mistakenly, that the issue may have been with the 2.6 Debian kernels, so I figured I'd just get Arch installed and see how things went.
    After getting X set up and working properly I saw that the issue was going to be much the same.  To get around the cursor being dragged into the corner against my will I found out that if I ran without HAL or that if I disabled hot-plugging I could use the touchpad, although not flawlessly.  Here's xorg.conf:
    Section "ServerLayout"
    Identifier "Xorg"
    Screen 0 "Default" 0 0
    InputDevice "Touchpad" "CorePointer"
    # InputDevice "USB Mouse" "SendCoreEvents"
    EndSection
    Section "ServerFlags"
    Option "AllowMouseOpenFail" "true"
    Option "AutoAddDevices" "false"
    EndSection
    Section "Module"
    Load "glx"
    Load "dri"
    Load "drm"
    Load "synaptics"
    EndSection
    Section "InputDevice"
    Identifier "Touchpad"
    Driver "synaptics"
    Option "SHMConfig" "true"
    Option "AlwaysCore" "true"
    Option "MinSpeed" "0.05"
    Option "MaxSpeed" "0.40"
    Option "TapButton1" "1"
    Option "TapButton2" "2"
    Option "FastTaps" "1"
    Option "VertEdgeScroll" "true"
    Option "HorizEdgeScroll" "true"
    Option "Emulate3Buttons" "true"
    EndSection
    #Section "InputDevice"
    # Identifier "USB Mouse"
    # Driver "evdev"
    # Option "SendCoreEvents" "true"
    #EndSection
    Section "Monitor"
    Identifier "LCD"
    EndSection
    Section "Device"
    Identifier "Radeon Mobility 7500"
    Driver "radeon"
    EndSection
    Section "Screen"
    Identifier "Default"
    Device "Radeon Mobility 7500"
    Monitor "LCD"
    DefaultColorDepth 24
    SubSection "Display"
    Depth 24
    Modes "1024x768" "800x600" "640x480"
    EndSubSection
    EndSection
    Section "DRI"
    Group "video"
    Mode 0666
    EndSection
    The "AutoAddDevice" option is the only thing that seems to make any difference in usability at all; without it I can't use the touchpad at all, and with it I can, but to varying degrees.  I've found that right after I boot up everything seems to work exactly how it's supposed to, but shortly after, sometimes 15 seconds, sometimes many minutes, things seem to get kind of unresponsive.  The cursor will go where I want it to go, but it jumps around and does it very slowly.  The mouse buttons also get very unresponsive.  Right click is especially bad, and I often have to hold down the button just to get it to do what I want, but left click is very bad too, requiring me to push the button down for almost a full second, sometimes several times.  Taps on the pad, after things go wrong, also stop being recognized, forcing me to use the buttons (which I'm OK with).  It's usable, but the behavior is not ideal whatsoever—it's rather annoying.
    The most aggravating thing, I think, is that I can't seem to find anyone else using this same model that has this issue.  The latest I've seen is from January: An Ubuntu (8.10) user reports no issues and is very pleased (see comments at the bottom of the page).
    Suspend (both to disk and RAM)
    I actually did install the latest Crunchbang (9.04.01, the 32-bit "Lite" edition) first to see if anything would clear up by installing it rather than running the live CD, but I only had it installed for a few hours.  I didn't really get into messing with xorg.conf that much yet, only really touching "FingerLow" and "FingerHigh" settings, so the touchpad issue was still nagging me.  I did play around a bit though and found out that suspend to RAM and suspend to disk worked pretty much from the go, only requiring that I installed uswsusp.  Issuing a simple "sudo pm-suspend" or "sudo pm-hiberate" put the computer to sleep and it woke back up without any issue at all.
    But suspend on Arch is proving to be a pain in the neck.  Suspend to RAM simply will not work; the computer shuts down but will not resume, leaving me only a blank screen with an unresponsive keyboard.  Suspend to disk works (using hibernate-script as pm-hibernate doesn't seem to do anything at all), but it works very poorly; both suspending and resuming take a very, very long time—so long, in fact, that I'm just better off shutting down and restarting normally, since the boot time is better.  I don't know what accounts for the drastic difference in distros, and this isn't the first experience I've had with suspension working on Ubuntu but not on Arch.  What is different in the Ubuntu implementation of pm-utils than the Arch way?  Is it the Ubuntu kernel?  Is there any way to implement the Ubuntu way with Arch (because, after all, I'd prefer to use Arch)?
    I'm considering installing Crunchbang once again if I can't get things to work the way I want them to in the next few days on Arch.  And, if I can't make the touchpad work in a satisfactory manner on Cruchbang, I might just have to reinstall Windows.  I don't want to do that.

    At least for the moment I've given up and reinstalled Windows XP, but I'm still kind of looking for solutions.  Suspend and hibernate are things I find to be somewhat important, but secondary to the touchpad issues, so I'm focusing on those.
    Out of curiosity today I test out pretty much every live CD I have in the house.  I found an old Ubuntu CD for 6.06 (Dapper) and had a little bit of luck with it.  By default pretty much every live CD configures Xorg to use an additional mouse that isn't present; to fix this I edited the "ServerLayout" section xorg.conf to only use the touchpad.  With this old Ubuntu CD, this achieved the desired result (mostly).  The touchpad worked how it ought to with no lag, but a few features were not implemented.
    Ubuntu 6.06 used the 0.4.3 version of the synaptics driver; newer Linux distros usually use 0.99 and above.  I tried my Knoppix 5.1 CD again, editing xorg.conf again to reflect the absence of an external mouse, but I did not get the behavior I was hoping for.  When I checked I found out that Knoppix 5.1 came with the 0.14.6 version of the synaptics driver.
    Turns out that 0.14.5 was something of a turning point for the driver.
    Makefile support for Xorg 7.0 has been added.
    Two-finger scrolling and pressure dependent motion
    speed have been implemented. A new parameter has
    been added to give greater control over tap
    behavior.
    (http://freshmeat.net/projects/synaptics/releases/228794)
    I suspect that the problem is coming from the addition of the "pressure dependent motion speed."  I don't know what options control this to toy with them.
    However, I'm not so sure.  This sounds like it would be something that would toy with my mind, making me think I'm experiencing "mouse lag" when certain options are really just conflicting, but as I had to point out again on another forum on which I posted this same thread, when using Arch (and the most recent synaptics driver) things started out fine and only after a little while, sometimes less than a minute, sometimes many, would things start to act up.  Either some progress is being made to resolve this problem with the latest releases, or something is going wrong internally that I do not understand.  I just cannot understand why, with the newest drivers, it's only after some use that the problem kicks in while when using all others the problems are immediate.

  • Transporting a business function: lock out users and suspend batch?

    Hi gurus,
    SAP advises in help.sap.com to lock out all users and suspend batch jobs before activating a business function in development.  I did that in development, activated the business function, and saved it to a transport.  Does the same recommendation to lock out users and suspend batch jobs hold true in the QA and Production systems when the transport is moved in? ... or is it ok to transport it during a time when there is user and batch activity going on?
    Warm Regards,
    CM

    You do have to lock out users and suspend batch, even using a transport.  There is a pdf called
    SAP Enhancement Packages Selecting and Activating Business Functions,  In it, it says to lock out users and stop batch activity in all systems,

  • All my purchased song from iTunes are not playing complete (iPod and computer with Windows Vista), unexpectedly stops and continues with next song. What am I doing wrong?

    All my purchased song from iTunes are not playing complete (iPod and computer with Windows Vista), unexpectedly stops and continues with next song. What am I doing wrong?

    Are the songs playing whole in iTunes? if not download them again.
    else read this Apple Support Article on your problem
    Have a nice day!

  • Order of stop and start of reporting services

    Hi All,
    I am using 11.1.1.3 version in my laptop,i want know the correct order of stop and start the services,please help me on this.
    Thanks
    Hypuser

    The full order list can be found at :- http://download.oracle.com/docs/cd/E12825_01/epm.111/epm_install/ch05s02.html
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • In Flex 3 how to Stop and Replay .swf animation created in Flash

    Hi
    I have an animation file that is created in Flash (I think
    CS3). In Flex if I import it inside a SWFLoader or if I import it
    as an Image. It plays once and stops. Then I can not replay it. I
    also can not pause it when its playing.
    I have tried few things based on help and code available in
    the Web to of no help. I have tried to convert the swfLoader
    instance to a movie clip like so to stop
    var c:MovieClip = swfLoaderHeaddress1.content as MovieClip;
    c.stop();
    <mx:SWFLoader x="53" y="116" width="206" height="255.3"
    visible="true"
    source="assets/animations/curatorial/ZoomHeadress_2nd.swf"
    id="swfLoaderHeaddress1"/>
    It does not work.
    I have not created the .swf animation, I am not sure how it
    is done. I belive it may not be using any ActionScript as I know
    the artist who created it does not know ActionScript. Does
    something need to be done inside the Flash to support the stop and
    play? Or is there a way to restart/replay stop a .swf animation in
    Flex 3 no matter how (and whether or not its developed using
    ActionScript) its developed in Flash?

    One way is she has to add some AS code to the animation, or
    you can do it yourself.
    In swf there must be something like this:
    var connReciever:LocalConnection = new LocalConnection();
    connReciever.client = this;
    connReciever.connect("fromFlexToSWF");
    function myFunction(parameter:SomeClass):void {...}
    And in Flex:
    var connSender:LocalConnection = new LocalConnection();
    connSender.send("fromFlexToSWF", "myFunction", [..args]);
    The other way: in case with just play/stop there is a way to
    resolve this by using that Flex Component Kit (or maybe "Flex Skin
    Design Extension", i do not remember), it is something like she
    just adding labels to animation frames then she exports it with
    Flex Kit and then you can work with it like with an object with
    "states".

  • My apps won't download to my iPad but will to my phone. When I put it my password, it just stops and won't do anything else????

    My apps won't download to my iPad but will to my phone. When I put it my password, it just stops and won't do anything else????

    Unless you have a copy of the iPod backup file from the previous computer installation you are out of luck. If yo have that file move it to your computer and restore the iPod from that backup.  Otherwise, you will have to restore the iPod to factoery defaults/new iPod and lose all your app date. That is the way it is since the iPod sees the computer as a new computer/iTunes library.  That backup file is located:
    Mac: ~/Library/Application Support/MobileSync/Backup/
    Windows XP: \Documents and Settings\(username)\Application Data\Apple Computer\MobileSync\Backup\
    Windows Vista and Windows 7: \Users\(username)\AppData\Roaming\Apple Computer\MobileSync\Backup\

  • When I try to buy any app or song from iTunes app or app store on iPhone 5 it seems to start the stops and goes back to baseline in a second or two

    When I try to buy any app or song from iTunes app or app store on iPhone 5 it seems to start the stops and goes back to baseline in a second or two.
    It did it with my old iPhone 4 in last month or so, and it I hoped it would go once I updated to new iPhone 5. The problem has transferred to new phone too.
    I can't sign in to iTunes account on iPhone. It takes the password then resets to baseline. No error message comes up. On the base computer (pc) it will allow me to sign up and buy songs, apps etc. I can then sync the phone and put them on it. It just won't let me buy direct from the .
    As there are no error messages I am at a loss what to do. I have updated the payment details on my account, and my husband has an iPhone 4 and has no such problems. We share the same wifi. I have tried with 3G as well as wifi, with no luck.
    I am pretty much out of ideas, and have tried searching forums but there is so much overlap between queries that I can't find a similar problem from someone else, but I am sure it exists!
    Can anyone please help me?
    Thanks in advance
    Sarah

    I figured it out!
    I read a solution for something that sounded similar.
    Anyone in similar position:
    Open iTunes app on iPhone, and pick an option from bottom, such as music. Then scroll down to bottom of page and where your iTunes ID is, press on it, and pick sign out.
    Then return to home screen, and double press home button and press and hold on first icon showing, until a minus symbol appears in the top left of icons present. Press on each minus symbol on each app in turn, until all app icons have disappeared. Then Restart the phone by pressing and hold the home button and the on/off/standby button at top of phone, until the apple symbol appears in centre of blank screen.
    Swipe to turn phone fully on and open settings and scroll down to iTunes and apps option and tap that. Pick sign in and put in your apple ID, it will accept it and then return to home screen and open iTunes a you'll find it works fine
    Simple really, but some like me won't think f this themselves!
    Hope that helps

  • HT1414 i have the 1st iPad. Can it be updated to iOS 6.0.1?  If not how to fix-when on the internet sometimes it will just stop and go to the apps screen.

    i have the 1st iPad. Can it be updated to iOS 6.0.1?  If not how to fix-when on the internet sometimes it will just stop and go to the apps screen.

    svargaswp wrote:
    i have the 1st iPad. Can it be updated to iOS 6.0.1?  ...
    No.
    iOS 5.1.1 is the lastest for the iPad 1.
    svargaswp wrote:
    ... how to fix-when on the internet sometimes it will just stop and go to the apps screen.
    Try This...
    Close All Open Apps...  Sign Out of your Account... Perform a Reset... Try again...
    Reset  ( No Data will be Lost )
    Press and hold the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears. Release the Buttons.
    http://support.apple.com/kb/ht1430
    Note:
    Also consider Deleting any Apps you have Purchased / Downloaded but you now never use..
    If necessary...
    Connect to iTunes on the computer you usually Sync with and “ Restore “...
    http://support.apple.com/kb/HT1414

  • Music skips and stops and starts

    Hello, we have just got a nano to replace a 3rd gen iPod.
    I have around 50 gigs of music on a lacie USB drive, and the music plays flawlessly from here in iTunes.
    However once imported into the nano, there is distortion, jumps and clicks in the music and sometimes the song will just stop and start from the beginning.
    Any ideas?

    Gary,
    You chould check out this thread we have going.
    http://discussions.apple.com/thread.jspa?threadID=356911&tstart=0
    Toshiba Satellite P25-609   Windows XP Pro   Media Center Edition iPod Nano 2G (as black as my cold, dead heart)

  • I get error 8062 when trying to copy files from one external hard drive to another. It starts out copying files, but after 10 minutes or so it stops and I get the error 8062. The hard drive tech support says the problem is in my Macbook Air.

    I cannot copy my doc and photos and videos from one external hard drive to a second external hard drive -- both plugged in to my MacBook Air -- I get Error 8062 and the copying (which seemed to be going on for 10 minutes) stops and nothing gets copied.
    As any Macbook Air owner knows, there is SO LITTLE storage capacity on the computer that you have to back up big files onto an external hard drive to avoid getting the other annoying error that says you have no more memory/storage capacity/whatever the proper term is, and you cannot use the computer.
    Backstory: Before this error cropped up, I had backed up lots of files to an external drive and then removed them from my computer. But then the external hard drive got corrupted and I could not access my entire photo library. Had to pay $850 to Kroll Ontrack to recover those files. I have now bought 2 new external 1 Terrabyte  hard drives as protection against another such disaster. BUT I cannot copy the files from the first hard drive where all my reovered files now sit, to another backup hard drive.
    Feeling vulnerable. Please help.
    SusaninNY

    From the menu bar, select
     ▹ System Preferences ▹ Energy Saver ▹ Power Adapter
    and uncheck the box labeled Put the hard disk(s) to sleep when possible, if it's checked.
    If the drive has more than one interface (USB, FireWire, Thunderbolt, eSATA), try one of the other interfaces.
    Check that the data cable is securely inserted at both ends.
    Try a different cable.
    If you're connecting the drive through a hub, connect it directly to a built-in port on the Mac.
    If you're connecting it directly, try a different port.
    Disconnect all other devices on the bus, or as many as possible.
    Test the drive with another Mac. Test another drive with this Mac.
    If the drive is bus-powered, but has an AC adapter, connect the adapter.
    Start up in Safe Mode and test.
    If the drive doesn't work under any of the above conditions, and if another drive does work with the same Mac, then the drive has failed. You may be able to salvage the mechanism by removing it from the enclosure and installing it in another one, or in a drive dock.

  • Firefox 4 freezes after i open it (keeps loading the page non-stop and i cant click or do anything

    firefox 4 freezes after i open it (keeps loading the page non-stop and i cant click or do anything, plus there is no option to report an error so i cant even get this checked and this seems to be the case on 3 different computers i use all have windows 7 32bit.

    Hello,
    Certain Firefox problems can be solved by performing a ''Clean reinstall''. This means you remove Firefox program files and then reinstall Firefox. Please follow these steps:
    '''Note:''' You might want to print these steps or view them in another browser.
    #Download the latest Desktop version of Firefox from http://www.mozilla.org and save the setup file to your computer.
    #After the download finishes, close all Firefox windows (click Exit from the Firefox or File menu).
    #Delete the Firefox installation folder, which is located in one of these locations, by default:
    #*'''Windows:'''
    #**C:\Program Files\Mozilla Firefox
    #**C:\Program Files (x86)\Mozilla Firefox
    #*'''Mac:''' Delete Firefox from the Applications folder.
    #*'''Linux:''' If you installed Firefox with the distro-based package manager, you should use the same way to uninstall it - see [[Installing Firefox on Linux]]. If you downloaded and installed the binary package from the [http://www.mozilla.org/firefox#desktop Firefox download page], simply remove the folder ''firefox'' in your home directory.
    #Now, go ahead and reinstall Firefox:
    ##Double-click the downloaded installation file and go through the steps of the installation wizard.
    ##Once the wizard is finished, choose to directly open Firefox after clicking the Finish button.
    Please report back to see if this helped you!
    Thank you.

Maybe you are looking for

  • My Multi Room DVR has stopped working on ONE BOX ONLY

    I have spent roughly 1 1/2 hours on the phone with tech support and would rather not continue that.  I have an 3 HD STB's in my house and 1 HD DVR.  For as long as I have had the service all the boxes could access the multi room dvr.  On Sunday I cou

  • Distinguish b/w Automatically created Info Record and created thru ME11

    Hi, How can we distinguish between Automatically created Info Record and manually created Info Record (By User through ME11 transaction). Where we can see the difference??? Plz guide...

  • How to convert a string to hex in TestStand

    Hi everyone, I think this is a fairly easy question to answer but I am newer to TestStand. In one step I am pulling in the Serial Number of a Device (which is alpha and numeric characters) and storing it as a String Local called Local.SerialNumberStr

  • Please recommend a UML design tool

    Apart from the obvious - Rational Rose and TogetherSoft - can anyone recommend a [cheaper] UML design tool that can generate UML class diagrams for existing Java classes (including EJBs) - as opposed to the usual generation of code from the diagrams?

  • Problem with gantt chart displaying - Apex4.2

    Hi I'm using Apex 4.2 on localhost and I have got three tables: employee, engineer, dates -> engineer table is a specification of employee table, that means in employee you can find also the names of the engineers. Engineer only has an additional att