1 package com.calipso.reportgenerator.client; 2 3 import com.calipso.reportgenerator.common.*; 4 import com.calipso.reportgenerator.common.InfoException; 5 6 9 public class ReportManagerFactory implements IReportManagerFactory { 10 11 18 public IReportManager newReportManager(ReportGeneratorConfiguration reportGeneratorConfiguration, boolean isStateFul, String distributedHost) throws InfoException { 19 IReportManager reportManager = null; 20 if (reportGeneratorConfiguration.getIsDistributed()) { 21 reportManager = RemoteReportManager.newRemoteReportManager(reportGeneratorConfiguration, isStateFul, distributedHost); 22 } 23 else { 24 try { 25 Class reportManagerFactoryClass = Class.forName("com.calipso.reportgenerator.reportmanager.LocalReportManagerFactory"); 26 IReportManagerFactory factory = (IReportManagerFactory) reportManagerFactoryClass.newInstance(); 27 reportManager = factory.newReportManager(reportGeneratorConfiguration,false, distributedHost); 28 } catch (Exception e) { 29 throw new InfoException(LanguageTraslator.traslate("466"),e); 30 } 31 } 32 return reportManager; 33 } 34 35 36 } 37 | Popular Tags |