Listener Creation

Hi. Suppose I wanted to create a custom listener interface for a class. Does my listener have to do anything special? What I'm try ing to ask is whether or not listeners are some specially created part of the language or just a general term.
I'm trying to make a HTML reader, and when it hits an opening tag it should call the listeners tagOpen( HTMLEvent e) and when it hits a closing tag call tagClose(HTMLEvent e).
Should the HTMLEvent inherit from anything or should it just be a custom class extending from object? Is there a special way I should add the listeners? Currently I have a method addHTMLListener(HTMLListener aListener) in the parser class and that puts aListener into a vector. The vector is then cycled through and each element has the correct function called.
Am I on the right track or am I straying too far out?

A listener is just a design pattern. There is no magic functionality. It is basically a way that a class can request to be asynchronously notified that something has happened in which it has particular interest.
You'll notice that listeners in JDK like MouseEventListener and ActionListener are interfaces, not classes. Anybody can implement them to do anything they want, so by definition there cannot be any "magic" functionality.

Similar Messages

  • After using WMIquery to listen Creation/Deletion of one process makes CPU usage to 100 % at remote terminal server

    Hi there ,
    I am new to the WMI and stuck with max CPU usage .
    I have to open my plugin(MakeyourVoice.exe )
     as MyAPP.exe process starts by a windows user. For hearing 
    the start of MyAPP.exe in processes space ,I have created the WMIquery in watcher.exe and query
     used as
    scope =
    new ManagementScope(String.Format("\\\\{0}\\root\\CIMV2", “localhost”),
    null);
    scope.Connect();
    wmiStartQuery =
    new
    WqlEventQuery("__InstanceOperationEvent",
    new TimeSpan(0, 0, 1),
    "TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name=\"MyAPP.exe\" ");
    ManagementEventWatcher StartWatcher =
    new ManagementEventWatcher(scope, wmiStartQuery);
    // register for WMI event within the scop
     StartWatcher.EventArrived +=
    this.WmiEventHandler;
     // Start Watcher
     StartWatcher.Start();
    Now the problem is if I run my watcher process in Remote Terminal Server (Windows Server 2008 R2 Standard)  with 5-6
    number of users logged in the CPU usage shoot up to 100 %.Due to this users  cannot do any activity on system.
    Could you please suggest how can I solve this issue, so that users can use my plugin?
    Thanks in advance..

    Hi Sharma, 
    Please seek help from
    Scripting forum or else wait until any of our moderator move this post to concerning forum.
    Thank you for understanding.
    Regards, Ravikumar P

  • Oas listener's configuration cannot be invoked

    after installation of OAS,listener creation is successful.but listeners configuration pages does not open .So no configuration for any listener can be done.message displayed is URL not found though the files are availablein C:\orant\4.0\admin\cgi
    null

    i have the same problem and i hope that if you manage it, you will send me a mail...
    everything in installation went right and i don4t know what do do :o(((

  • How to register RAC database to new listener manually in 10g?

    Hi Rac Experts,
    OS : Red Hat Enterprise Linux AS release 3 (Taroon Update 6)
    Oracle 10.2.0.2.0 database
    I am working on to register my two node RAC database to the new listener which i have created manually, after listener creation when i start the listener it only handles local instance but not the remote instance. Please advice....
    Please note that netca is not working on this machine and i am working from remote location, so i don't have gui access from here.
    Following is my listener on node1:
    LISTENER_OR44D1 =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = virtual ip)(PORT = 1527)(IP = FIRST)))
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = actual ip)(PORT = 1527)(IP = FIRST)))
    SID_LIST_LISTENER_OR44D1 =
    (SID_LIST =
    (SID_DESC = (ORACLE_HOME = /u01/app/oracle/product/oracle10/db)(SID_NAME = or44d1))
    -- PTLDBA.

    Hi,
    I did as per you advice but facing below error, i am i missing anything here. Please advice...
    SQL> show parameter liste
    NAME TYPE VALUE
    local_listener string LISTENER_or44d1
    remote_listener string LISTENERS_or44d
    SQL>
    SQL> show parameter service
    NAME TYPE VALUE
    service_names string or44d
    SQL>
    SQL> alter system set local_listener=or44d1 instance='or44d1';
    alter system set local_listener=or44d1 instance='or44d1'
    ERROR at line 1:
    ORA-02065: illegal option for ALTER SYSTEM
    SQL>
    SQL> alter system set local_listener='or44d1' instance='or44d1';
    alter system set local_listener='or44d1' instance='or44d1'
    ERROR at line 1:
    ORA-02065: illegal option for ALTER SYSTEM
    --PTLDBA                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • DB link error when trying to connect

    Hi All,
    Below is the error my i get when try to connect to a remote DB using a public DB link ,can anyone please advise.
    I tried to research but could not get to a right solution on how to trouble shoot this issue. Thanks!
    My Oracle Version is 10.2.0.4 and this in on windows platform.
    Link : "ELDT2 BARINGDB"
    Error : ORA-28545: error diagnosed by Net8 when connecting to an agent
    Unable to retrieve text of NETWORK/NCR message 65535
    ORA-02063: preceding 2 lines from ELDT2
    Edited by: 877410 on Mar 30, 2012 12:17 PM

    877410 wrote:
    Hi All,
    Below is the error my i get when try to connect to a remote DB using a public DB link ,can anyone please advise.
    I tried to research but could not get to a right solution on how to trouble shoot this issue. Thanks!
    My Oracle Version is 10.2.0.4 and this in on windows platform.
    Link : "ELDT2 BARINGDB"
    Error : ORA-28545: error diagnosed by Net8 when connecting to an agent
    Unable to retrieve text of NETWORK/NCR message 65535
    ORA-02063: preceding 2 lines from ELDT2
    Edited by: 877410 on Mar 30, 2012 12:17 PMAre you trying to connect to another Oracle database? Or this is to say MS SQL?
    Can you please post more details?
    tnsnames
    listener
    creation statement of dblink
    thank you

  • Creation of a context listener in a web project

    Hello.
    We need to create a custom context within a web application.
    In other projects what we do is create an implementation of the class javax.servlet.ServletContextListener, and reference it as a listener in the web.xml. This alows us to create threads within the container of the server, for instance.
    The problem is that after I create the web project in my developer studio 7.2 the class javax.servlet.ServletContextListener is not found within the classpath, that is referencing a Java CE 7.2 server.
    The project I created received the SAP Java EE 5 Library, but the class is not present in that.
    Is there another library from SAP I need to add? If I import that class from another jar, will it be well supported by the server?
    Thanks!

    I found the solution, that was only related to problems on my classpth. Thanks!

  • Creation of new listener after upgrade

    Hello!
    Is it obligatory measure to create new listener in enviroment of 11.2 after upgrade 10.2 database?
    I keep Oracle Database Software 10.2 in former location and change Oracle_home in listener.ora file
    Thanks and regards,
    Pavel

    It would be always better to have the listener running of the upper version to support the database of the same release and of lower release. Can't say its obligatory, preferred may be.
    Aman....

  • Creation of Flex Components Listening to a Custom Flex Event

    Hi,
    I would like to create a component in Flex which will always listen to a Cutom Event.
    Say, I create an event named "MyEvent" in Flex. I associate this event toa custom component, say MyComponent (extends Button). When ever this even is triggered , I should have a set of Components listening and tracking this event using an event listener in their definition.This should be in a framework level. That is, even if we add more components in our application, they should be able to listen to the Custom Event.
    Or in short, is it possible to make all the components in an application listen to a custom event triggered?

    Thanks for your answer.Can u please give an example so that I can understand it.Excuse me,I am a beginner in flex.

  • Adding a listener to Active directory for user creation using Java

    Hi,
    I would like to add a listener to active directory such that when a user is created to the "Users" container, I should be notified or informed. I would like to do this with Java. What should I do ?
    Regards,
    Anand Kumar D

    You should add a NamingListener or a NamespaceChangedListener.

  • Automating creation of Listening channels?

    Hi,
    Can we create listening channels through a script or so? we would like to create listening through a script rather than through B2B console. Is there any way to do so? like how we use WLST for configuring Weblogic resources?
    Thanks in advance.

    You can create via selfservice.xml.
    http://docs.oracle.com/cd/E17904_01/integration.1111/e10229/app_selfservice.htm#BABFCIAJ
    Refer to below thread for more details about selfservice:
    Re: sample selfservice.xml for 11g B2B??
    rgds,
    Nitesh

  • Issue with an available listener at Creation of Database Procedure

    Hello everybody
    First, Cloud Control documentation says that you have to add listener with a user with DBAAS_ADMIN_ROLE, role that I haven't found, so I did it with super administrator user (SYSMAN) on manually way (Setup -> Add Target -> Add Target Manually and Oracle Database, Listener, and ASM as Target Type). I added Listener without any problem.
    When I start a Creaction of Database Procedure to deploy an Oracle Database, on Step 6, no one Listener appears on Listener Configuration table.
    How can fix this issue????
    Thanks for helping

    I only want to restore as a last resort. Won’t a restore from backup justrestore a corrupt version?
    Thanks

  • Listening to Service ticket creation event

    Hi,
    I have a requirement to check the ticket details and populate one field as per the  ticket details. This operation has to be done on the below scenario.
    u2022 A service ticket is generated and already has a property confirmed
    u2022 A property(iObject) is confirmed for a new service ticket
    u2022 The property(iObject) is changed on the service ticket
    u2022 The service ticket is saved .
    We can handle the scenario 2 and 3 from UI. But I do not know how to handle the scenario 1 i.e. whenever a service ticket is generated. Is there an event which gets raised whenever a service ticket is generated ?
    For scenario 4, I am planning to invoke the required operation in the save button code which is available in UI. But when agent ends call, then also the service order gets saved. Is there a way I can invoke my code just before save ?
    Regards,
    Manas.
    Edited by: manas sahoo on Aug 6, 2008 9:44 AM

    Hello Manas,
    Check if this suggestions may help you.
    For scenario 1, you can check method IP_INBOUNDPLUG of your service ticket controller class. Maybe there you'll understand if a new bol entity for the service ticket was created or not.
    For scenario 4, you can use ORDER_SAVE badi. This BADI was 3 methods to manipulate a document before you saving it. See it to check if any of those three can help you.
    Kind regards.
    Bruno

  • Error in Creation of Object ID 00000000 is not allowed

    Hi all,
    When I am Hiring an employee using PA40, I am getting an error as "Creation of Object ID 00000000 is not allowed", when I save it.
    In the NUMKR Feature, the return value has been assigned to the Personnel Sub Area.
    Pls. can anybody explain, how can I solve this problem. 
    This is urgent requirement of client.
    Thanks,
    HR User.

    Hi Hr user
    Now listen carefully.
    1. If you have defined your feature NUMKR according to PSA then while running hiring action does PSA comes or it just gives you the Position, PA, EG and ESG fileds only.
    2. If the first condition is true then you will get the error, now the question is why
    Answer, you have defined the feature through PSA and once you try to save the IT0000 there is no PSA mentioned there thats why the system gives you the error.
    If this explnanation is understood by you than reply , i will tell you how you can bring the PSA field also in hiring action at IT0000.
    Do reply
    Regards,
    Bhupesh Wankar

  • Creation of Weblogic Domain in console mode not working

    Hi All,
    I've installed the Middleware home with ADF Runtime installer (Installer was 12.1.2.0.0). Now, I'm trying to create and configure a domain based on the JRF Template.  I'm executing the following command from Putty
    Step1. Navigate to MW_HOME/wlserver/common/bin
    Step2. execute "./config.sh -mode=console"
    Its throwing the following error :
    2014-07-21 17:03:41,643 WARNING [WizardController] com.oracle.cie.wizard.internal.engine.WizardControllerEngine - Duplicate action cause encountered: java.awt.HeadlessException:
    No X11 DISPLAY variable was set, but this program performed an operation which requires it.
    2014-07-21 17:03:41,643 SEVERE [WizardController] com.oracle.cie.wizard.internal.engine.WizardControllerEngine - Wizard error cause
    java.awt.HeadlessException:
    No X11 DISPLAY variable was set, but this program performed an operation which requires it.
      at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:207)
    at java.awt.Frame.<init>(Frame.java:420)
      at java.awt.Frame.<init>(Frame.java:385)
      at javax.swing.SwingUtilities$SharedOwnerFrame.<init>(SwingUtilities.java:1757)
      at javax.swing.SwingUtilities.getSharedOwnerFrame(SwingUtilities.java:1832)
      at javax.swing.JOptionPane.getRootFrame(JOptionPane.java:1697)
      at javax.swing.JOptionPane.showOptionDialog(JOptionPane.java:863)
      at javax.swing.JOptionPane.showConfirmDialog(JOptionPane.java:796)
      at javax.swing.JOptionPane.showConfirmDialog(JOptionPane.java:758)
      at com.oracle.cie.wizard.internal.cont.GUIContext.handleFatalErrorMessage(GUIContext.java:1141)
      at com.oracle.cie.wizard.internal.cont.GUITaskContainer$MethodRunner.run(GUITaskContainer.java:188)
      at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:302)
      at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
      at java.awt.EventQueue.access$200(EventQueue.java:103)
      at java.awt.EventQueue$3.run(EventQueue.java:694)
      at java.awt.EventQueue$3.run(EventQueue.java:692)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
    2014-07-21 17:03:41,643 WARNING [WizardController] com.oracle.cie.wizard.internal.engine.WizardControllerEngine - Given state 'ERROR' does not follow current 'ERROR'
    This vaguely means that its trying to open a GUI wizard, which is not what I intended to do. The argument -mode=console should run the installer in console mode, but its trying to launch it in GUI mode.
    I searched online, but I have not found anything useful on this issue yet.
    Am I missing something?  Has anyone faced this problem before.
    Any thoughts on this would be helpful  !!
    Thanks,
    Shiva Shankar B N

    Weblogic 12C (12.1.2 to be precise), currently does not support console mode Domain creation. It supports only GUI mode and Silent mode.
    Possible solution to create a 12.1.2  Weblogic domain fully qualified enough to deploy ADF Applications :
    1. Install Xming, and enable X11 forwarding on Putty
    2. Silent Mode installation: The Configuration wizard. ./config.sh -mode=silent  -silent_script=xyz . Yes, it needs a silent script, not silent.xml. I did not try this way and instead resorted to WLST.  Still there are not enough blogs that clearly tell you how to install domain based on JRF template. I stumbled upon a similar OTN forum post.
    Here is the bunch of WLST commands if anyone is interested
    #======================================================================================= 
    # Open a domain template. 
    #======================================================================================= 
    readTemplate("/u01/app/mw/Oracle_Home/wlserver/common/templates/wls/wls.jar") 
    #======================================================================================= 
    # Update the domain to enable the WebLogic Server domain with JRF and EM. 
    #======================================================================================= 
    addTemplate('/u01/app/mw/Oracle_Home/oracle_common/common/templates/wls/oracle.jrf_template_12.1.2.jar') 
    addTemplate('/u01/app/mw/Oracle_Home/em/common/templates/wls/oracle.em_wls_template_12.1.2.jar') 
    #======================================================================================= 
    # Configure the Administration Server and SSL port. 
    # To enable access by both local and remote processes, you should not set the 
    # listen address for the server instance (that is, it should be left blank or not set). 
    # In this case, the server instance will determine the address of the machine and 
    # listen on it. 
    #======================================================================================= 
    cd('Servers/AdminServer') 
    set('ListenAddress','') 
    set('ListenPort', 7001) 
    create('AdminServer','SSL') 
    cd('SSL/AdminServer') 
    set('Enabled', 'True') 
    set('ListenPort', 7002) 
    #======================================================================================= 
    # Define the user password for weblogic. 
    #======================================================================================= 
    cd('/') 
    cd('Security/base_domain/User/weblogic') 
    # Please set password here before using this script, e.g. cmo.setPassword('value') 
    cmo.setPassword('password') 
    # Create and configure a JDBC Data Source, and sets the JDBC user.   Provide the Schema Credentials of the Service table
    # Get RCU Configuration using RCU service table (STB) schema credentials 
    cd('/') 
    cd('JDBCSystemResource/LocalSvcTblDataSource/JdbcResource/LocalSvcTblDataSource') 
    cd('JDBCDriverParams/NO_NAME_0') 
    set('DriverName','oracle.jdbc.OracleDriver') 
    set('URL','jdbc:oracle:thin:@XX.XX.XX.XX:1521/xe.yourdomain.com') 
    set('PasswordEncrypted', 'schemaPassword') 
    set('UseXADataSourceInterface', 'false') 
    cd('Properties/NO_NAME_0') 
    cd('Property/user') 
    cmo.setValue('DEV_STB') 
    getDatabaseDefaults() 
    #======================================================================================= 
    # Write the domain and close the domain template. 
    #======================================================================================= 
    setOption('OverwriteDomain', 'true') 
    writeDomain('/u01/data/user_projects/domains/your_domain') 
    closeTemplate() 
    #======================================================================================= 
    # Exit WLST. 
    #======================================================================================= 
    exit() 
    Hoping to write a blog post soon..
    Thanks,
    Shiva Shankar B N

  • Trying to write a Listener on a CheckBox to change the Model of a ComboBox

    I am trying to change the list that appears in a ComboBox dynamically based on if a CheckBox is selected or not. I have multiple CheckBoxes and ComboBoxes being created in a loop based on a variable assigned at creation. Every tutorial i have seen writes out a listener that explicitly defines the checkbox instance but in my case i don't acctually know. My checkboxes are in an array of checkboxes as are the comboboxes as they are being created at runtime. Any help would be much apreciated this issue has been with me for two days now.

    here is a snippit of my code in how i was implementing this:
    int numButton = 17; //this is for testing only, this variable is set from another class normally
    // these variables are defined private elsewhere in the class
    JCheckBox PlayerByeCheck[] = new JCheckBox[numButton + 1];
    JCheckBox PlayerHomeCheck[] = new JCheckBox[numButton + 1];
    boolean PlayerOnBye[] = new boolean[numButton + 1];
    for (int i = 1; i <= numButton; i++) {
             PlayerByeCheck[i] = new JCheckBox();
         PlayerHomeCheck[i] = new JCheckBox();
         PlayerOnBye[i] = false;
    // more code here for building the gui it is not important for this problem
    // code to build the list starts here
    for (int i = 1; i <= numButton; i++) {
         ((TableLayout)PlayerRosterPanel.getLayout()).insertRow(1, TableLayout.PREFERRED);
             PlayerByeCheck.setOpaque(false);
         PlayerByeCheck[i].addItemListener(this);
         PlayerByeCheck[i].setName("PlayerByeCheck" + i);
         PlayerRosterPanel.add(PlayerByeCheck[i], new TableLayoutConstraints(2, 1, 2, 1, TableLayoutConstraints.CENTER, TableLayoutConstraints.FULL));
    //the comboox that i want to change
    //---- PlayerTeamSelect1 ----
         if (PlayerOnBye[i] = true) {
              PlayerTeamSelect[i].setModel(new DefaultComboBoxModel(new String[] {
                   "ARI",
                   "ATL",
                   "BAL",
              "BUF",
         "BYE"
              PlayerTeamSelect[i].setSelectedItem("BYE");
         } else {
              PlayerTeamSelect[i].setModel(new DefaultComboBoxModel(new String[] {
                   "ARI",
                   "ATL",
                   "BAL",
                   "BUF",
                   "CAR",
              "BYE"
         PlayerTeamSelect[i].setOpaque(false);
         PlayerRosterPanel.add(PlayerTeamSelect[i], new TableLayoutConstraints(4, 1, 4, 1, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL));
    //more gui code here method gets closed
    //Item Action Listener starts here this is where i am having the problem                         
    public void itemStateChanged(ItemEvent e) {
         Object source = e.getItem();
         if (source == PlayerByeCheck[1])
         int select = e.getStateChange();
              if (select == ItemEvent.SELECTED)
              PlayerOnBye[1] = true;
    PlayerRosterPanel.repaint();
    //repaint the window i think can't get the listener to work to see if this is the right way to do this
    //i doubt it is
    I have tried several different ways to write the listener, the example in the code above is following the java swing tutorial by explicitly defining the checkbox. I have tried to write the listener as i am creating the checkbox, which doesn't seem to work or i am wrting it wrong, which is entirely possible. Once the listener sets the value i think it should repaint the screen but i am sure that that is wrong right now as well. As my hunch is the repaint will reset the checkbox to DESELCTED the default value. I will come to that issue once i figure out how to get the listener working. Ideally i want to be able to set the listener for the checkboxes regardless as to how many there are. As stated above i am generating a list of checkboxes, comboboxes and other fields based on a variable that is defined in one of my objects. If the user selects checkbox 3 than combobox 3 should be changed, and the others should not. if the user selects all the checkboxes than all the comboboxes change.
    thanks for any help. Still plugging along on it trying to figure this one out.

Maybe you are looking for

  • Error in the Query

    I have 2 tables which I want to join ..........one is I_Sales and Other is I_Cost_Center ......now the common columns in both the tables are cost_center........ Now in this Sales table ,There is a column Showroom_code. for only one showroom there are

  • How can I copy Captivate 6.x document array data into a new Javascript array

    I'd like to copy an array from my captivate document variables to a variable within a script my project runs.  I attempted to use objCP.cpEIGetValue("m_VarHandle.Array.slice(0)") but that didnt seem to work.

  • Submit button don't commit field data to database

    Hello, I am working to fix a problem in apex. The problem that I have is that the submit button doesn't work propertely. When the form is running,  I select a row in the tabular form, change value in the  independent fields to Y, click the submit but

  • Unable to use Redlining in EAI Viewer due to Program Error...HeLp...

    Dear All, I am trying to use the redlining function but it is giving a ABAP dump which says The current ABAP "CL_ABAP_CLASSDESCR============CP" program had to be terminated because the ABAP processor detected an internal system error. Does any one ha

  • Waves and color grains on LCD monitor

    I have a Compaq SR 1931 IL(Windows 7 OS) model desktop pc. It has a 3gb RAM and 64MB Video card(inbuilt). No dedicated graphics card installed. After I installed my LCD monitor(DELL) I have these color horizontal grains, and horizontal waves moving v