How To Run Process In Background?

Hi,
I'm writing a CORBA Server, and basically, I need to spawn a process in the background. The process is:
tnameserv -ORBInitialPort 1250
I am new to Java, and am not sure how to go about doing this. Any sample code would be appreciated.
Thanks!

You could use a TimerTask - a user friendly way of spawning a Thread.
For example, the class from which you want to spawn a Thread could have the following lines: -
Timer timer = new Timer();
timer.schedule(new MyTimerTask(), 6000, 3000);
...where MyTimerTask is a class you write yourself. It must extend java.util.TimerTask and define a method with the following signature: -
public void run()
The run method should execute the task that you need performing in the separate Thread.
In this example, your main class would call the run() method of MyTimerTask after a delay of 10 minutes (6000 miliis) and would then continue to call it every 5 minutes.
Hope this helps!
Jon

Similar Messages

  • How to Run Jar in Background process

    Hi,
    I am develop one application in java,
    I have some problem in my application,
    whats my problem is, I want to run my jar file
    in system background, that is when i was start the system
    my jar gets ready to run the application,
    Can any one please give some idea to how to run my jar in
    background task and how to start the jar when the system
    start.
    Thanks in advance,
    Regards,
    Ganesh Kumar.L

    Hi
    It has been a while since you asked your question- I hope you still need the solution. Java typically does not support this because it is platform specific. I don't know what operating system you are working on. I assume Windows. There are numerous ways to do this in Windows. The easiest is to copy the program into the startup folder. The directory is: C:\Documents and Settings\All Users\Start Menu\Programs\Startup. Another way, less visible to the user, is to make an entry in the registry. If you place the location of the program as data in a key in HKLM\Software\Microsoft\Windows\Current\Version\Run of the registry, it will start with the system. This is hard to do in Java (for obvious reasons) however it is not impossible. You can use JNI which is really difficult to learn and hard to implement or you can use
    Process p=Runtime.getRunTime().exec({"reg.exe","add HKLM..."});This will execute the Windows utility reg.exe with the arguments provided by the second in the array of Strings. Documentation on reg.exe can be found through the command prompt. There are other ways such as modifying Autoexec.bat however they are less reliable
    Hope I helped

  • How to run MIDlet in background in J2ME?

    Hi Friends,
    I am new guy to J2ME and MotoRazr. I just want to run application in background while other application as normal. I am targeting MotoRazr v3xx, MIDP-2.0 & CLDC-1.0.
    In some post I found that we can use "Backgrounf: True" in JAD file, I tried this but it is not working.
    Can someone will help me?
    Thanks
    From
    [email protected]

    Thanks deep,
    But I really searched in forum .... and now also I am searching. But haven't found any solution.
    I just got some keywords like
    1) pauseApp()
    2) display.setCurrent(null)
    3) PushRegistry
    4) MIDlet without UI
    5) in JAD file "Background: True"
    6) Thread
    Can you tell me which should I use?
    My exactly problem is to Run a process in background which will trap key events while other applications are running.
    What do you do suggest?
    Thanks

  • How to run process flow outside owner project?

    Hi,
    I have two process flows (process_flow_A and process_flow_B) in two different projects (projectA, projectB). Process_flow_A has to be run after process_flow_B is finished. So what I am thinking now is either put process_flow_A in Project B or put process_flow_B in project A. But how to see process flows which are not in it's owner project? Or is there any other ways to do this task?
    thanks.

    It can be done - in a round about way.
    You can call a SQLPlus operator. The operator will call sqlplus_exec_template.sql. You can use this script to call your other process flow in the other project.
    ..owb_home/owb/rtp/sql/sqlplus_exec_template.sql
    If you open up the .sql file, you will see examples of how to use it to call mappings, process flows, etc.
    Hope this helps..

  • How to run process chains

    hi,
    this is sudhakar
    pls any one tell me
    I prepaired process chain
    but i dont know how to start how it run daily automatically
    pls any one give ans
    thanks
    sudhakar

    hi,
       open your process chain -> right click on start process ->  select maintain varient -> select direct scheduling -> goto change selections tab -> select date/time give from when you want to run for eg from today 3.00 PM means in date tab give todays date and in time tab give the time info.  in bottom select periodic jobs check box and click on periodic values tab -> here select daily check and save again check and save again save. now you schedule your job at 3.00PM from today, now you need to release this job, after this settings come to your process chain click on clock symbol to activate and schedule your process chain. so this chain will run at specified time, you can check this in SM37 by giving your user name and released job as job status.
    Regards
    Sankar

  • How to run process chain in day of 20 and 2 every month?

    Dear all,
    I have to run process chain in day of 20 and 2 every month,but the settting of PC just allow Scheduled start every month once
    time.
    Please tell me the way of setting process chain.
    Thanks.

    Hi,
    (1) Create an event in the BW system
    Define a system event (for example SAP_BW_TRIGGER) with Transaction SM62. Lets says it is "EVENTX". Use this even in the Process chain and execute the process chain as repeative job.
    (2) Use the below lines of code in the program for calling a Fucntion which trigeres the event created above . Here in this program you will call the the Below FM if and only id the sy-datum is 20 th or 2nd of the month ( as mentioned by our friend suggested).
    call function 'BP_EVENT_RAISE'
    exporting
    eventid = EVENTX
    exceptions
    bad_eventid = 1
    eventid_does_not_exist = 2
    eventid_missing = 3
    raise_failed = 4
    others = 5.
    endfunction.
    Regards,
    Anil Kumar Sharma .P

  • How to run InDesign in background?

    I mean to make InDesign application invisible while processing my script?    

    Which might be a reason to find a different method than indesign.
    This kind of Policy produces 2 things:
    First: They push Mediumsized companys to work illigal or not with indesign at all if they have some special needs which will be only legal by an indesign server.
    Second: They prohibit some external Developments or releases because it would be illigal tu use it.
    Theres no way to start indesign in Background with its own api (this is not 100% for shure but 95% :-)
    It might be Possible but not by VBA or Java, there are some workarounds with VB and c++ but this is a complete different animal.
    However maybe it would be legal using somekind of passive server. Means a timejob on one Computer working a set of data in some directory or Database down. It would not be a real server since the jobs starting itself on the Workstation and not by command from another application.
    Or Make a script which runs in a loop with a time break. In case 1 you have to make your own Atomic.
    But im really not shure how legal that would be. Anyway how legal the split client and Server in the policies by adobe is another animal too.
    Its hard to determine whats a server whats not in many cases.
    lets say you send the data directly to an automated workstation to work on it - is it an Server?
    if the workstation needs a pressing button thing is it or not? In that case you can use a macro keyboard to do this - is it then a server ?
    again i dont not understand this policies since you cannot start a multhithread on indesing workstation anyway it would be unuseable for real server applications. you cannot make a hing like a webservice because its simply to slow and unstable.
    didnt solve our problems but to be honest, im shure bevore a customer with lets say 8 or 9 employes buys a server for 30k he will work illigal (so are back to my beginning post)
    The Question is if indesign is really needed. today i see many prints going out by pdf... so there could be easier ways
    take a look on some report generators like crystal reports. for many needs absoloutly enough

  • How to run report in background, save output to word or excel

    Hello all,
    I have a huge report that needs to be run in background and I need the report in word. When running in Dialog it takes too long and SAP times out. How do you get something to run in background and have the output in excel. I know you can go into SM37, find the spool and then forward the spool request to a local file, is there an easier way to do it? Maybe setting up some kind of to text printer since the background job always asks for the output printer. Any suggestions?
    Thanks a lot,
    Sergiy

    Hi,
    Please check the article below:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f048c590-31a4-2c10-8599-bd01fabb93d4?quicklink=index&overridelayout=true
    -Vikram

  • How to run process tasks in Xellerate User form sequentially

    I have 2 tasks in the process definition of Xellerate User. One triggers on change in department and the other triggers on manager change. I want the manager task to trigger first and then the department task to run after the values have been updated in the former task. It so happens that always department task is getting triggered first.
    I cannot have task dependency in Xellerate User form. I tried setting the response code in the manager task and have it generate department task. In this case the department task is triggered twice. First time it runs before the manager task. The second time since it is a task to run in the response code of manager task.
    How to make each task run once and have it done sequentially?

    Yes that was my first instinct but I need the old and new values of department and manager. That is possible when I make it a process task.
    Heres what I want to do-
    If there is a change in department of a user, send mail to manager with old and new department values.
    If there is a change in manager when department changes, send mail to old and new manager with old and new department values.

  • How to run RPUBEN62 in background

    We designed our savings plan as an automatic plan and the business process is to have HR run HRBEN0012 to enroll hires every Monday morning.  However, our HR do not want to run this manual process.
    We tried to put RPUBEN62 on background job, but failed because it performs the 'Call screen 2000.' command in the END-OFSELECTION event in include BEN62E01, and this command causes the program to stop processing and the SAP GUI window is closed.
    We contacted SAP support and was told that RPUBEN62 is designed to run foreground, and we just started contacting SAP to see whether we can convince them to offer background run option.
    Any suggestion?  We do not want to clone the program if possible.
    Thanks.

    Sorry was searching for something else and seen this post, kinda old.
    We created a custom copy of   RPUBEN62, and run on a daily basis in the background. It is possible and saves some work for HR by automatically creating the standard plans for all new employees.
    B~

  • How to run threads in background

    hi everyone!
    I need some hints on my problem!
    I have an application with some working threads. When the user minimizes the app the app should go to the system tray and the threads should keep working.
    I already know how to put an icon with popup menu in the systray. Now, how can I run the working threads in background?
    Can anybody help me?
    C u,
    Filipe

    I said that because as far I understood the following code it just creates an icon and popup menu, right?
    So, when the user minimizes the app I need to kill it, create the icon and popup menu and leave the threads working.
    public class SystemTrayDemo extends JFrame
         private static final long serialVersionUID = 1L;
         public SystemTrayDemo()
              JPopupMenu menu = new JPopupMenu("Menu");
              JMenuItem menuItem1 = new JMenuItem("Menu1");
              JMenuItem menuItem2 = new JMenuItem("Menu2");
              JMenuItem menuItem3 = new JMenuItem("Menu3");
              JMenuItem menuItem4 = new JMenuItem("Exit");
              menu.add(menuItem1);
              menu.add(menuItem2);
              menu.add(menuItem3);
              menu.add(menuItem4);
              menuItem4.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent evt) {
                        System.exit(0);
              ImageIcon icon = new ImageIcon("database.png");
              TrayIcon trayIcon = new TrayIcon(icon, "Hello System Tray", menu);
              SystemTray tray = SystemTray.getDefaultSystemTray();
              tray.addTrayIcon(trayIcon);
         public static void main(String[] args)
              try
                   javax.swing.UIManager.setLookAndFeel("com.sun.java.swing. plaf.windows.WindowsLookAndFeel");
              catch(Exception e)
                   System.out.println(e);
              new SystemTrayDemo();
    }}

  • How to run form in Background

    Hi Experts,
    I have created a form and its print program for purchase order. they are assigned to T-code: ME22N through NACE.
    Now i need to run ME22N in both foreground and background.
    If we execute in foreground, it should display the printpreview. for that in ME22N, we have a button for print preview.
    If we execute it in background, it should generate a spool, with out any printpreview. How can we do this....?
    Please some one help me in this regard.
    Thanks in advance.

    In the IMG (SPRO) under materials management -> purchase orders -> messages - > output control -> message types -> define message types
    Set up one message type for print preview.  Set up a different message type for no print preview under fine tuned control.

  • How to run apps in background

    I wish to run an application in the background so that it does not show up in (and take up valuable space on) the dock. How do I do this? I've tried setting the "Hide" check box in the account preferences but the app still shows up in the dock.

    what you can do is click the home key 2 and see if the app is open if not just open it and then lock the ipod

  • How to run oli7bw in background??

    Hi all
    I would like to run the oli7bw transaction in background .
    how to do it?
    thanks in advance,
    Jayashree

    Hi,
    Put the selections in, enter a name for the run, enter a setup date and time for the future.  Click on menu option Program --> execute in background.  It will popup print parameter select the ok button> it will give another pop-up for start time.  You can select immediate and the job will be scheduled immediately in the background, or you can select Date/time and give a date & time it should start.
    Cheers..
    PS: I hope you are in the testing phase and not doing it in the live environment.

  • How to run LSMW  in Background

    Hi friends,
       I need some information. Is it possible to run an LSMW in Background. If so which type of programs we can run in Background which types are not?
    Regards,
    Naren.

    hello all,
    Regarding Session method :
    in  Run Batch Input session, we can use foreground or background.
    Direct input:
    Create Material with transaction „BMV0“
    Go to transaction SE38, choose the program “RMDATIND” and create a variant (direct relation to the run; Exp. Creation of the MRP view. Choose the appropriate entries in the following screen and save the variant.
    Click in the BMV0 on this button   then you get to this screen. Create a entry with you “Variant name” and save it.
    Important: Check in the P-System if you can create a entry in this table!!
    After the definition, choose the button  .
    Check the Job with TA: SM37
    This screen appears if you start the MBV0 from the LSMW
    Just press F8 to continue. You will get to this screen.
    This transaction gives you a Job log, protocol and also the possibility to restart a job in case of errors.
    reg,
    P_sonar

Maybe you are looking for

  • ATG catalog export error in startSQLRepository

    Hi, I want to export the catalog data from atg production. I followed the steps as below. 1. create FakeXADatasource.properties file in C:\ATG\ATG10.1.1\home\localconfig\atg\dynamo\service\jdbc. (There is mysql user named atguser with password atg123

  • Business Configuration in ByD

    Hi, experts,      Business Adaptation Catalog (BAC)      Business Configuration Content(BCC)      Business Configuration Object(BCO)      Business Configuration Set      Business Topic and Business Options      When to use standard BCOs and When to u

  • ITunes 10.7 crashing as soon as it loads

    Hi, Ever since I updated iTunes to the latest update, when it opens it crashes. It seems to be when it is trying to load the store. As it does this straight away I can't do anything in iTunes before it crashes. Tried Reinstalling it - No help OS - Wi

  • How to get videos on visual album to show on iPad

    The videos show on iPhone but NOT iPad. How do I get the video to show on iPad? Also, on iPhone have to leave the phone in portrait. If turn to landscape you can no longer see video. What do I need to "activate" on iPad to see the videos?

  • Cfinput validateAt onSubmit not working

    A bit about the environment:  Laptop running win7(x64), Apache2.2, and CF9.0.1 Developer. I created a simple login form, just asking for an email address and password, to test out form validation, and it worked flawlessly, so i went on to a much larg