package managedbean.profile;

import java.io.Serializable;
import java.util.Properties;

import javax.ejb.EJB;
import javax.enterprise.context.RequestScoped;
import javax.inject.Named;
import javax.naming.Context;
import javax.naming.InitialContext;

import ejb.profile.ProfileFacadeRemote;

/***
 * 
 * @author Marcos García Núñez (mgarcianun@uoc.edu)
 *
 */
@Named("UpdateSpecialistDoctorMBean")
@RequestScoped
public class UpdateSpecialistDoctorMBean extends ProfileMBeanBase implements Serializable {

	private static final long serialVersionUID = 1L;

	@EJB
	private ProfileFacadeRemote remoteManager;

	/**
	 * Constructor. Inicializa la conexión con el EJB Remoto
	 * 
	 * @throws Exception
	 */
	public UpdateSpecialistDoctorMBean() throws Exception {
		initializeAdminFacadeRemote();
	}

	/**
	 * Inicializa la conexión con el EJB Remoto
	 * 
	 * @throws Exception
	 */
	private void initializeAdminFacadeRemote() throws Exception {
		Properties props = System.getProperties();
		Context ctx = new InitialContext(props);
		remoteManager = (ProfileFacadeRemote) ctx.lookup("java:app/myHealth.jar/ProfileFacadeBean!ejb.component.ProfileFacadeRemote");
	}

}
