Author: baranowb
Date: Fri Mar 20 06:36:17 2009
New Revision: 5150

Modified:
trunk/servers/jain-slee/core/jar/src/main/java/org/mobicents/slee/container/deployment/profile/ConcreteProfileLocalObjectGenerator.java trunk/servers/jain-slee/core/jar/src/main/java/org/mobicents/slee/container/deployment/profile/ConcreteProfileMBeanGenerator.java trunk/servers/jain-slee/core/jar/src/main/java/org/mobicents/slee/container/profile/ProfileCmpHandler.java trunk/servers/jain-slee/core/jar/src/main/java/org/mobicents/slee/container/profile/ProfileLocalObjectConcreteImpl.java trunk/servers/jain-slee/core/jar/src/main/java/org/mobicents/slee/container/profile/ProfileMBeanConcrete.java trunk/servers/jain-slee/core/jar/src/main/java/org/mobicents/slee/container/profile/ProfileManagementHandler.java trunk/servers/jain-slee/core/jar/src/main/java/org/mobicents/slee/container/profile/ProfileObject.java

Log:
change:
- add CL switch in cases we know it is requried.

Modified: trunk/servers/jain-slee/core/jar/src/main/java/org/mobicents/slee/container/deployment/profile/ConcreteProfileLocalObjectGenerator.java
==============================================================================
--- trunk/servers/jain-slee/core/jar/src/main/java/org/mobicents/slee/container/deployment/profile/ConcreteProfileLocalObjectGenerator.java (original) +++ trunk/servers/jain-slee/core/jar/src/main/java/org/mobicents/slee/container/deployment/profile/ConcreteProfileLocalObjectGenerator.java Fri Mar 20 06:36:17 2009
@@ -185,6 +185,9 @@
                }
                String body="{ "+
                _PLO_PO_ALLOCATION+
+               "Thread t = Thread.currentThread();"+
+               "ClassLoader oldClassLoader = t.getContextClassLoader();"+
+ "t.setContextClassLoader(this.profileObject.getProfileSpecificationComponent().getClassLoader());"+
                "try{";
                if(hasReturnValue)
                        body+="Object result = 
"+interceptorAccess+"."+method.getName()+"($$);";
@@ -207,6 +210,10 @@
" throw new "+SLEEException.class.getName()+"(\"System level failure.,\",e);"+
                "  }"+
                "}" +
+               "finally"+
+               "{"+
+               "  t.setContextClassLoader(oldClassLoader);"+
+               "}"+
        "}";
                
                if(logger.isDebugEnabled())

Modified: trunk/servers/jain-slee/core/jar/src/main/java/org/mobicents/slee/container/deployment/profile/ConcreteProfileMBeanGenerator.java
==============================================================================
--- trunk/servers/jain-slee/core/jar/src/main/java/org/mobicents/slee/container/deployment/profile/ConcreteProfileMBeanGenerator.java (original) +++ trunk/servers/jain-slee/core/jar/src/main/java/org/mobicents/slee/container/deployment/profile/ConcreteProfileMBeanGenerator.java Fri Mar 20 06:36:17 2009
@@ -252,6 +252,9 @@
                String body="{ "+
                "boolean createdTransaction = false;"+
                "boolean rollback = true;"+
+               "Thread t = Thread.currentThread();"+
+               "ClassLoader oldClassLoader = t.getContextClassLoader();"+
+ "t.setContextClassLoader(this.profileObject.getProfileSpecificationComponent().getClassLoader());"+
                "try {"+
" createdTransaction = this.sleeTransactionManager.requireTransaction();";
                if(hasReturnValue)
@@ -275,7 +278,7 @@
" throw new "+ProfileImplementationException.class.getName()+"(checked);"+
                "}"+
                "finally {"+
-                       
+               "t.setContextClassLoader(oldClassLoader);"+   
                "  if (rollback) {"+
                "          try {"+
                "                  this.sleeTransactionManager.rollback();"+

Modified: trunk/servers/jain-slee/core/jar/src/main/java/org/mobicents/slee/container/profile/ProfileCmpHandler.java
==============================================================================
--- trunk/servers/jain-slee/core/jar/src/main/java/org/mobicents/slee/container/profile/ProfileCmpHandler.java (original) +++ trunk/servers/jain-slee/core/jar/src/main/java/org/mobicents/slee/container/profile/ProfileCmpHandler.java Fri Mar 20 06:36:17 2009
@@ -48,33 +48,40 @@
public void setCmpField(String fieldName, Object value) throws UnsupportedOperationException, IllegalStateException {

profileObject.getProfileTableConcrete().getProfileManagement().getSleeContainer().getTransactionManager().mandateTransaction();
+               Thread t = Thread.currentThread();
+               ClassLoader oldClassLoader = t.getContextClassLoader();
+ t.setContextClassLoader(this.profileObject.getProfileSpecificationComponent().getClassLoader());
+               try {
+                       // this operation is allowed ONLY
+                       // 1. for 1.1 profiles - if profile is write able
+                       // 2. for management clients
+                       // if a sbb tries to set a value, it is not authorized
+
+                       // This covers Management client
+                       if (this.profileObject.isManagementView()) {
+                               // write check is a double check to MBean, but 
lets be clear
+                               // here
+                               if (this.profileObject.isWriteable())
+ throw new ReadOnlyProfileException("Profile: " + profileObject.getProfileName() + ", table:" + this.profileObject.getProfileTableConcrete().getProfileTableName()
+                                                       + " ,is not 
writeable.");
+                       } else {
+                               // this gets
+                               if (!this.profileObject.isProfileWriteable()) {
+ throw new ReadOnlyProfileException("Profile: " + profileObject.getProfileName() + ", table:" + this.profileObject.getProfileTableConcrete().getProfileTableName()
+                                                       + " ,is not 
writeable.");
+                               }
+                       }

-               // this operation is allowed ONLY
-               // 1. for 1.1 profiles - if profile is write able
-               // 2. for management clients
-               // if a sbb tries to set a value, it is not authorized
-
-               // This covers Management client
-               if (this.profileObject.isManagementView()) {
-                       // write check is a double check to MBean, but lets be 
clear here
-                       if (this.profileObject.isWriteable())
- throw new ReadOnlyProfileException("Profile: " + profileObject.getProfileName() + ", table:" + this.profileObject.getProfileTableConcrete().getProfileTableName()
-                                               + " ,is not writeable.");
-               } else {
-                       // this gets
-                       if (!this.profileObject.isProfileWriteable()) {
- throw new ReadOnlyProfileException("Profile: " + profileObject.getProfileName() + ", table:" + this.profileObject.getProfileTableConcrete().getProfileTableName()
-                                               + " ,is not writeable.");
+                       if (!this.profileObject.isCanAccessCMP()) {
+ throw new IllegalStateException("Can not access CMP field at this moment.");
                        }
-               }

-               if (!this.profileObject.isCanAccessCMP()) {
- throw new IllegalStateException("Can not access CMP field at this moment.");
+                       // FIXME: set
+                       
this.profileObject.getProfileConcrete().setProfileDirty(true);
+               } finally {
+                       t.setContextClassLoader(oldClassLoader);
                }

-               // FIXME: set
-               this.profileObject.getProfileConcrete().setProfileDirty(true);
-
        }

        /**
@@ -86,15 +93,31 @@
        public Object getCmpField(String fieldName) {

profileObject.getProfileTableConcrete().getProfileManagement().getSleeContainer().getTransactionManager().mandateTransaction();
-
-               if (!this.profileObject.isCanAccessCMP()) {
- throw new IllegalStateException("Can not access CMP field at this moment.");
+               Thread t = Thread.currentThread();
+               ClassLoader oldClassLoader = t.getContextClassLoader();
+ t.setContextClassLoader(this.profileObject.getProfileSpecificationComponent().getClassLoader());
+               try {
+                       if (!this.profileObject.isCanAccessCMP()) {
+ throw new IllegalStateException("Can not access CMP field at this moment.");
+                       }
+                       return null;
+               } finally {
+                       t.setContextClassLoader(oldClassLoader);
                }
-               return null;
+
        }

        public void commitChanges() {
+               Thread t = Thread.currentThread();
+               ClassLoader oldClassLoader = t.getContextClassLoader();
+ t.setContextClassLoader(this.profileObject.getProfileSpecificationComponent().getClassLoader());
+               try {

+                       // FIXME: put something here
+
+               } finally {
+                       t.setContextClassLoader(oldClassLoader);
+               }
        }

        /**

Modified: trunk/servers/jain-slee/core/jar/src/main/java/org/mobicents/slee/container/profile/ProfileLocalObjectConcreteImpl.java
==============================================================================
--- trunk/servers/jain-slee/core/jar/src/main/java/org/mobicents/slee/container/profile/ProfileLocalObjectConcreteImpl.java (original) +++ trunk/servers/jain-slee/core/jar/src/main/java/org/mobicents/slee/container/profile/ProfileLocalObjectConcreteImpl.java Fri Mar 20 06:36:17 2009
@@ -47,22 +47,20 @@
        protected boolean isDefault = true;
        protected ProfileObject profileObject = null;
        protected SleeTransactionManager sleeTransactionManager = null;
-       // FIXME add this.
-       private ProfileLocalObjectInterceptor interceptor = null;
+       

public ProfileLocalObjectConcreteImpl(String profileTableName, ProfileSpecificationID profileSpecificationId, String profileName, SleeProfileManagement sleeProfileManagement, boolean isDefault) {
                super();
if (profileTableName == null || profileName == null || profileSpecificationId == null) {
                        throw new NullPointerException("Parameters must not be 
null");
                }
-
+               //FIXME: does any of below methods require CL change?
                this.profileName = profileName;
                this.profileTableName = profileTableName;
                this.profileSpecificationId = profileSpecificationId;
                this.sleeProfileManagement = sleeProfileManagement;
- this.interceptor = new DefaultProfileLocalObjectInterceptorImpl(this.sleeProfileManagement); this.sleeTransactionManager = this.sleeProfileManagement.getSleeContainer().getTransactionManager();
-
+               
        }

        /*
@@ -173,29 +171,29 @@
        }

        /**
- * This method allocates ProfileObject to serve calls. If this is snapshot, this method does nothing as we ha + * This method allocates ProfileObject to serve calls. If this is snapshot,
+        * this method does nothing as we ha
         */
public void allocateProfileObject() throws UnrecognizedProfileNameException, UnrecognizedProfileTableNameException, SLEEException {
-               
-               //FIXME: mayeb we should be protected ?
-                               try {
+
+               // FIXME: mayeb we should be protected ?
+               try {
                        sleeTransactionManager.mandateTransaction();
                } catch (TransactionRequiredLocalException trle) {
                        throw new SLEEException("No transaction present.", 
trle);
                }
-               
-               try{
- ProfileTableConcrete profileTable = (ProfileTableConcrete) this.sleeProfileManagement.getProfileTable(profileTableName, this.profileSpecificationId);
-               this.profileObject = 
profileTable.assignProfileObject(profileName);
-               // Set flag that SLEE component interacts with it. this is 
false only in
-               // case of JMX client
-               this.profileObject.setManagementView(false);
-               this.interceptor.setProfile(this.profileObject);
-               }catch(UnrecognizedProfileTableNameException e)
-               {
+
+               try {
+ ProfileTableConcrete profileTable = (ProfileTableConcrete) this.sleeProfileManagement.getProfileTable(profileTableName, this.profileSpecificationId);
+                       this.profileObject = 
profileTable.assignProfileObject(profileName);
+                       // Set flag that SLEE component interacts with it. this 
is false
+                       // only in
+                       // case of JMX client
+                       this.profileObject.setManagementView(false);
+               } catch (UnrecognizedProfileTableNameException e) {
                        try {
                                sleeTransactionManager.rollback();
- throw new TransactionRolledbackLocalException("No such profile table: "+profileTableName,e); + throw new TransactionRolledbackLocalException("No such profile table: " + profileTableName, e);
                        } catch (IllegalStateException e1) {
                                // TODO Auto-generated catch block
                                e1.printStackTrace();
@@ -206,12 +204,11 @@
                                // TODO Auto-generated catch block
                                e1.printStackTrace();
                        }
-               }catch(UnrecognizedProfileNameException e)
-               {
-                       //FIXME: WE NEED TO ENSUE THAT SNAPSHOTS WILL WORK!!!!!
+               } catch (UnrecognizedProfileNameException e) {
+                       // FIXME: WE NEED TO ENSUE THAT SNAPSHOTS WILL WORK!!!!!
                        try {
                                sleeTransactionManager.rollback();
- throw new TransactionRolledbackLocalException("No such profile: "+profileName,e); + throw new TransactionRolledbackLocalException("No such profile: " + profileName, e);
                        } catch (IllegalStateException e1) {
                                // TODO Auto-generated catch block
                                e1.printStackTrace();
@@ -223,13 +220,13 @@
                                e1.printStackTrace();
                        }
                }
-               
+
                try {
sleeTransactionManager.addBeforeCommitAction(new BeforeCommitTransctAction()); sleeTransactionManager.addAfterRollbackAction(new RollbackTransctAction());

                } catch (SystemException e) {
-                       throw new SLEEException("Failed to add management 
task",e);
+                       throw new SLEEException("Failed to add management 
task", e);
                }

        }
@@ -240,7 +237,7 @@

        private void removeProfileObject() {
                this.profileObject = null;
-               this.interceptor.setProfile(null);
+
        }

        private class BeforeCommitTransctAction implements TransactionalAction {

Modified: trunk/servers/jain-slee/core/jar/src/main/java/org/mobicents/slee/container/profile/ProfileMBeanConcrete.java
==============================================================================
--- trunk/servers/jain-slee/core/jar/src/main/java/org/mobicents/slee/container/profile/ProfileMBeanConcrete.java (original) +++ trunk/servers/jain-slee/core/jar/src/main/java/org/mobicents/slee/container/profile/ProfileMBeanConcrete.java Fri Mar 20 06:36:17 2009
@@ -62,39 +62,52 @@
        // #################

public void closeProfile() throws InvalidStateException, ManagementException {
-               /*
-                * SLEE 1.1 spec, 10.26.3.4 closeProfile method
-                */
+               Thread t = Thread.currentThread();
+               ClassLoader oldClassLoader = t.getContextClassLoader();
+ t.setContextClassLoader(this.profileObject.getProfileSpecificationComponent().getClassLoader());
+               try {
+                       /*
+                        * SLEE 1.1 spec, 10.26.3.4 closeProfile method
+                        */

-               /*
-                * The Administrator invokes the closeProfile method when the
-                * Administrator no longer requires access to the Profile MBean 
object.
-                * The implementation of this method is free to deregister the 
Profile
-                * MBean object from the MBean Server. ( but if you do this 
then test #
-                * 4386 will fail! )
-                */
-               if (logger.isDebugEnabled()) {
- logger.debug("closeProfile called (profile =" + this.profileObject.getProfileTableConcrete().getProfileTableName() + "/" + this.profileObject.getProfileName() + ")");
-                       logger.debug("profileWriteable " + 
this.profileObject.isWriteable());
- logger.debug("dirtyFlag " + this.profileObject.getProfileConcrete().isProfileDirty());
-               }
-               /*
-                * The closeProfile method must throw a 
javax.slee.InvalidStateException
-                * if the Profile MBean object is in the read-write state.
-                */
- if (this.profileObject.isWriteable() && this.profileObject.getProfileConcrete().isProfileDirty())
-                       throw new InvalidStateException();
+                       /*
+                        * The Administrator invokes the closeProfile method 
when the
+                        * Administrator no longer requires access to the 
Profile MBean
+                        * object. The implementation of this method is free to 
deregister
+                        * the Profile MBean object from the MBean Server. ( 
but if you do
+                        * this then test # 4386 will fail! )
+                        */
+                       if (logger.isDebugEnabled()) {
+ logger.debug("closeProfile called (profile =" + this.profileObject.getProfileTableConcrete().getProfileTableName() + "/" + this.profileObject.getProfileName() + ")");
+                               logger.debug("profileWriteable " + 
this.profileObject.isWriteable());
+ logger.debug("dirtyFlag " + this.profileObject.getProfileConcrete().isProfileDirty());
+                       }
+                       /*
+                        * The closeProfile method must throw a
+                        * javax.slee.InvalidStateException if the Profile 
MBean object is
+                        * in the read-write state.
+                        */
+ if (this.profileObject.isWriteable() && this.profileObject.getProfileConcrete().isProfileDirty())
+                               throw new InvalidStateException();

-               // Jean -- Should close imply unregister ? I think not.
-               // sleeProfileManager.unregisterProfileMBean(profileKey);
-               if (logger.isDebugEnabled()) {
-                       logger.debug("profileWriteable " + 
this.profileObject.isWriteable());
- logger.debug("dirtyFlag " + this.profileObject.getProfileConcrete().isProfileDirty());
-                       logger.debug("closeProfile call ended");
+                       // Jean -- Should close imply unregister ? I think not.
+                       // 
sleeProfileManager.unregisterProfileMBean(profileKey);
+                       if (logger.isDebugEnabled()) {
+                               logger.debug("profileWriteable " + 
this.profileObject.isWriteable());
+ logger.debug("dirtyFlag " + this.profileObject.getProfileConcrete().isProfileDirty());
+                               logger.debug("closeProfile call ended");
+                       }
+               } finally {
+                       t.setContextClassLoader(oldClassLoader);
                }
        }

public void commitProfile() throws InvalidStateException, ProfileVerificationException, ManagementException {
+
+               Thread t = Thread.currentThread();
+               ClassLoader oldClassLoader = t.getContextClassLoader();
+ t.setContextClassLoader(this.profileObject.getProfileSpecificationComponent().getClassLoader());
+
                /*
                 * 10.26.3.2 commitProfile method
                 */
@@ -296,6 +309,8 @@
                        }

                } finally {
+                       // FIXME: is this ok to set it befiore rollback?
+                       t.setContextClassLoader(oldClassLoader);
                        try {
                                // if the tx was not completed by now, then 
there was an
                                // exception and it should roll back
@@ -310,43 +325,53 @@
        }

        public void editProfile() throws ManagementException {
-               /*
-                * The Administrator invokes the editProfile method to obtain 
read-write
-                * access to the Profile MBean object (if the Administrator 
currently
-                * has read-only access to the Profile MBean object).
-                */
-               if (logger.isDebugEnabled()) {
- logger.debug("editProfile called (profile =" + this.profileObject.getProfileTableConcrete().getProfileTableName() + "/" + this.profileObject.getProfileName() + ")");
-                       logger.debug("profileWriteable " + 
this.profileObject.isWriteable());
- logger.debug("dirtyFlag " + this.profileObject.getProfileConcrete().isProfileDirty());
-               }

-               if (!this.profileObject.isWriteable()) {
-                       if (logger.isDebugEnabled())
-                               logger.debug("starting new Transaction and editing 
profile");
-                       /*
-                        * The implementation of this method should start a new 
transaction
-                        * for the editing session, or perform the equivalent 
function.
-                        */
-                       // sleeProfileManager.startTransaction(profileKey);
-                       // sleeProfileManager.startTransaction();
-                       // boolean b = txManager.requireTransaction();
-                       this.profileObject.setWriteable(true);
-                       this.profileObject.profileLoad();
-                       // if ( b ) txManager.commit();
-               }
-               /*
-                * If the Profile MBean object is already in the read-write 
state when
-                * this method is invoked, this method has no further effect 
and returns
-                * silently.
-                */
-               else {
-                       logger.debug("profile already in the read/write state");
-               }
-               if (logger.isDebugEnabled()) {
-                       logger.debug("profileWriteable " + 
this.profileObject.isWriteable());
- logger.debug("dirtyFlag " + this.profileObject.getProfileConcrete().isProfileDirty());
-                       logger.debug("editProfile call ended");
+               Thread t = Thread.currentThread();
+               ClassLoader oldClassLoader = t.getContextClassLoader();
+ t.setContextClassLoader(this.profileObject.getProfileSpecificationComponent().getClassLoader());
+               try {
+                       /*
+                        * The Administrator invokes the editProfile method to 
obtain
+                        * read-write access to the Profile MBean object (if the
+                        * Administrator currently has read-only access to the 
Profile MBean
+                        * object).
+                        */
+                       if (logger.isDebugEnabled()) {
+ logger.debug("editProfile called (profile =" + this.profileObject.getProfileTableConcrete().getProfileTableName() + "/" + this.profileObject.getProfileName() + ")");
+                               logger.debug("profileWriteable " + 
this.profileObject.isWriteable());
+ logger.debug("dirtyFlag " + this.profileObject.getProfileConcrete().isProfileDirty());
+                       }
+
+                       if (!this.profileObject.isWriteable()) {
+                               if (logger.isDebugEnabled())
+                                       logger.debug("starting new Transaction and 
editing profile");
+                               /*
+                                * The implementation of this method should 
start a new
+                                * transaction for the editing session, or 
perform the
+                                * equivalent function.
+                                */
+                               // 
sleeProfileManager.startTransaction(profileKey);
+                               // sleeProfileManager.startTransaction();
+                               // boolean b = txManager.requireTransaction();
+                               this.profileObject.setWriteable(true);
+                               this.profileObject.profileLoad();
+                               // if ( b ) txManager.commit();
+                       }
+                       /*
+                        * If the Profile MBean object is already in the 
read-write state
+                        * when this method is invoked, this method has no 
further effect
+                        * and returns silently.
+                        */
+                       else {
+                               logger.debug("profile already in the read/write 
state");
+                       }
+                       if (logger.isDebugEnabled()) {
+                               logger.debug("profileWriteable " + 
this.profileObject.isWriteable());
+ logger.debug("dirtyFlag " + this.profileObject.getProfileConcrete().isProfileDirty());
+                               logger.debug("editProfile call ended");
+                       }
+               } finally {
+                       t.setContextClassLoader(oldClassLoader);
                }

        }
@@ -378,39 +403,47 @@
        }

public void restoreProfile() throws InvalidStateException, ManagementException {
-               /*
-                * The Administrator invokes the restoreProfile method if the
-                * Administrator wishes to discard changes made to the Profile
-                * Management object that caches the persistent state of a 
Profile. The
-                * implementation of this method rolls back any changes that 
have been
-                * made to the Profile Management object since the Profile 
MBean object
-                * entered the read-write state and moves the Profile MBean 
object to
-                * the read-only state. If the Profile MBean object was 
returned by the
-                * createProfile method (see Section 14.11), then no new 
Profile is
-                * created since the transaction will not commit The execution 
of this
-                * method must begin in the same transaction context as that 
begun by
-                * the createProfile or editProfile invocation that initiated 
the
-                * editing session, but must roll back the transaction before 
returning.
-                */
-               if (logger.isDebugEnabled()) {
- logger.debug("restoreProfile called (profile =" + this.profileObject.getProfileTableConcrete().getProfileTableName() + "/" + this.profileObject.getProfileName() + ")");
-                       logger.debug("profileWriteable " + 
this.profileObject.isWriteable());
- logger.debug("dirtyFlag " + this.profileObject.getProfileConcrete().isProfileDirty());
-               }
-               /*
-                * The restoreProfile method must throw a
-                * javax.slee.InvalidStateException if the Profile MBean object 
is not
-                * in the read-write state.
-                */
-               if (!this.profileObject.isWriteable())
-                       throw new InvalidStateException();
+               Thread t = Thread.currentThread();
+               ClassLoader oldClassLoader = t.getContextClassLoader();
+ t.setContextClassLoader(this.profileObject.getProfileSpecificationComponent().getClassLoader());
+               try {
+                       /*
+                        * The Administrator invokes the restoreProfile method 
if the
+                        * Administrator wishes to discard changes made to the 
Profile
+                        * Management object that caches the persistent state 
of a Profile.
+                        * The implementation of this method rolls back any 
changes that
+                        * have been made to the Profile Management object 
since the Profile
+                        * MBean object entered the read-write state and moves 
the Profile
+                        * MBean object to the read-only state. If the Profile 
MBean object
+                        * was returned by the createProfile method (see 
Section 14.11),
+                        * then no new Profile is created since the transaction 
will not
+                        * commit The execution of this method must begin in 
the same
+                        * transaction context as that begun by the 
createProfile or
+                        * editProfile invocation that initiated the editing 
session, but
+                        * must roll back the transaction before returning.
+                        */
+                       if (logger.isDebugEnabled()) {
+ logger.debug("restoreProfile called (profile =" + this.profileObject.getProfileTableConcrete().getProfileTableName() + "/" + this.profileObject.getProfileName() + ")");
+                               logger.debug("profileWriteable " + 
this.profileObject.isWriteable());
+ logger.debug("dirtyFlag " + this.profileObject.getProfileConcrete().isProfileDirty());
+                       }
+                       /*
+                        * The restoreProfile method must throw a
+                        * javax.slee.InvalidStateException if the Profile 
MBean object is
+                        * not in the read-write state.
+                        */
+                       if (!this.profileObject.isWriteable())
+                               throw new InvalidStateException();

-               this.profileObject.profileLoad();
-               this.profileObject.setWriteable(false);
-               if (logger.isDebugEnabled()) {
-                       logger.debug("profileWriteable " + 
this.profileObject.isWriteable());
- logger.debug("dirtyFlag " + this.profileObject.getProfileConcrete().isProfileDirty());
-                       logger.debug("restoreProfile call ended");
+                       this.profileObject.profileLoad();
+                       this.profileObject.setWriteable(false);
+                       if (logger.isDebugEnabled()) {
+                               logger.debug("profileWriteable " + 
this.profileObject.isWriteable());
+ logger.debug("dirtyFlag " + this.profileObject.getProfileConcrete().isProfileDirty());
+                               logger.debug("restoreProfile call ended");
+                       }
+               } finally {
+                       t.setContextClassLoader(oldClassLoader);
                }

        }
@@ -425,7 +458,6 @@
        }

        protected String getProfileTableName() {
-               

return this.profileObject.getProfileTableConcrete().getProfileTableName();
        }

Modified: trunk/servers/jain-slee/core/jar/src/main/java/org/mobicents/slee/container/profile/ProfileManagementHandler.java
==============================================================================
--- trunk/servers/jain-slee/core/jar/src/main/java/org/mobicents/slee/container/profile/ProfileManagementHandler.java (original) +++ trunk/servers/jain-slee/core/jar/src/main/java/org/mobicents/slee/container/profile/ProfileManagementHandler.java Fri Mar 20 06:36:17 2009
@@ -6,13 +6,11 @@
 import javax.slee.profile.ProfileID;
 import javax.slee.profile.ProfileVerificationException;

-
-public class ProfileManagementHandler{
+public class ProfileManagementHandler {

        private ProfileCmpHandler profileCmpHandler = null;
        private ProfileObject profileObject = null;
-       
-       
+
        public void setProfileCmpHandler(ProfileCmpHandler profileCmpHandler) {
                this.profileCmpHandler = profileCmpHandler;
        }
@@ -32,60 +30,126 @@

        public void markProfileDirty() {
                profileObject.getProfileConcrete().setProfileDirty(true);
-               
+
        }

        public void profileInitialize() {
-               //FIXME: ??
-               
+
+               Thread t = Thread.currentThread();
+               ClassLoader oldClassLoader = t.getContextClassLoader();
+ t.setContextClassLoader(this.profileObject.getProfileSpecificationComponent().getClassLoader());
+               try {
+                       // FIXME: ??
+               } finally {
+                       t.setContextClassLoader(oldClassLoader);
+               }
+
        }

        public void profileLoad() {
-               // TODO Auto-generated method stub
-               
+               Thread t = Thread.currentThread();
+               ClassLoader oldClassLoader = t.getContextClassLoader();
+ t.setContextClassLoader(this.profileObject.getProfileSpecificationComponent().getClassLoader());
+               try {
+                       // FIXME: ??
+               } finally {
+                       t.setContextClassLoader(oldClassLoader);
+               }
+
        }

        public void profileStore() {
-               // TODO Auto-generated method stub
-               
+               Thread t = Thread.currentThread();
+               ClassLoader oldClassLoader = t.getContextClassLoader();
+ t.setContextClassLoader(this.profileObject.getProfileSpecificationComponent().getClassLoader());
+               try {
+                       // FIXME: ??
+               } finally {
+                       t.setContextClassLoader(oldClassLoader);
+               }
+
        }

        public void profileVerify() throws ProfileVerificationException {
-               // TODO Auto-generated method stub
-               
+               Thread t = Thread.currentThread();
+               ClassLoader oldClassLoader = t.getContextClassLoader();
+ t.setContextClassLoader(this.profileObject.getProfileSpecificationComponent().getClassLoader());
+               try {
+                       // FIXME: ??
+               } finally {
+                       t.setContextClassLoader(oldClassLoader);
+               }
+
        }

        public void profileActivate() {
-               // TODO Auto-generated method stub
-               
+               Thread t = Thread.currentThread();
+               ClassLoader oldClassLoader = t.getContextClassLoader();
+ t.setContextClassLoader(this.profileObject.getProfileSpecificationComponent().getClassLoader());
+               try {
+                       // FIXME: ??
+               } finally {
+                       t.setContextClassLoader(oldClassLoader);
+               }
+
        }

        public void profilePassivate() {
-               // TODO Auto-generated method stub
-               
+               Thread t = Thread.currentThread();
+               ClassLoader oldClassLoader = t.getContextClassLoader();
+ t.setContextClassLoader(this.profileObject.getProfileSpecificationComponent().getClassLoader());
+               try {
+                       // FIXME: ??
+               } finally {
+                       t.setContextClassLoader(oldClassLoader);
+               }
        }

        public void profilePostCreate() throws CreateException {
-               // TODO Auto-generated method stub
-               
+               Thread t = Thread.currentThread();
+               ClassLoader oldClassLoader = t.getContextClassLoader();
+ t.setContextClassLoader(this.profileObject.getProfileSpecificationComponent().getClassLoader());
+               try {
+                       // FIXME: ??
+               } finally {
+                       t.setContextClassLoader(oldClassLoader);
+               }
+
        }

        public void profileRemove() {
-               // TODO Auto-generated method stub
-               
+               Thread t = Thread.currentThread();
+               ClassLoader oldClassLoader = t.getContextClassLoader();
+ t.setContextClassLoader(this.profileObject.getProfileSpecificationComponent().getClassLoader());
+               try {
+                       // FIXME: ??
+               } finally {
+                       t.setContextClassLoader(oldClassLoader);
+               }
        }

        public void setProfileContext(ProfileContext arg0) {
-               // TODO Auto-generated method stub
-               
+               Thread t = Thread.currentThread();
+               ClassLoader oldClassLoader = t.getContextClassLoader();
+ t.setContextClassLoader(this.profileObject.getProfileSpecificationComponent().getClassLoader());
+               try {
+                       // FIXME: ??
+               } finally {
+                       t.setContextClassLoader(oldClassLoader);
+               }
+
        }

        public void unsetProfileContext() {
-               // TODO Auto-generated method stub
-               
-       }
-       
+               Thread t = Thread.currentThread();
+               ClassLoader oldClassLoader = t.getContextClassLoader();
+ t.setContextClassLoader(this.profileObject.getProfileSpecificationComponent().getClassLoader());
+               try {
+                       // FIXME: ??
+               } finally {
+                       t.setContextClassLoader(oldClassLoader);
+               }

-       
+       }

 }

Modified: trunk/servers/jain-slee/core/jar/src/main/java/org/mobicents/slee/container/profile/ProfileObject.java
==============================================================================
--- trunk/servers/jain-slee/core/jar/src/main/java/org/mobicents/slee/container/profile/ProfileObject.java (original) +++ trunk/servers/jain-slee/core/jar/src/main/java/org/mobicents/slee/container/profile/ProfileObject.java Fri Mar 20 06:36:17 2009
@@ -180,6 +180,10 @@

        }

+       public ProfileSpecificationComponent getProfileSpecificationComponent() 
{
+               return profileSpecificationComponent;
+       }
+
        public ProfileContextImpl getProfileContext() {
                return profileContext;
        }

Reply via email to