@Override
public boolean introspect(DataType dataType, final Operation operation) {
final Class javaType = dataType.getPhysical();
// Allow privileged access to read system properties. Requires PropertyPermission
// java.specification.version read in security policy.
final HelperContext context = AccessController.doPrivileged(new PrivilegedAction<HelperContext>() {
public HelperContext run() {
return SDOContextHelper.getHelperContext(operation);
}
});
final Type type = context.getTypeHelper().getType(javaType);
if (type == null) {
// FIXME: Need a better to test dynamic SDO
if (DataObject.class.isAssignableFrom(javaType)) {
// Dynamic SDO
dataType.setDataBinding(getName());
if (dataType.getLogical() == null) {
dataType.setLogical(XMLType.UNKNOWN);
}
return true;
}
return false;
}
if (type.isDataType()) {
// FIXME: Ignore simple types?
return false;
}
// Found a SDO type, replace the default context with a private one
AccessController.doPrivileged(new PrivilegedAction<Object>() {
public Object run() {
if (context == SDOContextHelper.getDefaultHelperContext()) {
HelperContext newContext = SDOUtil.createHelperContext();
SDOContextHelper.register(newContext, type);
if (operation != null) {
operation.getInputType().setMetaData(HelperContext.class, newContext);
}
} else {