WebLogic Server 6.0 Code Examples, BEA Systems, Inc.

examples.io
Class SpeedTrap

java.lang.Object
  |
  +--examples.io.SpeedTrap

public class SpeedTrap
extends java.lang.Object

This example writes a 10 MB file to the server, reads it back in again, and then reports the data transfer rates.

The following sections cover what to do:

  1. Build the Example
  2. Configure the Server
  3. Run the Example

Build the Example

  1. Set up your development shell, as described in Setting up your environment for building and running the examples.

  2. Compile the example by executing the following command or by executing the build script provided for this example in the samples/examples/io directory. The script will perform the following step:

    1. Compile the SpeedTrap class as shown in this example for Windows NT/2000:

        $ javac -d %CLIENT_CLASSES% SpeedTrap.java

Configure the Server

  1. Start the server with the examples configuration in a new command shell.
  2. Bring up the Administration Console in your browser.
  3. Click to expand the Services node in the left-hand pane.
  4. Select the FileT3 node in the left-hand pane.
  5. Click on Create a new File T3 link in the right-hand pane to display Configuration, Targets and Notes tab.
  6. Select the Configuration tab in the right-hand pane to display the Name and Path field.
  7. Register a fileSystem that the WebLogic Server maps to a real path that is valid on the server host. For example, to map the fileSystem "mySys" to "c:\temp" :
     Name: mySys
     Field: c:\temp
  8. Click the Create button to save the assignment.
  9. Select the Targets tab in the right-hand pane to display the Available and Chosen targets.
  10. Move the examplesServer from the Target column to the Chosen column.
  11. Click the Apply button to save the assignment.

Run the Example

  1. In your development shell, run the SpeedTrap example from the command line of the same machine as your WebLogic Server, listening on port 7001, with a registered fileSystem called "mySys":
      $ java examples.io.SpeedTrap t3://hostname:port mySys
    where:
    hostname
    Host name of the WebLogic Server.
    port
    Port where the WebLogic Server is listening for connections.

    After compiling this directory, call SpeedTrap with three arguments:

    You may also call SpeedTrap with two arguments:

    in which case it will use the empty file system name. The empty file system name refers to the local file system on the client. File names are always absolute on a remote file system, but may be relative on a local file system.

Author:
Copyright (c) 1997-1998 by WebLogic, Inc. All Rights Reserved., Copyright (c) 1999-2000 by BEA Systems, Inc. All Rights Reserved.

Constructor Summary
SpeedTrap()
           
 
Method Summary
static void main(java.lang.String[] argv)
          Runs the SpeedTrap file example.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpeedTrap

public SpeedTrap()
Method Detail

main

public static void main(java.lang.String[] argv)
                 throws java.lang.Exception
Runs the SpeedTrap file example.

Documentation is available at
http://e-docs.bea.com/wls/docs60

Copyright © 2000 BEA Systems, Inc. All Rights Reserved.