Package healthwatcher.business.factories

Source Code of healthwatcher.business.factories.RMIFacadeFactory

package healthwatcher.business.factories;

import java.io.IOException;
import java.rmi.RemoteException;

import healthwatcher.Constants;
import healthwatcher.business.HealthWatcherFacade;
import healthwatcher.business.RMIFacadeAdapter;
import healthwatcher.view.IFacade;
import healthwatcher.view.RMIServletAdapter;
import lib.exceptions.CommunicationException;
import lib.exceptions.RepositoryException;

/**
* A factory for a rmi facade
*/
public class RMIFacadeFactory extends AbstractFacadeFactory {

  public IFacade createClientFacade() throws CommunicationException {
    //return new RMIServletAdapter("//" + Constants.SERVER_NAME + "/" + Constants.SYSTEM_NAME);
    try {
      return HealthWatcherFacade.getInstance();
    } catch (RemoteException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (RepositoryException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    return null;
  }
 

  public void createServerFacade() throws CommunicationException {
    try {
      RMIFacadeAdapter.getInstance();
    } catch (Exception e) {
      throw new CommunicationException(e.getMessage());
    }
  }
}
TOP

Related Classes of healthwatcher.business.factories.RMIFacadeFactory

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.