container/services/src/main/java/org/mobicents/slee/container/management/SbbManagementImpl.java
public void installSbb(final SbbComponent sbbComponent)
			throws Exception {

		if (logger.isDebugEnabled()) {
			logger.debug("Installing " + sbbComponent);
		}

		final SleeTransactionManager sleeTransactionManager = sleeContainer
				.getTransactionManager();
		sleeTransactionManager.mandateTransaction();

		// change classloader
		ClassLoader oldClassLoader = Thread.currentThread()
				.getContextClassLoader();
		try {
			Thread.currentThread().setContextClassLoader(
					sbbComponent.getClassLoader());
			// Set up the comp/env naming context for the Sbb.
			JndiManagement jndiManagement = sleeContainer.getJndiManagement();
			jndiManagement.componentInstall(sbbComponent);
			jndiManagement.pushJndiContext(sbbComponent);
			try {
				setupSbbEnvironment(sbbComponent);
			} finally {
				jndiManagement.popJndiContext();
			}
			// generate class code for the sbb
			new SbbClassCodeGenerator().process(sbbComponent);
			
		//FIXME: this will erase stack trace.	
		//} catch (Exception ex) {
		//	throw ex;
		} finally {
			Thread.currentThread().setContextClassLoader(oldClassLoader);
		}
				
		// Set 1.0 Trace to off
		sleeContainer.getTraceManagement().getTraceFacility().setTraceLevelOnTransaction(
				sbbComponent.getSbbID(), Level.OFF);
		sleeContainer.getAlarmManagement().registerComponent(
				sbbComponent.getSbbID());
		// if we are in cluster mode we need to add the sbb class loader domain to the replication class loader
		if (!sleeContainer.getCluster().getMobicentsCache().isLocalMode()) {
			final ReplicationClassLoader replicationClassLoader = sleeContainer.getReplicationClassLoader();
			replicationClassLoader.addDomain(sbbComponent.getClassLoaderDomain());
			TransactionalAction action = new TransactionalAction() {
				public void execute() {
					replicationClassLoader.removeDomain(sbbComponent.getClassLoaderDomain());
				}
			};
			sleeTransactionManager.getTransactionContext().getAfterRollbackActions().add(action);
		}
		
	}
public void installSbb(final SbbComponent sbbComponent)
			throws Exception {

		if (logger.isDebugEnabled()) {
			logger.debug("Installing " + sbbComponent);
		}

		final SleeTransactionManager sleeTransactionManager = sleeContainer
				.getTransactionManager();
		sleeTransactionManager.mandateTransaction();

		// change classloader
		ClassLoader oldClassLoader = Thread.currentThread()
				.getContextClassLoader();
		try {
			Thread.currentThread().setContextClassLoader(
					sbbComponent.getClassLoader());
			// Set up the comp/env naming context for the Sbb.
			JndiManagement jndiManagement = sleeContainer.getJndiManagement();
			jndiManagement.componentInstall(sbbComponent);
			jndiManagement.pushJndiContext(sbbComponent);
			try {
				setupSbbEnvironment(sbbComponent);
			} finally {
				jndiManagement.popJndiContext();
			}
			// generate class code for the sbb
			new SbbClassCodeGenerator().process(sbbComponent);
			
		//FIXME: this will erase stack trace.	
		//} catch (Exception ex) {
		//	throw ex;
		} finally {
			Thread.currentThread().setContextClassLoader(oldClassLoader);
		}
				
		// Set 1.0 Trace to off
		sleeContainer.getTraceManagement().getTraceFacility().setTraceLevelOnTransaction(
				sbbComponent.getSbbID(), Level.OFF);
		sleeContainer.getAlarmManagement().registerComponent(
				sbbComponent.getSbbID());
		// if we are in cluster mode we need to add the sbb class loader domain to the replication class loader
		if (!sleeContainer.getCluster().getMobicentsCache().isLocalMode()) {
			final ReplicationClassLoader replicationClassLoader = sleeContainer.getReplicationClassLoader();
			replicationClassLoader.addDomain(sbbComponent.getClassLoaderDomain());
			TransactionalAction action = new TransactionalAction() {
				public void execute() {
					replicationClassLoader.removeDomain(sbbComponent.getClassLoaderDomain());
				}
			};
			sleeTransactionManager.getTransactionContext().getAfterRollbackActions().add(action);
		}
		
	}
public void installSbb ( final SbbComponent sbbComponent ) throws Exception { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Installing " + sbbComponent ) ; } final SleeTransactionManager sleeTransactionManager = sleeContainer . getTransactionManager ( ) ; sleeTransactionManager . mandateTransaction ( ) ; // change classloader ClassLoader oldClassLoader = Thread . currentThread ( ) . getContextClassLoader ( ) ; try { Thread . currentThread ( ) . setContextClassLoader ( sbbComponent . getClassLoader ( ) ) ; // Set up the comp/env naming context for the Sbb. JndiManagement jndiManagement = sleeContainer . getJndiManagement ( ) ; jndiManagement . componentInstall ( sbbComponent ) ; jndiManagement . pushJndiContext ( sbbComponent ) ; try { setupSbbEnvironment ( sbbComponent ) ; } finally { jndiManagement . popJndiContext ( ) ; } // generate class code for the sbb new SbbClassCodeGenerator ( ) . process ( sbbComponent ) ; //FIXME: this will erase stack trace.	 //} catch (Exception ex) { //	throw ex; } finally { Thread . currentThread ( ) . setContextClassLoader ( oldClassLoader ) ; } // Set 1.0 Trace to off sleeContainer . getTraceManagement ( ) . getTraceFacility ( ) . setTraceLevelOnTransaction ( sbbComponent . getSbbID ( ) , Level . OFF ) ; sleeContainer . getAlarmManagement ( ) . registerComponent ( sbbComponent . getSbbID ( ) ) ; // if we are in cluster mode we need to add the sbb class loader domain to the replication class loader if ( ! sleeContainer . getCluster ( ) . getMobicentsCache ( ) . isLocalMode ( ) ) { final ReplicationClassLoader replicationClassLoader = sleeContainer . getReplicationClassLoader ( ) ; replicationClassLoader . addDomain ( sbbComponent . getClassLoaderDomain ( ) ) ; TransactionalAction action = new TransactionalAction ( ) { public void execute ( ) { replicationClassLoader . removeDomain ( sbbComponent . getClassLoaderDomain ( ) ) ; } } ; sleeTransactionManager . getTransactionContext ( ) . getAfterRollbackActions ( ) . add ( action ) ; } }
/*
(non-Javadoc)
@see org.mobicents.slee.container.management.SbbManagement#installSbb(org.mobicents.slee.core.component.sbb.SbbComponent)
/ * ( non - Javadoc )