Package jade.util.leap

Examples of jade.util.leap.ArrayList


    suspendLock = new Object();
    pendingTimers = new AssociationTB();
    theDispatcher = TimerDispatcher.getTimerDispatcher();
    // restore O2AQueue
    if (o2aQueueSize > 0)
      o2aQueue = new ArrayList(o2aQueueSize);
    o2aLocks = new HashMap();
    myToolkit = DummyToolkit.instance();
    temporaryMessageQueue = true;
    msgQueue = new InternalMessageQueue(msgQueueMaxSize);
View Full Code Here


        }
      }
    }
    if(this.loggers == null){
      //istanzio la struttura e la popolo
      this.loggers = new ArrayList();
      for(Enumeration e = logManager.getLoggerNames();e.hasMoreElements();){
        String logName = (String)e.nextElement();
        try {
          Logger theLogger = this.logManager.getLogger(logName);
          //retrieving the level
          Level level = getLevel(theLogger);
          int loggerLevel = level.intValue();
          //If the result is null, this logger's effective level will be inherited from its parent.
          //The value is the one specified for the property level in the configuration file      
          if (logName == null || logName.length() == 0) {
            // This is the ROOT Logger --> Use a non-empty predefined name
            logName = DEFAULT_ROOT_LOGGER_NAME;
          }
          LoggerInfo logInfoElem = new LoggerInfo(logName, loggerLevel);
         
          //if a FileHandler has been specified it's not possibile to retrieve the fileName
         
          //retrieves all the handlers associated to the logger
          //root handlers are inheredited by default
          List loggerHandlers = (this.rootHandlers == null ? new ArrayList() : new ArrayList(this.rootHandlers));
          //root logger handlers have been already set.
          if(!logName.equals("")){
            Handler[] handlers = theLogger.getHandlers();
            //if an handler has been specified at runtime it will have a format
            //i.e java.util.logging.FileHandler@1234556 so we remove the last part.
View Full Code Here

   
    routes = new RoutingTable(myProfile.getBooleanProperty(ATTACH_PLATFORM_INFO, false));
   
    if (myContainer.getMain() != null) {
      globalAliases = new Hashtable();
      aliasListeners = new ArrayList();
    }
   
    // Look in the profile and check whether we must accept foreign agents
    acceptForeignAgents = myProfile.getBooleanProperty(Profile.ACCEPT_FOREIGN_AGENTS, false);
   
View Full Code Here

    }
  }
 
  // Remove all entries that maps to a given target
  private List removeEntriesFor(Hashtable table, Object target) {
    List removedKeys = new ArrayList();
    synchronized (table) {
      java.util.Iterator it = table.entrySet().iterator();
      while (it.hasNext()) {
        java.util.Map.Entry entry = (java.util.Map.Entry) it.next();
        if (entry.getValue().equals(target)) {
          removedKeys.add(entry.getKey());
          it.remove();
        }
      }
    }
    return removedKeys;
View Full Code Here

   */
  List getDescriptionAction(GetDescription action, AID requester) {
    if(logger.isLoggable(Logger.CONFIG))
      logger.log(Logger.CONFIG,"Agent "+requester+" requesting action GetDescription.");
    // FIXME: This embeds the description into a list since the Applet still expects a List
    List tmp = new ArrayList();
    tmp.add(getDescriptionOfThisDF());
    return tmp;
  }
View Full Code Here

  List getDescriptionUsedAction(GetDescriptionUsed action, AID requester) {
    AID parent = action.getParentDF();
    if(logger.isLoggable(Logger.CONFIG))
      logger.log(Logger.CONFIG,"Agent "+requester+" requesting action GetDescriptionUsed to federate with "+parent.getName());
    // FIXME: This embeds the description into a list since the Applet still expects a List
    List tmp = new ArrayList();
    tmp.add(getDescriptionOfThisDF(parent));
    return tmp;
  }
View Full Code Here

        gui.setAdapter(df.this); //this method must be called to avoid reflection (the constructor of the df gui has no parameters).   
        DFAgentDescription matchEverything = new DFAgentDescription();
        // FIXME: Getting a list with all DFAgentDescriptions may cause out of memory
        // The DFGui should probably be paged and we should use an iterated search.
        List agents = agentDescriptions.search(matchEverything, -1);
        List AIDList = new ArrayList();
        Iterator it = agents.iterator();
        while(it.hasNext())
          AIDList.add(((DFAgentDescription)it.next()).getName());
       
        gui.refresh(AIDList.iterator(), parents.iterator(), children.iterator());
        gui.setVisible(true);
        return true;
       
      }catch(Exception e){e.printStackTrace();}
    }
View Full Code Here

  //#APIDOC_EXCLUDE_BEGIN
  public Object clone(){
    Envelope env = new Envelope();

    // Deep clone
    env.to = new ArrayList(to.size());
    for(int i = 0; i < to.size(); i++) {
      AID id = (AID)to.get(i);
      env.to.add(id.clone())
    }

    // Deep clone
    env.intendedReceiver = new ArrayList(intendedReceiver.size());
    for(int i = 0; i < intendedReceiver.size(); i++) {
      AID id = (AID)intendedReceiver.get(i);
      env.intendedReceiver.add(id.clone());
    }

    env.stamps = (ArrayList)stamps.clone();

    if (from != null) {
      env.from = (AID)from.clone();
    }
    env.comments = comments;
    env.aclRepresentation = aclRepresentation;
    env.payloadLength = payloadLength;
    env.payloadEncoding = payloadEncoding;
    env.date = date;
    env.transportBehaviour = transportBehaviour;
   
    // Deep clone. Particularly important when security is enabled as SecurityObject-s (that are stored as
    // Envelope properties) are modified in the encryption process
    env.properties = new ArrayList(properties.size());
    for(int i = 0; i < properties.size(); i++) {
      Property p = (Property)properties.get(i);
      env.properties.add(p.clone());
    }
   
View Full Code Here

    final ContainerID container = ca.getContainer();
    if (logger.isLoggable(Logger.FINE))
      logger.log(Logger.FINE, "Agent " + requester + " requesting Create-agent " + agentID + " on container " + container);
    // Prepare arguments as a Object[]
    Iterator it = ca.getAllArguments();
    ArrayList listArg = new ArrayList();
    while (it.hasNext()) {
      listArg.add(it.next());
    }
    final Object[] args = listArg.toArray();
    final JADEPrincipal owner = ca.getOwner();
    final Credentials initialCredentials = ca.getInitialCredentials();

    // Do the job in a separated thread to avoid deadlock
    Thread auxThread = new Thread() {
View Full Code Here

  List queryPlatformLocationsAction(QueryPlatformLocationsAction qpl, AID requester) throws FIPAException {
    if (logger.isLoggable(Logger.FINE))
      logger.log(Logger.FINE, "Agent " + requester + " requesting Query-platform-locations");
    // FIXME: Permissions for this action are not yet defined
    ContainerID[] ids = myPlatform.containerIDs();
    List l = new ArrayList();
    for (int i = 0; i < ids.length; ++i) {
      l.add(ids[i]);
    }
    return l;
  }
View Full Code Here

TOP

Related Classes of jade.util.leap.ArrayList

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.