All Examples  COM Examples 



public class ServerSideDLLClient
extends Object
This package uses a DLL file to illustrate how to invoke COM objects using the WebLogic COM Compiler.

Included in this package is the beeper.dll file. The beep() method of this DLL causes the host computer to beep.

The WebLogic COM compiler is used to generate the necessary Java classes from the COM object. The generated implementation class is then deployed as a startup class in your WebLogic Server. Once the COM object is compiled and deployed, it becomes accessible from the network to any client via any of WebLogic's supported protocols. In this example, a simple Java client looks up the deployed beeper object and invokes the beep() method, causing the server computer to beep.

Build the example:

  1. Make sure that Microsoft SDK 3.1 (or later) for Java is installed and set up a development shell to use the Miscrosoft SDK, as described in Setting up your environment.
  2. Place beeper.dll in a directory that is in the PATH of the WebLogic Server process. This can be any directory that is listed in the PATH variable in the Environment tab of the System Properties dialog. For this example, you place beeper.dll in the "c:\winnt\" directory.
  3. Compile beeper.dll using the WebLogic COM compiler with the following command. This is a single command and should be typed on one command line.
       $ jview  weblogic.comc -nothreads -register c:\winnt\beeper.dll
    In the above command, the -nothreads option indicates that this DLL is not multithreaded. The -register option registers the DLL with Windows.
  4. Place the resulting classes,,,,,,, and and their associated directory structure into the weblogic\myserver\serverclasses directory.
  5. Compile the file as shown in this example for Windows NT.
      $ jvc /d %CLIENT_CLASSES%
Configure the server:
  1. Add an entry for the beeper implementation class to the file. The following entry registers the implementation class to become available at startup and binds the object in the WebLogic registry to the name "beeper".
Run the example:
  1. Start the WebLogic Server using the Microsoft JVM (JView) in a new command shell.
  2. In your development shell, start the client application using the following command.
      $ jview t3://hostname:port

    Host name of the WebLogic Server
    Port where the WebLogic Server is listening for connections (weblogic.system.ListenPort).
    If the argument is ommitted, "t3://localhost:7001" is assumed. If the machine hosting WebLogic Server does not beep, you may need to turn up the volume settings on the machine.
Copyright (c) 1999-2000 by BEA Systems, Inc. All Rights Reserved.

Constructor Index

 o ServerSideDLLClient()

Method Index

 o main(String[])
Runs this examle from the command line.


 o ServerSideDLLClient
 public ServerSideDLLClient()


 o main
 public static void main(String args[])
Runs this example from the command line.

All Examples  COM Examples