/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package beans.lieferant; import beans.*; import beans.lager.LagerRemote; import beans.artikelManager.ArtikelManagerRemote; import beans.adressen.AdressenRemote; import exceptions.IllegalerWertException; import exceptions.UnbekanntesEntityException; import javax.ejb.EJB; import javax.ejb.Stateless; import javax.jws.WebMethod; import javax.jws.WebParam; import javax.jws.WebService; /** * * @author jmueller */ @WebService @Stateless(mappedName="LieferantBean") public class LieferantBean implements LieferantRemote { @EJB private ArtikelManagerRemote artikelManagerBean; @EJB private LagerRemote lagerBean; @EJB private AdressenRemote adressenBean; /** * bestellt eine bestimmte Anzahl von Artikeln nach * @param id die Id des Artikels * @param anzahl die Anzahl */ // TODO: Session Bean erstellen die die Adresse des Lieferanten für bestimmte // Artikel heraussucht @WebMethod public void bestelleNach( @WebParam(name="artikelId") long id, @WebParam(name="anzahl") long anzahl) throws UnbekanntesEntityException, IllegalerWertException{ System.out.println("Lieferant: bestelleNach("+id+","+anzahl+")"); lagerBean.bucheArtikelEin(id, anzahl); System.out.println("Bestellung erfolgt bei: " + adressenBean.getLieferantenAdresseFuerArtikel(id) ); } }