ProfileTableImpl profileTable = this.sleeProfileManagement.getProfileTable(profileTableName); if (!profileTable.profileExists(profileName)) { throw new UnrecognizedProfileNameException("There is no such profile: " + profileName + ", in profile table: " + profileTableName);
profileTable = this.sleeProfileManagement.getProfileTable(profileTableName); if (profileName != null && !profileTable.profileExists(profileName)) { throw new UnrecognizedProfileNameException(profileName);
profileName); if(profile==null) throw new UnrecognizedProfileNameException( "Profile MBean does not exist."); throw new UnrecognizedProfileNameException( "Profile has been created but not committed.");
/** * */ private ProfileEntity loadProfileEntity(String profileName) throws UnrecognizedProfileNameException { if (profileName != null) { ProfileEntity profileEntity = profileEntityFramework.retrieveProfile(profileTable.getProfileTableName(), profileName); if (profileEntity == null) { throw new UnrecognizedProfileNameException(); } return profileEntity; } else { // clone default profile entity final ProfileEntity profileEntity = cloneEntity(profileTable.getDefaultProfileEntity()); // add a tx action after commit to update the state on the one stored in the table TransactionalAction action = new TransactionalAction() { public void execute() { profileTable.setDefaultProfileEntity(cloneEntity(profileEntity)); } }; profileTable.getSleeContainer().getTransactionManager().getTransactionContext().getAfterCommitActions().add(action); return profileEntity; } }
profileMBeanName = profileManager.findProfileMBean(profileTableName, profileName); if(profileMBeanName==null) throw new UnrecognizedProfileNameException("Failed removing Profile " + profileName + " from Profile Table " + profileTableName);
/** * Retrieves a profile given the cmp method name and profile id */ public static Object getProfileCMPMethod(SbbEntity sbbEntity, String getProfileCMPMethodName, ProfileID profileID) throws UnrecognizedProfileTableNameException, UnrecognizedProfileNameException { GetProfileCMPMethodDescriptor mGetProfileCMPMethod = sbbEntity.getSbbComponent() .getDescriptor().getGetProfileCMPMethods().get( getProfileCMPMethodName); if (mGetProfileCMPMethod == null) throw new AbstractMethodError("Profile CMP Method not found"); if (sbbEntity.getSbbObject().getState() != SbbObjectState.READY) { throw new IllegalStateException( "Could not invoke getProfileCMP Method, Sbb Object is not in the READY state!"); } ProfileManagement sleeProfileManager = sleeContainer .getSleeProfileTableManager(); ProfileTable profileTable = sleeProfileManager.getProfileTable(profileID.getProfileTableName()); if (!profileTable.profileExists(profileID.getProfileName())) { throw new UnrecognizedProfileNameException(profileID.toString()); } return profileTable.getProfile(profileID.getProfileName()).getProfileCmpSlee10Wrapper(); }
/** * Get an instance of a profile specified by the profileID given in parameter * @param method * @param profileID * @return * @throws SystemException */ private Object callGetProfileMethod(ProfileCMPMethod method, ProfileID profileID) throws UnrecognizedProfileTableNameException, UnrecognizedProfileNameException, SystemException{ SleeProfileManager sleeProfileManager=SleeProfileManager.getInstance(); try { if(sleeProfileManager.findProfileSpecId(profileID.getProfileTableName())==null) throw new UnrecognizedProfileTableNameException(); } catch (SystemException e) { throw new SLEEException("low-level failure"); } if(sleeProfileManager.findProfileMBean(profileID.getProfileTableName(),profileID.getProfileName())==null) throw new UnrecognizedProfileNameException(); //TODO call this method under a valid transaction context as defined in the spec return sleeProfileManager.getSbbCMPProfile(profileID); }