Package fr.dyade.aaa.agent

Examples of fr.dyade.aaa.agent.AgentId


  public RequestBuffer(ProxyAgentItf proxy) {
    proxyAgent = proxy;
  }
 
  public void put(int key, ProducerMessages req) {
    AgentId to = AgentId.fromString(req.getTarget());
    RequestGroupNot not = (RequestGroupNot) nots.get(to);
    if (not == null) {
      not = new RequestGroupNot();
      nots.put(to, not);
    }
    ClientMessages cm = new ClientMessages(key, req.getRequestId(), req
        .getMessages());
    if (to.getTo() == proxyAgent.getId().getTo()) {
      cm.setPersistent(false);
    }
    if (req.getAsyncSend()) {
      cm.setAsyncSend(true);
    }
View Full Code Here


  public void flush() {
    if (nots.size() > 0) {
      Enumeration ids = nots.keys();
      Enumeration notifs = nots.elements();
      while (notifs.hasMoreElements()) {
        AgentId to = (AgentId) ids.nextElement();
        RequestGroupNot not = (RequestGroupNot) notifs.nextElement();
        if (to.getTo() == proxyAgent.getId().getTo()) {
          not.setPersistent(false);
          proxyAgent.sendNot(to, not);
        } else {
          proxyAgent.sendNot(to, not);
        }
View Full Code Here

      AgentId adminId,
      String destClassName,
      byte type,
      Properties properties,
      boolean freerw) throws Exception {
    AgentId destId = null;
    StringBuffer strbuf = new StringBuffer();
    DestinationDesc destDesc = null;

    try {
      destDesc = AdminTopic.createDestinationAndSave(destName, adminId, properties,
                                                     type, destClassName,
                                                     "JoramHelper", strbuf);
    } catch (Exception exc) {
      logger.log(BasicLevel.ERROR, "JoramHelper.createDestination, Cannot create destination " + destName, exc);
      throw exc;
    }
   
    destId = destDesc.getId();
    if (logger.isLoggable(BasicLevel.DEBUG))
      logger.log(BasicLevel.DEBUG, "JoramHelper.createDestination info = " + strbuf.toString());
    strbuf.setLength(0);    

    if (freerw) {
      try {
        AdminTopic.setRightAndSave(new SetReader(null, destId.toString()), null, "-1");
      } catch (Exception exc) {
        if (logger.isLoggable(BasicLevel.ERROR))
          logger.log(BasicLevel.ERROR, "JoramHelper.createDestination, Cannot set FreeReader", exc);
      }
      try {
        AdminTopic.setRightAndSave(new SetWriter(null, destId.toString()), null, "-1");
      } catch (Exception exc) {
        if (logger.isLoggable(BasicLevel.ERROR))
          logger.log(BasicLevel.ERROR, "JoramHelper.createDestination, Cannot set FreeWriter", exc);
      }
    }
View Full Code Here

    // Retrieving the persisted messages, if any.
    List persistedMsgs = Message.loadAll(getMsgTxPrefix().toString());

    if (persistedMsgs != null) {
      Message persistedMsg;
      AgentId consId;
     
      while (! persistedMsgs.isEmpty()) {
        persistedMsg = (Message) persistedMsgs.remove(0);
        consId = (AgentId) consumers.get(persistedMsg.getIdentifier());
       
View Full Code Here

    Enumeration ids = not.getIds();

    String msgId;
    Message message;
    AgentId consId;
    int consCtx;
    DMQManager dmqManager = null;

    if (! ids.hasMoreElements()) {
      // If the deny request is empty, the denying is a contextual one: it
      // requests the denying of all the messages consumed by the denier in
      // the denying context:
      for (Iterator entries = deliveredMsgs.entrySet().iterator(); entries.hasNext();) {
        // Browsing the delivered messages:
        Map.Entry entry = (Map.Entry) entries.next();

        msgId = (String) entry.getKey();
        message = (Message) entry.getValue();

        consId = (AgentId) consumers.get(msgId);
        consCtx = ((Integer) contexts.get(msgId)).intValue();

        if (logger.isLoggable(BasicLevel.DEBUG))
          logger.log(BasicLevel.DEBUG, " -> deny msg " + msgId + "(consId = " + consId + ')');

        // If the current message has been consumed by the denier in the same
        // context: denying it.
        if (consId.equals(from) && consCtx == not.getClientContext()) {
          // state change, so save.
          setSave();
          consumers.remove(msgId);
          contexts.remove(msgId);
          entries.remove();
View Full Code Here

   * "denied" for delivery to an other requester, and a new delivery sequence
   * is launched. Messages considered as undeliverable are removed and sent to
   * the DMQ.
   */
  protected void doUnknownAgent(UnknownAgent uA) {
    AgentId client = uA.agent;
    Notification not = uA.not;

    // If the notification is not a delivery, doing nothing.
    if (! (not instanceof QueueMsgReply))
      return;

    String msgId;
    Message message;
    AgentId consId;
    DMQManager dmqManager = null;
    for (Iterator entries = deliveredMsgs.entrySet().iterator(); entries.hasNext();) {
      Map.Entry entry = (Map.Entry) entries.next();

      msgId = (String) entry.getKey();
      message = (Message) entry.getValue();

      consId = (AgentId) consumers.get(msgId);
      // Delivered message has been delivered to the deleted client:
      // denying it.
      if (consId.equals(client)) {
        entries.remove();
        message.setRedelivered();

        // state change, so save.
        setSave();
View Full Code Here

        if (logger.isLoggable(BasicLevel.DEBUG))
          logger.log(BasicLevel.DEBUG, " -> read heartBeat = " + heartBeat);
      }

      GetProxyIdNot gpin = new GetProxyIdNot(identity, inaddr);
      AgentId proxyId;
      try {
        gpin.invoke(AdminTopic.getDefault());
        proxyId = gpin.getProxyId();
      } catch (Exception exc) {
        if (logger.isLoggable(BasicLevel.DEBUG))
View Full Code Here

    Identity identity = (Identity) Identity.soapDecode(identityMap);
   
    GetProxyIdNot gpin = new GetProxyIdNot(identity, null);
    gpin.invoke(AdminTopic.getDefault());
    AgentId proxyId = gpin.getProxyId();
   
    OpenConnectionNot ocn = new OpenConnectionNot(false, heartBeat)
    ocn.invoke(proxyId);

    StandardConnectionContext cc = (StandardConnectionContext) ocn.getConnectionContext();
View Full Code Here

   *
   * @param serverId the id of the agent server
   * @return the <code>AgentId</code> of the JndiServer
   */
  public static AgentId getDefault(short serverId) {
    return new AgentId(
      serverId, serverId,
      AgentId.LocalJndiServiceStamp);
  }
View Full Code Here

   *
   * @param serverId the id of the agent server
   * @return the <code>AgentId</code> of the JndiServer
   */
  public static AgentId getDefault(short serverId) {
    return new AgentId(
      serverId, serverId,
      AgentId.LocalJndiServiceStamp);
  }
View Full Code Here

TOP

Related Classes of fr.dyade.aaa.agent.AgentId

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.