/* 658 */ ((JobStoreSupport)js).setInstanceName(schedName);
/* */ }
/* */
/* 665 */ String[] dsNames = this.cfg.getPropertyGroups("org.quartz.dataSource");
/* 666 */ for (int i = 0; i < dsNames.length; i++) {
/* 667 */ PropertiesParser pp = new PropertiesParser(this.cfg.getPropertyGroup("org.quartz.dataSource." + dsNames[i], true));
/* */
/* 670 */ String cpClass = pp.getStringProperty("connectionProvider.class", null);
/* */
/* 673 */ if (cpClass != null) {
/* 674 */ ConnectionProvider cp = null;
/* */ try {
/* 676 */ cp = (ConnectionProvider)loadHelper.loadClass(cpClass).newInstance();
/* */ } catch (Exception e) {
/* 678 */ this.initException = new SchedulerException("ConnectionProvider class '" + cpClass + "' could not be instantiated.", e);
/* */
/* 680 */ this.initException.setErrorCode(50);
/* */
/* 682 */ throw this.initException;
/* */ }
/* */
/* */ try
/* */ {
/* 687 */ pp.getUnderlyingProperties().remove("connectionProvider.class");
/* */
/* 690 */ setBeanProps(cp, pp.getUnderlyingProperties());
/* */ } catch (Exception e) {
/* 692 */ this.initException = new SchedulerException("ConnectionProvider class '" + cpClass + "' props could not be configured.", e);
/* */
/* 694 */ this.initException.setErrorCode(50);
/* */
/* 696 */ throw this.initException;
/* */ }
/* */
/* 699 */ dbMgr = DBConnectionManager.getInstance();
/* 700 */ dbMgr.addConnectionProvider(dsNames[i], cp);
/* */ }
/* */ else {
/* 703 */ String dsDriver = pp.getStringProperty("driver", null);
/* */
/* 705 */ String dsURL = pp.getStringProperty("URL", null);
/* 706 */ boolean dsAlwaysLookup = pp.getBooleanProperty("jndiAlwaysLookup", false);
/* */
/* 708 */ String dsUser = pp.getStringProperty("user", "");
/* 709 */ String dsPass = pp.getStringProperty("password", "");
/* 710 */ int dsCnt = pp.getIntProperty("maxConnections", 10);
/* 711 */ String dsJndi = pp.getStringProperty("jndiURL", null);
/* */
/* 713 */ String dsJndiInitial = pp.getStringProperty("java.naming.factory.initial", null);
/* */
/* 715 */ String dsJndiProvider = pp.getStringProperty("java.naming.provider.url", null);
/* */
/* 717 */ String dsJndiPrincipal = pp.getStringProperty("java.naming.security.principal", null);
/* */
/* 719 */ String dsJndiCredentials = pp.getStringProperty("java.naming.security.credentials", null);
/* */
/* 721 */ String dsValidation = pp.getStringProperty("validationQuery", null);
/* */
/* 724 */ if (dsJndi != null) {
/* 725 */ Properties props = null;
/* 726 */ if ((null != dsJndiInitial) || (null != dsJndiProvider) || (null != dsJndiPrincipal) || (null != dsJndiCredentials))
/* */ {
/* 728 */ props = new Properties();
/* 729 */ if (dsJndiInitial != null) {
/* 730 */ props.put("java.naming.factory.initial", dsJndiInitial);
/* */ }
/* 732 */ if (dsJndiProvider != null) {
/* 733 */ props.put("java.naming.provider.url", dsJndiProvider);
/* */ }
/* 735 */ if (dsJndiPrincipal != null) {
/* 736 */ props.put("java.naming.security.principal", dsJndiPrincipal);
/* */ }
/* 738 */ if (dsJndiCredentials != null) {
/* 739 */ props.put("java.naming.security.credentials", dsJndiCredentials);
/* */ }
/* */ }
/* 742 */ JNDIConnectionProvider cp = new JNDIConnectionProvider(dsJndi, props, dsAlwaysLookup);
/* */
/* 744 */ dbMgr = DBConnectionManager.getInstance();
/* 745 */ dbMgr.addConnectionProvider(dsNames[i], cp);
/* */ } else {
/* 747 */ if (dsDriver == null) {
/* 748 */ this.initException = new SchedulerException("Driver not specified for DataSource: " + dsNames[i]);
/* */
/* 751 */ throw this.initException;
/* */ }
/* 753 */ if (dsURL == null) {
/* 754 */ this.initException = new SchedulerException("DB URL not specified for DataSource: " + dsNames[i]);
/* */
/* 757 */ throw this.initException;
/* */ }
/* */ try {
/* 760 */ PoolingConnectionProvider cp = new PoolingConnectionProvider(dsDriver, dsURL, dsUser, dsPass, dsCnt, dsValidation);
/* */
/* 763 */ dbMgr = DBConnectionManager.getInstance();
/* 764 */ dbMgr.addConnectionProvider(dsNames[i], cp);
/* */ } catch (SQLException sqle) {
/* 766 */ this.initException = new SchedulerException("Could not initialize DataSource: " + dsNames[i], sqle);
/* */
/* 769 */ throw this.initException;
/* */ }
/* */
/* */ }
/* */
/* */ }
/* */
/* */ }
/* */
/* 780 */ String[] pluginNames = this.cfg.getPropertyGroups("org.quartz.plugin");
/* 781 */ SchedulerPlugin[] plugins = new SchedulerPlugin[pluginNames.length];
/* 782 */ for (int i = 0; i < pluginNames.length; i++) {
/* 783 */ Properties pp = this.cfg.getPropertyGroup("org.quartz.plugin." + pluginNames[i], true);
/* */
/* 786 */ String plugInClass = pp.getProperty("class", null);
/* */
/* 788 */ if (plugInClass == null) {
/* 789 */ this.initException = new SchedulerException("SchedulerPlugin class not specified for plugin '" + pluginNames[i] + "'", 50);
/* */
/* 793 */ throw this.initException;