Package com.tangosol.net

Examples of com.tangosol.net.NamedCache


  }

  @Override
  public void run()
  {
    NamedCache cache = Utility.getCache(Constants.SHIPMENT_CACHE);
    LikeFilter likeCity = new LikeFilter("getToAddress.getCity", (String) model.getSelectedItem());
    GreaterEqualsFilter greaterEqualParcel = new GreaterEqualsFilter("getParcels.size"
        , (Integer) parcelCount.getValue());
    AndFilter andFilter = new AndFilter(likeCity, greaterEqualParcel);
    Map<String, Object> result = (Map<String, Object>) cache.aggregate(andFilter, new CalculateWeightAggregrator());
    resultArea.append("Total entries processed: "+result.get(Constants.TOTAL_ENTRY)+Constants.NEWLINE);
    resultArea.append("Total weight: "+result.get(Constants.TOTAL_WEIGHT));
  }
View Full Code Here


    shipmentProgress.setString("Populating caches...");

    //This is not strictly correct because we should be using JPA to populate the caches
    //TODO later

    NamedCache cache = Utility.getCache(Constants.SHIPMENT_CACHE);
    cache.putAll(shipments);
    //

    JOptionPane.showMessageDialog(this, "Done! Generated and loaded "+max+" Shipment(s)");
    setVisible(false);
    dispose();
View Full Code Here

  public static void main(String... args) throws Exception
  {

    Shipment ship = Utility.randomShipment();

    NamedCache cache = Utility.getCache(Constants.CACHE_NAME);

    cache.put(ship.getId(), ship);
  }
View Full Code Here

  public static NamedCache getCache(String s)
  {
    if(!cache.containsKey(s))
    {
      CacheFactory.ensureCluster();
      NamedCache c = CacheFactory.getCache(s);
      cache.put(s, c);
    }
    return (cache.get(s));
  }
View Full Code Here

    Service svc = cluster.ensureService("OPSDistributedCache"
      , CacheService.TYPE_DISTRIBUTED);
    logger.log(Level.INFO, "Service name: " + svc.getInfo().getServiceName());
    logger.log(Level.INFO, "Serializer name: " + svc.getSerializer().getClass().getName());
*/
    NamedCache cache = CacheFactory.getCache(CACHE_NAME);
    logger.log(Level.INFO, "Publishing shipment: id = {0}", shipment.getId());
    logger.log(Level.INFO, "Cache name: " + cache.getCacheName());
    logger.log(Level.INFO, "Service name: " + cache.getCacheService().getInfo().getServiceName());
    cache.put(shipment.getId(), shipment);
    logger.log(Level.INFO, "After adding to cache");
  }
View Full Code Here

    logger.log(Level.INFO, "After adding to cache");
  }

  public static void publish(Map<Integer, Shipment> shipmentList) {
    CacheFactory.ensureCluster();
    NamedCache cache = CacheFactory.getCache(CACHE_NAME);
    logger.log(Level.INFO, "Bulk publishing shipments: {0}", shipmentList.size());
    cache.putAll(shipmentList);
  }
View Full Code Here

  }

  public String queryShippingServicesCache()
  {
    logger.info("Querying ShippingService Cache");
    NamedCache cache = CacheFactory.getCache("ShippingService");
    logger.info("Cache Size Before: "+cache.size());

    shippingServicesList.clear();
    shippingServicesList.addAll(getShippingServiceManager().findAllShippingServices());

    logger.info("Cache Size After: "+cache.size());
    return "cacheManagement";
  }
View Full Code Here

  }

  public String warmShippingServicesCache()
  {
    logger.info("Warming ShippingService Cache");
    NamedCache cache = CacheFactory.getCache("ShippingService");

    logger.info("Cache Size Before warm: "+cache.size());

    getShippingServiceManager().warmCache();

    logger.info("Cache Size After: "+cache.size());

    shippingServicesList.clear();
    shippingServicesList.addAll(getShippingServiceManager().findAllShippingServices());

    return "cacheManagement";
View Full Code Here

  public void performCacheLookupActionListener(ActionEvent event)
  {
    logger.info("Doing Cache Lookup name=["+inputCacheName+"]");

    NamedCache selectedCache = CacheFactory.getCache(inputCacheName);

    if(selectedCache == null)
    {
      getFacesContext().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_WARN, "Named Cache \"" + inputCacheName + "\" NOT found!", "Cache not found"));
    }
View Full Code Here

  }

  public void addShipmentMapListenerActionListener(ActionEvent event)
  {
    logger.info("Adding Map Listener");
    NamedCache cache = CacheFactory.getCache("Shipment");
    //shipmentListener = new ShipmentMapListener();
    //cache.addMapListener(shipmentListener);

    getFacesContext().addMessage(null, new FacesMessage("Added message listener to Shipment Cache"));
  }
View Full Code Here

TOP

Related Classes of com.tangosol.net.NamedCache

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.