Package jade.util.leap

Examples of jade.util.leap.HashMap


    //private Map agents = new HashMap(MAP_SIZE, MAP_LOAD_FACTOR);
    private Map agents;
   
    public LADT(int size) {
      agents = new HashMap(size);
    }
View Full Code Here


   */
  class ServiceEntry {

    public ServiceEntry(Service s) {
      myService = s;
      slices = new HashMap();
    }
View Full Code Here

      }
    }
  }
 
  private Map loadSubscriptionsCache() {
    Map m = new HashMap();
    Enumeration e = kBase.getSubscriptions();
    while (e.hasMoreElements()) {
      SubscriptionResponder.Subscription sub = (SubscriptionResponder.Subscription) e.nextElement();
     
      try {
        AbsIRE absIota = (AbsIRE) cm.extractAbsContent(sub.getMessage());
        AbsPredicate absResult = absIota.getProposition();
        AbsAgentAction absAction = (AbsAgentAction) absResult.getAbsObject(BasicOntology.RESULT_ACTION);
        AbsAgentAction absSearch = (AbsAgentAction) absAction.getAbsObject(BasicOntology.ACTION_ACTION);
        Search search = (Search) FIPAManagementOntology.getInstance().toObject(absSearch);   
        DFAgentDescription template = (DFAgentDescription) search.getDescription();
       
        m.put(sub.getMessage().getConversationId(), new SubscriptionInfo(sub, template, absIota));
      }
      catch (Exception ex) {
        // Should never happen since, this has already been decoded correctly once
        ex.printStackTrace();
      }
View Full Code Here

  PlatformManagerImpl(Profile p) throws ProfileException {
    myCommandProcessor = p.getCommandProcessor();
    myIMTPManager = p.getIMTPManager();
    myMain = new MainContainerImpl(p, this);

    nodes = new HashMap();
    services = new HashMap();
    replicas = new HashMap();
    monitors = new HashMap();

    platformID = p.getParameter(Profile.PLATFORM_ID, null);
    if (platformID == null || platformID.equals("")) {
      try {
        // Build the PlatformID using the local host and port
View Full Code Here

      NodeDescriptor nodeDsc = (NodeDescriptor) allNodes[i];
      infos.add(new NodeInfo(nodeDsc));
    }

    // Build the map of services for each node
    Map nodeServices = new HashMap();
    // Avoid concurrent modification exception
    Object[] allServices = services.values().toArray();
    for (int j = 0; j < allServices.length; ++j) {
      ServiceEntry e = (ServiceEntry) allServices[j];
      Node[] serviceNodes = e.getNodes();

      for (int i = 0; i < serviceNodes.length; i++) {
        String nodeName = serviceNodes[i].getName();

        Vector v = (Vector) nodeServices.get(nodeName);
        if (v == null) {
          v = new Vector();
          nodeServices.put(nodeName, v);
        }
        Service svc = e.getService();
        v.addElement(new ServiceDescriptor(svc.getName(), svc));
      }
    }

    // Now fill the services in the list of NodeInfo
    Iterator it = infos.iterator();
    while (it.hasNext()) {
      NodeInfo ni = (NodeInfo) it.next();
      Vector v = (Vector) nodeServices.get(ni.getNodeDescriptor().getName());
      ni.setServices(v);
    }
    return infos;
  }
View Full Code Here

   Default constructor.
   */
  public Agent() {
    //#MIDP_EXCLUDE_BEGIN
    myToolkit = DummyToolkit.instance();
    o2aLocks = new HashMap();
    suspendLock = new Object();
    temporaryMessageQueue = true;
    //#MIDP_EXCLUDE_END
    msgQueue = new InternalMessageQueue(msgQueueMaxSize);
    stateLock = new Object();
View Full Code Here

    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);

    //#PJAVA_EXCLUDE_BEGIN
View Full Code Here

    return true;
  }

  private BECodec getBECodec(String serviceName) {
    if (serviceBECodecs == null) {
      serviceBECodecs = new HashMap(2);
    }
    BECodec codec = (BECodec) serviceBECodecs.get(serviceName);
    if (codec == null) {
      try {
        codec = (BECodec) Class.forName(serviceName+"BECodec").newInstance()
View Full Code Here

  * @param cacheSize is the size of this cache
  **/
  public HashCache(int cacheSize)
  {
    list = new LinkedList();
    ht = new HashMap(cacheSize);
    cs = cacheSize;
  }
View Full Code Here

  private transient Logger myLogger;

  public BaseNode(String name, boolean hasPM) {
    myName = name;
    hasLocalPM = hasPM;
    localSlices = new HashMap(5);
    myLogger = Logger.getMyLogger(getClass().getName());
  }
View Full Code Here

TOP

Related Classes of jade.util.leap.HashMap

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.