Extension SDK for BEA WebLogic Network Gatekeeper
Creating an example WESPA module
The following section provides a description on how to create an example WESPA module:
The example WESPA module will use the interfaces defined for the example SESPA service capability module prepared in Creating an example SESPA module. The WESPA module will have the following properties:
- package:
com.acompany.wespa.mysctype
- Interface used by the client, acting on the WESPA module:
MyServiceCapability
- Interface used by the WESPA module, acting on the client:
MyServiceCapabilityListener
- Method implemented by the WESPA module for application-initiated requests, defined in the
MyServiceCapability
interface:
myMethod
myMethoddWait
enableNetworkTriggeredEvents
disableNetworkTriggeredEvents
- Methods invoked by the WESPA service capability for application-initiated requests, defined in the
MyServiceCapabilityListener
interface, and implemented by the client:
myMethodResult
myMethodError
deactivate
- Interface used by the WESPA module, acting on the client:
MyServiceCapabilityNetworkTriggeredEventListener
- Methods invoked by the WESPA service capability for network-triggered requests, defined in the
MyServiceCapabilityNetworkTriggeredEventListener
interface, and implemented by the client:
myDeliverNetworkTriggeredEventMethod
deactivate
General preparations
This is general preparations. Do not perform these two steps if they already have been performed when creating the plug-in, ESPA service capability, or SESPA module in the previous chapters.
- Make sure the files for the WESPA Module and the WESPA interfaces are copied to the directory
exampleproj.
That is, all files and directories in module_templates\wespa_sc_impl and module_templates\w
espa_sc_if.
- Change directory to
bea\wlng21\esdk\build
and issue the command ant
Preparing the WESPA service capability interface
Build environment
- Edit the file
exampleproj\wespa_sc_if\build.xml
.
Edit the properties described in Adapting the build files for the modules on page 15-40 to reflect the desired names.
- Edit the Java to WSDL mapping. In all
<axis-java2wsdl>
tags, adapt the names, and locations of the WSDL files to be generated, package names of the implementing classes, and the namespace to use.
WESPA service capability module interface structure
- Rename the directories to reflect the desired package structure. Also change the package definitions accordingly.
WESPA service capability module interfaces
- Add any additional methods to be used in the interface between an application and the WESPA module. Use the method definitions in
MyServiceCapability.java
, MyServiceCapabilityListener.java
and MyServiceCapabilityNetworkTriggeredEventListener.java
as templates.
In the template file, the method myMethod
is an example of how to define an asynchronous method invoked by the WESPA module on the SESPA module and myMethodWait
is an example of a synchronous method.
There are dummy implementations of the interfaces, MyServiceCapability_dummy.java
and MyServiceCapabilityListener_dummy.java
. Adapt the dummy implementations to the interface definitions.
An assignmentID
is given when invoking the method myMethod
. The ID connects an invocation to myMethod
and the corresponding invocation of myMethodResult
or myMethodError.
WESPA service capability module interface compilation
- Compile the WESPA module interface by changing directory to
exampleproj\wespa_sc_if
and execute the command ant
Preparing the WESPA service capability module implementation
Set up the build environment
- Edit the file
exampleproj\wespa_sc_impl\build.xml
.
- Edit the war-file name. Change the property local.warName to the name of the war file to be deployed in Tomcat.
WESPA service capability module structure
- Rename the directories to reflect the desired package structure. Also change the package definitions accordingly.
SESPA service capability listener implementation
The listener interface implementation has to be updated so it implements the SESPA service capability module listener interface as defined in SESPA service capability module interfaces.
- Open the file
MyServiceCapabilityListenerImpl.java
in exampleproj\wespa_sc_impl\src\com\acompany\wespa\mysctype.
- Open the file
MyServiceCapabilityListenerImpl.java
in exampleproj\wespa_sc_impl\src\com\acompany\wespa\mysctype.
- Adapt the import statement for the SESPA Service Capability interface if there has been any changes.
- Adapt the name of the class that the implements the listener, if necessary.
WESPA service capability SOAP binding implementation
The interface has to be updated so it implements the MyServiceCapability
interface as defined in WESPA service capability module interfaces.
- Open the file
MyServiceCapabilitySoapBindingImpl.java
in exampleproj\wespa_sc_impl\src\com\acompany\wespa\mysctype
.
- Adapt the import statement for the SESPA Service Capability interface if there has been any changes.
- The nameLookUp() method must be adapted to use fetch the SESPA implementation from SLEE Common loader. The lookup i performed by name. The name was given in SESPA service capability module service. The cast from Object obj must also be adapted to any changes in package structures and class names.
- Open the file
web.xml in wespa_sc_impl\deploy\server
- Edit the reference to the servlet implementation. Adapt the classnames and package definitions in the tag <servlet> if necessary.
Compilation of the WESPA service capability module implementation
Prior to this, the plug-in interface, SESPA and WESPA module interfaces must have been built.
- Compile the WESPA module implementation by changing directory to
exampleproj\wespa_sc_impl
and perform the command ant
Installing the WESPA service capability module
This section describes how to install and deploy the WESPA module that was created using the instructions in this section. For detailed instructions on how to use the Management Tool, see WebLogic Network Gatekeeper User's Guide.
- Copy the generated war file to the
/<install dir>/slee/bin/autowar
directory in the Network Gatekeeper.
- Open the Management Tool and select the SLEE running on the server the file was copied to.
- In the Embedded_tomcat service, choose addContext. Enter the following parameter data:
Parameter
|
Description
|
contextPath
|
The context path to be used. For example: /exampleContext
The Web Service will be reached in the following URL:
http://<IP-address>:<port>/<contextPath>/services/<method>
|
docBase
|
Document root. Can be a war-file or a directory. Can be specified with an absolute or a relative path name or an URL. In the example the files are stored in: /usr/local/slee/bin/autowar/ <name of war file>.war
|
useCookies
|
Enable cookies (TRUE/FALSE) for session handling. Use FALSE.
|
autostart
|
Start this context during next service restart (TRUE/FALSE). Use TRUE.
|
The WESPA module is started.