Methods Summary |
---|
public java.lang.Object | cloneFor(java.lang.Object container)INTERNAL:
Return a clone of the specified container.
if (container == null) {
return null;
}
try {
return invokeCloneMethodOn(getCloneMethod(), container);
} catch (IllegalArgumentException ex) {
// container may be a superclass of the concrete container class
// so we have to use the right clone method...
return invokeCloneMethodOn(getCloneMethod(container.getClass()), container);
}
|
public void | convertClassNamesToClasses(java.lang.ClassLoader classLoader)INTERNAL:
Convert all the class-name-based settings in this ContainerPolicy to actual class-based
settings. This method is used when converting a project that has been built
with class names to a project with classes.
super.convertClassNamesToClasses(classLoader);
if (containerClassName == null){
return;
}
Class containerClass = null;
try{
if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){
try {
containerClass = (Class)AccessController.doPrivileged(new PrivilegedClassForName(containerClassName, true, classLoader));
} catch (PrivilegedActionException exception) {
throw ValidationException.classNotFoundWhileConvertingClassNames(containerClassName, exception.getException());
}
} else {
containerClass = oracle.toplink.essentials.internal.security.PrivilegedAccessHelper.getClassForName(containerClassName, true, classLoader);
}
} catch (ClassNotFoundException exc){
throw ValidationException.classNotFoundWhileConvertingClassNames(containerClassName, exc);
}
setContainerClass(containerClass);
|
public java.lang.reflect.Method | getCloneMethod()INTERNAL:
Return the 'clone()' Method for the container class.
Lazy initialization is used, so we can serialize these things.
if (cloneMethod == null) {
setCloneMethod(getCloneMethod(getContainerClass()));
}
return cloneMethod;
|
protected java.lang.reflect.Method | getCloneMethod(java.lang.Class javaClass)INTERNAL:
Return the 'clone()' Method for the specified class.
Return null if the method does not exist anywhere in the hierarchy
try {
// This must not be set "accessible" - clone() must be public, and some JVM's do not allow access to JDK classes.
if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){
try {
return (Method)AccessController.doPrivileged(new PrivilegedGetMethod(javaClass, "clone", (Class[])null, false));
} catch (PrivilegedActionException exception) {
throw QueryException.methodDoesNotExistInContainerClass("clone", javaClass);
}
} else {
return PrivilegedAccessHelper.getMethod(javaClass, "clone", (Class[])null, false);
}
} catch (NoSuchMethodException ex) {
throw QueryException.methodDoesNotExistInContainerClass("clone", javaClass);
}
|
public java.lang.Class | getContainerClass()INTERNAL:
Returns the container class to be used with this policy.
return containerClass;
|
public java.lang.String | getContainerClassName()
if ((containerClassName == null) && (containerClass != null)) {
containerClassName = containerClass.getName();
}
return containerClassName;
|
public abstract java.lang.Class | getInterfaceType()
|
public boolean | hasNext(java.lang.Object iterator)INTERNAL:
Return whether the iterator has more objects,
return ((Iterator)iterator).hasNext();
|
protected java.lang.Object | invokeCloneMethodOn(java.lang.reflect.Method method, java.lang.Object container)INTERNAL:
Invoke the specified clone method on the container,
handling the necessary exceptions.
try {
if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){
try {
return AccessController.doPrivileged(new PrivilegedMethodInvoker(method, container, (Object[])null));
} catch (PrivilegedActionException exception) {
Exception throwableException = exception.getException();
if (throwableException instanceof IllegalAccessException) {
throw QueryException.cannotAccessMethodOnObject(method, container);
} else {
throw QueryException.methodInvocationFailed(method, container, throwableException);
}
}
} else {
return PrivilegedAccessHelper.invokeMethod(method, container, (Object[])null);
}
} catch (IllegalAccessException ex1) {
throw QueryException.cannotAccessMethodOnObject(method, container);
} catch (InvocationTargetException ex2) {
throw QueryException.methodInvocationFailed(method, container, ex2);
}
|
public boolean | isValidContainerType(java.lang.Class containerType)INTERNAL:
Validate the container type.
return oracle.toplink.essentials.internal.helper.Helper.classImplementsInterface(containerType, getInterfaceType());
|
protected java.lang.Object | next(java.lang.Object iterator)INTERNAL:
Return the next object on the queue.
Valid for some subclasses only.
return ((Iterator)iterator).next();
|
public void | setCloneMethod(java.lang.reflect.Method cloneMethod)INTERNAL:
Set the Method that will return a clone of an instance of the containerClass.
this.cloneMethod = cloneMethod;
|
public void | setContainerClass(java.lang.Class containerClass)INTERNAL:
Set the class to use as the container.
this.containerClass = containerClass;
initializeConstructor();
|
public void | setContainerClassName(java.lang.String containerClassName)
this.containerClassName = containerClassName;
|
protected java.lang.Object | toStringInfo()
return this.getContainerClass();
|