Package enterprise.web.tookit.controller

Source Code of enterprise.web.tookit.controller.PrincipalController

package enterprise.web.tookit.controller;

import javax.naming.InitialContext;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;

import org.apache.log4j.Logger;

import enterprise.web.tookit.evento.Evento;
import enterprise.web.tookit.evento.EventoEJBRemote;

/**
* @since 13/10/2012
*
* @author Regis Rocha.
*
* @description Classe para controlar todas as requisicoes principais, tais como requicoes de menu, ou
*              direcionamento para pagina principal.
*
*
*/
@Path("/principal")
public class PrincipalController {

  /**
   * log
   */
  private final static Logger log = Logger.getLogger(PrincipalController.class);

  // Default constructor.
  public PrincipalController() {
  }

  /**
   *
   * @return
   */
  @GET
  @Produces("application/json")
  public Evento init() {

    try {
      InitialContext context = new InitialContext();
      Object ref = context.lookup("Evento");

      final EventoEJBRemote eventoEJBRemote = (EventoEJBRemote) ref;

      return eventoEJBRemote.pesquisarEventoPorId(2);

    } catch (Exception e) {
      log.error("", e);
    }

    return null;
  }
}
TOP

Related Classes of enterprise.web.tookit.controller.PrincipalController

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.