diff options
Diffstat (limited to 'reportbuilder/java/org/libreoffice/report/pentaho/SOReportJobFactory.java')
-rw-r--r-- | reportbuilder/java/org/libreoffice/report/pentaho/SOReportJobFactory.java | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/reportbuilder/java/org/libreoffice/report/pentaho/SOReportJobFactory.java b/reportbuilder/java/org/libreoffice/report/pentaho/SOReportJobFactory.java index 6ed6ec73f4e8..b9a0c2d42511 100644 --- a/reportbuilder/java/org/libreoffice/report/pentaho/SOReportJobFactory.java +++ b/reportbuilder/java/org/libreoffice/report/pentaho/SOReportJobFactory.java @@ -30,6 +30,8 @@ import com.sun.star.lang.IllegalArgumentException; import com.sun.star.lang.WrappedTargetException; import com.sun.star.lang.XInitialization; import com.sun.star.lang.XServiceInfo; +import com.sun.star.lang.XSingleComponentFactory; +import com.sun.star.lib.uno.helper.Factory; import com.sun.star.lib.uno.helper.PropertySetMixin; import com.sun.star.lib.uno.helper.WeakBase; import com.sun.star.registry.InvalidRegistryException; @@ -74,7 +76,7 @@ public class SOReportJobFactory { } - private static class _SOReportJobFactory extends WeakBase implements XInitialization, XServiceInfo, XJob, XPropertySet, ReportJobFactory + public static class _SOReportJobFactory extends WeakBase implements XInitialization, XServiceInfo, XJob, XPropertySet, ReportJobFactory { private static final Log LOGGER = LogFactory.getLog(_SOReportJobFactory.class); @@ -381,5 +383,38 @@ public class SOReportJobFactory } } + /** + * Gives a factory for creating the service. This method is called by the <code>JavaLoader</code> + * <p/> + * + * @param sImplName the name of the implementation for which a service is desired + * @return returns a <code>XSingleComponentFactory</code> for creating the component + * @see com.sun.star.comp.loader.JavaLoader + */ + public static XSingleComponentFactory __getComponentFactory(final String sImplName) + { + XSingleComponentFactory xFactory = null; + + try + { + if (sImplName.equals(_SOReportJobFactory.class.getName())) + { + xFactory = Factory.createComponentFactory(_SOReportJobFactory.class, _SOReportJobFactory.getServiceNames()); + } + else if (sImplName.equals(SOFunctionManager.class.getName())) + { + xFactory = Factory.createComponentFactory(SOFunctionManager.class, SOFunctionManager.getServiceNames()); + } + else if (sImplName.equals(SOFormulaParser.class.getName())) + { + xFactory = Factory.createComponentFactory(SOFormulaParser.class, SOFormulaParser.getServiceNames()); + } + } + catch (java.lang.IncompatibleClassChangeError e2) + { + } + + return xFactory; + } } |