Examples of ControllerException


Examples of ca.simplegames.micro.controllers.ControllerException

            } else if (e instanceof RedirectException || e.getCause() instanceof RedirectException) {
                throw new RedirectException();
            }

            if (e.getCause() != null && e.getCause() instanceof ControllerException) {
                throw new ControllerException(e.getMessage());
            }
            throw new ViewException(e.getMessage());
        }
    }
View Full Code Here

Examples of ca.simplegames.micro.controllers.ControllerException

                                        .getDeclaredMethod(ControllerManager.EXECUTE_METHOD, paramTypes);
                                method.invoke(controller, params);
                            } catch (Exception e) {
                                repository.getLog().error(String.format("%s, error: %s", controllerName, e.getMessage()));
                                e.printStackTrace();
                                throw new ControllerException(e.getMessage());
                            }
                        } else {
                            controllerManager.execute(controllerName, context, (Map) controllerMap.get(Globals.OPTIONS));
                        }
                    }
View Full Code Here

Examples of douyu.mvc.ControllerException

      if (m.equals(method)) {
        return;
      }
    }

    throw new ControllerException("501 Not Implemented method: " + method);
  }
View Full Code Here

Examples of douyu.mvc.ControllerException

  public void executeAction(String actionName) throws ControllerException {
    this.actionName = actionName;
    try {
      executeAction();
    } catch (Exception e) {
      throw new ControllerException("failed to execute action: " + actionName, e);
    }
  }
View Full Code Here

Examples of jade.wrapper.ControllerException

   * @param localAgentName The short local name of the desired agent.
   * @throws ControllerException If any problems occur obtaining this proxy.
   */
  public static AgentController getAgent(String localName) throws ControllerException {
    if(myFrontEnd == null) {
      throw new ControllerException("FrontEndContainer  not found");
    }
    // Check that the agent exists
    jade.core.Agent instance = myFrontEnd.getLocalAgent(localName);
    if (instance == null) {
      throw new ControllerException("Agent " + localName + " not found.");
    }
    return new MicroAgentControllerImpl(localName, myFrontEnd);
  }
View Full Code Here

Examples of jade.wrapper.ControllerException

    if (myContainer == null || !myContainer.isJoined()) {
      initProfile();
     
      myContainer = Runtime.instance().createAgentContainer(profile);
      if (myContainer == null) {
        throw new ControllerException("JADE startup failed.");
      }
    }
    if (myAgent == null) {
      try {
        Agent a = (Agent) Class.forName(agentType).newInstance();
        if (a instanceof GatewayAgent) {
          //#DOTNET_EXCLUDE_BEGIN
          ((GatewayAgent) a).setListener(new GatewayListenerImpl());
          //#DOTNET_EXCLUDE_END
         
          // We are able to detect the GatewayAgent state only if the internal agent is a GatewayAgent instance
          gatewayAgentState = NOT_ACTIVE;
        }
        a.setArguments(agentArguments);
        myAgent = myContainer.acceptNewAgent("Control"+myContainer.getContainerName(), a);
       
        if (gatewayAgentState == NOT_ACTIVE) {
          // Set the ACTIVE state synchronously so that when checkJADE() completes isGatewayActive() certainly returns true
          gatewayAgentState = ACTIVE;
        }
        myAgent.start();
      }
      catch (StaleProxyException spe) {
        // Just let it through
        throw spe;
      }
      catch (Exception e) {
        throw new ControllerException("Error creating GatewayAgent [" + e + "]");
      }
    }
  }
View Full Code Here

Examples of nz.co.transparent.client.db.ControllerException

          columnMap.get(primaryKeyName),
          rsh);

      if (columnMapTemp == null) {
        conn.rollback();
        throw new ControllerException("GenericController: Cannot find record.");
      }

      Date oldDate = (java.util.Date) columnMap.get("date_updated");
      Date newDate = (java.util.Date) columnMapTemp.get("date_updated");
      if (!oldDate.equals(newDate)) {
        conn.rollback();
        throw new UpdaterException();
        // Signal that record has already been changed
      }

      sql = "update " + tableName;
      String parameter = null;
      String columnName = null;
      List columnNameList = null;
      List paramList = new ArrayList();
      // Iterate over columns
      Set columnSet = columnMapTemp.keySet();
      Iterator iterator = columnSet.iterator();
      int i = 0;
      while (iterator.hasNext()) {
        columnName = (String) iterator.next();

        if (columnName.equals("date_updated")) {
          parameter = "CURRENT_TIMESTAMP";
        } else {
          parameter = "?";
          paramList.add(columnMap.get(columnName));
        }

        if (i++ == 0) {
          sql += " set " + columnName + " = " + parameter;
        } else {
          sql += " ," + columnName + " = " + parameter;
        }
      }

      sql += " where (" + primaryKeyName + "=?)";
      paramList.add(columnMap.get(primaryKeyName));
      // Add primaryKey value to paramList
      int result = queryRunner.update(sql, paramList.toArray());

      if (result == 0) {
        conn.rollback();
      } else {
        conn.commit();
      }

      return result;
    } catch (SQLException se) {
      log.warning("SQL Exception: " + se.getMessage());
      try {
        conn.rollback();
      } catch (SQLException se2) {
        log.warning("SQL Exception: " + se2.getMessage());
        throw new ControllerException(se2);
      }
      throw new ControllerException(se);
    } finally {
      try {
        DbUtils.close(conn);
      } catch (SQLException se3) {
        log.warning("SQL Exception: " + se3.getMessage());
        throw new ControllerException(se3);
      }
    }
  }
View Full Code Here

Examples of nz.co.transparent.client.db.ControllerException

      recordMap.put("is_default", Boolean.FALSE);
      updateRecord(tableName, primaryKeyName, recordMap);
    } catch (SQLException se) {
      log.warning("GenericController: " + se.getMessage());
      throw new ControllerException(se);
    } catch (UpdaterException ue) {
      throw new ControllerException(ue);
    }
  }
View Full Code Here

Examples of nz.co.transparent.client.db.ControllerException

    try {
      queryRunner.update(sql);
    } catch (SQLException se) {
      log.warning("GenericController: " + se.getMessage());
      throw new ControllerException(se);
    }
  }
View Full Code Here

Examples of nz.co.transparent.client.db.ControllerException

    try {
      queryRunner.update(sql);
    } catch (SQLException se) {
      log.warning("GenericController: " + se.getMessage());
      throw new ControllerException(se);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.