Importing External Commands and Libraries

Importing External Commands

If the user wishes to import some external or custom BeanShell commands, there is a special module implementation distributed with core Bean Sheet that can be used to import those commands. The user will need to be aware of command classpath as well as packages1. As always, the module will be declared using a module descriptor properties file in the module directory next to beansheet-<ver>.jar or beansheet_bundle-<ver>.jar as follows:

mod.impl.class zinger.bsheet.module.CommandImportModule

mod.class.path <command and library classpath separated by whitespaces>

importCommands <command packages separated by whitespaces>

Starting with version 0.9.6, Bean Sheet is distributed with its own command extensions imported this way declared in commands.properties. This declaration can be used as an example for other such imports, but it is recommended that it not be extended because it will get overwritten when upgrading Bean Sheet.

Importing External Libraries

It is possible to let Bean Sheet use external libraries without running it with a different system classpath by using a special case of command import that does not import any commands, but merely introduces new classloaders pointed to the desired external libraries:

mod.impl.class zinger.bsheet.module.CommandImportModule

mod.class.path <library classpath separated by whitespaces>

importCommands /



1See BeanShell documentation for the basics on writing external commands.