java/nekurak.net-web/src/java/cz/frantovo/nekurak/web/HledacSluzby.java
changeset 51 d01685a7e07d
parent 49 9b2a597cc862
     1.1 --- a/java/nekurak.net-web/src/java/cz/frantovo/nekurak/web/HledacSluzby.java	Thu Mar 04 10:20:28 2010 +0100
     1.2 +++ b/java/nekurak.net-web/src/java/cz/frantovo/nekurak/web/HledacSluzby.java	Thu Mar 04 12:02:41 2010 +0100
     1.3 @@ -1,6 +1,7 @@
     1.4  package cz.frantovo.nekurak.web;
     1.5  
     1.6  import cz.frantovo.nekurak.ejb.PodnikRemote;
     1.7 +import cz.frantovo.nekurak.ejb.UzivatelRemote;
     1.8  import java.io.Serializable;
     1.9  import java.util.logging.Level;
    1.10  import java.util.logging.Logger;
    1.11 @@ -15,6 +16,7 @@
    1.12  public class HledacSluzby implements Serializable {
    1.13  
    1.14      private PodnikRemote podnikEJB;
    1.15 +    private UzivatelRemote uzivatelEJB;
    1.16      private static final Logger log = Logger.getLogger(HledacSluzby.class.getSimpleName());
    1.17  
    1.18      public PodnikRemote getPodnikEJB() {
    1.19 @@ -29,4 +31,17 @@
    1.20  	}
    1.21  	return podnikEJB;
    1.22      }
    1.23 +
    1.24 +    public UzivatelRemote getUzivatelEJB() {
    1.25 +	if (uzivatelEJB == null) {
    1.26 +	    try {
    1.27 +		Context c = new InitialContext();
    1.28 +		uzivatelEJB = (UzivatelRemote) c.lookup("cz.frantovo.nekurak.ejb.UzivatelRemote");
    1.29 +	    } catch (NamingException e) {
    1.30 +		log.log(Level.SEVERE, "Chyba při hledání UzivatelRemote", e);
    1.31 +		throw new RuntimeException(e);
    1.32 +	    }
    1.33 +	}
    1.34 +	return uzivatelEJB;
    1.35 +    }
    1.36  }