javax.slee.profile
Interface Profile


public interface Profile

This interface must be implemented by a profile abstract class included in a Profile Specification.

Additional method declarations
A Profile Specification Developer may define or implement a number of additional methods in the profile abstract class that follow certain design patterns. These are:

Since:
SLEE 1.1

Method Summary
 void profileActivate()
          The SLEE invokes this method on a Profile object in the Pooled state when the SLEE reassigns the Profile object to an existing Profile.
 void profileInitialize()
          The SLEE invokes this method on a Profile object in the Pooled state only when the default Profile for a Profile Table is created.
 void profileLoad()
          The SLEE invokes this method on a Profile object in the Ready state when the state of the Profile object needs to be synchronized with the state in the underlying data source.
 void profilePassivate()
          The SLEE invokes this method on a Profile object in the Ready state when the SLEE needs to reclaim the Profile object.
 void profilePostCreate()
          The SLEE invokes this method on a Profile object in the Pooled state when a new Profile is created.
 void profileRemove()
          The SLEE invokes this method on a Profile object in the Ready state when a Profile is removed.
 void profileStore()
          The SLEE invokes this method on a Profile object in the Ready state when the state of the underlying data source needs to be synchronized with the state of the Profile object.
 void profileVerify()
          The SLEE invokes this method in response to a request made by the Administrator via the JMX management interface to commit any changes made to a Profile.
 void setProfileContext(ProfileContext context)
          Set the ProfileContext object for the Profile object.
 void unsetProfileContext()
          Unset the ProfileContext object for the Profile object.
 

Method Detail

setProfileContext

void setProfileContext(ProfileContext context)
Set the ProfileContext object for the Profile object. The SLEE invokes this method immediately after a new Profile object has been created. If the Profile object needs to use the ProfileContext object during its lifetime, it should store the ProfileContext object reference in an instance variable.

This method is invoked with an unspecified transaction context. The Profile object cannot access its persistent CMP state or invoke mandatory transactional methods during this method invocation.

Parameters:
context - the ProfileContext object given to the Profile object by the SLEE.

unsetProfileContext

void unsetProfileContext()
Unset the ProfileContext object for the Profile object. If the Profile object stored a reference to the ProfileContext object given to it in the setProfileContext(javax.slee.profile.ProfileContext) method, the Profile object should clear that reference during this method.

This is the last method invoked on a Profile object before it becomes a candidate for garbage collection.

This method is invoked with an unspecified transaction context. The Profile object cannot access its persistent CMP state or invoke mandatory transactional methods during this method invocation.


profileInitialize

void profileInitialize()
The SLEE invokes this method on a Profile object in the Pooled state only when the default Profile for a Profile Table is created. This method allows the CMP fields to be initialized to suitable defaults for other Profiles that are created in the Profile Table.

This method is invoked with an active transaction context. The SLEE follows a call to this method with a call to profilePostCreate(), and profileStore() in the same transaction.


profilePostCreate

void profilePostCreate()
                       throws CreateException
The SLEE invokes this method on a Profile object in the Pooled state when a new Profile is created. This method is invoked after the persistent representation of the Profile has been created. If this method is called on the default Profile (ie. when the default Profile is being created), the CMP fields contain the values set by the profileInitialize() method. For all other profiles, the CMP fields are prepopulated with a copy of the values stored in the default Profile.

The Profile object enters the Ready state after this method returns.

If the default Profile is being created, this method is invoked with the same transaction context that the corresponding profileInitialize() method was invoked with.

Throws:
CreateException - this exception may be thrown by the profile code if the Profile could not be created successfully.

profileActivate

void profileActivate()
The SLEE invokes this method on a Profile object in the Pooled state when the SLEE reassigns the Profile object to an existing Profile. This method gives the Profile object a chance to initialize additional transient state and acquire additional resources that it needs while it is in the Ready state. The Profile object transitions from the Pooled state to the Ready state after this method returns.

This method is invoked with an unspecified transaction context. The Profile object cannot access its persistent CMP state or invoke mandatory transactional methods during this method invocation.


profilePassivate

void profilePassivate()
The SLEE invokes this method on a Profile object in the Ready state when the SLEE needs to reclaim the Profile object. This method gives the Profile object a chance to release any state or resources, typically allocated during the profileActivate() method, that should not be held while the Profile object is in the Pooled state.

This method is invoked with an unspecified transaction context. The Profile object cannot access its persistent CMP state or invoke mandatory transactional methods during this method invocation.


profileLoad

void profileLoad()
The SLEE invokes this method on a Profile object in the Ready state when the state of the Profile object needs to be synchronized with the state in the underlying data source. The Profile object should reload from CMP fields any transient state that depends on the state stored in those CMP fields.

This method is invoked with an active transaction context.


profileStore

void profileStore()
The SLEE invokes this method on a Profile object in the Ready state when the state of the underlying data source needs to be synchronized with the state of the Profile object. The Profile object should store into CMP fields any transient state that depends on the state stored in those CMP fields.

This method is invoked with an active transaction context.


profileRemove

void profileRemove()
The SLEE invokes this method on a Profile object in the Ready state when a Profile is removed. Any resources obtained by the Profile object during profilePostCreate() or profileActivate() should be released by the Profile object. The Profile object transitions to the Pooled state after this method returns.

This method is invoked with an active transaction context.


profileVerify

void profileVerify()
                   throws ProfileVerificationException
The SLEE invokes this method in response to a request made by the Administrator via the JMX management interface to commit any changes made to a Profile. The Profile object should verify that the values stored in the CMP fields of the Profile form a valid Profile. If not, a ProfileVerificationException should be thrown.

The profileStore() method is invoked in the same transaction context before this method in order to ensure that the CMP fields of the Profile object are synchronized with any transient state stored by the Profile object.

Throws:
ProfileVerificationException - if the Profile fails any verification check.


Copyright © 2008. All Rights Reserved.