container/profiles/src/main/java/org/mobicents/slee/container/management/jmx/ProfileProvisioningMBeanImpl.java
public void createProfileTable(ProfileSpecificationID specificationID,
			String profileTableName) throws NullPointerException,
			UnrecognizedProfileSpecificationException,
			InvalidArgumentException, ProfileTableAlreadyExistsException,
			ManagementException {
		
		if (logger.isDebugEnabled()) {
			logger.debug("createProfileTable( profileTable = "+profileTableName+" , specificationID = "+specificationID+" )");
		}
		
		try {
			ProfileTableImpl.validateProfileTableName(profileTableName);
		}
		catch (IllegalArgumentException e) {
			throw new InvalidArgumentException(e.getMessage());
		}
		
		final SleeContainer sleeContainer = getSleeContainer();
		
		if (sleeContainer.getSleeState() != SleeState.RUNNING)
			return;

		ProfileSpecificationComponent component = sleeContainer.getComponentRepository().getComponentByID(specificationID);
		if (component == null)
			throw new UnrecognizedProfileSpecificationException();

		ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader();
		
		boolean terminateTx = sleeTransactionManagement.requireTransaction();
		boolean doRollback = true;		
		try {
			Thread.currentThread().setContextClassLoader(component.getClassLoader());
			sleeProfileManagement.addProfileTable(profileTableName,component);
			doRollback =false;
		} catch (ProfileTableAlreadyExistsException e) {
			throw e;
		} catch (Throwable e) {
			if (logger.isDebugEnabled()) {
				logger.debug(e.getMessage(),e);
			}
			throw new ManagementException(e.getMessage(),e);
		} finally {
			Thread.currentThread().setContextClassLoader(currentClassLoader);			
			try {
				sleeTransactionManagement.requireTransactionEnd(terminateTx,doRollback);	
			} catch (Throwable e) {
				throw new ManagementException(e.getMessage(),e);
			}
		}
	}
public void createProfileTable(ProfileSpecificationID specificationID,
			String profileTableName) throws NullPointerException,
			UnrecognizedProfileSpecificationException,
			InvalidArgumentException, ProfileTableAlreadyExistsException,
			ManagementException {
		
		if (logger.isDebugEnabled()) {
			logger.debug("createProfileTable( profileTable = "+profileTableName+" , specificationID = "+specificationID+" )");
		}
		
		try {
			ProfileTableImpl.validateProfileTableName(profileTableName);
		}
		catch (IllegalArgumentException e) {
			throw new InvalidArgumentException(e.getMessage());
		}
		
		final SleeContainer sleeContainer = getSleeContainer();
		
		if (sleeContainer.getSleeState() != SleeState.RUNNING)
			return;

		ProfileSpecificationComponent component = sleeContainer.getComponentRepository().getComponentByID(specificationID);
		if (component == null)
			throw new UnrecognizedProfileSpecificationException();

		ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader();
		
		boolean terminateTx = sleeTransactionManagement.requireTransaction();
		boolean doRollback = true;		
		try {
			Thread.currentThread().setContextClassLoader(component.getClassLoader());
			sleeProfileManagement.addProfileTable(profileTableName,component);
			doRollback =false;
		} catch (ProfileTableAlreadyExistsException e) {
			throw e;
		} catch (Throwable e) {
			if (logger.isDebugEnabled()) {
				logger.debug(e.getMessage(),e);
			}
			throw new ManagementException(e.getMessage(),e);
		} finally {
			Thread.currentThread().setContextClassLoader(currentClassLoader);			
			try {
				sleeTransactionManagement.requireTransactionEnd(terminateTx,doRollback);	
			} catch (Throwable e) {
				throw new ManagementException(e.getMessage(),e);
			}
		}
	}
/*
(non-Javadoc)
@see javax.slee.management.ProfileProvisioningMBean#createProfileTable(javax.slee.profile.ProfileSpecificationID, java.lang.String)