container/common/src/main/java/org/mobicents/slee/container/management/jmx/TraceMBeanImpl.java
public void setTraceLevel(NotificationSource src, final String tracerName, TraceLevel lvl) throws NullPointerException, UnrecognizedNotificationSourceException, InvalidArgumentException,
			ManagementException {
		if(src == null)
		{
			throw new NullPointerException("NotificationSource must nto be null!");
		}
		
		if(lvl == null)
		{
			throw new NullPointerException("TraceLevel must not be null!");
		}
		if
		(!this.isNotificationSourceDefined(src))
		{
			throw new UnrecognizedNotificationSourceException("Notification source not recognized: "+src);
		}
		TracerImpl.checkTracerName(tracerName, src);
		
		if(!this.isTracerDefined(src,tracerName))
		{
			//FIXME: what is valid tracer name? JDOC contradicts that not existing tracer name is invalid
			this.createTracer(src,tracerName,false);
		}
		
		final TracerStorage ts = this.tracerStorage.get(src);
		if (ts == null) {
			throw new ManagementException("NotificationSource has been uninstalled from SLEE. Can not create tracer.");
		}
		try {
			
			
			try {
				final SleeTransactionManager sleeTransactionManager = sleeContainer.getTransactionManager();
				if(sleeTransactionManager.getTransaction()!=null)
				{
					final TraceLevel _oldLevel=ts.getTracerLevel(tracerName);
					TransactionalAction action = new TransactionalAction() {
						TraceLevel oldLevel = _oldLevel;
						public void execute() {
							try {
								ts.setTracerLevel(oldLevel, tracerName);
							} catch (InvalidArgumentException e) {
								logger.error(e.getMessage(),e);
							}
						}
					};
					sleeTransactionManager.getTransactionContext().getAfterRollbackActions().add(action);
				}
			} catch (SystemException e) {
				
				e.printStackTrace();
			}
			
			ts.setTracerLevel(lvl, tracerName);
			
			
		} catch (Exception e) {
			throw new ManagementException("Failed to set trace level due to: ", e);
		}

		
	}
public void setTraceLevel(NotificationSource src, final String tracerName, TraceLevel lvl) throws NullPointerException, UnrecognizedNotificationSourceException, InvalidArgumentException,
			ManagementException {
		if(src == null)
		{
			throw new NullPointerException("NotificationSource must nto be null!");
		}
		
		if(lvl == null)
		{
			throw new NullPointerException("TraceLevel must not be null!");
		}
		if
		(!this.isNotificationSourceDefined(src))
		{
			throw new UnrecognizedNotificationSourceException("Notification source not recognized: "+src);
		}
		TracerImpl.checkTracerName(tracerName, src);
		
		if(!this.isTracerDefined(src,tracerName))
		{
			//FIXME: what is valid tracer name? JDOC contradicts that not existing tracer name is invalid
			this.createTracer(src,tracerName,false);
		}
		
		final TracerStorage ts = this.tracerStorage.get(src);
		if (ts == null) {
			throw new ManagementException("NotificationSource has been uninstalled from SLEE. Can not create tracer.");
		}
		try {
			
			
			try {
				final SleeTransactionManager sleeTransactionManager = sleeContainer.getTransactionManager();
				if(sleeTransactionManager.getTransaction()!=null)
				{
					final TraceLevel _oldLevel=ts.getTracerLevel(tracerName);
					TransactionalAction action = new TransactionalAction() {
						TraceLevel oldLevel = _oldLevel;
						public void execute() {
							try {
								ts.setTracerLevel(oldLevel, tracerName);
							} catch (InvalidArgumentException e) {
								logger.error(e.getMessage(),e);
							}
						}
					};
					sleeTransactionManager.getTransactionContext().getAfterRollbackActions().add(action);
				}
			} catch (SystemException e) {
				
				e.printStackTrace();
			}
			
			ts.setTracerLevel(lvl, tracerName);
			
			
		} catch (Exception e) {
			throw new ManagementException("Failed to set trace level due to: ", e);
		}

		
	}
public void setTraceLevel ( NotificationSource src , final String tracerName , TraceLevel lvl ) throws NullPointerException , UnrecognizedNotificationSourceException , InvalidArgumentException , ManagementException { if ( src == null ) { throw new NullPointerException ( "NotificationSource must nto be null!" ) ; } if ( lvl == null ) { throw new NullPointerException ( "TraceLevel must not be null!" ) ; } if ( ! this . isNotificationSourceDefined ( src ) ) { throw new UnrecognizedNotificationSourceException ( "Notification source not recognized: " + src ) ; } TracerImpl . checkTracerName ( tracerName , src ) ; if ( ! this . isTracerDefined ( src , tracerName ) ) { //FIXME: what is valid tracer name? JDOC contradicts that not existing tracer name is invalid
 this . createTracer ( src , tracerName , false ) ; } final TracerStorage ts = this . tracerStorage . get ( src ) ; if ( ts == null ) { throw new ManagementException ( "NotificationSource has been uninstalled from SLEE. Can not create tracer." ) ; } try { try { final SleeTransactionManager sleeTransactionManager = sleeContainer . getTransactionManager ( ) ; if ( sleeTransactionManager . getTransaction ( ) != null ) { final TraceLevel _oldLevel = ts . getTracerLevel ( tracerName ) ; TransactionalAction action = new TransactionalAction ( ) { TraceLevel oldLevel = _oldLevel ; public void execute ( ) { try { ts . setTracerLevel ( oldLevel , tracerName ) ; } catch ( InvalidArgumentException e ) { logger . error ( e . getMessage ( ) , e ) ; } } } ; sleeTransactionManager . getTransactionContext ( ) . getAfterRollbackActions ( ) . add ( action ) ; } } catch ( SystemException e ) { e . printStackTrace ( ) ; } ts . setTracerLevel ( lvl , tracerName ) ; } catch ( Exception e ) { throw new ManagementException ( "Failed to set trace level due to: " , e ) ; } }
/*
(non-Javadoc)
@see javax.slee.management.TraceMBean#setTraceLevel(javax.slee.management.NotificationSource, java.lang.String, javax.slee.facilities.TraceLevel)
/ * ( non - Javadoc )