diff -r 936ad9853a30 -r 12268fc31114 java/nekurak.net-lib/src/cz/frantovo/nekurak/web/HledacSluzby.java --- a/java/nekurak.net-lib/src/cz/frantovo/nekurak/web/HledacSluzby.java Tue Apr 06 00:09:59 2010 +0200 +++ b/java/nekurak.net-lib/src/cz/frantovo/nekurak/web/HledacSluzby.java Tue Apr 06 00:27:48 2010 +0200 @@ -1,5 +1,6 @@ package cz.frantovo.nekurak.web; +import cz.frantovo.nekurak.ejb.ClanekRemote; import cz.frantovo.nekurak.ejb.PodnikRemote; import cz.frantovo.nekurak.ejb.UzivatelRemote; import java.io.Serializable; @@ -17,8 +18,9 @@ private PodnikRemote podnikEJB; private UzivatelRemote uzivatelEJB; + private ClanekRemote clanekEJB; private static final Logger log = Logger.getLogger(HledacSluzby.class.getSimpleName()); - + public PodnikRemote getPodnikEJB() { if (podnikEJB == null) { try { @@ -44,4 +46,17 @@ } return uzivatelEJB; } + + public ClanekRemote getClanekEJB() { + if (clanekEJB == null) { + try { + Context c = new InitialContext(); + clanekEJB = (ClanekRemote) c.lookup("cz.frantovo.nekurak.ejb.ClanekRemote"); + } catch (NamingException e) { + log.log(Level.SEVERE, "Chyba při hledání ClanekRemote", e); + throw new RuntimeException(e); + } + } + return clanekEJB; + } }