Package org.omnifaces.util
Class JNDIObjectLocator.JNDIObjectLocatorBuilder
- java.lang.Object
-
- org.omnifaces.util.JNDIObjectLocator.JNDIObjectLocatorBuilder
-
- Enclosing class:
- JNDIObjectLocator
public static class JNDIObjectLocator.JNDIObjectLocatorBuilder extends Object
The builder of theJNDIObjectLocator
.
-
-
Constructor Summary
Constructors Constructor Description JNDIObjectLocatorBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JNDIObjectLocator.JNDIObjectLocatorBuilder
app()
Specifies that the default namespace to be used in construction of portable JNDI names must bejava:app
instead ofjava:module
.JNDIObjectLocator
build()
Builds theJNDIObjectLocator
.JNDIObjectLocator.JNDIObjectLocatorBuilder
cacheRemote()
Specifies to cache remote enterprise beans.JNDIObjectLocator.JNDIObjectLocatorBuilder
environment(String key, String value)
Adds an environment property.JNDIObjectLocator.JNDIObjectLocatorBuilder
environment(Map<String,String> environment)
Specifies the environment to be passed intoInitialContext
.JNDIObjectLocator.JNDIObjectLocatorBuilder
global()
Specifies that the default namespace to be used in construction of portable JNDI names must bejava:global
instead ofjava:module
.JNDIObjectLocator.JNDIObjectLocatorBuilder
initialHost(String initialHost)
Adds initial host environment property.JNDIObjectLocator.JNDIObjectLocatorBuilder
initialPort(int initialPort)
Adds initial port environment property.JNDIObjectLocator.JNDIObjectLocatorBuilder
namespace(String namespace)
Specifies the default namespace to be used in construction of portable JNDI names.JNDIObjectLocator.JNDIObjectLocatorBuilder
noCaching()
Specifies to disable cache.
-
-
-
Method Detail
-
environment
public JNDIObjectLocator.JNDIObjectLocatorBuilder environment(Map<String,String> environment)
Specifies the environment to be passed intoInitialContext
. The default isnull
.- Parameters:
environment
- The environment.- Returns:
- This builder.
- Throws:
NullPointerException
- When given environment is null.IllegalStateException
- When environment is already set in this builder or when this builder is already build.
-
environment
public JNDIObjectLocator.JNDIObjectLocatorBuilder environment(String key, String value)
Adds an environment property.- Parameters:
key
- The key of the new environment property.value
- The value of the new environment property.- Returns:
- This builder.
- Throws:
NullPointerException
- When key or value is null.IllegalStateException
- When environment property is already set in this builder or when this builder is already build.
-
initialHost
public JNDIObjectLocator.JNDIObjectLocatorBuilder initialHost(String initialHost)
Adds initial host environment property.- Parameters:
initialHost
- The initial host environment property.- Returns:
- This builder.
- Throws:
IllegalStateException
- When initial host is already set in this builder or when this builder is already build.NullPointerException
- When value is null.
-
initialPort
public JNDIObjectLocator.JNDIObjectLocatorBuilder initialPort(int initialPort)
Adds initial port environment property.- Parameters:
initialPort
- The initial port environment property.- Returns:
- This builder.
- Throws:
IllegalStateException
- When initial port is already set in this builder or when this builder is already build.
-
namespace
public JNDIObjectLocator.JNDIObjectLocatorBuilder namespace(String namespace)
Specifies the default namespace to be used in construction of portable JNDI names. The default isjava:module
.- Parameters:
namespace
- The namespace.- Returns:
- This builder.
- Throws:
IllegalStateException
- When namespace is already set in this builder or when this builder is already build.NullPointerException
- When given namespace is null.
-
global
public JNDIObjectLocator.JNDIObjectLocatorBuilder global()
Specifies that the default namespace to be used in construction of portable JNDI names must bejava:global
instead ofjava:module
.- Returns:
- This builder.
- Throws:
IllegalStateException
- When namespace is already set in this builder.
-
app
public JNDIObjectLocator.JNDIObjectLocatorBuilder app()
Specifies that the default namespace to be used in construction of portable JNDI names must bejava:app
instead ofjava:module
.- Returns:
- This builder.
- Throws:
IllegalStateException
- When namespace is already set in this builder.
-
noCaching
public JNDIObjectLocator.JNDIObjectLocatorBuilder noCaching()
Specifies to disable cache. The default isfalse
.- Returns:
- This builder.
- Throws:
IllegalStateException
- When noCaching is already set in this builder or when this builder is already build.
-
cacheRemote
public JNDIObjectLocator.JNDIObjectLocatorBuilder cacheRemote()
Specifies to cache remote enterprise beans. The default isfalse
.- Returns:
- This builder.
- Throws:
IllegalStateException
- When cacheRemote is already set in this builder or when this builder is already build.
-
build
public JNDIObjectLocator build()
Builds theJNDIObjectLocator
.- Returns:
- The
JNDIObjectLocator
. - Throws:
IllegalStateException
- When this builder is already build.
-
-