WebSphere

Creating an emitter factory with scripting

You can create an emitter factory using a Jacl or Jython script.

Before you begin

Before starting this task, the wsadmin tool must be running. See the WebSphere® Application Server documentation for more information.

About this task

Perform the following steps to configure a new emitter factory.
Procedure
  1. Identify the Common Event Infrastructure provider ID.
    • Using Jacl:
      set providerid [$AdminConfig getid \
      /Cell:mycell/Node:mynode/Server:myserver/ \
      EventInfrastructureProvider:/]
    • Using Jython:
      providerid =
      AdminConfig.getid('/Cell:mycell/Node:mynode/Server:myserver/EventInfrastructureProvider:/')
      print providerid
    Example output:
    EventInfrastructureProvider(cells/mycell/nodes/mynode/servers/myserver|resources-cei.xml#
      EventInfrastructureProvider_1)
  2. Set the required attributes.
    • Using Jacl:
      set Name [list name "EmitterName"]
      set JndiName [list jndiName "Put JNDI name for new emitter factory here"]
      set Description [list description "Put description here"]
      set Category [list category "Put category here"]
      
      # set TransactionMode to true to send each event in a new transaction
      set TransactionMode [list preferredTransactionMode "false"]
      
      # set SynchronizationMode to true to use synchronous event transmission
      # as the preferred synchronization mode
      set SynchronizationMode [list preferredSynchronizationMode "true"]
      
      # leave blank if synchronous transmission is not supported
      set SyncJNDIName [list synchronousTransmissionProfileJNDIName \
        "Put JNDI name of synchronous transmission profile here "]
      
      # leave blank if asynchronous transmission is not supported
      set AsyncJNDIName [list asynchronousTransmissionProfileJNDIName \
        "Put JNDI name of asynchronous transmission profile here "]
      
      set FilteringEnabled [list filteringEnabled "false"]
      
      # leave blank if filtering is not enabled
      set FilterJNDIName [list filterFactoryJNDIName \
        "Put JNDI name of event filter here"]
      
      # custom properties include compatibility mode
      set CompatibilityMode [list [list name compatibilityMode] \
        [list description ""] \
        [list required false] \
        [list type java.lang.Boolean] \
        [list value "false"] ] \
      set resProp [list [list resourceProperties [list \
        $CompatibilityMode ]]]
    • Using Jython:
      Name = ['name', 'EmitterName']
      JndiName = ['jndiName', 'Put JNDI name for new emitter factory here']
      Description = ['description', 'Put description here']
      Category = ['category', 'Put category here']
      
      # set TransactionMode to true to send each event in a new transaction
      TransactionMode = ['preferredTransactionMode', 'false']
      
      # set SynchronizationMode to true to use synchronous event transmission
      # as the preferred synchronization mode
      SynchronizationMode = ['preferredSynchronizationMode', 'true']
      
      # leave blank if synchronous transmission is not supported
      SyncJNDIName = ['synchronousTransmissionProfileJNDIName', \
                      'Put JNDI name of synchronous transmission profile here']
      
      # leave blank if asynchronous transmission is not supported
      AsyncJNDIName = ['asynchronousTransmissionProfileJNDIName', \
                       'Put JNDI name of asynchronous transmission profile here']
      
      FilteringEnabled = ['filteringEnabled', 'false']
      
      # leave blank if filtering is not enabled
      FilterJNDIName = ['filterFactoryJNDIName', 'Put JNDI name of event filter here']
      
      # custom properties include compatibility mode
      compatibilityName = ['name','compatibilityMode']
      compatibilityDescription = ['description','']
      compatibilityRequired = ['required', 'false']
      compatibilityType = ['type', 'java.lang.Boolean']
      compatibilityValue = ['value', 'false']
      CompatibilityMode = [compatibilityName, compatibilityDescription, compatibilityRequired, \
                           compatibilityType, compatibilityValue]
      customProperties = ['propertySet', [['resourceProperties', [CompatibilityMode]]]]
  3. Set the properties for the new emitter factory.
    • Using Jacl:
      set properties "[list $Name $JndiName $Description $Category \
        $TransactionMode $SynchronizationMode $AsyncJNDIName \
        $SyncJNDIName $FilteringEnabled $FilterJNDIName \
                    [list propertySet $resProp]]"
    • Using Jython:
      properties = [Name,JndiName,Description,Category,TransactionMode,
      SynchronizationMode,AsyncJNDIName,SyncJNDIName,FilteringEnabled, 
      FilterJNDIName, customProperties]
      print properties
    Example output:
    [['name', 'EmitterName'], ['jndiName', 'Put JNDI name for new 
    emitter factory here'], ['description', 'Put description here'], 
    ['category', 'Put category here'], ['preferredTransactionMode', 
    'false'], ['preferredSynchronizationMode', 'true'], 
    ['asynchronousTransmissionProfileJNDIName', 'Put JNDI name of 
    asynchronous transmission profile here '], 
    ['synchronousTransmissionProfileJNDIName', 'Put JNDI name of 
    synchronous transmission profile here '], ['filteringEnabled', 
    'false'], ['filterFactoryJNDIName', 'Put JNDI name of event 
    filter here'], ['propertySet', [['resourceProperties', [[['name', 
    'compatibilityMode'], ['description', ''], ['required', 'false'], 
    ['type', 'java.lang.Boolean'], ['value', 'false']]]]]]]
  4. Create the emitter factory.
    • Using Jacl:
      set emitterProf [$AdminConfig create EmitterFactoryProfile \
      $providerid $properties]
    • Using Jython:
      print AdminConfig.create('EmitterFactoryProfile', providerid, properties)
    Example output:
    EmitterName(cells/mycell/nodes/mynode/servers/myserver|resources-cei.xml#EmitterFactoryProfile_1)
  5. Save the configuration changes.
  6. In a network deployment environment only, synchronize the node.
  7. Restart the server.

task Task topic

Terms of use | Feedback


Timestamp icon Last updated: 22 June 2010


http://publib.boulder.ibm.com/infocenter/dmndhelp/v6r2mx/topic/com.ibm.websphere.cei.620.doc/doc/tcei_create_emitter_factory_profile_script.html
Copyright IBM Corporation 2005, 2010. All Rights Reserved.
This information center is powered by Eclipse technology (http://www.eclipse.org).