container/profiles/src/main/java/org/mobicents/slee/container/management/jmx/ProfileProvisioningMBeanImpl.java
public void removeProfile(java.lang.String profileTableName, java.lang.String profileName) throws java.lang.NullPointerException, UnrecognizedProfileTableNameException,
			UnrecognizedProfileNameException, ManagementException {

		if (logger.isDebugEnabled()) {
			logger.debug("removeProfile( profileTableName = "
					+ profileTableName + " , profileName = " + profileName
					+ " )");
		}
		
		if (profileTableName == null)
			throw new NullPointerException("Argument[ProfileTableName] must nto be null");
		if (profileName == null)
			throw new NullPointerException("Argument[ProfileName] must nto be null");

		boolean b = this.sleeTransactionManagement.requireTransaction();
		boolean rb = true;
		try {
			ProfileTableImpl profileTable = this.sleeProfileManagement.getProfileTable(profileTableName);
			if (!profileTable.profileExists(profileName)) {
				throw new UnrecognizedProfileNameException("There is no such profile: " + profileName + ", in profile table: " + profileTableName);
			}
			profileTable.removeProfile(profileName, true, false);
			if(!sleeTransactionManagement.getRollbackOnly()) {
				rb = false;
			}
			else {
				throw new ManagementException("Transaction used in profile removal rolled back");
			}
		} catch (UnrecognizedProfileTableNameException e) {
			throw e;
		} catch (UnrecognizedProfileNameException e) {
			throw e;
		} catch (Exception e) {
			throw new ManagementException("Failed to remove due to system level failure.", e);
		} finally {
			try {
				sleeTransactionManagement.requireTransactionEnd(b,rb);	
			} catch (Throwable e) {
				throw new ManagementException(e.getMessage(),e);
			}			
		}

	}
public void removeProfile(java.lang.String profileTableName, java.lang.String profileName) throws java.lang.NullPointerException, UnrecognizedProfileTableNameException,
			UnrecognizedProfileNameException, ManagementException {

		if (logger.isDebugEnabled()) {
			logger.debug("removeProfile( profileTableName = "
					+ profileTableName + " , profileName = " + profileName
					+ " )");
		}
		
		if (profileTableName == null)
			throw new NullPointerException("Argument[ProfileTableName] must nto be null");
		if (profileName == null)
			throw new NullPointerException("Argument[ProfileName] must nto be null");

		boolean b = this.sleeTransactionManagement.requireTransaction();
		boolean rb = true;
		try {
			ProfileTableImpl profileTable = this.sleeProfileManagement.getProfileTable(profileTableName);
			if (!profileTable.profileExists(profileName)) {
				throw new UnrecognizedProfileNameException("There is no such profile: " + profileName + ", in profile table: " + profileTableName);
			}
			profileTable.removeProfile(profileName, true, false);
			if(!sleeTransactionManagement.getRollbackOnly()) {
				rb = false;
			}
			else {
				throw new ManagementException("Transaction used in profile removal rolled back");
			}
		} catch (UnrecognizedProfileTableNameException e) {
			throw e;
		} catch (UnrecognizedProfileNameException e) {
			throw e;
		} catch (Exception e) {
			throw new ManagementException("Failed to remove due to system level failure.", e);
		} finally {
			try {
				sleeTransactionManagement.requireTransactionEnd(b,rb);	
			} catch (Throwable e) {
				throw new ManagementException(e.getMessage(),e);
			}			
		}

	}
/*
(non-Javadoc)
@see javax.slee.management.ProfileProvisioningMBean#removeProfile(java.lang.String, java.lang.String)