protected void loadPlugin(ServerPluginEnvironment env, boolean enabled) throws Exception {
if (enabled) {
// validate some things about this plugin that are specific for bundle functionality
BundlePluginDescriptorType descriptor = (BundlePluginDescriptorType) env.getPluginDescriptor();
BundleType bt = descriptor.getBundle();
if (bt == null || bt.getType() == null || bt.getType().length() == 0) {
// if the xml parser did its job, this will probably never happen, but just in case, make sure there is
// a non-null, valid bundle type name - we have other code that expects this to be true
throw new Exception("The bundle plugin [" + env.getPluginKey().getPluginName()
+ "] did not specify a valid bundle type in its descriptor");
}