예제 #1
0
 /**
  * Set the system AvatarManager instance.
  *
  * @param avatarManager
  */
 public static void set(AvatarManager avatarManager) {
   instance = avatarManager;
   avatarObject = PersistentStore.getPersistentObject(KEY);
   synchronized (avatarObject) {
     avatarObject.setContents(instance);
   }
 }
예제 #2
0
 /**
  * Retrieves the system's AvatarManager instance.
  *
  * @return Instance of AvatarManager.
  */
 public static AvatarManager getInstance() {
   if (instance == null) {
     avatarObject = PersistentStore.getPersistentObject(KEY);
     if (avatarObject.getContents() == null) {
       instance = new AvatarManager();
       synchronized (avatarObject) {
         avatarObject.setContents(instance);
       }
     } else {
       instance = (AvatarManager) avatarObject.getContents();
     }
   }
   return instance;
 }
예제 #3
0
 public static NotificationManager getInstance() {
   if (instance == null) {
     notificationObject = PersistentStore.getPersistentObject(KEY);
     if (notificationObject.getContents() == null) {
       instance = new NotificationManager();
       synchronized (notificationObject) {
         notificationObject.setContents(instance);
       }
     } else {
       instance = (NotificationManager) notificationObject.getContents();
     }
   }
   return instance;
 }
예제 #4
0
 /** Constructor del DAO para el Usuario */
 public UsuarioDB() {
   // setUrl();
   persist = PersistentStore.getPersistentObject(IDSTORE);
   try {
     usuario = (Usuario) persist.getContents();
   } catch (Exception e) {
     usuario = null;
   }
   try {
     if (usuario == null) {
       // usuario = new Usuario();
       // persist.setContents(usuario);
       persist.commit();
     }
   } catch (Exception e) {
   }
 }