Package org.wicketstuff.security.actions

Examples of org.wicketstuff.security.actions.RegistrationException


           * @see org.wicketstuff.security.actions.ActionFactory#register(Class, String)
           */
          public WaspAction register(Class<? extends WaspAction> waspActionClass,
            String name) throws RegistrationException
          {
            throw new RegistrationException(
              "this test factory does not allow registration");
          }

          /**
           *
 
View Full Code Here


   */
  public synchronized TestAction register(Class<? extends WaspAction> waspActionClass, String name)
    throws RegistrationException
  {
    if (AllActions.class.isAssignableFrom(waspActionClass))
      throw new RegistrationException("Can not register 'all' actions");
    TestAction temp = registeredClassActions.get(waspActionClass);
    if (temp != null)
      return temp;
    if (WaspAction.class.isAssignableFrom(waspActionClass))
    {
      if (power > 30)
        throw new RegistrationException("Can not register more then 32 different actions.");
      // 32 since we start at 0 :)
      int action = nextPowerOf2();
      return register(waspActionClass, new TestAction(action, name, getFactoryKey()));
    }
    throw new RegistrationException(waspActionClass + " is not a " + WaspAction.class.getName());
  }
View Full Code Here

  protected final synchronized TestAction register(Class<? extends WaspAction> waspActionClass,
    TestAction action) throws RegistrationException
  {
    // sanity checks
    if (AllActions.class.isAssignableFrom(waspActionClass))
      throw new RegistrationException("Can not register 'all' actions");
    if (power > 30)
      throw new RegistrationException("Can not register more then 32 different actions.");
    int assignedPowerOf2 = nextPowerOf2();
    if (assignedPowerOf2 > maxAssingableAction)
      throw new RegistrationException(
        "Unable to register an action with a base value greater then " +
          maxAssingableAction);
    if (assignedPowerOf2 < 0)
      throw new RegistrationException(assignedPowerOf2 + " is not a positive value");
    // includes any implied actions
    Integer powerOf2 = Integer.valueOf(action.actions());
    if (!implies(powerOf2.intValue(), assignedPowerOf2))
      throw new RegistrationException("Unable to register action '" + action.getName() +
        "' with value " + powerOf2 + " expected " + assignedPowerOf2 + " or more.");
    // end of checks

    stringValues.put(powerOf2, action.getName());
    registeredIntActions.put(Integer.valueOf(power), action);
View Full Code Here

   */
  public SwarmAction register(Class<? extends WaspAction> waspActionClass,
    String name) throws RegistrationException
  {
    if (AllActions.class.isAssignableFrom(waspActionClass))
      throw new RegistrationException("Can not register 'all' actions");
    SwarmAction temp = registeredClassActions.get(waspActionClass);
    if (temp != null)
      return temp;
    if (WaspAction.class.isAssignableFrom(waspActionClass))
    {
      if (power > 30)
        throw new RegistrationException("Can not register more then 32 different actions.");
      // 32 since we start at 0 :)
      int action = nextPowerOf2();
      return register(waspActionClass, new SwarmAction(action, name, getFactoryKey()));
    }
    throw new RegistrationException(waspActionClass + " is not a " + WaspAction.class.getName());
  }
View Full Code Here

  protected final SwarmAction register(Class<? extends WaspAction> waspActionClass,
    SwarmAction action) throws RegistrationException
  {
    // sanity checks
    if (AllActions.class.isAssignableFrom(waspActionClass))
      throw new RegistrationException("Can not register 'all' actions");
    if (power > 30)
      throw new RegistrationException("Can not register more then 32 different actions.");
    int assignedPowerOf2 = nextPowerOf2();
    if (assignedPowerOf2 > maxAssingableAction)
      throw new RegistrationException(
        "Unable to register an action with a base value greater then " +
          maxAssingableAction);
    if (assignedPowerOf2 < 0)
      throw new RegistrationException(assignedPowerOf2 + " is not a positive value");
    // includes any implied actions
    Integer powerOf2 = Integer.valueOf(action.actions());
    if (!implies(powerOf2.intValue(), assignedPowerOf2))
      throw new RegistrationException("Unable to register action '" + action.getName() +
        "' with value " + powerOf2 + " expected " + assignedPowerOf2 + " or more.");
    // end of checks

    stringValues.put(powerOf2, action.getName());
    registeredIntActions.put(power, action);
View Full Code Here

TOP

Related Classes of org.wicketstuff.security.actions.RegistrationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.