Skip navigation.

Extension SDK for BEA WebLogic Network Gatekeeper

  Previous Next vertical dots separating previous/next from contents/index/pdf Contents View as PDF   Get Adobe Reader

Creating an example network plug-in

The following section provides a description on how to create an example network protocol plug-in:

In this section, the example network plug-in is described.

The plug-in consists of two parts:

The SLEE service part of the example plug-in has the following properties:

The Web Services part of the example plug-in has the following properties:

 


General preparations for the SLEE part of the plug-in

  1. Make sure the files for the SLEE plug-in and SLEE plug-in interfaces are copied to the directory exampleproj. That is, all files and directories in module_templates\plugin_impl and module_templates\plugin_if.
  2. Make sure the files for the Web Services part of the plug-in interfaces are copied to the directory exampleproj. That is, all files and directories in module_templates\wplugin_if and module_templates\wplugin_impl
  3. Change directory to bea\wlng21\esdk\exampleproj\build and issue the command ant

 


Preparing the SLEE plug-in interface

Set up the build environment

  1. Edit the file exampleproj\plugin_if\build.xml.
  2. Edit the properties described in Adapting the build files for the modules on page 15-40 to reflect the desired names.

Define the plug-in interface structure

  1. In the file exampleproj\plugin_if\idl\my_plugin_if.idl, change the plug-in interface structure to reflect the desired package structure. For example, the structure:
  2. module com {
             module acompany{
                      module myplugintype{

    Will create the plug-in structure com.acompany.myplugintype

Interfaces in the plug-in

These interfaces are defined:

In the example two methods related to application-initiated request will be called from by the plug-in to the ESPA service capability, myMethodRes and myMethodErr. Both methods are responses to the operation exampleMethodReq, invoked by the ESPA service capability and implemented by the plug-in.

assignmentID is the ID that connects an invocation to myMethodReq and the corresponding invocation of myMethodRes or myMethodErr.

In the example one method related to network initiated request will be called from by the plug-in to the ESPA service capability, myDeliverNetworkTriggeredEventMethod. This method is used to deliver network triggered events to the ESPA service capability. As a response to a network triggered event, the following methods will be invoked from the ESPA service capability:

networkTransactionId is the ID that connects an invocation to myDeliverNetworkTriggeredEventMethod and the corresponding invocation of myDeliverNetworkTriggeredEventMethodResult or myDeliverNetworkTriggeredEventMethodError.

  1. Add or change additional methods to be used in the interface between the ESPA service capability and the plug-in. Use the definitions in exampleproj\plugin_if\idl\my_plugin_if.idl as templates.

 


Compilation of the SLEE plug-in interface

  1. Compile the Web Services plug-in interface by changing directory to exampleproj\wplugin_if and execute the command ant
  2. This compiles the interface between the SLEE plug-in and the Web services part of the plug-in to be used by the SLEE plug-in implementation.

  3. Compile the SLEE plug-in interface by changing directory to exampleproj\plugin_if and execute the command ant
  4. This compiles the SLEE plug-in interface, and generates Java and CORBA files to be used by the plug-in implementation.

 


Preparing the SLEE plug-in implementation

Set up the build environment

  1. Edit the file exampleproj\plugin_impl\build.xml.
  2. Edit the properties described in Adapting the build files for the modules on page 15-40 to reflect the desired names.
  3. Note: Always use a prefix in the jar name. The autostarted SLEE services are started in alphabetic order based on the jar name. All network plug-ins should have a prefix so they are started prior to the ESPA service capability modules.

Defining the plug-in OAM methods

  1. Edit the files exampleproj\plugin_impl\idl\MyPluginOAM.idl. Define any additional OAM methods.

Adapting the plug-in interface implementation

  1. Adapt the plug-in interface so it implements the plug-in interface as defined in Interfaces in the plug-in.
  2. Edit the file MyPlugin_impl.java in exampleproj\plugin_impl\src\com\acompany\plugin\myplugintype.
  3. If the name of the interface in the plug-in has changed, change the name of the POA the class extends to reflect the new name.
  4. If the methods in the plug-in interface has changed, also change the names of the implementing methods in this class.
  5. Edit the file MyMethodReqTask.java in exampleproj\plugin_impl\src\com\acompany\plugin\myplugintype
  6. Adapt the methods so they use call-back methods defined in the plug-in interface as defined in Interfaces in the plug-in.

Plug-in type definition

Each plug-in has a type definition and information on supported address plans.

  1. Edit the file MyPluginContext.java in exampleproj\plugin_impl\src\com\acompany\plugin\ and change the PLUGIN_TYPE definition to the desired type.
  2. Define which address plan(s) that is (are) supported in the TrAddressPlan[] structure.

    As default, the address plan is TrAddressPlan.R_ADDRESS_PLAN_E164, see the JavaDoc for the ESPA service capability and plug-in interfaces for a list of address plans.

 


Compilation of the SLEE plug-in implementation

Compile the plug-in implementation by changing directory to exampleproj\plugin_impl and execute the command ant

 


Installing the SLEE plug-in

This section describes how to install and deploy the plug-in that was created using the instructions in this section. For instructions on how to use the Management Tool and how to register a plug-in in more detail, see WebLogic Network Gatekeeper User's Guide.

  1. Make sure you have access (by ftp directly to the file system) to the SLEE the plug-in shall be installed in.
  2. Open the Management Tool and select the SLEE where to install the plug-in.
  3. In the management tool, select the Plugin_Manager service, and invoke the method addType. Use the type defined for the plug-in.
  4. In the example, the plug-in type is MYPLUGIN_TYPE, as defined in step 18. in Plug-in type definition.

  5. In the SLEE_deployment service, select install. Enter the URL to the jar-file in the field ServiceJarURL and click Invoke.
  6. In the example, the path is:

    file:///<drive>/exampleproj/plugin_impl/lib and the name was defined in the build file property local.jarName.

    Note: Use three (3) slashes before the drive name on Windows systems.

  7. In the SLEE_deployment service, select start. Enter the SLEE name for the plug-in. Click Invoke.
  8. The name was defined in the build file property local.deployName.

  9. In the SLEE_deployment service, select activate. Enter the SLEE name for the plug-in. Click Invoke.

 


Setting up a plug-in route

It is necessary to define a route, so the plug-in can be selected by the plug-in manager.

  1. In the management tool, select the Plugin_Manager service, and invoke the method getIdList. Do not define any parameters.
  2. An ID for the plug-in is returned.

  3. In the management tool, choose the Plugin_Manager service, and invoke the method addRoute. In the Id field, enter the ID returned from the previous operation.
  4. In the addressExpression field, enter ^.* in order make the plug-in accept all destination address numbers, or other routing criteria that is desired.

 


General preparations for the Web Services part of the plug-in

  1. Make sure the files for the Web Service plug-in and plug-in interfaces are copied to the directory exampleproj. That is, all files and directories in module_templates\wplugin_impl and module_templates\wplugin_if.
  2. Change directory to bea\wlng21\esdk\build and issue the command ant

 


Preparing the Web Services plug-in interface

Set up the build environment

  1. Edit the file exampleproj\wplugin_if\build.xml.
  2. Edit the properties described in Adapting the build files for the modules on page 15-40 to reflect the desired names.

Interfaces in the plug-in

There are three interfaces defined:

In the example these methods will be called from the SLEE service part of the plug-in to Web Services part of the plug-in.

  1. Add or change additional methods to be used in the interface between the SLEE service part of the network plug-in and the Web Services part of the plug-in. Use the definitions in exampleproj\wplugin\myplugintype as templates.

 


Compilation of the Web Services part of the plug-in interface

  1. Compile the plug-in interface by changing directory to exampleproj\wplugin_if and execute the command ant
  2. This compiles the plug-in interface.

 


Preparing the Web Services part of the plug-in implementation

Set up the build environment

  1. Edit the file exampleproj\plugin_impl\build.xml.
  2. Edit the properties described in Adapting the build files for the modules on page 15-40 to reflect the desired names.
  3. Note: Always use a prefix in the jar name. The autostarted SLEE services are started in alphabetic order based on the jar name. All network plug-ins should have a prefix so they are started prior to the ESPA service capability modules.

Adapting the Web Services plug-in interface implementation

  1. Adapt the plug-in interface so it implements the plug-in interface as defined in Interfaces in the plug-in on page 16-8.
  2. Edit the file NetworkInterfaceImpl.java, MyWPluginNetworkTriggeredEventResultListenerImpl.java and MyWPluginServlet.java in exampleproj\wplugin_impl\src\com\acompany\wplugin\myplugintype.
  3. If the names of the interfaces has changed, change the name of the names the classes implements to reflect the new name.
  4. If the methods in the interfaces has changed, also change the names of the implementing methods in this class.

 


Compilation of the Web Services plug-in implementation

Generate Java stubs from the WSDL file that describes the interface between the Web Services part of the plug-in and the network node, by changing directory to exampleproj\network_if and execute the command ant

Compile the Web Services plug-in implementation by changing directory to exampleproj\wplugin_impl and execute the command ant

 


Installing the Web Service plug-in

This section describes how to install and deploy the Web Services plug-in that was created using the instructions in this section. For instructions on how to use the Management Tool, see WebLogic Network Gatekeeper User's Guide.

  1. Make sure you have access (by ftp directly to the file system) to the SLEE the plug-in shall be installed in.
  2. Copy the generated war file to the /<install dir>/slee/bin/autowar directory in the Network Gatekeeper.
  3. Open the Management Tool and select the SLEE running on the server the file was copied to.
  4. 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.

  5. Click Invoke.
  6. The Web Service part of the plug-in is started.

 

Skip navigation bar  Back to Top Previous Next