/** * Wrap the object if required. * This is used for the wrapper policy support and EJB. */ public Object wrapObject(Object implementation, AbstractSession session) { if (!this.hasWrapperPolicy) { return implementation; } if (implementation == null) { return null; } // PERF: Using direct variable access. // Check if already wrapped. if ((!this.descriptor.hasWrapperPolicy()) || this.descriptor.getWrapperPolicy().isWrapped(implementation)) { return implementation; } // Allow for inheritance, the concrete wrapper must always be used. if (this.descriptor.hasInheritance() && this.descriptor.getInheritancePolicy().hasChildren() && (implementation.getClass() != this.descriptor.getJavaClass())) { ClassDescriptor descriptor = session.getDescriptor(implementation); if (descriptor != this.descriptor) { return descriptor.getObjectBuilder().wrapObject(implementation, session); } } return this.descriptor.getWrapperPolicy().wrapObject(implementation, session); }
/** * ADVANCED: * Sets the WrapperPolicy for this descriptor. * This advanced feature can be used to wrap objects with other classes such as CORBA TIE objects or EJBs. */ public void setWrapperPolicy(WrapperPolicy wrapperPolicy) { this.wrapperPolicy = wrapperPolicy; // For bug 2766379 must be able to set the wrapper policy back to default // which is null. if (wrapperPolicy != null) { wrapperPolicy.setDescriptor(this); } getObjectBuilder().setHasWrapperPolicy(wrapperPolicy != null); }
/** * Unwrap the object if required. * This is used for the wrapper policy support and EJB. */ public Object unwrapObject(Object proxy, AbstractSession session) { if (!this.hasWrapperPolicy) { return proxy; } if (proxy == null) { return null; } // PERF: Using direct variable access. // Check if already unwrapped. if ((!this.descriptor.hasWrapperPolicy()) || (this.descriptor.getJavaClass() == proxy.getClass()) || (!this.descriptor.getWrapperPolicy().isWrapped(proxy))) { if (session.getProject().hasProxyIndirection()) { //Bug#3947714 Check and trigger the proxy here return ProxyIndirectionPolicy.getValueFromProxy(proxy); } return proxy; } // Allow for inheritance, the concrete wrapper must always be used. if (this.descriptor.hasInheritance() && (this.descriptor.getInheritancePolicy().hasChildren())) { ClassDescriptor descriptor = session.getDescriptor(proxy); if (descriptor != this.descriptor) { return descriptor.getObjectBuilder().unwrapObject(proxy, session); } } return this.descriptor.getWrapperPolicy().unwrapObject(proxy, session); }
Object object = cp.next(iterator, cloningSession); if (mapping.getReferenceDescriptor().hasWrapperPolicy()) { object = mapping.getReferenceDescriptor().getWrapperPolicy().unwrapObject(object, cloningSession); objectToLock = mapping.getReferenceDescriptor().getWrapperPolicy().unwrapObject(objectToLock, cloningSession);
if (this.descriptor.hasWrapperPolicy() && this.descriptor.getWrapperPolicy().isWrapped(clone)) {
getWrapperPolicy().initialize(session);
/** * Unwrap the object if required. * This is used for the wrapper policy support and EJB. */ public Object unwrapObject(Object proxy, AbstractSession session) { if (!this.hasWrapperPolicy) { return proxy; } if (proxy == null) { return null; } // PERF: Using direct variable access. // Check if already unwrapped. if ((!this.descriptor.hasWrapperPolicy()) || (this.descriptor.getJavaClass() == proxy.getClass()) || (!this.descriptor.getWrapperPolicy().isWrapped(proxy))) { if (session.getProject().hasProxyIndirection()) { //Bug#3947714 Check and trigger the proxy here return ProxyIndirectionPolicy.getValueFromProxy(proxy); } return proxy; } // Allow for inheritance, the concrete wrapper must always be used. if (this.descriptor.hasInheritance() && (this.descriptor.getInheritancePolicy().hasChildren())) { ClassDescriptor descriptor = session.getDescriptor(proxy); if (descriptor != this.descriptor) { return descriptor.getObjectBuilder().unwrapObject(proxy, session); } } return this.descriptor.getWrapperPolicy().unwrapObject(proxy, session); }
Object object = cp.next(iterator, cloningSession); if (mapping.getReferenceDescriptor().hasWrapperPolicy()) { object = mapping.getReferenceDescriptor().getWrapperPolicy().unwrapObject(object, cloningSession); objectToLock = mapping.getReferenceDescriptor().getWrapperPolicy().unwrapObject(objectToLock, cloningSession);
if (this.descriptor.hasWrapperPolicy() && this.descriptor.getWrapperPolicy().isWrapped(clone)) {
getWrapperPolicy().initialize(session);
/** * Wrap the object if required. * This is used for the wrapper policy support and EJB. */ public Object wrapObject(Object implementation, AbstractSession session) { if (!this.hasWrapperPolicy) { return implementation; } if (implementation == null) { return null; } // PERF: Using direct variable access. // Check if already wrapped. if ((!this.descriptor.hasWrapperPolicy()) || this.descriptor.getWrapperPolicy().isWrapped(implementation)) { return implementation; } // Allow for inheritance, the concrete wrapper must always be used. if (this.descriptor.hasInheritance() && this.descriptor.getInheritancePolicy().hasChildren() && (implementation.getClass() != this.descriptor.getJavaClass())) { ClassDescriptor descriptor = session.getDescriptor(implementation); if (descriptor != this.descriptor) { return descriptor.getObjectBuilder().wrapObject(implementation, session); } } return this.descriptor.getWrapperPolicy().wrapObject(implementation, session); }
/** * Unwrap the object if required. * This is used for the wrapper policy support and EJB. */ public Object unwrapObject(Object proxy, AbstractSession session) { if (!this.hasWrapperPolicy) { return proxy; } if (proxy == null) { return null; } // PERF: Using direct variable access. // Check if already unwrapped. if ((!this.descriptor.hasWrapperPolicy()) || (this.descriptor.getJavaClass() == proxy.getClass()) || (!this.descriptor.getWrapperPolicy().isWrapped(proxy))) { if (session.getProject().hasProxyIndirection()) { //Bug#3947714 Check and trigger the proxy here return ProxyIndirectionPolicy.getValueFromProxy(proxy); } return proxy; } // Allow for inheritance, the concrete wrapper must always be used. if (this.descriptor.hasInheritance() && (this.descriptor.getInheritancePolicy().hasChildren())) { ClassDescriptor descriptor = session.getDescriptor(proxy); if (descriptor != this.descriptor) { return descriptor.getObjectBuilder().unwrapObject(proxy, session); } } return this.descriptor.getWrapperPolicy().unwrapObject(proxy, session); }
Object object = cp.next(iterator, session); if (mapping.getReferenceDescriptor().hasWrapperPolicy()) { object = mapping.getReferenceDescriptor().getWrapperPolicy().unwrapObject(object, session); objectToLock = mapping.getReferenceDescriptor().getWrapperPolicy().unwrapObject(objectToLock, session);
/** * ADVANCED: * Sets the WrapperPolicy for this descriptor. * This advanced feature can be used to wrap objects with other classes such as CORBA TIE objects or EJBs. */ public void setWrapperPolicy(WrapperPolicy wrapperPolicy) { this.wrapperPolicy = wrapperPolicy; // For bug 2766379 must be able to set the wrapper policy back to default // which is null. if (wrapperPolicy != null) { wrapperPolicy.setDescriptor(this); } getObjectBuilder().setHasWrapperPolicy(wrapperPolicy != null); }
if (this.descriptor.hasWrapperPolicy() && this.descriptor.getWrapperPolicy().isWrapped(clone)) {
getWrapperPolicy().initialize(session);
/** * Wrap the object if required. * This is used for the wrapper policy support and EJB. */ public Object wrapObject(Object implementation, AbstractSession session) { if (!this.hasWrapperPolicy) { return implementation; } if (implementation == null) { return null; } // PERF: Using direct variable access. // Check if already wrapped. if ((!this.descriptor.hasWrapperPolicy()) || this.descriptor.getWrapperPolicy().isWrapped(implementation)) { return implementation; } // Allow for inheritance, the concrete wrapper must always be used. if (this.descriptor.hasInheritance() && this.descriptor.getInheritancePolicy().hasChildren() && (implementation.getClass() != this.descriptor.getJavaClass())) { ClassDescriptor descriptor = session.getDescriptor(implementation); if (descriptor != this.descriptor) { return descriptor.getObjectBuilder().wrapObject(implementation, session); } } return this.descriptor.getWrapperPolicy().wrapObject(implementation, session); } }
m_parentDescriptor.getWrapperPolicy().unwrapObject(parentObj, uow);
/** * ADVANCED: * Sets the WrapperPolicy for this descriptor. * This advanced feature can be used to wrap objects with other classes such as CORBA TIE objects or EJBs. */ public void setWrapperPolicy(WrapperPolicy wrapperPolicy) { this.wrapperPolicy = wrapperPolicy; // For bug 2766379 must be able to set the wrapper policy back to default // which is null. if (wrapperPolicy != null) { wrapperPolicy.setDescriptor(this); } getObjectBuilder().setHasWrapperPolicy(wrapperPolicy != null); }
m_parentDescriptor.getWrapperPolicy().unwrapObject(parentObj, uow);