![]() | Developer's-Panther WebSphere | ![]() |
This appendix discusses how to make C functions that you write available to EJBs.
How to Add C Functions for EJB Access | ![]() |
dll or .so).server.lib. (To see what application libraries are available, check the SMFLIBS setting in panther.ini.)panther.ini and add the JPL file to the SMINITJPL setting in the EJB Globals section.
Note:
SMINITJPL in panther.ini must only be used to call sm_slib_load and sm_slib_install. All other JPL commands are unavailable.
For UNIX, add the shared library to LD_LIBRARY_PATH (Solaris) or LIBPATH (AIX).
For Windows, add the DLL to the working directory, the Windows system directory, or the PATH.
New. Select Project Tab
Win32 Dynamic-Link Library.cpp file created with your project in the Source Files. (This is in the FileView tab on the left frame of MSVC.)smmach.h and smproto.h. The include statements for these header files have to be added to the StdAfx.h file in Header Files in the File View frame.
Options
Directories tab. Make sure that Show Directories For is set to Include files. (You can either double click in the window to add a new entry, or click on the yellow box.)Library files.
Settings
Link Tab
Object/Library Files. Add the names of your libraries here. You may also need to add the files themselves to the project. Select Project
Add to Project
Files.def file to export your functions. The .def file should just contain the Keyword EXPORT and then the name of your functions following it. Add the .def file to the project. Same as previous step to add lib files to project.
Settings
C/C++ tab. Add /DWIN32_EJB to Project Options.
Build DLLName..so -- shared libs, statements in {} have to be modified.
def file to export your functions.-lpthread -D_REENTRANT -D__EXTENSIONS__ -G -L{path_to_panther_lib_directory} -l{library_file} -I{include_other_files_such_as_.def_file} -D{PLAT_NAME} -o {my_.so_file}
An example compile line for UNIX is:
acc -lpthread -D_REENTRANT -D__EXTENSIONS__ -G
-L/usr/prolifics/prlwassv425/lib -lPanSmEJB
-Imy_dll.def -DSOLARIS2_6 -o libMyShared.so my_shared.c
Here is a very simple .def file for the function isit_there.
my_dll.def:
EXPORT
isit_there