The Interceptor examples
There are two interceptor examples that illustrate the use of Interceptors.
Building the Interceptor Examples
To build the interceptor examples, use the Makefile (vbmake.bat on Windows)
from the current directory. You will not find Makefiles in the sample and
timer subdirectories. Type make (vbmake on Windows)
at the prompt from the current directory.
Compilation Errors and Warnings
You may see the following kind of compilation errors when you compile this
example from the interceptor directory by typing make (vbmake
on Windows) using either JDK1.0.2 or JDK1.1.1:
prompt>javac sample/Init.java
./sample/SampleBindInterceptor.java:5: Package
com.visigenic.vbroker.interceptor not found in import.
import com.visigenic.vbroker.interceptor.*;
^
prompt>javac timer/Init.java
./timer/TimerBindInterceptor.java:5: Package
com.visigenic.vbroker.interceptor not found in import.
import com.visigenic.vbroker.interceptor.*;
^
The above error occurs because the javac compiler in JDK1.0.2 and JDK1.1.1
cannot locate packages imported from JAR files. The solution to this problem
is to either:
-
Unjar the vbjorb.jar file found in the VisiBroker for Java 3.2 installation/lib
directory using the following command:
prompt>jar xvf vbjorb.jar
Modify the example: delete the import statment and explicitly prefix each
occurrence of classes from the imported package with the complete package
name.
Upgrade to JDK1.1.2 or higher
Running the Interceptor Examples
To run the sample example in conjunction with the Bank
example, you must:
Set the CLASSPATH=.:../bank:$CLASSPATH
Or set the CLASSPATH=.;..\bank;%CLASSPATH%
for Windows users
Invoke vbj -DORBservices=sample Server & from the Bank
example
(start vbj -DORBservices=sample Server on Windows)
// make Server run in the background
Invoke vbj -DORBservices=sample Client from the Bank
example
Sample output from client and server is listed in the sample
example.
To run the timer example in conjunction with the Bank example, you must:
Set the CLASSPATH=.:../bank:$CLASSPATH
Or set the CLASSPATH=.;..\bank;%CLASSPATH%
for Windows users
Invoke vbj -DORBservices=timer Server from the Bank
example
(start vbj -DORBservices=timer Server on Windows)
// make Server run in the background
Invoke vbj -DORBservices=timer Client from the Bank
example
Sample output from client and server is listed in the timer
example.
Return to the Top-level Examples Page.