JavacardOS will not accept order any more, please contact our partner Feitian online Store:
https://ftsafe.en.alibaba.com/index.html

Create instances for classes

JavaCard Applet Development Related Questions and Answers.
leogen
Posts: 13
Joined: Wed Jan 06, 2016 2:45 am
Points :94
Contact:

Create instances for classes

Post by leogen » Tue Jan 17, 2017 5:23 am

I have separate packages in my project and I need to create instances for all classes in this packages. I create instance of class by the below code.
But I have problem with deleting my packages and applet after I call Digest.getInstance(). I need to implement clearInstacePool() method to set reference of digest to null in unistall() method of my applet. How can I create instance of class without implementing clearInstacePool()?

Code: Select all

public class Digest 
{
   private static Digest digest = null;
   protected Digest ()
  {
 
  }
  public static Digest getInstance()
  {
         if(digest == null)
          digest = new Digest();
         
        return digest;
  }
  public static void clearInstacePool()
  {
         digest = null;
  }
}

User avatar
mabel
Posts: 237
Joined: Mon May 18, 2015 3:09 am
Points :1705
Contact:

Re: Create instances for classes

Post by mabel » Tue Jan 17, 2017 10:52 pm

Create instance usually involves the new operator, which has nothing to do with what methods are implemented.

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: Google [Bot] and 17 guests

JavaCard OS : Disclaimer