Package jade.lang.acl

Examples of jade.lang.acl.StringACLCodec


   * @return <code>Enumeration</code> with instances of the class
   * <code> jade.proto.SubscriptionResponder&Subscription</code>
   */
  public Enumeration getSubscriptions(){
    Vector subscriptions = new Vector();
    StringACLCodec codec = new StringACLCodec();
    ResultSet rs = null;
   
    try {
      rs = getPreparedStatements().stm_selSubscriptions.executeQuery();
      while (rs.next()) {
        String base64Str = rs.getString("aclm");
        String aclmStr = new String(Base64.decodeBase64(base64Str.getBytes("US-ASCII")), "US-ASCII");
        ACLMessage aclm = codec.decode(aclmStr.getBytes(), ACLCodec.DEFAULT_CHARSET);
        subscriptions.add(sr.createSubscription(aclm));
      }
     
    } catch (Exception e) {
      if(logger.isLoggable(Logger.SEVERE))
View Full Code Here


            }
          } else {
            return;
          }

          ACLCodec codec = new StringACLCodec();
          String charset = null
          if ((env == null) || ((charset = env.getPayloadEncoding()) == null)) {
            charset = ACLCodec.DEFAULT_CHARSET;
          }
          ACLMessage tmp = codec.decode(content.getBytes(charset),charset);
          tmp.setEnvelope(env);
          Message msg = new Message(tmp, unicastReceiver);

          /* If this is a 'posted-message' event and the sender is
          // currently under sniff, then the message was already
View Full Code Here

     
      // Initialize messaging-related System Activity Monitoring
      initializeSAM();
     
      // Activate the default ACL String codec anyway
      ACLCodec stringCodec = new StringACLCodec();
      messageEncodings.put(stringCodec.getName().toLowerCase(), stringCodec);
     
      // Activate the efficient encoding for intra-platform encoding
      ACLCodec efficientCodec = new LEAPACLCodec();
      messageEncodings.put(efficientCodec.getName().toLowerCase(), efficientCodec);
     
View Full Code Here

      currentDir = chooser.getCurrentDirectory();
      String fileName = chooser.getSelectedFile().getAbsolutePath();

      try {
        FileWriter f = new FileWriter(fileName);
        StringACLCodec codec = new StringACLCodec(null, f);
        // ACLMessage ACLmsg = currentMsgGui.getMsg();
        codec.write(currentACL);
        f.close();

      }
      catch (FileNotFoundException e3) {
       if(logger.isLoggable(Logger.WARNING))
View Full Code Here

            theMessageLine = theMessageLine + "\n" + line;
            line = br.readLine();
          }
          char[] chararray = theMessageLine.toCharArray();

          StringACLCodec codec = new StringACLCodec(new StringReader(new String(chararray)), null);
          ACLMessage theMsg = codec.decode();

          this.addMessageNode(direction, theTime, theMsg);

        }
        br.close();
View Full Code Here

      if (((e = m.getEnvelope()) == null) ||
          ((charset = e.getPayloadEncoding()) == null)) {
        charset = ACLCodec.DEFAULT_CHARSET;
      }
      String s = m.getPayload();
      ACLCodec codec = new StringACLCodec();
      msg = codec.decode(s.getBytes(charset),charset);
      msg.setEnvelope(e);
    }
    catch(ACLCodec.CodecException aclce) {
      aclce.printStackTrace();
    } catch ( UnsupportedEncodingException exception ) {
View Full Code Here

      if (((e = m.getEnvelope()) == null) ||
          ((charset = e.getPayloadEncoding()) == null)) {
        charset = ACLCodec.DEFAULT_CHARSET;
      }
      String s = m.getPayload();
      ACLCodec codec = new StringACLCodec();
      msg = codec.decode(s.getBytes(charset),charset);
      msg.setEnvelope(e);
    }
    catch(ACLCodec.CodecException aclce) {
      aclce.printStackTrace();
    } catch ( UnsupportedEncodingException exception ) {
View Full Code Here

      if (((e = m.getEnvelope()) == null) ||
          ((charset = e.getPayloadEncoding()) == null)) {
        charset = ACLCodec.DEFAULT_CHARSET;
      }
      String s = m.getPayload();
      ACLCodec codec = new StringACLCodec();
      msg = codec.decode(s.getBytes(charset),charset);
      msg.setEnvelope(e);
    }
    catch(ACLCodec.CodecException aclce) {
      aclce.printStackTrace();
    } catch ( UnsupportedEncodingException exception ) {
View Full Code Here

          ObjectInputStream p = new ObjectInputStream(istream);
          GenericMessage message = (GenericMessage) p.readObject();
          istream.close();

          // Use an ACL codec to read in the receiver AID
          StringACLCodec codec = new StringACLCodec(in, null);
          // Read the receiver AID
          AID receiver = codec.decodeAID();

          // Notify the listener that a new item was loaded
          for(int k = 0; k < howMany; k++) {
            ll.itemLoaded(toRead.getName(), message, receiver);
          }
View Full Code Here

TOP

Related Classes of jade.lang.acl.StringACLCodec

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.