Bean Scripting Framework

Bean Scripting Framework - aka BSF - was an "Achitecture for incorporating scripting into Java applications, applets and servlets". This was provided extending initial body rule.

BSF support

A transduce can - using such extension - have rule body written using different idioms and a new tag Script was provided for this purpose (Following HTML convention). Such tag a two attributes. One - required - denoting the language used and the second was a possible file inclusion in the same language.

            
    <Transducer syntax='$(vodoo-stream.site)/xsp/xsp.xsp'
                extends='$(vodoo-stream.site)/xsp/xsp.xsp'
                class='$(vodoo-stream.home)/lib/vodoo/BSFAdapter.jar'
                handler='vodoo.stream.transduce.bsf.BSFHandler'>

     <Method name='notifyConfiguration'>
      <Parameter>$(vodoo-stream.site)/bsf/languages.xsp</Parameter>
      <Parameter>$(vodoo-stream.site)/bsf/languages.xml</Parameter>
     </Method>

     <When>
      <Path>
       <ElementPath path='Transducer/Extends?/Groups?/Group?/When?'/>
      </Path>
      <Element name='Script'>
       <Attribute name='language' type='required'/>
       <Attribute name='source'   type='implied'/>
       <Method name='notifyMethod'/>
      </Element>
     </When>

     <When>
      <Path>
       <ElementPath path='Transducer/Extends?/Groups?/Group?/When?'/>
      </Path>
      <Element name='Condition'>
       <Attribute name='language' type='required'/>
       <Attribute name='source'   type='implied'/>
       <Method name='notifyPredicate'/>
      </Element>
     </When>

   </Transducer>
        
BSF integration [site-xsp/bsf/bsf.xsp]
Bean Scripting Framework Initialisation

In the BSF Support section we define an extension for BFS support. Such support lets users writing code using differents languages in a same transducer. One keypoint of this integration was the way languages are declared.

First instructions are the initialisation of BSF also based on transducers. Back to the BSF extension this was started by the following code fragment.


 <Transducer syntax='$(vodoo-stream.site)/xsp/xsp.xsp'
             extends='$(vodoo-stream.site)/xsp/xsp.xsp'
             class='$(vodoo-stream.home)/lib/vodoo/BSFAdapter.jar'
             handler='vodoo.stream.transduce.bsf.BSFHandler'>

  <Method name='notifyConfiguration'>
   <Parameter>$(vodoo-stream.site)/bsf/languages.xsp</Parameter>
   <Parameter>$(vodoo-stream.site)/bsf/languages.xml</Parameter>
  </Method>

  ...

 </Transducer>
        
BSF integration [site-xsp/bsf/bsf.xsp]

A First remark was the dog fooding technic used to configure the BSF handler. Such configuration mechanism uses first a transducer for XML analysis and second a file containing the configuration.