HHH-15322 Allow JNDI lookups using the osgi scheme
This commit is contained in:
parent
6b4ac625e1
commit
c53050c7c3
|
@ -119,7 +119,7 @@ public class JndiServiceImpl implements JndiService {
|
|||
try {
|
||||
final URI uri = new URI( jndiName );
|
||||
final String scheme = uri.getScheme();
|
||||
if ( scheme != null && (! "java".equals( scheme ) ) ) {
|
||||
if ( scheme != null && (! allowedScheme( scheme ) ) ) {
|
||||
throw new JndiException( "JNDI lookups for scheme '" + scheme + "' are not allowed" );
|
||||
}
|
||||
}
|
||||
|
@ -137,6 +137,16 @@ public class JndiServiceImpl implements JndiService {
|
|||
}
|
||||
}
|
||||
|
||||
private static boolean allowedScheme(final String scheme) {
|
||||
switch ( scheme ) {
|
||||
case "java" :
|
||||
case "osgi" :
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private void cleanUp(InitialContext initialContext) {
|
||||
try {
|
||||
initialContext.close();
|
||||
|
|
Loading…
Reference in New Issue