All Examples COM Examples
Class examples.com.ServerSideDLLClient
java.lang.Object
|
+----examples.com.ServerSideDLLClient
- 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:
-
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.
-
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.
-
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.
-
Place the resulting classes, weblogic.com.beeper.Beeper,
weblogic.com.beeper.IBeeper, weblogic.com.remote.beeper.IBeeper,
weblogic.com.remote.beeper.IBeeper_WLSkel,
weblogic.com.remote.beeper.IBeeperStub,
weblogic.com.remote.beeper.IBeeperImpl, and
weblogic.com.remote.beeper.Uitilities and their associated directory structure
into the weblogic\myserver\serverclasses
directory.
-
Compile the ServerSideDLLClient.java file as shown in this example for Windows NT.
$ jvc /d %CLIENT_CLASSES% ServerSideDLLClient.java
Configure the server:
-
Add an entry for the beeper implementation class to the weblogic.properties file.
The following entry registers the implementation class
weblogic.com.remote.beeper.IBeeperImpl
to become available at startup and binds the object in the WebLogic registry to the
name "beeper".
weblogic.system.startupClass.beepertest=\
weblogic.com.remote.beeper.IBeeperImpl
weblogic.system.startupArgs.beepertest=beeper
Run the example:
-
Start the WebLogic Server using the Microsoft JVM (JView) in a new command shell.
-
In your development shell, start the client application using the following command.
$ jview examples.com.ServerSideDLLClient t3://hostname:port
where:
- hostname
- Host name of the WebLogic Server
- port
- 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.
- Author:
- Copyright (c) 1999-2000 by BEA Systems, Inc. All Rights Reserved.
-
ServerSideDLLClient()
-
-
main(String[])
- Runs this examle from the command line.
ServerSideDLLClient
public ServerSideDLLClient()
main
public static void main(String args[])
- Runs this example from the command line.
All Examples COM Examples