예제 #1
0
  /** Public singleton access method. */
  public static synchronized PhotoFactory getInstance() {
    if (instance == null) {
      log.config(
          LogBuilder.createSystemMessage().addAction("setting AirplanePhotoFactory").toString());
      setInstance(new AirplanePhotoFactory());
    }

    return instance;
  }
예제 #2
0
  protected void startUp(String rootDir) throws Exception {
    super.startUp(rootDir);
    log.info("AbstractMain.startUp completed");

    log.config(LogBuilder.createSystemMessage().addAction("load image storage").toString());
    // GcsAdapter.Builder gcsAdapterBuilder = new GcsAdapter.Builder();
    ImageStorage.setInstance(new DatastoreAdapter());

    log.config(LogBuilder.createSystemMessage().addAction("load globals").toString());
    GlobalsManager.getInstance().loadGlobals();

    log.config(LogBuilder.createSystemMessage().addAction("load user").toString());
    UserManager.getInstance().init();

    log.config(LogBuilder.createSystemMessage().addAction("init PhotoFactory").toString());
    DrumcymbalPhotoFactory.initialize();
    CoordinateFactory.initialize();

    log.config(LogBuilder.createSystemMessage().addAction("load Photos").toString());
    // PhotoManager.getInstance().init();
    DrumcymbalPhotoManager.getInstance().init();
  }
예제 #3
0
파일: User.java 프로젝트: chscqe/wahlzeit
  /** @methodtype initialization */
  protected void initialize(
      String id,
      String nickName,
      EmailAddress emailAddress,
      AccessRights accessRights,
      Client previousClient) {
    super.initialize(id, nickName, emailAddress, accessRights, previousClient);

    log.config(
        LogBuilder.createSystemMessage()
            .addAction("initialize user")
            .addParameter("id", id)
            .addParameter("name", nickName)
            .addParameter("E-Mail", emailAddress.asString())
            .toString());
    incWriteCount();
  }
예제 #4
0
  public void loadExistingUsers() {
    ObjectifyService.run(
        new Work<Void>() {
          @Override
          public Void run() {
            Collection<User> existingUser = new ArrayList<User>();
            readObjects(existingUser, User.class);

            for (User user : existingUser) {
              if (!hasClientById(user.getId())) {
                doAddClient(user);
              } else {
                log.config(
                    LogBuilder.createSystemMessage()
                        .addParameter("user has been loaded", user.getId())
                        .toString());
              }
            }
            return null;
          }
        });

    log.info(LogBuilder.createSystemMessage().addMessage("loaded all clients").toString());
  }