author | František Kučera <franta-hg@frantovo.cz> |
Thu Feb 25 02:41:57 2010 +0100 (2010-02-25) | |
changeset 39 | ea342cf8c15a |
parent 28 | java/nekurak.net-web/src/java/cz/frantovo/nekurak/web/PodnikyHibernateWeb.java@0f037986bb6b |
child 49 | 9b2a597cc862 |
permissions | -rw-r--r-- |
franta-hg@28 | 1 |
package cz.frantovo.nekurak.web; |
franta-hg@28 | 2 |
|
franta-hg@39 | 3 |
import cz.frantovo.nekurak.ejb.PodnikDAORemote; |
franta-hg@39 | 4 |
import cz.frantovo.nekurak.ejb.PodnikRemote; |
franta-hg@28 | 5 |
import java.io.Serializable; |
franta-hg@28 | 6 |
import java.util.logging.Level; |
franta-hg@28 | 7 |
import java.util.logging.Logger; |
franta-hg@28 | 8 |
import javax.naming.Context; |
franta-hg@28 | 9 |
import javax.naming.InitialContext; |
franta-hg@28 | 10 |
import javax.naming.NamingException; |
franta-hg@28 | 11 |
|
franta-hg@28 | 12 |
/** |
franta-hg@28 | 13 |
* |
franta-hg@28 | 14 |
* @author fiki |
franta-hg@28 | 15 |
*/ |
franta-hg@39 | 16 |
public class HledacSluzby implements Serializable { |
franta-hg@28 | 17 |
|
franta-hg@39 | 18 |
private PodnikRemote podnikEJB; |
franta-hg@39 | 19 |
private static final Logger log = Logger.getLogger(HledacSluzby.class.getSimpleName()); |
franta-hg@28 | 20 |
|
franta-hg@39 | 21 |
public PodnikRemote getPodnikEJB() { |
franta-hg@39 | 22 |
if (podnikEJB == null) { |
franta-hg@28 | 23 |
try { |
franta-hg@28 | 24 |
Context c = new InitialContext(); |
franta-hg@39 | 25 |
podnikEJB = (PodnikRemote) c.lookup("cz.frantovo.nekurak.ejb.PodnikRemote"); |
franta-hg@28 | 26 |
} catch (NamingException e) { |
franta-hg@39 | 27 |
log.log(Level.SEVERE, "Chyba při hledání PodnikRemote", e); |
franta-hg@28 | 28 |
throw new RuntimeException(e); |
franta-hg@28 | 29 |
} |
franta-hg@28 | 30 |
} |
franta-hg@39 | 31 |
return podnikEJB; |
franta-hg@28 | 32 |
} |
franta-hg@28 | 33 |
} |