Extension SDK for BEA WebLogic Network Gatekeeper
Creating an example SESPA module
The following section provides a description on how to create an example SESPA module:
The example SESPA module will use the interfaces defined for the example ESPA service capability module prepared in Creating an example ESPA Service Capability module. The SESPA module will have the following properties:
- package:
com.acompany.espa.mysctype
- Interface used by the WESPA module for application-initiated requests, acting on the SESPA module:
MyServiceCapability
- Interface used by the SESPA module for application-initiated requests, acting on the WESPA module:
MyServiceCapabilityListener
- Methods implemented by the SESPA module, defined in the
MyServiceCapability
interface:
myMethodWait
myMethod
enableNetworkTriggeredEvents
- disableNetworkTriggeredEvents
- Methods invoke by the WESPA service capability for application-initiated requests, defined in the
MyServiceCapabilityListener
interface, and implemented by the WESPA module:
myMethodResult
myMethodError
- Interface used by the WESPA module for application-initiated requests, acting on the SESPA module:
MyServiceCapability
- Interface used by the SESPA module for application-initiated requests, acting on the WESPA module:
MyServiceCapabilityListener
- Methods implemented by the SESPA module, defined in the
MyServiceCapability
interface:
myMethodWait
myMethod
enableNetworkTriggeredEvents
- disableNetworkTriggeredEvents
- Methods invoke by the WESPA service capability for application-initiated requests, defined in the
MyServiceCapabilityListener
interface, and implemented by the WESPA module:
myMethodResult
myMethodError
- Interface used by the SESPA module for network-triggered requests, acting on the WESPA module:
MyServiceCapabilityNetworkTriggeredEventListener
- Methods used by the SESPA module, defined in the
MyServiceCapabilityNetworkTriggeredEventListener
interface:
myDeliverNetworkTriggeredEventMethod
deactivate
General preparations
This is general preparations. Do not perform these two steps if they already have been performed when creating the Service Capability as described in Creating an example ESPA Service Capability module.
- Make sure the files for the SESPA Module and the SESPA interfaces are copied to the directory
exampleproj.
That is, all files and directories in module_templates\sespa_sc_impl and module_templates\s
espa_sc_if.
- Change directory to
bea\wlng21\esdk\build
and issue the command ant
Preparing the SESPA service capability interface
Build environment
- Edit the file
exampleproj\sespa_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.
SESPA service capability module interface structure
- Rename the directories to reflect the desired package structure. Also change the package definitions accordingly.
SESPA service capability module interfaces
- Add any additional methods to be used in the interface between the SESPA service capability 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.
An assignmentID
is given when invoking the method myMethod
. The ID connects an invocation to myMethod
and the corresponding invocation of myMethodResult
or myMethodError.
SESPA service capability module interface compilation
- Compile the SESPA service capability interface by changing directory to
exampleproj\sespa_sc_if\
and execute the command ant
Preparing the SESPA service capability module implementation
Set up the build environment
- Edit the file
exampleproj\sespa_sc_impl\build.xml
.
Edit the properties described in Adapting the build files for the modules on page 15-40 reflect the desired names.
Defining the OAM methods
SESPA service capability module structure
- Rename the directories to reflect the desired package structure. Also change the package definitions accordingly.
SESPA service capability module listener implementation
The listener interface implementation has to be updated so it implements the ESPA service capability module listener interface as defined in Interfaces to the ESPA service capability module.
- Open the file
MyESPAServiceCapabilityListener_impl.java
in exampleproj\sespa_sc_impl\src\com\acompany\sespa\mysctype.
- Adapt the import statement for the ESPA Service Capability interface if there has been any changes.
- Adapt the name of the class that the extends the listener, the name of the class is the same as as the classname for the callback interface, with the addition POA, for example:
public class MyESPAServiceCapabilityListener_impl extends MyServiceCapabilityListenerPOA
SESPA service capability module implementation
The interface has to be updated so it implements the MyServiceCapability
interface as defined in SESPA service capability module interfaces.
- Open the file
MyServiceCapabilityImpl.java
in exampleproj\sespa_sc_impl\src\com\acompany\sespa\mysctype.
Adapt the import statement for the ESPA Service Capability module manager if there has been any changes to them.
- IAdapt the method names to reflect the names in the interface definitions.
SESPA service capability module service
- Open the file
MyServiceCapabilityService.java
in exampleproj\sespa_sc_impl\src\com\acompany\sespa\mysctype.
- Define the name that the WESPA modules will use to fetch the SESPA Service Capability implementation. The name is defined when the SESPA Service Capability registers itself in SLEE Common Loader, SleeCommonLoader.getInstance().addObject(...).
Compilation of the SESPA service capability module implementation
Prior to this, the plug-in interface, ESPA service capability module interface, and the SESPA service capability interface must have been built.
- Compile the SESPA service capability module implementation by changing directory to
exampleproj\sespa_sc_impl
and execute the command ant
Installing the SESPA service capability module
This section describes how to install and deploy the SESPA service capability module that was created using the instructions in this section. For instructions on how to use Management tool and how to register an SESPA service capability module in more detail, see WebLogic Network gatekeeper User's Guide.
- Make sure you have access (by ftp directly to the file system) to the SLEE the SESPA service capability module shall be installed in.
- Open the Management Tool and select the SLEE in which to install the SESPA service capability module.
- In the SLEE_deployment service, choose install. Enter the URL to the jar-file in the field ServiceJarURL and click Invoke.
In the example, the path and file name is file:///<drive>/exampleproj/sespa_sc_impl/lib
and the name was defined in the build file property local.jarName.
Note: On Windows systems, use three (3) slashes prior to the drive name.
- In the SLEE_deployment service, choose start. Enter the SLEE name for the SESPA service capability module. Click Invoke.
The name was defined in the build file property local.deployName.
- In the SLEE_deployment service, choose activate. Enter the SLEE name for the SESPA service capability module. Click Invoke.
The name was defined in the build file property local.deployName.