...
Code Block | ||||
---|---|---|---|---|
| ||||
@HookType( value = UserDelegationHook.class ) public class UserDelegationHookProcessor extends HookProcessorAdapter<UserDelegationHook>AbstractHookProcessor<UserDelegationHook> implements UserDelegationHook { public boolean confirmCreateDelegation( String userName, UserDelegation delegation ) { boolean confirm = true; for ( DelegationHook hook : getHooks() ) { try { confirm = hook.confirmCreateDelegation( String userName, delegation ); if( confirm == false ) { return false; } } catch ( HookException e ) { throw new HookExecutorException( "Hook " + hook.getClass().getSimpleName() + " zwrócił następujący wyjątek: '" + e.getMessage() + "'" ); } } return confirm; } public void delegationAdded( String userName, UserDelegation delegation ) { for ( DelegationHook hook : getHooks() ) { try { hook.delegationAdded( String userName, delegation ); } catch ( HookException e ) { throw new HookExecutorException( "Hook " + hook.getClass().getSimpleName() + " zwrócił następujący wyjątek: '" + e.getMessage() + "'" ); } } } } |
...