Package org.infinispan.ec2demo

Examples of org.infinispan.ec2demo.CacheBuilder


  private Cache<String, Nucleotide_Protein_Element> nucleiodCache;

   @Override
  public void init(ServletConfig config) throws ServletException {
    super.init(config);
    CacheBuilder cacheBuilder = (CacheBuilder) getServletContext().getAttribute("cacheBuilder");
    influenzaCache = cacheBuilder.getCacheManager().getCache("InfluenzaCache");
    proteinCache = cacheBuilder.getCacheManager().getCache("ProteinCache");
    nucleiodCache = cacheBuilder.getCacheManager().getCache("NucleotideCache");
  }
View Full Code Here


    dispatcher.forward(request, response);
  }

   @Override
  public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    CacheBuilder cacheBuilder = (CacheBuilder) getServletContext().getAttribute("cacheBuilder");
    String searchGBAN = request.getParameter("vGBAN");
    request.setAttribute("total", searchGBAN);
   
    //check the influenza cache first
    Influenza_N_P_CR_Element myRec = influenzaCache.get(searchGBAN);
   
    if (myRec != null) {
      log.trace("Searching nucleiodCache for " + myRec.getGanNucleoid());
      Nucleotide_Protein_Element nucldet = nucleiodCache.get(myRec.getGanNucleoid());     
      request.setAttribute("Nucleotide", nucldet);

      // Display the protein details
      Map<String, String> myProt = myRec.getProtein_Data();
      Map<String, String> myMap = new HashMap<String, String>();
      for (String x : myProt.keySet()) {
        log.trace("Searching proteinCache for " + x);
        Nucleotide_Protein_Element myProtdet = proteinCache.get(x);
        String protein_CR = myProt.get(x);   
        myMap.put(myProtdet.getGenbankAccessionNumber(), protein_CR);
      }
      request.setAttribute("PMap", myMap);
    }



    //Retrieve the cache cluster memebers
    List<Address> myList = cacheBuilder.getCacheManager().getMembers();
    List<String> k = new ArrayList<String>();
    for (Address ad : myList)
      k.add(ad.toString());
    request.setAttribute("CMap", k);
View Full Code Here

  public void contextInitialized(ServletContextEvent arg0) {
    System.out.println("in CacheServletListener");
    try {
      this.context = arg0.getServletContext();
      String x = arg0.getServletContext().getInitParameter("InfinispanConfigFile");
      currCacheBuilder =  new CacheBuilder(x);
      System.out.println("in CacheServletListener...starting cache");
      currCacheBuilder.getCacheManager().start();
      System.out.println("in CacheServletListener...starting cache...done");
      context.setAttribute("cacheBuilder", currCacheBuilder);
    } catch (IOException e) {
View Full Code Here

  private Cache<String, Nucleotide_Protein_Element> nucleiodCache;

   @Override
  public void init(ServletConfig config) throws ServletException {
    super.init(config);
    CacheBuilder cacheBuilder = (CacheBuilder) getServletContext().getAttribute("cacheBuilder");
    influenzaCache = cacheBuilder.getCacheManager().getCache("InfluenzaCache");
    proteinCache = cacheBuilder.getCacheManager().getCache("ProteinCache");
    nucleiodCache = cacheBuilder.getCacheManager().getCache("NucleotideCache");
  }
View Full Code Here

    dispatcher.forward(request, response);
  }

   @Override
  public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    CacheBuilder cacheBuilder = (CacheBuilder) getServletContext().getAttribute("cacheBuilder");
    String searchGBAN = request.getParameter("vGBAN");
    request.setAttribute("total", searchGBAN);
   
    //check the influenza cache first
    Influenza_N_P_CR_Element myRec = influenzaCache.get(searchGBAN);
   
    if (myRec != null) {
      log.trace("Searching nucleiodCache for " + myRec.getGanNucleoid());
      Nucleotide_Protein_Element nucldet = nucleiodCache.get(myRec.getGanNucleoid());     
      request.setAttribute("Nucleotide", nucldet);

      // Display the protein details
      Map<String, String> myProt = myRec.getProtein_Data();
      Map<String, String> myMap = new HashMap<String, String>();
      for (String x : myProt.keySet()) {
        log.trace("Searching proteinCache for " + x);
        Nucleotide_Protein_Element myProtdet = proteinCache.get(x);
        String protein_CR = myProt.get(x);   
        myMap.put(myProtdet.getGenbankAccessionNumber(), protein_CR);
      }
      request.setAttribute("PMap", myMap);
    }



    //Retrieve the cache cluster memebers
    List<Address> myList = cacheBuilder.getCacheManager().getMembers();
    List<String> k = new ArrayList<String>();
    for (Address ad : myList)
      k.add(ad.toString());
    request.setAttribute("CMap", k);
View Full Code Here

  public void contextInitialized(ServletContextEvent arg0) {
    System.out.println("in CacheServletListener");
    try {
      this.context = arg0.getServletContext();
      String x = arg0.getServletContext().getInitParameter("InfinispanConfigFile");
      currCacheBuilder =  new CacheBuilder(x);
      System.out.println("in CacheServletListener...starting cache");
      currCacheBuilder.getCacheManager().start();
      System.out.println("in CacheServletListener...starting cache...done");
      context.setAttribute("cacheBuilder", currCacheBuilder);
    } catch (IOException e) {
View Full Code Here

  private Cache<String, Nucleotide_Protein_Element> nucleiodCache;

   @Override
  public void init(ServletConfig config) throws ServletException {
    super.init(config);
    CacheBuilder cacheBuilder = (CacheBuilder) getServletContext().getAttribute("cacheBuilder");
    influenzaCache = cacheBuilder.getCacheManager().getCache("InfluenzaCache");
    proteinCache = cacheBuilder.getCacheManager().getCache("ProteinCache");
    nucleiodCache = cacheBuilder.getCacheManager().getCache("NucleotideCache");
  }
View Full Code Here

    dispatcher.forward(request, response);
  }

   @Override
  public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    CacheBuilder cacheBuilder = (CacheBuilder) getServletContext().getAttribute("cacheBuilder");
    String searchGBAN = request.getParameter("vGBAN");
    request.setAttribute("total", searchGBAN);
   
    //check the influenza cache first
    Influenza_N_P_CR_Element myRec = influenzaCache.get(searchGBAN);
   
    if (myRec != null) {
      myLogger.trace("Searching nucleiodCache for " + myRec.getGanNucleoid());
      Nucleotide_Protein_Element nucldet = nucleiodCache.get(myRec.getGanNucleoid());     
      request.setAttribute("Nucleotide", nucldet);

      // Display the protein details
      Map<String, String> myProt = myRec.getProtein_Data();
      Map<String, String> myMap = new HashMap<String, String>();
      for (String x : myProt.keySet()) {
        myLogger.trace("Searching proteinCache for " + x);
        Nucleotide_Protein_Element myProtdet = proteinCache.get(x);
        String protein_CR = myProt.get(x);   
        myMap.put(myProtdet.getGenbankAccessionNumber(), protein_CR);
      }
      request.setAttribute("PMap", myMap);
    }



    //Retrieve the cache cluster memebers
    List<Address> myList = cacheBuilder.getCacheManager().getMembers();
    List<String> k = new ArrayList<String>();
    for (Address ad : myList)
      k.add(ad.toString());
    request.setAttribute("CMap", k);
View Full Code Here

  public void contextInitialized(ServletContextEvent arg0) {
    System.out.println("in CacheServletListener");
    try {
      this.context = arg0.getServletContext();
      String x = arg0.getServletContext().getInitParameter("jgroups_file");
      currCacheBuilder =  new CacheBuilder(x);
      System.out.println("in CacheServletListener...starting cache");
      currCacheBuilder.getCacheManager().start();
      System.out.println("in CacheServletListener...starting cache...done");
      context.setAttribute("cacheBuilder", currCacheBuilder);
    } catch (IOException e) {
View Full Code Here

TOP

Related Classes of org.infinispan.ec2demo.CacheBuilder

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.