當前位置: 首頁>>代碼示例>>Java>>正文


Java InjectService類代碼示例

本文整理匯總了Java中org.hibernate.service.spi.InjectService的典型用法代碼示例。如果您正苦於以下問題:Java InjectService類的具體用法?Java InjectService怎麽用?Java InjectService使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


InjectService類屬於org.hibernate.service.spi包,在下文中一共展示了InjectService類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: applyInjections

import org.hibernate.service.spi.InjectService; //導入依賴的package包/類
private <R extends Service> void applyInjections(R service) {
	try {
		for ( Method method : service.getClass().getMethods() ) {
			InjectService injectService = method.getAnnotation( InjectService.class );
			if ( injectService == null ) {
				continue;
			}

			processInjection( service, method, injectService );
		}
	}
	catch (NullPointerException e) {
           log.error( "NPE injecting service deps : " + service.getClass().getName() );
	}
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:16,代碼來源:AbstractServiceRegistryImpl.java

示例2: processInjection

import org.hibernate.service.spi.InjectService; //導入依賴的package包/類
@SuppressWarnings({ "unchecked" })
private <T extends Service> void processInjection(T service, Method injectionMethod, InjectService injectService) {
	if ( injectionMethod.getParameterTypes() == null || injectionMethod.getParameterTypes().length != 1 ) {
		throw new ServiceDependencyException(
				"Encountered @InjectService on method with unexpected number of parameters"
		);
	}

	Class dependentServiceRole = injectService.serviceRole();
	if ( dependentServiceRole == null || dependentServiceRole.equals( Void.class ) ) {
		dependentServiceRole = injectionMethod.getParameterTypes()[0];
	}

	// todo : because of the use of proxies, this is no longer returning null here...

	final Service dependantService = getService( dependentServiceRole );
	if ( dependantService == null ) {
		if ( injectService.required() ) {
			throw new ServiceDependencyException(
					"Dependency [" + dependentServiceRole + "] declared by service [" + service + "] not found"
			);
		}
	}
	else {
		try {
			injectionMethod.invoke( service, dependantService );
		}
		catch ( Exception e ) {
			throw new ServiceDependencyException( "Cannot inject dependency service", e );
		}
	}
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:33,代碼來源:AbstractServiceRegistryImpl.java

示例3: setJndiService

import org.hibernate.service.spi.InjectService; //導入依賴的package包/類
@InjectService( required = false )
@SuppressWarnings("UnusedDeclaration")
public void setJndiService(JndiService jndiService) {
	this.jndiService = jndiService;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:6,代碼來源:DatasourceConnectionProviderImpl.java

示例4: injectJdbcServices

import org.hibernate.service.spi.InjectService; //導入依賴的package包/類
/**
 * Hook for service registry to be able to inject JdbcServices
 *
 * @param jdbcServices The JdbcServices service
 */
@InjectService
@SuppressWarnings("UnusedDeclaration")
public void injectJdbcServices(JdbcServices jdbcServices) {
	this.jdbcServices = jdbcServices;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:11,代碼來源:StandardRefCursorSupport.java

示例5: setEntityManagerFactory

import org.hibernate.service.spi.InjectService; //導入依賴的package包/類
@InjectService
@Override
public void setEntityManagerFactory(EntityManagerFactoryRef entityManagerFactoryRef) {
    this.entityManagerFactory = entityManagerFactoryRef.getEntityManagerFactory();
}
 
開發者ID:esacinc,項目名稱:sdcct,代碼行數:6,代碼來源:DbMetadataServiceImpl.java

示例6: setMetadata

import org.hibernate.service.spi.InjectService; //導入依賴的package包/類
@InjectService
@Override
public void setMetadata(MetadataRef metadataRef) {
    this.metadata = metadataRef.getMetadata();
}
 
開發者ID:esacinc,項目名稱:sdcct,代碼行數:6,代碼來源:DbMetadataServiceImpl.java

示例7: setSearchIntegrator

import org.hibernate.service.spi.InjectService; //導入依賴的package包/類
@InjectService
@Override
public void setSearchIntegrator(SearchFactoryReference searchFactoryRef) {
    this.searchIntegrator = searchFactoryRef.getSearchIntegrator();
}
 
開發者ID:esacinc,項目名稱:sdcct,代碼行數:6,代碼來源:DbMetadataServiceImpl.java


注:本文中的org.hibernate.service.spi.InjectService類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。