Beispiel #1
0
  public void start() {
    groupSystem = EJBUtil.defaultLookup(GroupSystem.class);
    personViewer = EJBUtil.defaultLookup(PersonViewer.class);
    postingBoard = EJBUtil.defaultLookup(PostingBoard.class);

    instance = this;
  }
Beispiel #2
0
 @Override
 protected Post loadObject(Guid guid) {
   try {
     PostingBoard board = EJBUtil.defaultLookup(PostingBoard.class);
     Post post = board.loadRawPost(SystemViewpoint.getInstance(), guid);
     // Filter group notifications from search results
     if (board.postIsGroupNotification(post)) return null;
     return post;
   } catch (NotFoundException e) {
     throw new RuntimeException(e);
   }
 }
  @Override
  public IQ handleIQ(IQ packet) throws UnauthorizedException {
    Log.debug("handling IQ packet " + packet);
    IQ reply = IQ.createResultIQ(packet);
    Element iq = packet.getChildElement();
    String method = iq.attributeValue("name");
    List<String> args = new ArrayList<String>();

    // TODO Don't look this up each time
    // We currently do this to avoid problems during development
    // from reloading Jive - later we probably want to move this to
    // constructor
    XMPPMethods methods = EJBUtil.defaultLookup(XMPPMethods.class);
    SimpleAnnotatedInvoker xmppInvoker =
        new SimpleAnnotatedInvoker(XMPPRemoted.class, methods, new PersonArgumentPrepender());

    for (Object argObj : iq.elements()) {
      Node arg = (Node) argObj;
      Log.debug("parsing expected arg node " + arg);
      if (arg.getNodeType() == Node.ELEMENT_NODE) {
        String argValue = arg.getText();
        Log.debug("Adding arg value" + argValue);
        args.add(argValue);
      }
    }

    try {
      Log.debug(
          "invoking method "
              + method
              + " with ("
              + args.size()
              + ") args "
              + Arrays.toString(args.toArray()));
      @SuppressWarnings("unused")
      String replyStr = xmppInvoker.invoke(method, args, packet.getFrom());
      // Don't do anything with this yet
    } catch (Exception e) {
      Log.debug("Caught exception during client method invocation", e);
    }
    return reply;
  }
Beispiel #4
0
 @Override
 protected List<Guid> loadAllIds() {
   return EJBUtil.defaultLookup(PostingBoard.class).getAllPostIds();
 }