BEA Home | Events | Solutions | Partners | Products | Services | Download | Developer Center | WebSUPPORT
| WebLogic Server Doc Home | WebLogic jCOM Reference Guide | Previous Topic | Next Topic | Contents | View as PDF

WebLogic jCOM and COM Event

If a COM Class can generate events (has a source interface), then WebLogic jCOM's com2java tool, will generate Java code which allows Java objects to subscribe to the event using standard Java semantics. For information on the generated files, please read the relevant section of the com2java documentation.

In summary, if a COM Class has a source interface that is defined in the same type library as the class, then WebLogic jCOM's com2java tool will do the following:

- it will generate an addXYZListener method and a removeXYZListener method in the corresponding Java class that it generates to access the COM Class

- it will derive the event interface from java.util.EventListener

- for each method in the event interface, it will create a class derived from java.util.EventObject, which contains all of the original method parameters, an instance of which is passed as the sole parameter to the method

- it will generate an adapter class which implements the event interface, and provide default empty implementations of each method in the interface

From a Java programmer's perspective there is nothing really else to it. You use the standard Java event techniques -- you implement the event listener interface, and then subscribe to the event using the addXYZListener method.

Copyright © 2001 BEA Systems, Inc. All rights reserved. Required browser: Netscape 4.0 or higher, or Microsoft Internet Explorer 4.0 or higher.