How can I execute a method on a specified time?

How can I execute a method on a specified time such as method1() will be executed on 1:00 p.m and the method2() will be executed in 1:00 a.m?

BilgeTonyukuk99 wrote:
How can I execute a method on a specified time such as method1() will be executed on 1:00 p.m and the method2() will be executed in 1:00 a.m?As a simple example, take a look at http://www.javapractices.com/topic/TopicAction.do?Id=54.
As an alternative (and looks like better approach), you could use the ScheduledThreadPoolExecutor.

Similar Messages

  • How can I send an email at a specified time?

    I want to be able to send an email to someone at a specific time. How can I do this? I'm sure I can do this with Entourage, but Mail doesn't seem to have this facility. Ie, I want to send someone a reminder, on Monday, but I want to be able to set this up now, in case I forget. Why doesn't Mail seem to have this quite basic facility? Anyone got any ideas?

    Save as an application, and then set iCal to run that application at a given time (as an alarm).
    Of course, the downside to this is that your mail message is set in the compiled Application, which is where a script like the one in the previous post comes in handy (it will basically be the same mechanism, but slightly more elaborate to be able to specify a message, etc.).
    I completely agree with you - this sort of functionality would be best rolled into Mail itself (maybe with a separate function called "Send At...") but then again you sacrifice simplicity for extra buttons. It's a double-edged sword.

  • How can I disarm the counter in a specified time?

    I am using 6602 counter. I use 2 counters to perform "Buffered Period Measurement ". I use internal time base (20MHz) as the SOURCE, and wire the signal to the Gate. The counters are triggered by a trigger signal.
    Now I just want to stop counting the signal in a specified time after the counters triggered. After that time, even the input signal is still running,the counting must be stopped. How can I implement this purpose? I don't know how to disarm the counter when the counter are still running, and how to exactly determinate the stop time.
    Thanks for any advise. I have attach my present routine here.
    Attachments:
    counters.vi ‏192 KB

    Just to expand a bit on Justin's answer to outline a few particulars.
    You mentioned using 2 counters to capture buffered periods so I'm assuming that you'll enable triggering to guarantee that they both have the same start time. Note that in this scheme, element #0 of your array of buffered periods will represent the time from the Trigger edge until the first Gate edge.
    Since your description made it sound acceptable to ignore pulse periods occurring later than the interval of interest, perhaps you can collect data for a little longer than necessary, then reset the counters and trim off the periods that came in "too late" using 'Array Subset.' A quick-and-dirty way is to loop over each array of periods, performing a cumulative sum until it exceeds the specified data collection time interval. That'll tell you the length of the subset you need to keep.
    The hard part is that after starting the measurement, you'll need to poll task attributes/properties to determine when the trigger has been received. Only after that's been determined would you start keeping track of approximate time in software.
    There are ways to do the timing in hardware if you get more of the 6602's counters involved. Here's one way:
    1. First configure your 2 counters for buffered period measurement. However, instead of using the internal timebase for a Source, use another counter's output as a Source. Under DAQmx, the internal routing details are handled for you; under traditional NI-DAQ, you'll need to make explicit routing via RTSI.
    Note that in this scheme, these 2 counters don't need to be triggered.
    2. Next, generate a finite-duration pulse train at 20 MHz (examples can be readily found under LabVIEW help or this website). This pulse train should last for your data collection time interval, and will act as the Source signal for your period measurements. It is important that the period-measuring counters are started before the finite pulse train.
    The finite pulse train uses 2 counters -- one to generate the output pulse train at 20 MHz and a "helper" that produces a single pulse whose duration equals your data collection interval time.
    If you need to synchronize to some external trigger signal, you can set the "helper" counter to be triggered, but there'll be one subtle catch. The first period measurement in your buffers will not include the time from the external trigger signal until the beginning of the single "helper" pulse, i.e., the "delay" time spec for the pulse. You can either make this very very short and ignore it, or make it any convenient duration and then add it to the first period measurements. Be careful though: the timebase for this "delay" time isn't necessarily the same as the timebase used to measure periods.
    There's quite a bit of complication there, so let me suggest an easier way that assumes no need to synchronize to an external trigger. (I'll use DAQmx terminology, since the traditional NI-DAQ would get complicated again with explicit RTSI signal routing.)
    A. As describe in #1 above, configure your period-measuring counters to use a 3rd counter's output as the timing source terminal.
    B. After starting your 2 period-measuring counters, start up the 3rd counter to generate a continuous 20 MHz pulse train.
    C. After the 3rd counter starts, call the 'Wait (ms)' function from the Time & Dialog palette. Wait for slightly longer than your desired collection time.
    D. Read all buffered periods from the counters. You may need to first query each to find out how many are waiting to be read.
    E. Reset all 3 counters.
    F. Do the cumulative sum work on the two buffered period arrays to determine where each should be truncated.
    Note that step "C" above will leave you stuck while data is being collected. A small variation would be to read a reference time ("Tick Count (ms)") right after starting your 20 MHz counter, then set up a loop that allows you to terminate early (logical OR of, say, "abort" button, data acq error cluster error, and time comparison). In that loop, you put a delay of maybe 50-200 msec using "Wait (ms)."
    "Wait (ms)" will output a tick count from which you subtract the reference time. When the difference exceeds your data collection time, you can exit the loop and continue with step D above.
    -Kevin P.

  • How can i execute ejb method in a servlet?

    hi
    I am using a IBM HTTP Server and Weblogic Server.
    I could execute below source in a main method of application but i could not that in a init method of servlet because of ClassCastException.
    (a classpath of weblogic contains client's classpath)
    // source code
    Hashtable props = new Hashtable();
    props.pu(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    props.put(Context.PROVIDER_URL,
    "t3://192.168.1.5:7001");
    Context ctx = new InitialContext(props);
    Object obj = ctx.lookup("session.LigerSessionHome");
    LigerSessionHome home = (LigerSessionHome) PortableRemoteObject.narrow (obj, LigerSessionHome.class);
    // error code
    Exception : session.LigerSessionBeanHomeImpl_ServiceStub
    java.lang.ClassCastException: session.LigerSessionBeanHomeImpl_ServiceStub
    at com.ibm.rmi.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:253)
    at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:136)
    at credit.getCreditResearch(credit.java:41)
    at creditResearchClient.doGet(creditResearchClient.java:122)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
    thanks

    Have your stubs somehow got out of sync? So that your Servlet engine is pointing to a different jar than that of your jvm on which you were running your client application
    hi
    I am using a IBM HTTP Server and Weblogic Server.
    I could execute below source in a main method of
    application but i could not that in a init method of
    servlet because of ClassCastException.
    (a classpath of weblogic contains client's classpath)
    // source code
    Hashtable props = new Hashtable();
    props.pu(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    props.put(Context.PROVIDER_URL,
    "t3://192.168.1.5:7001");
    Context ctx = new InitialContext(props);
    Object obj = ctx.lookup("session.LigerSessionHome");
    LigerSessionHome home = (LigerSessionHome)
    PortableRemoteObject.narrow (obj,
    LigerSessionHome.class);
    // error code
    Exception :
    session.LigerSessionBeanHomeImpl_ServiceStub
    java.lang.ClassCastException:
    session.LigerSessionBeanHomeImpl_ServiceStub
    at
    com.ibm.rmi.javax.rmi.PortableRemoteObject.narrow(Porta
    leRemoteObject.java:253)
    at
    javax.rmi.PortableRemoteObject.narrow(PortableRemoteObj
    ct.java:136)
    at credit.getCreditResearch(credit.java:41)
    at
    creditResearchClient.doGet(creditResearchClient.java:12
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java
    740)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java
    865)
    thanks

  • How can I execute method of Component for name

    Hello,
    My program has JInternalFrame with some components. Write me please - how can I execute method of Component for name of Component ?
    Like this:
    ... findObject("jTextArea1").cut();
    Thank you in advance.

    just cycle through the container's components until
    you find one where getName equals "jTextArea1"Thank you for your answer.
    I'm creating components in runtime (I add panel+JTextArea in JTabbedPane) and I don't know how many components will be in JTabbedPane.
    I know only it's names.
    I wan't to execute metod JTextaRea_n_.cut() via using JTextaRea_n_.Name.
    How ?

  • How can I create a method with throws  instruction

    Hello Everybody!
    How can I create this method inside WebDynpro.
    I enter "throws CloneNotSupportedException" manually an it removes always.
    What is wrong ?
    public java.lang.Object clone( ) throws CloneNotSupportedException{
        //@@begin clone()
         __Tdag__Is_Charactconfig that= (__Tdag__Is_Charactconfig)super.clone();
           return that;
        //@@end
    Regards
    sas

    I only checked in my 7.1 IDE and there this section exists.
    If it does not exist in your IDE, just create the method manually in the //@@begin others ... //@@end user-coding-area at the end of the controller class. This solves the issue for methods that are called from inside the controller. For public methods to be called from other controllers, this will not help.
    Armin

  • How can I execute a Procedure with OUT variable is %ROWTYPE on SQL Prompt

    Hi,
    I have a procedure with OUT variable is %ROWTYPE
    How can I execute the following procedure on SQL prompt.
    (without creating anonymous block)
    CREATE OR REPLACE PROCEDURE zz_sp_EMP(VEMPNO IN EMP.EMPNO%TYPE,
    V_REC IN OUT EMP%ROWTYPE)
    AS
    BEGIN
    SELECT * INTO V_REC FROM EMP WHERE EMPNO = VEMPNO;
    END;
    Thanks & Regards,
    Naresh

    as previous posters said: it's not possible to do this without declaring a variable in the anonymous block.
    With anonymous block it would look like this (had to change it a bit, since i'm using hr-schema on oracle XE):
    declare
    l_rec EMPLOYEES%ROWTYPE;
    begin
    zz_sp_EMP(VEMPNO => 100, V_REC => l_rec);
    DBMS_OUTPUT.PUT_LINE ( 'first_name = ' || l_rec.first_name );
    DBMS_OUTPUT.PUT_LINE ( 'last_name = ' || l_rec.last_name );
    end;
    first_name = Steven
    last_name = King

  • How can i execute vb scripts in java program

    hi
    how can i execute any batch files or any other exe files (vb scripts) from java programs
    thanks

    Hi,
    You use Runtime.exec to execute commands / exe-files. See the documentation (and remember that it will only work on windows):
    http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Runtime.html
    /Kaj

  • How can I execute Stored Procedures in PARALLEL and DYNAMICALLY ?

    Hi 
    I have a stored procedure. It can be executed like this
    exec test @p = 1;
    exec test @p = 2
    exec test @p = n;
    n can be hundred.
    I want the sp being executed in parallel, not sequence. It means the 3 examples above can be run at the same time.
    If I know the number in advance, say 3, I can create 3 different Execution SQL Tasks. They can be run in parallel.
    However, the n is not static. It is coming from a table. 
    How can I execute Stored Procedures in PARALLEL and DYNAMICALLY ?
    I think about using script task. In the script, I get the value of n, and the list of p, from the table, then running a loop with. In the loop, I create a threat and in the threat, I execute the sp like : exec test @p = p. So the exec test may
    be run parallel. But I am not sure if it works.
    Any idea is really appreciated.

    Hi nam_man,
    According to your description, you want to call stored procedures in parallel, right?
    In SSIS, we can create separate jobs with different stored procedures, then set the same schedule to kick the jobs off at the same time. In this way, we should be careful to monitor blocking and deadlocking depending on what the jobs are doing.
    We can also put all stored procedures in SSIS Sequence container, then they will be run in parallel.
    For more information about SSIS job and Sequence container, please refer to the following documents:
    http://www.mssqltips.com/sqlservertutorial/220/scheduling-ssis-packages-with-sql-server-agent/
    https://msdn.microsoft.com/en-us/library/ms139855(v=sql.110).aspx
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu
    Wendy Fu
    TechNet Community Support

  • How can I execute program after using F4_Filename function?

    Hi all,
    I'm a new user on the forum. I've been working with ABAP and SAP for a few weeks. I wrote a program for importing data from excel file to SAP using BDC. During searching this forum I found information about F4_Filename function which allows users to browse the disc for a file. I'd like to add this function to my program. I have a parameter for a file name but this is an ordinary static string field. When I added the code which I found in the message on this forum the rest of program doesn't execute.
    This is simple program for example:
    REPORT  Z_TEST8_AB.
    DATA f_name TYPE STRING.
    PARAMETERS p_file like rlgrap-filename DEFAULT 'c:\test.xls'.
    f_name = p_file.
    write:/ f_name.
    This program works correctly. There is a field for parameter. I can change the default name for a file.
    After all, I can run the program (F8) and rest of the code is executed. The field for parameter dissapears from the screen and the file name is displayed. ( command write)
    Now I added a function F4_Filename
    REPORT  Z_TEST8_AB.
    DATA f_name TYPE STRING.
    PARAMETERS p_file like rlgrap-filename DEFAULT 'c:\test.xls'.
    at selection-screen on value-request for p_file.
      call function 'F4_FILENAME'
           exporting
                program_name  = syst-repid
                dynpro_number = syst-dynnr
                field_name    = 'p_file'
           importing
                file_name     = p_file.
    f_name = p_file.
    write:/ f_name.
    I can browse a computer for a file now but after selecting the file I can't run the rest of the code. When I click on the icon or press key F8 the field for parameter doesn't dissapier and the command write is not executed.
    What do I do wrong?
    Could anyone suggest me a solution? How can I executed the code after using this function?
    Thanks in advance.
    Regards,
    Arek.

    Hi arkadiusz,
    1. simple
    2.
    <b>start-of-selection.</b>
    f_name = p_file.
    write:/ f_name.
    regards,
    amit m.

  • How can I execute external application?

    Hi friends I want printing my barcodes a laser printer (Kyocera) it isn't a barcode printer. So I think (and I look kyocera web page my model doesn't support barcode printing in sap) print my barcodes using an external system. Before SAP we are using JollyPrint application for printing barcodes. It is using an Excel file.
    I can create a excel file for this application. I must execute this (JollyPrint-it is a label application) application when I press a button. How can I execute this application?
    Thanks
    Mehmet
    P.S. I have been writing this message with details may be somebody can give me a simple way for this

    Well, I can suggest you following steps. May be it works for you .
    -Create an external OS command in SM69
    -Test OS command in SM49 ( <u><i>about OS command if you search in SDN you’ll get lot of material</i></u> )
    -Create a Script at your OS level, I’m assuming you might have some UNIX flavor or Sun solaria’s.
    -Create a Shell script , which execute the printer job from OS .
    -Shell script will have parameters . ( e.g. printer name, destination etc )
    -set the path of shell script directory in SM69 ( the command you just created )
    -Execute shell script using your ABAP program ( use FM "SXPG_COMMAND_EXECUTE" )
    In the ABAP  program you can pass the parameters and execute the command from ABAP as a result your job will start printing on the required destination. Moreover, you can also capture the spool at OS level .
    FYI
    For UNIX script, if you search in www.google.com ( UNIX forums) . you’ll get shell script .
    Hope this’ll give you idea!!
    <b>P.S award the points.</b>
    Good luck
    Thanks
    Saquib Khan
    "Some are wise and some are otherwise"

  • How can I execute an .app remotely in a server via internet?

    Hi,
    Using PHP, or something like it,  how can I execute a MAC OSX app but have it run remotely in the server?
    I know this may sound like a simple question but I have almost no experience with Web apps.
    Thanks,
    Juan Dent

    All you need is a trigger that starts the execution. A simple HTML link to the file will do.

  • How can i access the methods if i only got the java class file?

    just like what the topic said...i would like to ask if i only got the class file of java without API documentation. how can i know what method is included ?
    thanks a lot.
    my email address is : [email protected]

    Class.getMethods()
    throws SecurityException
    Returns an array containing Method objects reflecting all the public member methods of the class or interface represented by this Class object, including those declared by the class or interface and and those inherited from superclasses and superinterfaces. The elements in the array returned are not sorted and are not in any particular order. This method returns an array of length 0 if this Class object represents a class or interface that has no public member methods, or if this Class object represents an array class, primitive type, or void.

  • How can I execute a statement before a VO is running

    JDEVADF_11.1.1.3.PS2_GENERIC_100408.2356.5660
    I use ADF BC
    how can I execute a statement before a VO is running

    thanks for the answer
    i use a logon function before I run a VO
    after a certain time will be disconnected
    and I have to call the function again
    sorry for my English
    public String logon(String username, String password){
    CallableStatement st = null;
    this.username = username;
    this.password = password;
    try {
    st = getDBTransaction().createCallableStatement("begin ep_security.LogOn(?,?); end;",0);
    st.setObject(1, username);
    st.setObject(2, password);
    st.executeUpdate();
    this.getDBTransaction().commit();
    } catch (SQLException e) {
    System.out.println("ERROR "+e.getMessage());
    this.addWarning(new JboWarning("Quote retrieved successfully"));
    System.out.println("...RETURN ERROR");
    return "error";
    } finally {
    if (st != null) {
    try {
    // 7. Close the statement
    st.close();
    } catch (SQLException e) {
    e.printStackTrace();
    }

  • How can I execute a batch file from my java program

    Hi,
    Can someone help me or direct me to a link,
    How can I execute a DOS batch file from my java program?
    Thanks

    You will need to grab a handle to the process's
    outputstream so u can see its output.The OP didn't mention any output from any batch file;
    nor any input for that
    matter,so lets not complicate matters here for now
    ok?Actually I think this is essential to see whether it works or not. It's either that or do some manual check to see whether it ran, which is not exactly elegant, and in some cases this may not be easier than simply writing the output stream code, or in fact it may be impossible to check manually.
    I'm sure it wasn't intentional that your post appeared to be bristling with attitude.

Maybe you are looking for

  • Error message when I calling planning layout in the STS

    Dear I'm trying to use Status and Tracking System with BPS ( SEM 4.0 SP10,  BW 3.5 SP14 ). But I got some error messages when I calling planning layout in the STS screen.. I designed 2 lower unit(A,B) and 1 upper unit(C) for the test. and using Botto

  • Can't import prores files into Premiere Pro CC or SpeedGrade CC

    Can't import prores files into Premiere Pro CC or SpeedGrade CC. But I can into After Effects CC. I also can't export to DNxHD files to an MXF file either. I do have latest Quicktime Pro installed and I also have Avid Media Composer and the other pie

  • Delivery date not getting transferred while running BAPI_PO_CREATE1

    Hi Experts, I am passing the delivery date item level delivery schedule to the function module BAPI_PO_CREATE1. But it's not taking it in.The new PO is gettinig created with blank delivery date. I implemented the OSS notes 858316 & 890901 with no luc

  • How to save notes on the computer

    My iPod touch 5th gen broke and the iTunes store is replacing but I dont want to loose all of my notes in the Notes App. Can I save them to the computer?

  • Assigning UD Connect Source Object to BW

    Hello, We are Facing an error " An error occurred in step 1 during generation of the function module" while we are trying to Generate DataSource Object via UD Connect Source Object. Connection with the UD connect is also Fine. Pointers regarding this