Package org.jboss.as.naming.util
Class NamingUtils
java.lang.Object
org.jboss.as.naming.util.NamingUtils
Common utility functions used by the naming implementation.
- Author:
- John E. Bailey
-
Method Summary
Modifier and TypeMethodDescriptionstatic CannotProceedExceptioncannotProceedException(Object resolvedObject, Name remainingName) Return a cannot-proceed exception.static InvalidNameExceptionCreate an invalid name exception for an empty name.static StringgetLastComponent(Name name) Get the last component of a name.static booleanDetermine if a name is empty, or if ot contains only one component which is the empty string.static booleanisLastComponentEmpty(Name name) Determine whether the last component is empty.static NameAlreadyBoundExceptionCreate a name-already-bound exception.static NameNotFoundExceptionnameNotFoundException(String name, Name contextName) Create a name-not-found exception.static <T> NamingEnumeration<T>namingEnumeration(Collection<T> collection) Return a naming enumeration over a collection.static NamingExceptionnamingException(String message, Throwable cause) Return a general naming exception with a root cause.static NamingExceptionnamingException(String message, Throwable cause, Name remainingName) Return a general naming exception with a root cause and a remaining name field.static NotContextExceptionnotAContextException(Name name) Return a not-context exception for a name.static voidRebind val to name in ctx, and make sure that all intermediate contexts existstatic voidRebind val to name in ctx, and make sure that all intermediate contexts existstatic voidUnbinds a name from ctx, and removes parents if they are emptystatic voidUnbinds a name from ctx, and removes parents if they are empty
-
Method Details
-
getLastComponent
Get the last component of a name.- Parameters:
name- the name- Returns:
- the last component
-
isEmpty
Determine if a name is empty, or if ot contains only one component which is the empty string.- Parameters:
name- the name- Returns:
trueif the name is empty or contains one empty component
-
isLastComponentEmpty
Determine whether the last component is empty.- Parameters:
name- the name to test- Returns:
trueif the last component is empty, or if the name is empty
-
nameNotFoundException
Create a name-not-found exception.- Parameters:
name- the namecontextName- the context name- Returns:
- the exception
-
nameAlreadyBoundException
Create a name-already-bound exception.- Parameters:
name- the name- Returns:
- the exception
-
emptyNameException
Create an invalid name exception for an empty name.- Returns:
- the exception
-
notAContextException
Return a not-context exception for a name.- Parameters:
name- the name- Returns:
- the exception
-
namingException
Return a general naming exception with a root cause.- Parameters:
message- the messagecause- the exception cause, ornullfor none- Returns:
- the exception
-
namingException
Return a general naming exception with a root cause and a remaining name field.- Parameters:
message- the messagecause- the exception cause, ornullfor noneremainingName- the remaining name- Returns:
- the exception
-
cannotProceedException
public static CannotProceedException cannotProceedException(Object resolvedObject, Name remainingName) Return a cannot-proceed exception.- Parameters:
resolvedObject- the resolved objectremainingName- the remaining name- Returns:
- the exception
-
namingEnumeration
Return a naming enumeration over a collection.- Type Parameters:
T- the member type- Parameters:
collection- the collection- Returns:
- the enumeration
-
rebind
Rebind val to name in ctx, and make sure that all intermediate contexts exist- Parameters:
ctx- the parent JNDI Context under which value will be boundname- the name relative to ctx where value will be boundvalue- the value to bind.- Throws:
NamingException- for any error
-
rebind
Rebind val to name in ctx, and make sure that all intermediate contexts exist- Parameters:
ctx- the parent JNDI Context under which value will be boundname- the name relative to ctx where value will be boundvalue- the value to bind.- Throws:
NamingException- for any error
-
unbind
Unbinds a name from ctx, and removes parents if they are empty- Parameters:
ctx- the parent JNDI Context under which the name will be unboundname- The name to unbind- Throws:
NamingException- for any error
-
unbind
Unbinds a name from ctx, and removes parents if they are empty- Parameters:
ctx- the parent JNDI Context under which the name will be unboundname- The name to unbind- Throws:
NamingException- for any error
-