Examples of Action


Examples of me.taylorkelly.bigbrother.datablock.BBDataBlock.Action

            rs = ps.executeQuery();
            conn.commit();

            int size = 0;
            while (rs.next()) {
                Action action = Action.values()[rs.getInt("action")];
                int type = rs.getInt("type");

                switch (action) {
                    case BLOCK_BROKEN:
                    case LEAF_DECAY:
View Full Code Here

Examples of mfinder.annotation.Action

        //trim empay and '/'
        String namespace = ns == null ? PATH_SEPARATOR + "" : PATH_SEPARATOR + StringUtil.trim(ns.name(), PATH_SEPARATOR);

        String path = null;
        //not nullable Action
        Action action = method.getAnnotation(Action.class);
        //Action名称可能为空字符串
        String aname = action.name().trim();
        if ("".equals(aname)) {
            //Action名称为空字符串时取其方法的名称(区分大小写)
            aname = method.getName();
            //if namespace is '/' or not
            path = namespace.length() == 1 ? PATH_SEPARATOR + aname : namespace + PATH_SEPARATOR + aname;
        } else {
            //action's name can't be null by annotation
            String name = StringUtil.trim(aname, PATH_SEPARATOR);
            //if action's name is trim as empty
            if (name.isEmpty()) {
                path = namespace;
            } else if (PATH_SEPARATOR == aname.charAt(0)) {
                path = PATH_SEPARATOR + name;
            } else {
                //if namespace is '/' or not
                path = namespace.length() == 1 ? PATH_SEPARATOR + name : namespace + PATH_SEPARATOR + name;
            }
        }

        //包含特别属性注入的Action需重新生成对象
        if (obj != null && Injector.actionInjection.containsKey(path)) {
            obj = objectFactory.newInstance(obj.getClass());
            Injector.injectAction(path, obj);
        }

        //Action中不记录路径的后缀名称
        ActionProxy ap = new ActionProxy(this, namespace, path, action, method, obj);

        //interceptorStack
        String stackName = action.interceptorStack().trim();
        //not not nullable action's interceptors
        String[] interceptorNames = action.interceptors();

        List<InterceptorProxy> inters = new ArrayList<InterceptorProxy>();
        //action interceptors
        if (interceptorNames.length != 0) {
            ////action interceptorStack
            if (StringUtil.isNotNull(stackName)) {
                addActionInterceptors(inters, stackName, ap);
            }
            //action中申明的interceptors
            for (String name : action.interceptors()) {
                InterceptorProxy ip = interceptors.get(name);
                if (ip == null) {
                    LOG.warn("No such Interceptor [" + name + "] defined in : " + ap.getMethodInfo());
                } else {
                    inters.add(ip);
                }
            }
        } //action interceptorStack
        else if (StringUtil.isNotNull(stackName)) {
            addActionInterceptors(inters, stackName, ap);
        } else {
            //是否已设置action的拦截器集合
            boolean setInterceptors = false;
            //namespace interceptorStack & interceptors
            if (ns != null) {
                //namespace interceptorStack
                if (StringUtil.isNotNull(stackName = ns.interceptorStack().trim())) {
                    setInterceptors = true;
                    addActionInterceptors(inters, stackName, ap);
                }
                //namespace interceptors
                if (ns.interceptors().length != 0) {
                    setInterceptors = true;
                    for (String name : ns.interceptors()) {
                        InterceptorProxy ip = interceptors.get(name);
                        if (ip == null) {
                            LOG.warn("No such Interceptor [" + name + "] defined in : " + ap.getMethodInfo());
                        } else {
                            inters.add(ip);
                        }
                    }
                }
            }
            //defaultInterceptorStack
            if (!setInterceptors) {
                if (StringUtil.isNotNull(stackName = defaultInterceptorStack)) {
                    addActionInterceptors(inters, stackName, ap);
                }
            }
        }
        //trim
        ((ArrayList) inters).trimToSize();
        ap.setInterceptors(inters);

        //set results
        Result[] rs = action.results();
        Map<String, Result> res = new HashMap<String, Result>(rs.length);
        for (Result r : rs) {
            res.put(r.name(), r);
        }
        ap.setResults(res);
View Full Code Here

Examples of model.tools.flowmanager.Action

      for (int i = 0; i < json.length(); i++) {
        obj = json.getJSONObject(i);
        String objActionType = obj.getString("type");
        try{
        if (objActionType.equals("OUTPUT")) {
          actions.add(new Action("output", String.valueOf(obj
              .getInt("port")), "Port"));
        } else if (objActionType.equals("OPAQUE_ENQUEUE")) {
          actions.add(new Action("enqueue", String.valueOf(obj
              .getInt("port") + ":" + obj.getInt("queueId")),
              "Port:Queue ID"));
        } else if (objActionType.equals("STRIP_VLAN")) {
          actions.add(new Action("strip-vlan", ""));
        } else if (objActionType.equals("SET_VLAN_ID")) {
          actions.add(new Action("set-vlan-id", String.valueOf(obj
              .getInt("virtualLanIdentifier")), "VLAN ID"));
        } else if (objActionType.equals("SET_VLAN_PCP")) {
          actions.add(new Action("set-vlan-priority",
              String.valueOf(obj
                  .getInt("virtualLanPriorityCodePoint")),
              "VLAN PCP"));
        } else if (objActionType.equals("SET_DL_SRC")) {
          String dl = obj.getString("dataLayerAddress");
          actions.add(new Action("set-src-mac", dl,
              "Data Layer Address"));
        } else if (objActionType.equals("SET_DL_DST")) {
          String dl = obj.getString("dataLayerAddress");
          actions.add(new Action("set-dst-mac", dl,
              "Data Layer Address"));
        } else if (objActionType.equals("SET_NW_TOS")) {
          actions.add(new Action("set-tos-bits", String.valueOf(obj
              .getInt("networkTypeOfService")),
              "Network Type Of Service"));
        } else if (objActionType.equals("SET_NW_SRC")) {
          long ip = obj.getLong("networkAddress");
          byte[] bytes = BigInteger.valueOf(ip).toByteArray();
          InetAddress address = null;

          try {
            address = InetAddress.getByAddress(bytes);
          } catch (UnknownHostException e) {
            System.out.println("Getting address failed.");
            e.printStackTrace();
          }

          actions.add(new Action("set-src-ip", address.toString()
              .replaceAll("/", ""), "Network Address"));
        } else if (objActionType.equals("SET_NW_DST")) {
          long ip = obj.getLong("networkAddress");
          byte[] bytes = BigInteger.valueOf(ip).toByteArray();
          InetAddress address = null;

          try {
            address = InetAddress.getByAddress(bytes);
          } catch (UnknownHostException e) {
            System.out.println("Getting address failed.");
            e.printStackTrace();
          }

          actions.add(new Action("set-dst-ip", address.toString()
              .replaceAll("/", ""), "Network Address"));
        } else if (objActionType.equals("SET_TP_SRC")) {
          actions.add(new Action("set-src-port", String.valueOf(obj
              .getInt("transportPort")), "Transport Port"));
        } else if (objActionType.equals("SET_TP_DST")) {
          actions.add(new Action("set-dst-port", String.valueOf(obj
              .getInt("transportPort")), "Transport Port"));
      }
        }catch(Exception e1){
            e1.printStackTrace();
        }
View Full Code Here

Examples of name.pehl.karaka.client.activity.event.ActivityAction.Action

    }

    @Override
    public void onActivityAction(ActivityActionEvent event)
    {
        Action action = event.getAction();
        Activity activity = event.getActivity();
        switch (action)
        {
            case SAVE:
                save(activity);
View Full Code Here

Examples of net.fortuna.ical4j.model.property.Action

            } else if (ReminderDurationUnit.DAYS.equals(teamEvent.getReminderDurationUnit())) {
              dur = new Dur((-1) * teamEvent.getReminderDuration(), 0, 0, 0);
            }
            if (dur != null) {
              alarm.getProperties().add(new Trigger(dur));
              alarm.getProperties().add(new Action(teamEvent.getReminderActionType().getType()));
              vEvent.getAlarms().add(alarm);
            }
          }
          if (teamEvent.hasRecurrence() == true) {
            final Recur recur = teamEvent.getRecurrenceObject();
View Full Code Here

Examples of net.minecraftforge.event.entity.player.PlayerInteractEvent.Action

        WorldEdit we = WorldEdit.getInstance();
        ForgePlayer player = wrap((EntityPlayerMP) event.entityPlayer);
        ForgeWorld world = getWorld(event.entityPlayer.worldObj);

        Action action = event.action;
        switch (action) {
            case LEFT_CLICK_BLOCK: {
                WorldVector pos = new WorldVector(LocalWorldAdapter.adapt(world), event.x, event.y, event.z);

                if (we.handleBlockLeftClick(player, pos)) {
View Full Code Here

Examples of net.sf.arianne.marboard.server.action.Action

   *
   * @param caster the user performing this action
   * @param action the action to be performed provided by marauroa
   */
  public void execute(RPObject caster, RPAction action) {
    Action actionHandler = actionFactory.create(action.get("type"));
    actionHandler.onAction((User) caster, action);
  }
View Full Code Here

Examples of net.sourceforge.fullsync.Action

        }
        break;
      case State.DirHereFileThere:
        State buff = bsd.getState(dst);
        if (buff.equals(State.Orphan, Location.Buffer)) {
          actions.add(new Action(Action.Add, Location.Destination, BufferUpdate.Destination,
              "There was a node in buff, but its orphan, so add"));
        }
        else if (buff.equals(State.DirHereFileThere, state.getLocation())) {
          if (state.getLocation() == Location.Source) {
            actions.add(new Action(Action.Nothing, Location.None, BufferUpdate.Destination,
                "dirherefilethere, but there is a dir instead of file, so its in sync"));
          }
          else {
            actions.add(new Action(Action.DirHereFileThereError, Location.Destination, BufferUpdate.None,
                "file changed from/to dir, can't overwrite"));
            // TODO ^ recompare here
          }
        }
        else {
          actions.add(new Action(Action.DirHereFileThereError, state.getLocation(), BufferUpdate.None,
              "cant update, dir here file there error occured"));
        }
        break;
      case State.FileChange:
        if (bsd.getState(dst).equals(State.NodeInSync, Location.Both)) {
          if (state.getLocation() == Source) {
            actions.add(updateDestination);
          }
          else if (state.getLocation() == Destination) {
            actions.add(overwriteDestination);
          }
        }
        else {
          actions.add(overwriteDestination);
        }
        break;
      case State.NodeInSync:
        // TODO this check is not neccessary, check rules whether to do or not
        // if( bsd.getState( dst ).equals( State.NodeInSync, Location.Both ) || bsd.getState( dst ).equals( State.NodeInSync,
        // Location.None ) )
      {
        actions.add(inSync);
        actions.add(overwriteDestination);
      }
      break;
      default:
        actions.add(new Action(Action.NotDecidableError, Location.None, BufferUpdate.None, "no rule found"));
        break;
    }

    actions.add(ignore);
View Full Code Here

Examples of net.sourceforge.pebble.web.action.Action

      // strip of the query string - some servers leave this on
      actionName = actionName.substring(0, actionName.indexOf("?"));
    }
    int index = actionName.lastIndexOf("/");
    actionName = actionName.substring(index + 1, (actionName.length() - actionExtension.length()));
    Action action;

    try {
      log.debug("Action is " + actionName);
      action = actionFactory.getAction(actionName);
    } catch (ActionNotFoundException anfe) {
      log.warn(anfe.getMessage());
      response.sendError(HttpServletResponse.SC_NOT_FOUND);
      return;
    }

    boolean authorised = isAuthorised(request, action);
    if (!authorised) {
      response.sendError(HttpServletResponse.SC_FORBIDDEN);
    } else {
      boolean validated = securityTokenValidator.validateSecurityToken(request, response, action);
      if (!validated) {
        // Forward to no security url
        request.getRequestDispatcher("/noSecurityToken.action").forward(request, response);
      } else {
        try {
          Model model = new Model();
          model.put(Constants.BLOG_KEY, blog);
          model.put(Constants.BLOG_URL, blog.getUrl());
          action.setModel(model);
          View view;
          try {
            view = action.process(request, response);
          } catch (ClassCastException cce) {
            // PEBBLE-45 Actions intended for single blog mode should fail nicely.  This is a simple method that will
            // allow has to handle all actions with minimal effort
            if (cce.getMessage().contains(MultiBlog.class.getName()) && cce.getMessage().contains(Blog.class.getName())) {
              view = new MultiBlogNotSupportedView();
View Full Code Here

Examples of net.suncrescent.clicker.robot.action.Action

    // if 899,699 is blue
    Condition dialogIsVisible = new Condition(ConditionType.PIXEL_COLOR_MATCHES);
    dialogIsVisible.setConditionParameters(new Point(899, 699), new Color(2, 114, 171));

    // Setup Time
    this.actionList.add(new Action(15000, 1216, 572, MouseAction.NONE));

    // Dialog
    this.actionList.add(new Action(600, 935, 703, MouseAction.NONE, oneButtonDialogIsVisible));
    this.actionList.add(new Action(100, 935, 703, MouseAction.LEFT_CLICK, oneButtonDialogIsVisible));
    // Dialog
    this.actionList.add(new Action(600, 858, 703, MouseAction.NONE, dialogIsVisible));
    this.actionList.add(new Action(100, 858, 703, MouseAction.LEFT_CLICK, dialogIsVisible));
    // Northwest Stadium
    this.actionList.add(new Action(600, 830, 725, MouseAction.NONE));
    this.actionList.add(new Action(100, 820, 725, MouseAction.LEFT_CLICK));
    // Mall
    this.actionList.add(new Action(600, 1339, 583, MouseAction.NONE));
    this.actionList.add(new Action(100, 1339, 583, MouseAction.LEFT_CLICK));
    // North Hospital
    this.actionList.add(new Action(600, 1552, 586, MouseAction.NONE));
    this.actionList.add(new Action(100, 1552, 586, MouseAction.LEFT_CLICK));
    // Petshop
    this.actionList.add(new Action(600, 1709, 903, MouseAction.NONE));
    this.actionList.add(new Action(100, 1709, 903, MouseAction.LEFT_CLICK));
    // Drag Map
    this.actionList.add(new Action(600, 1489, 891, MouseAction.NONE));
    this.actionList.add(new Action(300, 1489, 891, MouseAction.LEFT_DOWN));
    this.actionList.add(new Action(300, 869, 62, MouseAction.LEFT_UP));
    // West Casino
    this.actionList.add(new Action(600, 712, 202, MouseAction.NONE));
    this.actionList.add(new Action(100, 712, 202, MouseAction.LEFT_CLICK));
    // Flowers
    this.actionList.add(new Action(600, 705, 493, MouseAction.NONE));
    this.actionList.add(new Action(100, 705, 493, MouseAction.LEFT_CLICK));
    // Stadium
    this.actionList.add(new Action(600, 1105, 354, MouseAction.NONE));
    this.actionList.add(new Action(100, 1105, 354, MouseAction.LEFT_CLICK));
    // East Casino
    this.actionList.add(new Action(600, 1298, 197, MouseAction.NONE));
    this.actionList.add(new Action(100, 1298, 197, MouseAction.LEFT_CLICK));
    // East Hospital
    this.actionList.add(new Action(600, 1575, 336, MouseAction.NONE));
    this.actionList.add(new Action(100, 1575, 336, MouseAction.LEFT_CLICK));
    // South East Stadium
    this.actionList.add(new Action(600, 1575, 636, MouseAction.NONE));
    this.actionList.add(new Action(100, 1575, 636, MouseAction.LEFT_CLICK));
    // Bowling
    this.actionList.add(new Action(600, 592, 705, MouseAction.NONE));
    this.actionList.add(new Action(100, 592, 705, MouseAction.LEFT_CLICK));
    // Disco
    this.actionList.add(new Action(600, 1140, 739, MouseAction.NONE));
    this.actionList.add(new Action(100, 1140, 739, MouseAction.LEFT_CLICK));
    // South West Hospital
    this.actionList.add(new Action(600, 157, 324, MouseAction.NONE));
    this.actionList.add(new Action(100, 157, 324, MouseAction.LEFT_CLICK));
    // North West Hospital
    this.actionList.add(new Action(600, 157, 202, MouseAction.NONE));
    this.actionList.add(new Action(100, 157, 202, MouseAction.LEFT_CLICK));
    // South West Stadium
    this.actionList.add(new Action(600, 170, 705, MouseAction.NONE));
    this.actionList.add(new Action(100, 170, 705, MouseAction.LEFT_CLICK));
    // Drag Map
    this.actionList.add(new Action(600, 393, 384, MouseAction.NONE));
    this.actionList.add(new Action(300, 393, 384, MouseAction.LEFT_DOWN));
    this.actionList.add(new Action(100, 715, 915, MouseAction.LEFT_UP));
    this.actionList.add(new Action(600, 393, 384, MouseAction.NONE));
    this.actionList.add(new Action(300, 393, 384, MouseAction.LEFT_DOWN));
    this.actionList.add(new Action(150000, 693, 684, MouseAction.LEFT_UP));
  }
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.