Package com.library.bookmanangement_library

Source Code of com.library.bookmanangement_library.LibraryService

package com.library.bookmanangement_library;

import org.codehaus.jackson.map.Module;

import com.library.bookmanangement_library.CustomJson;
import com.library.bookmanangement_library.config.LibraryServiceConfiguration;
import com.library.bookmanangement_library.resource.BookResource;
import com.library.bookmanangement_library.resource.LibraryResource;
import com.yammer.dropwizard.Service;
import com.yammer.dropwizard.config.Environment;
import com.yammer.dropwizard.json.Json;

public class LibraryService extends Service<LibraryServiceConfiguration> {
 
  public static void main(String args[]) throws Exception
  {
    new LibraryService().run(args);
  }

  @Override
  protected void initialize(LibraryServiceConfiguration configuration, Environment environment)
      throws Exception {
    environment.addResource(BookResource.class);
  }

  @Override
  public Json getJson() {
    final CustomJson json = new CustomJson();
        for (Module module : getJacksonModules()) {
            json.registerModule(module);
        }
        return json;
  }

}
TOP

Related Classes of com.library.bookmanangement_library.LibraryService

TOP
Copyright © 2018 www.massapi.com. 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.