|
WebLogic Server 6.0 Code Examples, BEA Systems, Inc. |
See:
Description
Interface Summary | |
Trader | The methods in this interface are the public face of TraderBean. |
TraderHome | This interface is the home interface for the TraderBean.java, which in WebLogic is implemented by the code-generated container class TraderBeanC. |
Class Summary | |
TraderBean | TraderBean is a stateless Session Bean. |
TradeResult | This class reflects the results of a buy/sell transaction. |
This example demonstrates connectivity between an EJB with valuetypes and a CORBA/C++ client. This example illustrates:
To get the most out of this example, first read through the source code files to see what is happening. Start with the XML deployment files to find the general structure of the EJB, i.e. which classes are used for the different objects and interfaces, then examine the other files included in the package to see how the application works.
Note: This example is shown for demonstration purpose only and is broken. However that most C++ products on the market do not provide enough support to deal with this example. It is included here for completeness.
The following section describes how to build and run the example:
$ set VISIBROKER_HOME=c:\Inprise\vbroker
$ set IDL2CPP=%VISIBROKER_HOME%\bin\idl2cpp -no_servant -idl_strictwhere:
$ mkdir build build\META-INF build\images idlSources cpp\javax\ejb
$ copy *.xml build\META-INF
$ copy *.gif build\images
$ javac -d build Trader.java TraderHome.java TradeResult.java TraderBean.java
$ cd build
$ jar cv0f std_ejb_generic_idl.jar META-INF examples images
$ cd ..
$ java weblogic.ejbc -compiler javac -iiop -idl -idlOverwrite -idlDirectory idlSources build\std_ejb_generic_idl.jar %APPLICATIONS%\ejb_generic_idl.jar
$ %IDL2CPP% -I%VISIBROKER_HOME%\idl -namespace -IidlSources -src_suffix cpp -root_dir . idlSources\examples\rmi_iiop\ejb\generic_idl\TradeResult.idl
$ %IDL2CPP% -I%VISIBROKER_HOME%\idl -namespace -IidlSources -src_suffix cpp -root_dir . idlSources\examples\rmi_iiop\ejb\generic_idl\Trader.idl
$ %IDL2CPP% -I%VISIBROKER_HOME%\idl -namespace -IidlSources -src_suffix cpp -root_dir . idlSources\examples\rmi_iiop\ejb\generic_idl\TraderHome.idl
$ %IDL2CPP% -I%VISIBROKER_HOME%\idl -namespace -IidlSources -src_suffix cpp -root_dir cpp\javax\ejb idlSources\javax\ejb\EJBObject.idl
$ %IDL2CPP% -I%VISIBROKER_HOME%\idl -namespace -IidlSources -src_suffix cpp -root_dir cpp\javax\ejb idlSources\javax\ejb\EJBHome.idl
$ %IDL2CPP% -I%VISIBROKER_HOME%\idl -namespace -IidlSources -src_suffix cpp -root_dir cpp\javax\ejb idlSources\javax\ejb\RemoveEx.idl
$ %IDL2CPP% -I%VISIBROKER_HOME%\idl -namespace -IidlSources -src_suffix cpp -root_dir cpp\javax\ejb idlSources\javax\ejb\RemoveException.idl
$ %IDL2CPP% -I%VISIBROKER_HOME%\idl -namespace -IidlSources -src_suffix cpp -root_dir cpp\javax\ejb idlSources\javax\ejb\CreateEx.idl
$ %IDL2CPP% -I%VISIBROKER_HOME%\idl -namespace -IidlSources -src_suffix cpp -root_dir cpp\java\lang idlSources\java\lang\_Ex.idl
$ %IDL2CPP% -I%VISIBROKER_HOME%\idl -namespace -IidlSources -src_suffix cpp -root_dir cpp\java\lang idlSources\java\lang\_Object.idl
$ %IDL2CPP% -I%VISIBROKER_HOME%\idl -namespace -IidlSources -src_suffix cpp -root_dir cpp\java\lang idlSources\java\lang\_Exception.idl
$ %IDL2CPP% -I%VISIBROKER_HOME%\idl -namespace -IidlSources -src_suffix cpp -root_dir cpp\java\lang idlSources\java\lang\Throwable.idl
$ %IDL2CPP% -I%VISIBROKER_HOME%\idl -namespace -IidlSources -src_suffix cpp -root_dir cpp\java\rmi idlSources\java\rmi\Remote.idl
$ %IDL2CPP% -I%VISIBROKER_HOME%\idl -namespace -IidlSources -src_suffix cpp -root_dir cpp\java\io idlSources\java\io\Serializable.idl
$ %IDL2CPP% -I%VISIBROKER_HOME%\idl -namespace -IidlSources -src_suffix cpp -root_dir cpp\java\io idlSources\java\io\PrintStream.idl
$ %IDL2CPP% -I%VISIBROKER_HOME%\idl -namespace -IidlSources -src_suffix cpp -root_dir cpp\java\io idlSources\java\io\PrintWriter.idl
$ %IDL2CPP% -I%VISIBROKER_HOME%\idl -namespace -IidlSources -src_suffix cpp -root_dir cpp\java\io idlSources\java\io\Writer.idl
$ %IDL2CPP% -I%VISIBROKER_HOME%\idl -namespace -IidlSources -src_suffix cpp -root_dir cpp\java\io idlSources\java\io\IOEx.idl
$ %IDL2CPP% -I%VISIBROKER_HOME%\idl -namespace -IidlSources -src_suffix cpp -root_dir cpp\java\io idlSources\java\io\IOException.idl
$ %IDL2CPP% -I%VISIBROKER_HOME%\idl -namespace -IidlSources -src_suffix cpp -root_dir cpp\org\omg\boxedRMI idlSources\org\omg\boxedRMI\seq1_wchar.idl
$ CL /MD /DTHREAD /nologo -DWIN32 /GX /DSTRICT /DALIGNED /DVISIBROKER /DMSVCUSING_BUG /DMSVCNESTEDUSING_BUG -Icpp -I%VISIBROKER_HOME%\include -I%VISIBROKER_HOME%\include\stubs -I%WL_HOME%\samples -c Trader_c.cpp TraderHome_c.cpp cpp\Client.cpp cpp\javax\ejb\EJBObject_c.cpp cpp\javax\ejb\EJBHome_c.cpp cpp\javax\ejb\RemoveEx_c.cpp cpp\javax\ejb\RemoveException_c.cpp cpp\java\lang\_Object_c.cpp cpp\java\lang\_Ex_c.cpp cpp\java\lang\_Exception_c.cpp cpp\java\lang\Throwable_c.cpp cpp\java\rmi\Remote_c.cpp cpp\java\io\PrintWriter_c.cpp cpp\java\io\PrintStream_c.cpp cpp\java\io\Writer_c.cpp cpp\java\io\Serializable_c.cpp cpp\java\io\IOException_c.cpp cpp\java\io\IOEx_c.cpp cpp\org\omg\boxedRMI\seq1_wchar_c.cpp
$ LINK /nologo /out:Client.exe /LIBPATH:%VISIBROKER_HOME%\lib TradeResult_c.obj Trader_c.obj TraderHome_c.obj EJBObject_c.obj EJBHome_c.obj RemoveEx_c.obj RemoveException_c.obj _Object_c.obj _Ex_c.obj_Exception_c.obj Throwable_c.obj Remote_c.obj Serializable_c.obj PrintWrite_c.obj PrintStream_c.obj Write_c.obj seq1_wchar_c.obj Client.obj IOEx_c.obj IOException_c.obj
Additional information on using the build scripts is found in Building Enterprise JavaBean examples
$ set CLASSPATH=%CLASSPATH%;%WL_HOME%\config\examples\applications\ejb_generic_idl.jarwhere WL_HOME is the installation directory for WebLogic Server.
$ java utils.host2ior hostname portwhere:
$ Client ServerIORwhere ServerIOR is the IOR you obtained by running the host2ior utility.
Read more about WebLogic RMI over IIOP in the Developer Guide, Using WebLogic RMI over IIOP.
Read more about WebLogic EJB in the Developer Guide, BEA WebLogic Server Enterprise JavaBeans.
Read more about WebLogic RMI in the Developer Guide, Using WebLogic RMI.
|
Documentation is available at http://e-docs.bea.com/wls/docs60 |