try {
if ( !StringUtils.isEmpty( plugin.getLifecycleListenerClassname() ) ) {
listener = loader.loadClass( plugin.getLifecycleListenerClassname() ).newInstance();
}
} catch ( Throwable t ) {
throw new PlatformPluginRegistrationException( Messages.getInstance().getErrorString(
"PluginManager.ERROR_0017_COULD_NOT_LOAD_PLUGIN_LIFECYCLE_LISTENER", plugin.getId(), plugin //$NON-NLS-1$
.getLifecycleListenerClassname() ), t );
}
if ( listener != null ) {
if ( !IPluginLifecycleListener.class.isAssignableFrom( listener.getClass() ) ) {
throw new PlatformPluginRegistrationException(
Messages
.getInstance()
.getErrorString(
"PluginManager.ERROR_0016_PLUGIN_LIFECYCLE_LISTENER_WRONG_TYPE", plugin.getId(),
plugin.getLifecycleListenerClassname() ) ); //$NON-NLS-1$