public class AccountDelegate {
  public AccountProfileTO getAccountProfile(String accountId) {
    AccountProfileTO accountProfile = null;
    try {
      AccountSessionHome home = (AccountSessionHome)
       ServiceLocator.getInstance().getEJBHome("Account", AccountSessionHome.class);
      AccountSession session = home.create();
 
      // wywoanie fasady sesji konta w celu pobrania profilu konta
      accountProfile = session.getAccountDetails(accountId);
    }
    catch(CreateException ex) {
      // zamiana wyjtku tworzenia komponentu sesyjnego na wyjtek aplikacji
    }
    catch(RemoteException ex) {
      // zamiana wyjtku zdalnego na wyjtek aplikacji
    }
    return accountProfile;
  }
}
