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