HHH-5632 - Import initial services work
This commit is contained in:
parent
a8a9d24e77
commit
bf51fb9a1a
|
@ -124,9 +124,7 @@ public class ClassLoaderServiceImpl implements ClassLoaderService {
|
|||
this.resourcesClassLoader = resourcesClassLoader;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Class classForName(String className) {
|
||||
for ( ClassLoader classLoader : classLoadingClassLoaders ) {
|
||||
try {
|
||||
|
@ -138,9 +136,7 @@ public class ClassLoaderServiceImpl implements ClassLoaderService {
|
|||
throw new ClassLoadingException( "Unable to load class [" + className + "]" );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public URL locateResource(String name) {
|
||||
// first we try name as a URL
|
||||
try {
|
||||
|
@ -158,9 +154,7 @@ public class ClassLoaderServiceImpl implements ClassLoaderService {
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public InputStream locateResourceStream(String name) {
|
||||
// first we try name as a URL
|
||||
try {
|
||||
|
@ -178,9 +172,7 @@ public class ClassLoaderServiceImpl implements ClassLoaderService {
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public List<URL> locateResources(String name) {
|
||||
try {
|
||||
Enumeration<URL> urlEnumeration = resourcesClassLoader.getResources( name );
|
||||
|
|
|
@ -38,16 +38,12 @@ import org.hibernate.service.spi.ServicesRegistry;
|
|||
public class ClassLoaderServiceInitiator implements ServiceInitiator<ClassLoaderService> {
|
||||
public static final ClassLoaderServiceInitiator INSTANCE = new ClassLoaderServiceInitiator();
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Class<ClassLoaderService> getServiceInitiated() {
|
||||
return ClassLoaderService.class;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public ClassLoaderService initiateService(Map configurationValues, ServicesRegistry registry) {
|
||||
return new ClassLoaderServiceImpl( configurationValues );
|
||||
}
|
||||
|
|
|
@ -83,6 +83,7 @@ public class ServicesRegistryImpl implements ServicesRegistry {
|
|||
serviceMap = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "unchecked" })
|
||||
public <T extends Service> T getService(Class<T> serviceRole) {
|
||||
T service = internalGetService( serviceRole );
|
||||
|
|
|
@ -39,16 +39,12 @@ public class JmxServiceInitiator implements ServiceInitiator<JmxService> {
|
|||
public static final String JMX_ENABLED = "hibernate.jmx.enabled";
|
||||
public static final JmxServiceInitiator INSTANCE = new JmxServiceInitiator();
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Class<JmxService> getServiceInitiated() {
|
||||
return JmxService.class;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public JmxService initiateService(Map configValues, ServicesRegistry registry) {
|
||||
return ConfigurationHelper.getBoolean( JMX_ENABLED, configValues, false )
|
||||
? new JmxServiceImpl( configValues )
|
||||
|
|
|
@ -50,6 +50,7 @@ public class JndiServiceImpl implements JndiService {
|
|||
this.initialContextSettings = JndiHelper.extractJndiProperties( configurationValues );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object locate(String jndiName) {
|
||||
InitialContext initialContext = buildInitialContext();
|
||||
try {
|
||||
|
@ -74,6 +75,7 @@ public class JndiServiceImpl implements JndiService {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bind(String jndiName, Object value) {
|
||||
InitialContext initialContext = buildInitialContext();
|
||||
try {
|
||||
|
|
|
@ -37,16 +37,12 @@ import org.hibernate.service.spi.ServicesRegistry;
|
|||
public class JndiServiceInitiator implements ServiceInitiator<JndiService> {
|
||||
public static final JndiServiceInitiator INSTANCE = new JndiServiceInitiator();
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Class<JndiService> getServiceInitiated() {
|
||||
return JndiService.class;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public JndiService initiateService(Map configurationValues, ServicesRegistry registry) {
|
||||
return new JndiServiceImpl( configurationValues );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue