@Override public <R extends Service> void injectDependencies(ServiceBinding<R> binding) { throw new ServiceException( "Boot-strap registry should only contain provided services" ); }
@Override public <R extends Service> R initiateService(ServiceInitiator<R> serviceInitiator) { throw new ServiceException( "Boot-strap registry should only contain provided services" ); }
@Override public <R extends Service> void configureService(ServiceBinding<R> binding) { throw new ServiceException( "Boot-strap registry should only contain provided services" ); }
@Override public <R extends Service> void startService(ServiceBinding<R> binding) { throw new ServiceException( "Boot-strap registry should only contain provided services" ); }
@Override @SuppressWarnings( {"unchecked"}) public PersisterClassResolver initiateService(Map configurationValues, ServiceRegistryImplementor registry) { final Object customImpl = configurationValues.get( IMPL_NAME ); if ( customImpl == null ) { return new StandardPersisterClassResolver(); } if ( PersisterClassResolver.class.isInstance( customImpl ) ) { return (PersisterClassResolver) customImpl; } final Class<? extends PersisterClassResolver> customImplClass = Class.class.isInstance( customImpl ) ? (Class<? extends PersisterClassResolver>) customImpl : locate( registry, customImpl.toString() ); try { return customImplClass.newInstance(); } catch (Exception e) { throw new ServiceException( "Could not initialize custom PersisterClassResolver impl [" + customImplClass.getName() + "]", e ); } }
@Override @SuppressWarnings( {"unchecked"}) public PersisterFactory initiateService(Map configurationValues, ServiceRegistryImplementor registry) { final Object customImpl = configurationValues.get( IMPL_NAME ); if ( customImpl == null ) { return new PersisterFactoryImpl(); } if ( PersisterFactory.class.isInstance( customImpl ) ) { return (PersisterFactory) customImpl; } final Class<? extends PersisterFactory> customImplClass = Class.class.isInstance( customImpl ) ? ( Class<? extends PersisterFactory> ) customImpl : locate( registry, customImpl.toString() ); try { return customImplClass.newInstance(); } catch (Exception e) { throw new ServiceException( "Could not initialize custom PersisterFactory impl [" + customImplClass.getName() + "]", e ); } }
private static Driver loadDriverIfPossible(String driverClassName, ServiceRegistryImplementor serviceRegistry) { if ( driverClassName == null ) { log.debug( "No driver class specified" ); return null; } if ( serviceRegistry != null ) { final ClassLoaderService classLoaderService = serviceRegistry.getService( ClassLoaderService.class ); final Class<Driver> driverClass = classLoaderService.classForName( driverClassName ); try { return driverClass.newInstance(); } catch ( Exception e ) { throw new ServiceException( "Specified JDBC Driver " + driverClassName + " could not be loaded", e ); } } try { return (Driver) Class.forName( driverClassName ).newInstance(); } catch ( Exception e1 ) { throw new ServiceException( "Specified JDBC Driver " + driverClassName + " could not be loaded", e1 ); } }
throw new ServiceException( "Unable to call constructor of RegionFactory impl [" + strategyClass.getName() + "]", e ); throw new ServiceException( "Unable to call constructor of RegionFactory impl [" + strategyClass.getName() + "]", e ); throw new ServiceException( "Unable to call constructor of RegionFactory impl [" + strategyClass.getName() + "]", e );
@Override public BatchBuilder initiateService(Map configurationValues, ServiceRegistryImplementor registry) { final Object builder = configurationValues.get( BUILDER ); if ( builder == null ) { return new BatchBuilderImpl( ConfigurationHelper.getInt( Environment.STATEMENT_BATCH_SIZE, configurationValues, 1 ) ); } if ( BatchBuilder.class.isInstance( builder ) ) { return (BatchBuilder) builder; } final String builderClassName = builder.toString(); try { return (BatchBuilder) registry.getService( ClassLoaderService.class ).classForName( builderClassName ).newInstance(); } catch (Exception e) { throw new ServiceException( "Could not build explicit BatchBuilder [" + builderClassName + "]", e ); } } }
throw new ServiceException( "Unable to locate specified multi-tenant connection provider [" + className + "]" ); throw new ServiceException( "Unable to instantiate specified multi-tenant connection provider [" + implClass.getName() + "]" );
private void applyCustomerResolvers( DialectResolverSet resolver, ServiceRegistryImplementor registry, Map configurationValues) { final String resolverImplNames = (String) configurationValues.get( AvailableSettings.DIALECT_RESOLVERS ); if ( StringHelper.isNotEmpty( resolverImplNames ) ) { final ClassLoaderService classLoaderService = registry.getService( ClassLoaderService.class ); for ( String resolverImplName : StringHelper.split( ", \n\r\f\t", resolverImplNames ) ) { try { resolver.addResolver( (DialectResolver) classLoaderService.classForName( resolverImplName ).newInstance() ); } catch (HibernateException e) { throw e; } catch (Exception e) { throw new ServiceException( "Unable to instantiate named dialect resolver [" + resolverImplName + "]", e ); } } } } }
@SuppressWarnings( {"unchecked"}) protected <R extends Service> R createService(ServiceBinding<R> serviceBinding) { final ServiceInitiator<R> serviceInitiator = serviceBinding.getServiceInitiator(); if ( serviceInitiator == null ) { // this condition should never ever occur throw new UnknownServiceException( serviceBinding.getServiceRole() ); } try { R service = serviceBinding.getLifecycleOwner().initiateService( serviceInitiator ); // IMPL NOTE : the register call here is important to avoid potential stack overflow issues // from recursive calls through #configureService if ( service != null ) { registerService( serviceBinding, service ); } return service; } catch ( ServiceException e ) { throw e; } catch ( Exception e ) { throw new ServiceException( "Unable to create requested service [" + serviceBinding.getServiceRole().getName() + "]", e ); } }
public final org.hibernate.service.spi.ServiceException unableToConfigureDatastoreProvider(final java.lang.Exception arg0) { org.hibernate.service.spi.ServiceException result = new org.hibernate.service.spi.ServiceException(java.lang.String.format(unableToConfigureDatastoreProvider$str()), arg0); java.lang.StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(java.util.Arrays.copyOfRange(st, 1, st.length)); return result; }
public final org.hibernate.service.spi.ServiceException unableToStartDatastoreProvider(final java.lang.Exception arg0) { org.hibernate.service.spi.ServiceException result = new org.hibernate.service.spi.ServiceException(java.lang.String.format(unableToStartDatastoreProvider$str()), arg0); java.lang.StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(java.util.Arrays.copyOfRange(st, 1, st.length)); return result; }
public final org.hibernate.service.spi.ServiceException unableToStartDatastoreProvider(final java.lang.Exception arg0) { org.hibernate.service.spi.ServiceException result = new org.hibernate.service.spi.ServiceException(java.lang.String.format(unableToStartDatastoreProvider$str()), arg0); java.lang.StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(java.util.Arrays.copyOfRange(st, 1, st.length)); return result; }
@Override public final ServiceException unableToStartDatastoreProvider(final Exception arg0) { final ServiceException result = new ServiceException(String.format(getLoggingLocale(), unableToStartDatastoreProvider$str()), arg0); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String unableToConfigureDatastoreProvider = "OGM000072: Unable to configure datastore provider";
@Override public final ServiceException unableToConfigureDatastoreProvider(final Exception arg0) { final ServiceException result = new ServiceException(String.format(getLoggingLocale(), unableToConfigureDatastoreProvider$str()), arg0); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String cannotLoadLuceneParserBackend = "OGM000073: Couldn't load the Lucene-based query parser backend. Make sure the dependency org.hibernate.hql:hibernate-hql-lucene is part of the classpath.";
@Override public final ServiceException unableToConfigureDatastoreProvider(final Exception arg0) { final ServiceException result = new ServiceException(String.format(getLoggingLocale(), unableToConfigureDatastoreProvider$str()), arg0); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String cannotLoadLuceneParserBackend = "OGM000073: Couldn't load the Lucene-based query parser backend. Make sure the dependency org.hibernate.hql:hibernate-hql-lucene is part of the classpath.";
@Override public final ServiceException unableToConfigureDatastoreProvider(final Exception arg0) { final ServiceException result = new ServiceException(String.format(getLoggingLocale(), unableToConfigureDatastoreProvider$str()), arg0); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String cannotLoadLuceneParserBackend = "OGM000073: Couldn't load the Lucene-based query parser backend. Make sure the dependency org.hibernate.hql:hibernate-hql-lucene is part of the classpath.";
@Override public final ServiceException unableToConfigureDatastoreProvider(final Exception arg0) { final ServiceException result = new ServiceException(String.format(getLoggingLocale(), unableToConfigureDatastoreProvider$str()), arg0); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String cannotLoadLuceneParserBackend = "OGM000073: Couldn't load the Lucene-based query parser backend. Make sure the dependency org.hibernate.hql:hibernate-hql-lucene is part of the classpath.";