How to create an event / callback in a pojo

Let's say I want to create a class that opens and closes a JDBC connection. I'd like to create the following events: (is there a different term I should be using? Callback, Function Pointer, etc...)
Event 1: Before Open
Event 2: After Open
Event 3. On Time Out.
Then in a separate class I would assign a local method to one of those events. For example "class1.SetBeforeOpen(HandleBeforeOpen);"
How do I do this?

Using listeners:
http://java.sun.com/docs/books/tutorial/uiswing/events/intro.html
http://java.sun.com/docs/books/tutorial/uiswing/events/generalrules.html
They are taken from a tutorial about Swing, but they also apply to listeners in general. (Of course, Swing has nothing to do with JDBC!)

Similar Messages

  • How to create the event in the report for jobs scheduling.

    Hi Experts,
    i have a requirement like as follows:
    The following triggers for Batch Jobs in the SCM system will be created.i.     
    Background Processing Event = u201CAPO Background Processing Eventu201D. After sending the Event, write a Log Report line u201CEvent u201CAPO Background Processing Eventu201D sentu201D.
    Could you please suggest me how we create the Event or which transaction ?
    Please give me a steps for creating events so that based on these events we use
    CALL METHOD cl_batch_event=>raise
        EXPORTING
          i_eventid                      = p_bpeve
          i_server                       = p_server
          i_ignore_incorrect_server      = p_ignore
        EXCEPTIONS
          excpt_raise_failed             = 1
          excpt_server_accepts_no_events = 2
          excpt_raise_forbidden          = 3
          excpt_unknown_event            = 4
          excpt_no_authority             = 5
          OTHERS                         = 6.
    Right now i received message "APO Background Processing Event" is doesn't exists.
    Thanks in Advance.
    Puneet.

    Hi Puneet,
    Goto transaction SM62 and in there to BckProcEvents tab. There you can create the events.
    You just need to specify the name and Description of an event.
    Hope this serves your purpose.
    Thanks

  • How to create an Event & schedule a rpt based on results of that Event..

    Help,
    I need to schedule a report, that will run after an event is done. I only want the rpt to run if the event produces more than 1 record.
    I dont know how to create an event? I am assuming I can use a SQL qry as an event. I would like to use:
    select count(*) as RegCounts from [reg contact log] 
    where [due date] = date() +1 and [response due]=Yes
    Erin

    Help,
    I need to schedule a report, that will run after an event is done. I only want the rpt to run if the event produces more than 1 record.
    I dont know how to create an event? I am assuming I can use a SQL qry as an event. I would like to use:
    select count(*) as RegCounts from [reg contact log] 
    where [due date] = date() +1 and [response due]=Yes
    Erin

  • PALM Z22 HOW TO CREATE CALENDAR EVENTS THEN UPLOAD THEM TO THE PALM Z22

    Hello, I would like to know if anyone can advise me on how to create calendar events in say, excel, and then upload them to my Palm Z22.  The reason I want to create them in excel is so that I can also update the file information to my cell phone as well.
    Thanks for your assistance.....
    Tony
    Post relates to: Palm Z22

    Hello Tony,
    If you want to use Excel, then I would suggest that you export your calendar spreadsheet as a comma separated values (.csv) file and then import that data into the Calendar application in Palm Desktop.  Then Hotsync your Palm.
    Alan G

  • How to create facebook event in Xcode 4.6

    Hi All,
    I am doing a Facebook application in ios sdk 6 using Xcode 4.6.
    I have to create a facebook event. I am in pretty confusion that How to create facebook event in my code.
    Can anybody help me..
    Thanks in advance.
    Regards,
    R.V.Lakshmi kanth

    You should update to Xcode 4.6.3, to begin with. Then Google the latest FB iOS API...details should be provided there on usage.

  • How to create a event to display records depend on selection ofdropdownlist

    BSP
    how to create a event to display records depend on selection of dropdownlist box,
    Using BHTML,
    thank you,
    regards,
    jagrut bharatkumar shukla

    1) Copy this script to the code
    <script type="text/javascript">
    function displayVacationDates() {   
        for (var i=0; i < document.forms[0].Status.length; i++) {
            if (document.forms[0].Status[i].checked && document.forms[0].Status[i].value=='Vacation'){
              document.getElementById('startDateRow').style.visibility='visible';
              document.getElementById('endDateRow').style.visibility='visible';
             if (document.forms[0].Status[i].checked && !(document.forms[0].Status[i].value=='Vacation')){
             document.getElementById('startDateRow').style.visibility='hidden';
              document.getElementById('endDateRow').style.visibility='hidden';
    </script>
    2) Set initial style to 'hidden'
    <tr id="startDateRow" style="visibility:hidden">
    <td align="left"><blockquote>
      <p><span class="style16 style8"><strong>Start date:
      </strong></span></p>
    </blockquote>                 </td>
    <td align="left"><script>DateInput('VacStart', true, 'DD-MON-YYYY')</script></td>
    </tr>
    <tr id="endDateRow" style="visibility:hidden">
    <td align="left"><blockquote>
      <p><span class="style16 style8"><strong>End date:
      </strong></span></p>
    </blockquote>                      </td>
    <td align="left"><script>DateInput('VacEnd', true, 'DD-MON-YYYY')</script></td>
    </tr>
    3) Call the display script
    <input name="Status" type="radio" value="In the Field" onclick="displayVacationDates()">
    <input name="Status" type="radio" value="Vacation" onclick="displayVacationDates()">
    <input name="Status" type="radio" value="Sick day" onclick="displayVacationDates()">
    <input name="Status" type="radio" value="Admin Day" onclick="displayVacationDates()">
    <input name="Status" type="radio" value="DSR Ride Along" onclick="displayVacationDates()">
    <input name="Status" type="radio" value="ServiceCall" onclick="displayVacationDates()">

  • How to create a event in SWED

    Hi Guys,
    I have to create a event for Health Benefit Plan (HR module). I created a Change Doucment object using transaction SCDO and generated. For this CHange Document Object i have to create the event.
    I wnet to transaction SWED and in the Change Docu. Object column,If i search for my Object using F4 help, i dont find the object what i created.
    Can anyone please guide, what i missed and how to create????
    Thanks
    Vinod

    Hi Vinod,
    Have a look at this link:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e06f2480-02de-2a10-72af-eed9a513a6c6
    Or
    if u want to create a zevent .
    just go to swo1-> create zBO -> create zevent.
    Delegate ur standard BO.
    Then go to SWEC.
    write change Doc name ,BO name, Event name there.
    Hope it helps u!
    Regards,
    Mamta

  • How to create new event in new hard drive

    i brought new mac n im doing editing in fcp x since 2 weeks, so i have only 1 tera hard driveand its almost full. now i need to do lot more. so im thinking to have extra hard drive. n my qestion is that can i use any hard drive or i need to have only from apple. and again to create new event in that drive how to do that. cause in fcp x i cannt see the key saying where u want to save ur enent? so im in confuse.....

    You should use a good, fast FireWire 800 drive. make sure it is formatted Mac OS Extended. To set where the event goes, select the drive in the Event Library.

  • How to create a event and assign to task

    Hi
    How to create events in BW and assign to any process..
    Like i want to complete a delta load and do the full load.
    After finishing the delta load, full load has to be triggered.
    So can anyone help to creating the events in bw and assigning it to the prcess.
    Regards
    Rak

    Hi AHP
    Thanks for the reply.. we are not using the process chains instead we are using the infopackage groups. I created the event in SM62, But how should i assign this new event to my delta load.
    In full upload infopackage, in selection option i can give the event there in "after event"
    But my doubt is how to assign my event to the delta infopack
    "<i>you can just put the full load process type variant after the delta load, any consideration ?"</i>. Can you be more specific.
    Regards
    Rak

  • If my component has more then one button,how to create click events

    I am learning about java beans
    My java class
    public class ButtonClass extends JButton implements Serializable{
    // ButtonHandler bh;
    public ButtonClass() {
    setText( "Hello world!" );
    setOpaque( true );
    setBackground( Color.ORANGE );
    setForeground( Color.BLUE);
    setVerticalAlignment( CENTER );
    setHorizontalAlignment( CENTER );
    // addActionListener(new ButtonHandler(new JTextArea("Hello")));
    But i want to create Bean having more then one button on my bean.
    But how to create event individually for each button

    Do you mean how do you process each event from the buttons and know which button casued the event?
    If that is what you mean then look at ButtonGroup. You can add the same mouselistener to each button and then check which one cause the event:
    myButtonEvent.getButton()

  • How to create an EVENT when defining a JOB

    Hi,
    I would like to run an abap program in background after a process order has been saved (transactions COR1-COR2).
    In the save exit (EXIT_SAPLCOZV_001) of the process order, I create the job that will run the abap program. after the process order is saved
    I created an event with SM62 but I do not know how to set it up.
    Or may be there is another solution.
    Thanks for your help.

    You can use the function module BP_EVENT_RAISE to raise the event. This can be called inside your user exit.
    First create an event in SM62.
    Now go to SM36 and create the job and give the ABAP program name you want to execute. Under START DATE select option AFTER EVENT. Then enter your SAP event name. After entering other information save the job.
    Please see this site for more info.
    http://www.sapfans.com/sapfans/sapfaq/robert.htm
    Events are mainly used to trigger from outside SAP.
    Thanks
    Vinod
    Message was edited by: Vinod C

  • How to create an event in two different time zones?

    Hello,
    I am traveling a lot and I would like to be able to enter the flight details in iCal - whether on my iPhone, iCloud, i... whatever. The problem is that I cannot manage to enter these details without calculating the time difference. Example:
    I am flying on Saturday from Frankfurt to Japan. My flight takes off at 19:00h local German time and arrives in Tokyo at 13:00h local time (in Japan)
    I can either specify the time zone for Germany or for Tokyo, but is there a way to enter the event from 19:00h German time to 13:00h Tokyo time?
    Thank you very much for your time.
    Larry

    Hi Alex,
    this applies only when the event takes place in one time zone, but in my case I start the event on one time zone and ends in a different time zone. As it is known, the airlines show always the local times on the ticket. Which means that I start my travel at 19:00h German time (UTC +2) and end it at 13:00h Tokyo time (UTC +9). When I create the event I can choose From Date/Time... To Date/Time and below I have Time zone. Ideally I should have two time zones, one for the start and another for the end.
    Since this situation only applies to travelling (I can't think of another case right now), I believe that Apple didn't take this into consideration.
    Any other thoughts/ideas? Other than manually calculating the difference, of course.

  • How to create an event booking app

    Hi
    This is the second time this month I have been asked to add an Event or an option to subscribe to an event and pay for it using BC. Since there is no build-in module for this and I am not a developer can you explain or direct me to a place where I can find some samples or tutorials how to develop this?
    Basically I need
    1. list of events with a button to book (availability will be good to have).
    2. Register, add credit card details and pay.
    3. Connect to payment gateway and return confirmation/ error.
    4. Client receive a confirmation email with event details.
    5. Client details are stored in the CRM database.
    This is more or less.
    Thanks
    Micha

    Thanks Liam for you quick response.
    I know how to use the Event module but I don't see any documentation on how to add payment options to an event (even thought there is a payment option in the module).
    I would like people to register to the event and capture there information for future marketing newsletters. I don't really need/ want the calendar since we will have about one event each month. So basically it will be:
    1. List of events page
    2. Event details and booking/payment form (prefer using JSON).
    Cheers
    Micha

  • How to create an event/incident from data collector on agent?

    Hi,
    I would like to be able to create an event or incident for a target type/name, from its data collector script on the Agent.
    On the OM Server I would be able to use emcli publish_event but emcli is not available on the Agent of course.
    Thanks,
    Ed

    Andy;
    If you are using Labview to do that, you can take advantage of the shipping example named "Measure Buffered Period.vi". You can set that counter's source to be the 100K interanl time base, and route the events line to that counter's gate pin. At each event, the counting number will be stored at the buffer, and you can keep reading those numbers. as you know the frequency of the timebase, the elapsed time will be the counting number you read, times 1/100k. As you probably don't need much accuracy on the 10minutes counter, you can do that opeartion by Software, and stop the while loop after that time has been reached.
    Hope this heslps.
    Filipe
    Applications Engineer
    National Instruments

  • How to create dynamic event handler methods?

    Hello!
    Is it possible to create dynamic event handler methods in the views of WDC and then subscribe to an event of another WD component completely dynamically.
    Many thanks,
    Smitha.

    By first realising AJAX is not Java but JavaScript and then reading a tutorial on JavaScript DOM manipulation and then by reading a tutorial on AJAX and then by applying your knowledge and then in the end by integrating it in your JSP.

Maybe you are looking for

  • Critical issue with exporting images in iPhoto 08?

    I have been exporting selected photos to a thumb drive under iPhoto 06. I then take the thumb drive and put it in a pioneer palsma and go to GALLERY mode. Works fantastic and I can then review the images with my clients. Never had a problem with iPho

  • Non standard members of Time dimension

    Colleagues, I have created a Time Dimension which consists of 16 periods instead of normal 12 periods in a year. When I attach YYYY.P13,YYYY.P14,YYYY.P15,YYYY.P16 to YYYY.TOTAL and send data for the respective periods, the input schedule saves succes

  • Error -3259 ; I can't download songs

    I purchased a CD off of iTunes, but everytime it goes to download the songs I get the message "Error -3259 and it says my network connection has been timed out. However, about 4 of the 20 songs HAVE downloaded. I have tried restarting iTunes but I co

  • HT1338 my mac pro started running very slow not all the time it is only 2 months old

    My new macpro has been running very slow off and on (mostly on) it is only 2 months old I took it into the genius bar and they could not find anything wrong.  I took it home and it ran fine for a short while then started up again. I have watched acti

  • Ipod says it's charged when it isn't

    When I put my new Ipod Touch onto my Soundmaster Dock to charge the little battery in the right hand corner says that it's fully charged, however on the slide to unlock screen it shows that the battery is only 30% full. When I put the Ipod on my frie