Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
titlePrzykład
@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() + "'" );
			}
		}
	}
}

...