Oracle Application Server TopLink API Reference
10g Release 2 (10.1.2)

B15903-01


oracle.toplink.descriptors
Interface WrapperPolicy

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
EJBWrapperPolicy

public interface WrapperPolicy
extends java.io.Serializable

Purpose: The wrapper policy can be used to wrap all objects read from the database in another object. This allows for TopLink to utilize one version of the class for its purposes and allows for the application to deal with another version of the object. The wrapper policy is used for things such as EJB Entity Beans and is directly used by the TopLink for WebLogic product for EJB Container Managed Persistence. It is assumed that relationships must be through the wrapper objects. Object identity is not maintained on the wrapper objects, only the wrapped object.


Field Summary
static java.lang.String Wrapping
          Used for profiling.

 

Method Summary
 void initialize(oracle.toplink.publicinterface.Session session)
          PUBLIC: Required: Lets the policy perform initialization.
 boolean isTraversable()
          PUBLIC: Required: Return true if the wrapped value should be traversed.
 boolean isWrapped(java.lang.Object object)
          PUBLIC: Required: Return true if the object is already wrapped.
 void setDescriptor(Descriptor descriptor)
          PUBLIC: Required: Set the descriptor.
 java.lang.Object unwrapObject(java.lang.Object proxy, oracle.toplink.publicinterface.Session session)
          PUBLIC: Required: Unwrap the object to return the implementation that is meant to be used by TopLink.
 java.lang.Object wrapObject(java.lang.Object original, oracle.toplink.publicinterface.Session session)
          PUBLIC: Required: Wrap the object to return the implementation that the application requires.

 

Field Detail

Wrapping

public static final java.lang.String Wrapping
Used for profiling.
See Also:
Constant Field Values

Method Detail

initialize

public void initialize(oracle.toplink.publicinterface.Session session)
                throws DescriptorException
PUBLIC: Required: Lets the policy perform initialization.
Parameters:
session - the session to initialize against
Throws:
DescriptorException

isTraversable

public boolean isTraversable()
PUBLIC: Required: Return true if the wrapped value should be traversed. Normally the wrapped value is looked after independently, it is not required to be traversed.

isWrapped

public boolean isWrapped(java.lang.Object object)
PUBLIC: Required: Return true if the object is already wrapped.

setDescriptor

public void setDescriptor(Descriptor descriptor)
PUBLIC: Required: Set the descriptor.
Parameters:
descriptor - the descriptor for the object being wrapped

unwrapObject

public java.lang.Object unwrapObject(java.lang.Object proxy,
                                     oracle.toplink.publicinterface.Session session)
PUBLIC: Required: Unwrap the object to return the implementation that is meant to be used by TopLink. The object may already be unwrapped in which case the object should be returned.
Parameters:
proxy - the wrapped object
session - the session to unwrap into

wrapObject

public java.lang.Object wrapObject(java.lang.Object original,
                                   oracle.toplink.publicinterface.Session session)
PUBLIC: Required: Wrap the object to return the implementation that the application requires. The object may already be wrapped in which case the object should be returned.
Parameters:
session - the session to wrap the object against.
Returns:
java.lang.Object the wrapped object

Copyright © 1998, 2005 Oracle Corporation. All Rights Reserved.