ccm_remove
4.3.4 Interfaces Supported by the Entity Container API Type
This section describes the interfaces supported by the entity container API type. This includes both internal interfaces provided by the container and callback interfaces that must be implemented by components deployed in this container API type.
4.3.4.1 The EntityContext Interface
The EntityContext is an internal interface that provides a component instance with access to the container-provided runtime services. It serves as a ÒbootstrapÓ to the various services the container provides for the component.
The EntityContext enables the component to simply obtain all the references it may require to implement its behavior.
exception IllegalState { };
local interface EntityContext : CCMContext { Object get_CCM_object () raises (IllegalState);
PrimaryKeyBase get_primary_key () raises (IllegalState); };
get_CCM_object
The get_CCM_object operation is used to obtain the reference used to invoke the component. For basic components, this will always be the component reference. For extended components, this will be a specific facet reference. If this operation is issued outside of the scope of a callback operation, the IllegalState exception is returned. get_primary_key
The get_primary_key operation is used by an
entity
component to access the primary key value declared for this componentÕs home. This operation is equivalent to issuing the same operation on the componentÕs home interface. If this operation is issued outside of the scope of a callback operation, the IllegalState exception is returned.4.3.4.2 The EntityComponent Interface
The EntityComponent is a callback interface implemented by both process and entity components. It contains operations to manage the persistent state of the component.
Note Ð As currently defined, any operation request will cause the container to activate the component segment, if required. Since the component reference is well-structured, we could consider the possibility of trapping navigation operations prior to activation and executing them without actually activating the component (or we could leave that to clever implementations).
exception CCMException {CCMExceptionReason reason;}; local interface EntityComponent : EnterpriseComponent {
void set_entity_context (in EntityContext ctx) raises (CCMException);
void unset_entity_context ()raises (CCMException); void ccm_activate () raises (CCMException);
void ccm_load ()raises (CCMException); void ccm_store ()raises (CCMException); void ccm_passivate ()raises (CCMException); void ccm_remove ()raises (CCMException); };
set_entity_context
The set_entity_context operation is used to set the EntityContext of the component. The container calls this operation after a component instance has been created. This operation is called outside the scope of an active transaction. The component may raise the CCMException with the SYSTEM_ERROR minor code to indicate a failure caused by a system level error.
unset_entity_context
The unset_entity_context operation is used to remove the EntityContext of the component. The container calls this operation just before a component instance is destroyed. This operation is called outside the scope of an active transaction. The component may raise the CCMException with the SYSTEM_ERROR minor code to indicate a failure caused by a system level error.
ccm_activate
The ccm_activate operation is called by the container to notify the component that it has been made active. For most CORBA component implementations, no action is required. The component instance should perform any initialization (other than establishing its state) required prior to operation invocation. This operation is called
within an unspecified transaction context. The component may raise the
CCMException with the
SYSTEM_ERROR minor code to indicate a failure caused by a system level error.ccm_load
The ccm_load operation is called by the container to instruct the component to synchronize its state by loading it from its underlying persistent store. When container- managed persistence is implemented using the CORBA persistent state service, this operation can be implemented in generated code. If self-managed persistence is being used, the component is responsible for locating its state in a persistent store. This operation executes within the scope of the current transaction. The component may raise the CCMException with the SYSTEM_ERROR minor code to indicate a failure caused by a system level error.
ccm_store
The ccm_store operation is called by the container to instruct the component to synchronize its state by saving it in its underlying persistent store. When container- managed persistence is implemented using the CORBA persistent state service, this operation can be implemented in generated code. If self-managed persistence is being used, the component is responsible for saving its state in the persistent store. This operation executes within the scope of the current transaction. The component may raise the CCMException with the SYSTEM_ERROR minor code to indicate a failure caused by a system level error.
ccm_passivate
The ccm_passivate operation is called by the container to notify the component that it has been made inactive. For most CORBA component implementations, no action is required. The component instance should perform any termination processing (other than saving its state) required prior to being passivated. This operation is called within an unspecified transaction context. The component may raise the CCMException with the SYSTEM_ERROR minor code to indicate a failure caused by a system level error.
ccm_remove
The ccm_remove operation is called by the container when the servant is about to be destroyed. It informs the component that it is about to be destroyed. This operation is always called outside the scope of a transaction. The component raises the
CCMException with the
REMOVE_ERROR minor code if it does not allow the destruction of the component. The component may raise the CCMException with the SYSTEM_ERROR minor code to indicate a failure caused by a system level error.The EntityComponent interface is equivalent to the EntityBean interface in Enterprise JavaBeans. Container-managed persistence with the CORBA persistent state service supports automatic code generation for ccm_load and ccm_store. For self-managed persistence, the component implementor provides the ccm_load and ccm_store methods. Since both process and
entity components have persistent state and container-managed persis- tence, the same callback interfaces can be used.