signature:
public class ConcreteClassGeneratorUtils { /** * Add a concrete method invoking the interceptor < B > interceptorName < / B >
 * with the same parameters , name , return type as the method < B > method < / B >
 * @ param concreteClass
 * the concrete where to add the interceptor method
 * @ param method
 * method from which is generating the new proxy method
 * @ param interceptorName
 * the interceptor name implementing the interface
 * InvocationHandler . This name must be the name of an existing
 * field of the concrete class
 * @ param callSuperMethod
 * if true the concrete implementation of the method will call
 * super ( ) */
public static void addInterceptedMethod ( CtClass concreteClass , CtMethod method , String interceptorName , boolean callSuperMethod ) { } }

implementation:
if ( method == null ) throw new InvalidParameterException ( "Intercepted method should not be null" ) ; if ( interceptorName == null ) throw new InvalidParameterException ( "Interceptor class name should not be null" ) ; String methodToAdd = "public " ; // Add the return type
boolean hasReturn = false ; CtClass returnType = null ; try { returnType = method . getReturnType ( ) ; methodToAdd = methodToAdd . concat ( returnType . getName ( ) + " " ) ; hasReturn = true ; } catch ( NotFoundException nfe ) { // nfe . printStackTrace ( ) ;
logger . trace ( "No return type -- assuming return type is void " ) ; methodToAdd = methodToAdd + "void " ; } // Add the method name
methodToAdd = methodToAdd . concat ( method . getName ( ) + "(" ) ; // Add the parameters
CtClass [ ] parameterTypes = null ; ; String parametersInit = "Object[] args=null;" ; String argsInit = "Class[] classes=null;" ; try { parameterTypes = method . getParameterTypes ( ) ; parametersInit = parametersInit + "args=new Object[" + parameterTypes . length + "];" ; argsInit = argsInit + "classes=new Class[" + parameterTypes . length + "];" ; for ( int argNumber = 0 ; argNumber < parameterTypes . length ; argNumber ++ ) { methodToAdd = methodToAdd . concat ( parameterTypes [ argNumber ] . getName ( ) + " arg_" + argNumber ) ; // handle the primitive types
if ( ! parameterTypes [ argNumber ] . isPrimitive ( ) ) parametersInit = parametersInit + " args[" + argNumber + "]=arg_" + argNumber + ";" ; else parametersInit = parametersInit + " args[" + argNumber + "]=" + ClassUtils . getObjectFromPrimitiveType ( parameterTypes [ argNumber ] . getName ( ) , "arg_" + argNumber ) + ";" ; String typeClass = parameterTypes [ argNumber ] . getName ( ) ; // handle the primitive types
if ( ! parameterTypes [ argNumber ] . isPrimitive ( ) ) { if ( parameterTypes [ argNumber ] . isArray ( ) ) { String arrayClassRepresentation = toArray ( parameterTypes [ argNumber ] ) ; if ( arrayClassRepresentation != null ) argsInit = argsInit + "classes[" + argNumber + "]=" + SleeContainerUtils . class . getName ( ) + ".getCurrentThreadClassLoader().loadClass(\"" + arrayClassRepresentation + "\");" ; } else argsInit = argsInit + "classes[" + argNumber + "]=" + SleeContainerUtils . class . getName ( ) + ".getCurrentThreadClassLoader().loadClass(\"" + typeClass + "\");" ; } else argsInit = argsInit + "classes[" + argNumber + "]=" + ClassUtils . getClassFromPrimitiveType ( typeClass ) + ".TYPE;" ; if ( argNumber + 1 < parameterTypes . length ) methodToAdd = methodToAdd + "," ; } methodToAdd += ") " ; // Add method exceptions
if ( method . getExceptionTypes ( ) . length > 0 ) { CtClass [ ] exceptions = method . getExceptionTypes ( ) ; methodToAdd += " throws " ; for ( int i = 0 ; i < exceptions . length - 1 ; i ++ ) { String exName = exceptions [ i ] . getName ( ) ; methodToAdd += exName + ", " ; } methodToAdd += exceptions [ exceptions . length - 1 ] . getName ( ) ; } } catch ( NotFoundException nfe ) { nfe . printStackTrace ( ) ; throw new SLEEException ( "Failed creating concrete Profile MBean implementation class" , nfe ) ; } // Start adding method body
methodToAdd += " { " ; methodToAdd += "" + parametersInit ; methodToAdd += "" + argsInit ; methodToAdd += "Class clazz=this.getClass();" ; methodToAdd += "Object result=null;" ; methodToAdd += "try{" ; // call the super method
if ( callSuperMethod ) { if ( method . getName ( ) . equals ( "profileStore" ) ) { methodToAdd = methodToAdd + "super." + method . getName ( ) + "(" ; if ( parameterTypes != null && parameterTypes . length > 0 ) { for ( int argNumber = 0 ; argNumber < parameterTypes . length ; argNumber ++ ) { methodToAdd = methodToAdd + "arg_" + argNumber ; if ( argNumber + 1 < parameterTypes . length ) methodToAdd = methodToAdd + "," ; } } methodToAdd = methodToAdd + ");" ; } } methodToAdd = methodToAdd + "java.lang.reflect.Method method=clazz.getDeclaredMethod(\"" + method . getName ( ) + "\",classes" + ");" ; methodToAdd = methodToAdd + "result=" + interceptorName + ".invoke(this,method,args); " ; methodToAdd = methodToAdd + "}catch(RuntimeException t){t.printStackTrace(); throw (t); " + " } catch (Exception ex1) { ex1.printStackTrace(); throw (ex1); }" ; // call the super method
if ( callSuperMethod ) { if ( ! method . getName ( ) . equals ( "profileStore" ) ) { methodToAdd = methodToAdd + "super." + method . getName ( ) + "(" ; if ( parameterTypes != null && parameterTypes . length > 0 ) { for ( int argNumber = 0 ; argNumber < parameterTypes . length ; argNumber ++ ) { methodToAdd = methodToAdd + "arg_" + argNumber ; if ( argNumber + 1 < parameterTypes . length ) methodToAdd += "," ; } } methodToAdd += ");" ; } } // handle the primitive types
if ( hasReturn ) { if ( ! returnType . getName ( ) . equalsIgnoreCase ( "void" ) ) { if ( ! returnType . isPrimitive ( ) ) methodToAdd = methodToAdd + "return (" + returnType . getName ( ) + ")result;" ; else methodToAdd = methodToAdd + "return " + ClassUtils . getPrimitiveTypeFromObject ( returnType . getName ( ) , "result" ) + ";" ; } } methodToAdd += "}" ; // Add the implementation code
logger . trace ( "Method " + methodToAdd + " added" ) ; CtMethod methodTest ; try { methodTest = CtNewMethod . make ( methodToAdd , concreteClass ) ; concreteClass . addMethod ( methodTest ) ; } catch ( CannotCompileException cce ) { throw new SLEEException ( "Cannot compile method " + method . getName ( ) , cce ) ; }


signature:
public class ConcreteClassGeneratorUtils { /** * Transform an array class to its string representation < BR >
 * example : String [ ] - > [ Ljava . lang . String ;
 * @ param typeClass
 * the array class to transform
 * @ return the String representation of the class */
public static String toArray ( CtClass typeClass ) { } }

implementation: StringTokenizer st = new StringTokenizer ( typeClass . getName ( ) , "[" ) ; String name = null ; CtClass arrayClass ; try { arrayClass = typeClass . getComponentType ( ) ; if ( ! arrayClass . isPrimitive ( ) ) name = "L" + arrayClass . getName ( ) . replace ( '/' , '.' ) + ";" ; else name = toJvmRepresentation ( arrayClass . getName ( ) ) ; st . nextToken ( ) ; while ( st . hasMoreTokens ( ) ) { st . nextToken ( ) ; name = "[" + name ; } } catch ( NotFoundException e ) { e . printStackTrace ( ) ; } return name ;


signature:
public class ConcreteClassGeneratorUtils { /** * Get the jvm representation of the primitives types < BR >
 * Exemple : int - > I , boolean - > Z and so on . . .
 * @ param primitiveTypeName
 * the primitive type name whose the jvm representation is wanted
 * @ return the jvm representation of the primitive type */
public static String toJvmRepresentation ( String primitiveTypeName ) { } }

implementation: if ( primitiveTypeName . equals ( "int" ) ) return "I" ; if ( primitiveTypeName . equals ( "boolean" ) ) return "Z" ; if ( primitiveTypeName . equals ( "byte" ) ) return "B" ; if ( primitiveTypeName . equals ( "char" ) ) return "C" ; if ( primitiveTypeName . equals ( "double" ) ) return "D" ; if ( primitiveTypeName . equals ( "float" ) ) return "F" ; if ( primitiveTypeName . equals ( "long" ) ) return "J" ; if ( primitiveTypeName . equals ( "short" ) ) return "S" ; if ( primitiveTypeName . equals ( "void" ) ) return "V" ; return primitiveTypeName ;


signature:
public class ConcreteClassGeneratorUtils { /** * Copy declared methods from one class to another
 * @ param source
 * the class from which the methods are copied
 * @ param destination
 * the class to which the methods are copied
 * @ param exceptions
 * optionnal , defines the set of exceptions the methods can throw */
public static void copyMethods ( CtClass source , CtClass destination , CtClass [ ] exceptions ) { } }

implementation: copyMethods ( source . getDeclaredMethods ( ) , destination , exceptions ) ;


signature:
public class ConcreteClassGeneratorUtils { /** * Copy methods to a class
 * @ param methods
 * the methods to copy
 * @ param destination
 * the class to which the methods are copied
 * @ param exceptions
 * optional , defines the set of exceptions the methods can throw */
public static void copyMethods ( CtMethod [ ] methods , CtClass destination , CtClass [ ] exceptions ) { } }

implementation: CtMethod methodCopy = null ; for ( CtMethod method : methods ) { try { methodCopy = new CtMethod ( method , destination , null ) ; if ( exceptions != null ) { try { methodCopy . setExceptionTypes ( exceptions ) ; } catch ( NotFoundException e ) { throw new SLEEException ( e . getMessage ( ) , e ) ; } } destination . addMethod ( methodCopy ) ; } catch ( CannotCompileException e ) { throw new SLEEException ( e . getMessage ( ) , e ) ; } }


signature:
public class ServiceActivityFactoryImpl { /** * / * ( non - Javadoc )
 * @ see javax . slee . serviceactivity . ServiceActivityFactory # getActivity ( ) */
public ServiceActivity getActivity ( ) throws TransactionRequiredLocalException , FactoryException { } }

implementation: final SleeContainer sleeContainer = serviceManagement . getSleeContainer ( ) ; final SleeTransactionManager stm = sleeContainer . getTransactionManager ( ) ; stm . mandateTransaction ( ) ; ServiceID serviceID = SleeThreadLocals . getInvokingService ( ) ; if ( serviceID == null ) { throw new FactoryException ( "unable to find out the invoking service id" ) ; } return new ServiceActivityImpl ( serviceID ) ;


signature:
public class DeployableComponent { /** * Parser for the deployment descriptor . Minimal version obtained from
 * Container .
 * @ return a String containing the Component ID .
 * @ throws IOException */
private Collection < DeployableComponent > parseDescriptor ( ) throws IOException { } }

implementation:
if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Parsing Descriptor for " + this . diURL . toString ( ) ) ; } Collection < DeployableComponent > deployableComponents = new ArrayList < DeployableComponent > ( ) ; SleeContainer sleeContainer = SleeContainer . lookupFromJndi ( ) ; ComponentDescriptorFactory componentDescriptorFactory = sleeContainer . getComponentManagement ( ) . getComponentDescriptorFactory ( ) ; // Special case for the services . . .
if ( this . diShortName . endsWith ( ".xml" ) ) { if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Parsing Service Descriptor." ) ; } InputStream is = null ; try { is = diURL . openStream ( ) ; ServiceDescriptorFactory sdf = componentDescriptorFactory . getServiceDescriptorFactory ( ) ; List < ? extends ServiceDescriptor > serviceDescriptors = sdf . parse ( is ) ; for ( ServiceDescriptor sd : serviceDescriptors ) { DeployableComponent dc = new DeployableComponent ( this , sleeContainerDeployer ) ; dc . componentType = SERVICE_COMPONENT ; dc . componentID = sd . getServiceID ( ) ; dc . componentKey = getComponentIdAsString ( dc . componentID ) ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Component ID: " + dc . componentKey ) ; logger . trace ( "------------------------------ Dependencies ------------------------------" ) ; } // Get the set of this sbb dependencies
Set < ComponentID > serviceDependencies = sd . getDependenciesSet ( ) ; // Iterate through dependencies set
for ( ComponentID dependencyId : serviceDependencies ) { // Add the dependency
dc . dependencies . add ( getComponentIdAsString ( dependencyId ) ) ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( getComponentIdAsString ( dependencyId ) ) ; } } if ( logger . isTraceEnabled ( ) ) { logger . trace ( "--------------------------- End of Dependencies --------------------------" ) ; } dc . installActions . add ( new ActivateServiceAction ( ( ServiceID ) dc . componentID , sleeContainerDeployer . getSleeContainer ( ) . getServiceManagement ( ) ) ) ; dc . uninstallActions . add ( new DeactivateServiceAction ( ( ServiceID ) dc . componentID , sleeContainerDeployer . getSleeContainer ( ) . getServiceManagement ( ) ) ) ; deployableComponents . add ( dc ) ; } return deployableComponents ; } catch ( Exception e ) { logger . error ( "" , e ) ; return null ; } finally { // Clean up !
if ( is != null ) { try { is . close ( ) ; } finally { is = null ; } } } } try { URL descriptorXML = null ; // Determine whether the type of this instance is an sbb , event , RA
// type , etc .
if ( ( descriptorXML = duWrapper . getEntry ( "META-INF/sbb-jar.xml" ) ) != null ) { if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Parsing SBB Descriptor." ) ; } InputStream is = null ; try { is = descriptorXML . openStream ( ) ; // Parse the descriptor using the factory
SbbDescriptorFactory sbbdf = componentDescriptorFactory . getSbbDescriptorFactory ( ) ; List < ? extends SbbDescriptor > sbbDescriptors = sbbdf . parse ( is ) ; if ( sbbDescriptors . isEmpty ( ) ) { logger . warn ( "The " + duWrapper . getFileName ( ) + " deployment descriptor contains no sbb definitions" ) ; return null ; } for ( SbbDescriptor sbbDescriptor : sbbDescriptors ) { DeployableComponent dc = new DeployableComponent ( this , sleeContainerDeployer ) ; dc . componentType = SBB_COMPONENT ; // Get the Component ID
dc . componentID = sbbDescriptor . getSbbID ( ) ; // Get the Component Key
dc . componentKey = getComponentIdAsString ( dc . componentID ) ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Component ID: " + dc . componentKey ) ; logger . trace ( "------------------------------ Dependencies ------------------------------" ) ; } // Get the set of this sbb dependencies
Set < ComponentID > sbbDependencies = sbbDescriptor . getDependenciesSet ( ) ; // Iterate through dependencies set
for ( ComponentID dependencyId : sbbDependencies ) { // Add the dependency
dc . dependencies . add ( getComponentIdAsString ( dependencyId ) ) ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( getComponentIdAsString ( dependencyId ) ) ; } } // FIXME : This is special case for Links . Maybe it
// should be treated in SbbDescriptorImpl ?
for ( ResourceAdaptorTypeBindingDescriptor raTypeBinding : sbbDescriptor . getResourceAdaptorTypeBindings ( ) ) { for ( ResourceAdaptorEntityBindingDescriptor raEntityBinding : raTypeBinding . getResourceAdaptorEntityBinding ( ) ) { String raLink = raEntityBinding . getResourceAdaptorEntityLink ( ) ; // Add the dependency
dc . dependencies . add ( raLink ) ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( raLink ) ; } } } if ( logger . isTraceEnabled ( ) ) { logger . trace ( "--------------------------- End of Dependencies --------------------------" ) ; } deployableComponents . add ( dc ) ; } } catch ( Exception e ) { logger . error ( "" , e ) ; } finally { // Clean up !
if ( is != null ) { try { is . close ( ) ; } finally { is = null ; } } } } else if ( ( descriptorXML = duWrapper . getEntry ( "META-INF/profile-spec-jar.xml" ) ) != null ) { if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Parsing Profile Specification Descriptor." ) ; } InputStream is = null ; try { // Get the InputStream
is = descriptorXML . openStream ( ) ; // Parse the descriptor using the factory
ProfileSpecificationDescriptorFactory psdf = componentDescriptorFactory . getProfileSpecificationDescriptorFactory ( ) ; List < ? extends ProfileSpecificationDescriptor > psDescriptors = psdf . parse ( is ) ; // Get a list of the profile specifications in the
// deployable unit .
if ( psDescriptors . isEmpty ( ) ) { logger . warn ( "The " + duWrapper . getFileName ( ) + " deployment descriptor contains no profile-spec definitions" ) ; return null ; } // Iterate through the profile spec nodes
for ( ProfileSpecificationDescriptor psDescriptor : psDescriptors ) { DeployableComponent dc = new DeployableComponent ( this , sleeContainerDeployer ) ; // Set Component Type
dc . componentType = PROFILESPEC_COMPONENT ; // Get the Component ID
dc . componentID = psDescriptor . getProfileSpecificationID ( ) ; // Get the Component Key
dc . componentKey = getComponentIdAsString ( dc . componentID ) ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Component ID: " + dc . componentKey ) ; logger . trace ( "------------------------------ Dependencies ------------------------------" ) ; } // Get the set of this sbb dependencies
Set < ComponentID > psDependencies = psDescriptor . getDependenciesSet ( ) ; // Iterate through dependencies set
for ( ComponentID dependencyId : psDependencies ) { // Add the dependency
dc . dependencies . add ( getComponentIdAsString ( dependencyId ) ) ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( getComponentIdAsString ( dependencyId ) ) ; } } if ( logger . isTraceEnabled ( ) ) { logger . trace ( "--------------------------- End of Dependencies --------------------------" ) ; } deployableComponents . add ( dc ) ; } } catch ( Exception e ) { logger . error ( "" , e ) ; } finally { // Clean up !
if ( is != null ) { try { is . close ( ) ; } finally { is = null ; } } } } else if ( ( descriptorXML = duWrapper . getEntry ( "META-INF/event-jar.xml" ) ) != null ) { if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Parsing Event Definition Descriptor." ) ; } InputStream is = null ; try { // Get the InputStream
is = descriptorXML . openStream ( ) ; // Parse the descriptor using the factory
EventTypeDescriptorFactory etdf = componentDescriptorFactory . getEventTypeDescriptorFactory ( ) ; List < ? extends EventTypeDescriptor > etDescriptors = etdf . parse ( is ) ; if ( etDescriptors == null || etDescriptors . isEmpty ( ) ) { logger . warn ( "The " + duWrapper . getFileName ( ) + " deployment descriptor contains no event-type definitions" ) ; return null ; } for ( EventTypeDescriptor etDescriptor : etDescriptors ) { DeployableComponent dc = new DeployableComponent ( this , sleeContainerDeployer ) ; // Set Component Type
dc . componentType = EVENTTYPE_COMPONENT ; // Get the Component ID
dc . componentID = etDescriptor . getEventTypeID ( ) ; // Get the Component Key
dc . componentKey = getComponentIdAsString ( dc . componentID ) ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Component ID: " + dc . componentKey ) ; logger . trace ( "------------------------------ Dependencies ------------------------------" ) ; } // Get the set of this sbb dependencies
Set < ComponentID > etDependencies = etDescriptor . getDependenciesSet ( ) ; // Iterate through dependencies set
for ( ComponentID dependencyId : etDependencies ) { // Add the dependency
dc . dependencies . add ( getComponentIdAsString ( dependencyId ) ) ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( getComponentIdAsString ( dependencyId ) ) ; } } if ( logger . isTraceEnabled ( ) ) { logger . trace ( "--------------------------- End of Dependencies --------------------------" ) ; } deployableComponents . add ( dc ) ; } } catch ( Exception e ) { logger . error ( "" , e ) ; } finally { // Clean up !
if ( is != null ) { try { is . close ( ) ; } finally { is = null ; } } } } else if ( ( descriptorXML = duWrapper . getEntry ( "META-INF/resource-adaptor-type-jar.xml" ) ) != null ) { if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Parsing Resource Adaptor Type Descriptor." ) ; } InputStream is = null ; try { // Get the InputStream
is = descriptorXML . openStream ( ) ; // Parse the descriptor using the factory
ResourceAdaptorTypeDescriptorFactory ratdf = componentDescriptorFactory . getResourceAdaptorTypeDescriptorFactory ( ) ; List < ? extends ResourceAdaptorTypeDescriptor > ratDescriptors = ratdf . parse ( is ) ; if ( ratDescriptors == null || ratDescriptors . isEmpty ( ) ) { logger . warn ( "The " + duWrapper . getFileName ( ) + " deployment descriptor contains no resource-adaptor-type definitions" ) ; return null ; } // Go through all the Resource Adaptor Type Elements
for ( ResourceAdaptorTypeDescriptor ratDescriptor : ratDescriptors ) { DeployableComponent dc = new DeployableComponent ( this , sleeContainerDeployer ) ; // Set Component Type
dc . componentType = RATYPE_COMPONENT ; // Get the Component ID
dc . componentID = ratDescriptor . getResourceAdaptorTypeID ( ) ; // Get the Component Key
dc . componentKey = getComponentIdAsString ( dc . componentID ) ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Component ID: " + dc . componentKey ) ; logger . trace ( "------------------------------ Dependencies ------------------------------" ) ; } // Get the set of this sbb dependencies
Set < ComponentID > ratDependencies = ratDescriptor . getDependenciesSet ( ) ; // Iterate through dependencies set
for ( ComponentID dependencyId : ratDependencies ) { // Add the dependency
dc . dependencies . add ( getComponentIdAsString ( dependencyId ) ) ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( getComponentIdAsString ( dependencyId ) ) ; } } if ( logger . isTraceEnabled ( ) ) { logger . trace ( "--------------------------- End of Dependencies --------------------------" ) ; } deployableComponents . add ( dc ) ; } } catch ( Exception e ) { logger . error ( "" , e ) ; } finally { // Clean up !
if ( is != null ) { try { is . close ( ) ; } finally { is = null ; } } } } else if ( ( descriptorXML = duWrapper . getEntry ( "META-INF/resource-adaptor-jar.xml" ) ) != null ) { if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Parsing Resource Adaptor Descriptor." ) ; } InputStream is = null ; try { // Get the InputStream
is = descriptorXML . openStream ( ) ; // Parse the descriptor using the factory
ResourceAdaptorDescriptorFactory radf = componentDescriptorFactory . getResourceAdaptorDescriptorFactory ( ) ; List < ? extends ResourceAdaptorDescriptor > raDescriptors = radf . parse ( is ) ; DeployConfigParser sleeDeployConfigParser = sleeContainerDeployer . getSLEEDeployConfigParser ( ) ; // Go through all the Resource Adaptor Elements
for ( ResourceAdaptorDescriptor raDescriptor : raDescriptors ) { DeployableComponent dc = new DeployableComponent ( this , sleeContainerDeployer ) ; // Set Component Type
dc . componentType = RA_COMPONENT ; // Set the Component ID
dc . componentID = raDescriptor . getResourceAdaptorID ( ) ; // Set the Component Key
dc . componentKey = getComponentIdAsString ( dc . componentID ) ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Component ID: " + dc . componentKey ) ; logger . trace ( "------------------------------ Dependencies ------------------------------" ) ; } // Get the set of this sbb dependencies
Set < ComponentID > raDependencies = raDescriptor . getDependenciesSet ( ) ; // Iterate through dependencies set
for ( ComponentID dependencyId : raDependencies ) { // Add the dependency
dc . dependencies . add ( getComponentIdAsString ( dependencyId ) ) ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( getComponentIdAsString ( dependencyId ) ) ; } } if ( logger . isTraceEnabled ( ) ) { logger . trace ( "--------------------------- End of Dependencies --------------------------" ) ; } // get management actions for this ra , in SLEE ' s deploy config
if ( sleeDeployConfigParser != null ) { Collection < ManagementAction > managementActions = sleeDeployConfigParser . getPostInstallActions ( ) . get ( dc . getComponentKey ( ) ) ; if ( managementActions != null ) { dc . installActions . addAll ( managementActions ) ; } managementActions = sleeDeployConfigParser . getPreUninstallActions ( ) . get ( dc . getComponentKey ( ) ) ; if ( managementActions != null ) { dc . uninstallActions . addAll ( managementActions ) ; } } deployableComponents . add ( dc ) ; } } catch ( Exception e ) { logger . error ( "" , e ) ; } finally { // Clean up !
if ( is != null ) { try { is . close ( ) ; } finally { is = null ; } } } } else if ( ( descriptorXML = duWrapper . getEntry ( "META-INF/library-jar.xml" ) ) != null ) { if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Parsing Library Descriptor." ) ; } InputStream is = null ; try { // Get the InputStream
is = descriptorXML . openStream ( ) ; // Parse the descriptor using the factory
LibraryDescriptorFactory ldf = componentDescriptorFactory . getLibraryDescriptorFactory ( ) ; List < ? extends LibraryDescriptor > libraryDescriptors = ldf . parse ( is ) ; // Go through all the Resource Adaptor Elements
for ( LibraryDescriptor libraryDescriptor : libraryDescriptors ) { DeployableComponent dc = new DeployableComponent ( this , sleeContainerDeployer ) ; // Set Component Type
dc . componentType = LIBRARY_COMPONENT ; // Set the Component ID
dc . componentID = libraryDescriptor . getLibraryID ( ) ; // Set the Component Key
dc . componentKey = getComponentIdAsString ( dc . componentID ) ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Component ID: " + dc . componentKey ) ; logger . trace ( "------------------------------ Dependencies ------------------------------" ) ; } // Get the set of this sbb dependencies
Set < ComponentID > libraryDependencies = libraryDescriptor . getDependenciesSet ( ) ; // Iterate through dependencies set
for ( ComponentID dependencyId : libraryDependencies ) { // Add the dependency
dc . dependencies . add ( getComponentIdAsString ( dependencyId ) ) ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( getComponentIdAsString ( dependencyId ) ) ; } } if ( logger . isTraceEnabled ( ) ) { logger . trace ( "--------------------------- End of Dependencies --------------------------" ) ; } deployableComponents . add ( dc ) ; } } catch ( Exception e ) { logger . error ( "" , e ) ; } finally { // Clean up !
if ( is != null ) { try { is . close ( ) ; } finally { is = null ; } } } } else { logger . warn ( "\r\n--------------------------------------------------------------------------------\r\n" + "No Component Descriptor found in '" + duWrapper . getFileName ( ) + "'.\r\n" + "--------------------------------------------------------------------------------" ) ; return new ArrayList < DeployableComponent > ( ) ; } } finally { } return deployableComponents ;


signature:
public class AddressPlan { /** * Get an < code > AddressPlan < / code > object from an integer value .
 * @ param plan the address plan as an integer .
 * @ return an < code > AddressPlan < / code > object corresponding to < code > plan < / code > .
 * @ throws IllegalArgumentException if < code > plan < / code > is not a valid
 * address plan value . */
public static AddressPlan fromInt ( int plan ) throws IllegalArgumentException { } }

implementation: switch ( plan ) { case ADDRESS_PLAN_NOT_PRESENT : return NOT_PRESENT ; case ADDRESS_PLAN_UNDEFINED : return UNDEFINED ; case ADDRESS_PLAN_IP : return IP ; case ADDRESS_PLAN_MULTICAST : return MULTICAST ; case ADDRESS_PLAN_UNICAST : return UNICAST ; case ADDRESS_PLAN_E164 : return E164 ; case ADDRESS_PLAN_AESA : return AESA ; case ADDRESS_PLAN_URI : return URI ; case ADDRESS_PLAN_NSAP : return NSAP ; case ADDRESS_PLAN_SMTP : return SMTP ; case ADDRESS_PLAN_X400 : return X400 ; case ADDRESS_PLAN_SIP : return SIP ; case ADDRESS_PLAN_E164_MOBILE : return E164_MOBILE ; case ADDRESS_PLAN_H323 : return H323 ; case ADDRESS_PLAN_GT : return GT ; case ADDRESS_PLAN_SSN : return SSN ; case ADDRESS_PLAN_SLEE_PROFILE_TABLE : return SLEE_PROFILE_TABLE ; case ADDRESS_PLAN_SLEE_PROFILE : return SLEE_PROFILE ; default : throw new IllegalArgumentException ( "Invalid address plan: " + plan ) ; }


signature:
public class AddressPlan { /** * Get an < code > AddressPlan < / code > object from a string value .
 * @ param plan the address plan as a string , for example as returned by the { @ link # toString ( ) }
 * method ( case insensitive ) .
 * @ return an < code > AddressPlan < / code > object corresponding to < code > plan < / code > .
 * @ throws NullPointerException if < code > plan < / code > is < code > null < / code > .
 * @ throws IllegalArgumentException if < code > plan < / code > is not a valid
 * address plan value .
 * @ since SLEE 1.1 */
public static AddressPlan fromString ( String plan ) throws NullPointerException , IllegalArgumentException { } }

implementation: if ( plan == null ) throw new NullPointerException ( "plan is null" ) ; if ( plan . equalsIgnoreCase ( NOT_PRESENT_STRING ) ) return NOT_PRESENT ; if ( plan . equalsIgnoreCase ( UNDEFINED_STRING ) ) return UNDEFINED ; if ( plan . equalsIgnoreCase ( IP_STRING ) ) return IP ; if ( plan . equalsIgnoreCase ( MULTICAST_STRING ) ) return MULTICAST ; if ( plan . equalsIgnoreCase ( UNICAST_STRING ) ) return UNICAST ; if ( plan . equalsIgnoreCase ( E164_STRING ) ) return E164 ; if ( plan . equalsIgnoreCase ( AESA_STRING ) ) return AESA ; if ( plan . equalsIgnoreCase ( URI_STRING ) ) return URI ; if ( plan . equalsIgnoreCase ( NSAP_STRING ) ) return NSAP ; if ( plan . equalsIgnoreCase ( SMTP_STRING ) ) return SMTP ; if ( plan . equalsIgnoreCase ( X400_STRING ) ) return X400 ; if ( plan . equalsIgnoreCase ( SIP_STRING ) ) return SIP ; if ( plan . equalsIgnoreCase ( E164_MOBILE_STRING ) ) return E164_MOBILE ; if ( plan . equalsIgnoreCase ( H323_STRING ) ) return H323 ; if ( plan . equalsIgnoreCase ( GT_STRING ) ) return GT ; if ( plan . equalsIgnoreCase ( SSN_STRING ) ) return SSN ; if ( plan . equalsIgnoreCase ( SLEE_PROFILE_TABLE_STRING ) ) return SLEE_PROFILE_TABLE ; if ( plan . equalsIgnoreCase ( SLEE_PROFILE_STRING ) ) return SLEE_PROFILE ; throw new IllegalArgumentException ( "Invalid address plan: " + plan ) ;


signature:
public class TimerFacilityImpl { /** * ( non - Javadoc )
 * @ see javax . slee . facilities . TimerFacility # setTimer ( javax . slee . ActivityContextInterface , javax . slee . Address , long , javax . slee . facilities . TimerOptions ) */
public TimerID setTimer ( ActivityContextInterface aci , Address address , long startTime , TimerOptions timerOptions ) throws NullPointerException , IllegalArgumentException , FacilityException { } }

implementation: return setTimer ( aci , address , startTime , Long . MAX_VALUE , 1 , timerOptions ) ;


signature:
public class TimerFacilityImpl { /** * ( non - Javadoc )
 * @ see javax . slee . facilities . TimerFacility # setTimer ( javax . slee . ActivityContextInterface , javax . slee . Address , long , long , int , javax . slee . facilities . TimerOptions ) */
public TimerID setTimer ( ActivityContextInterface aci , Address address , long startTime , long period , int numRepetitions , TimerOptions timerOptions ) throws NullPointerException , IllegalArgumentException , TransactionRolledbackLocalException , FacilityException { } }

implementation:
if ( aci == null ) throw new NullPointerException ( "Null ActivityContextInterface" ) ; if ( startTime < 0 ) throw new IllegalArgumentException ( "startTime < 0" ) ; if ( period <= 0 ) throw new IllegalArgumentException ( "period <= 0" ) ; if ( timerOptions == null ) throw new NullPointerException ( "Null TimerOptions" ) ; if ( timerOptions . getTimeout ( ) > period ) throw new IllegalArgumentException ( "timeout > period" ) ; if ( timerOptions . getTimeout ( ) < this . getResolution ( ) ) timerOptions . setTimeout ( Math . min ( period , this . getResolution ( ) ) ) ; if ( period == Long . MAX_VALUE && numRepetitions == 1 ) { // non periodic value , the framework expects it to be negative instead
period = - 1 ; } // when numRepetitions = = 0 the timer repeats infinitely or until
// canceled
if ( numRepetitions < 0 ) throw new IllegalArgumentException ( "numRepetitions < 0" ) ; SleeTransactionManager txMgr = sleeContainer . getTransactionManager ( ) ; boolean startedTx = txMgr . requireTransaction ( ) ; TimerIDImpl timerID = new TimerIDImpl ( sleeContainer . getUuidGenerator ( ) . createUUID ( ) ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "setTimer: timerID = " + timerID + " , startTime = " + startTime + " period = " + period + " numRepetitions = " + numRepetitions + " timeroptions =" + timerOptions ) ; } // Attach to activity context
org . mobicents . slee . container . activity . ActivityContextInterface aciImpl = ( org . mobicents . slee . container . activity . ActivityContextInterface ) aci ; aciImpl . getActivityContext ( ) . attachTimer ( timerID ) ; // schedule timer task
TimerFacilityTimerTaskData taskData = new TimerFacilityTimerTaskData ( timerID , aciImpl . getActivityContext ( ) . getActivityContextHandle ( ) , address , startTime , period , numRepetitions , timerOptions ) ; final TimerFacilityTimerTask task = new TimerFacilityTimerTask ( taskData ) ; if ( configuration . getTaskExecutionWaitsForTxCommitConfirmation ( ) ) { final CountDownLatch countDownLatch = new CountDownLatch ( 1 ) ; task . setCountDownLatch ( countDownLatch ) ; TransactionalAction action = new TransactionalAction ( ) { @ Override public void execute ( ) { countDownLatch . countDown ( ) ; } } ; TransactionContext txContext = txMgr . getTransactionContext ( ) ; txContext . getAfterCommitActions ( ) . add ( action ) ; txContext . getAfterRollbackActions ( ) . add ( action ) ; } scheduler . schedule ( task ) ; // If we started a tx for this operation , we commit it now
if ( startedTx ) { try { txMgr . commit ( ) ; } catch ( Exception e ) { throw new TransactionRolledbackLocalException ( "Failed to commit transaction" ) ; } } return timerID ;


signature:
public class TimerFacilityImpl { /** * ( non - Javadoc )
 * @ see javax . slee . facilities . TimerFacility # cancelTimer ( javax . slee . facilities . TimerID ) */
public void cancelTimer ( TimerID timerID ) throws NullPointerException , TransactionRolledbackLocalException , FacilityException { } }

implementation: if ( logger . isDebugEnabled ( ) ) { logger . debug ( "cancelTimer: timerID = " + timerID ) ; } if ( timerID == null ) throw new NullPointerException ( "Null TimerID" ) ; SleeTransactionManager txMgr = sleeContainer . getTransactionManager ( ) ; boolean terminateTx = txMgr . requireTransaction ( ) ; boolean doRollback = true ; try { cancelTimer ( timerID , true ) ; doRollback = false ; } finally { try { txMgr . requireTransactionEnd ( terminateTx , doRollback ) ; } catch ( Throwable e ) { throw new TransactionRolledbackLocalException ( e . getMessage ( ) , e ) ; } }


signature:
public class TimerFacilityImpl { /** * ( non - Javadoc )
 * @ see javax . slee . facilities . TimerFacility # getActivityContextInterface ( javax . slee . facilities . TimerID ) */
public ActivityContextInterface getActivityContextInterface ( TimerID timerID ) throws NullPointerException , TransactionRequiredLocalException , FacilityException { } }

implementation: if ( timerID == null ) { throw new NullPointerException ( "null timerID" ) ; } sleeContainer . getTransactionManager ( ) . mandateTransaction ( ) ; TimerFacilityTimerTaskData taskData = ( TimerFacilityTimerTaskData ) scheduler . getTimerTaskData ( timerID ) ; if ( taskData != null ) { try { return sleeContainer . getActivityContextFactory ( ) . getActivityContext ( taskData . getActivityContextHandle ( ) ) . getActivityContextInterface ( ) ; } catch ( Exception e ) { throw new FacilityException ( e . getMessage ( ) , e ) ; } } else { return null ; }


signature:
public class AlarmLevelFilter { /** * Determine whether the specified notification should be delivered to notification
 * listeners using this notification filter .
 * @ param notification the notification to be sent .
 * @ return < code > true < / code > if the notification should be delivered to notification
 * listeners , < code > false < / code > otherwise . This method always returns
 * < code > false < / code > if < code > notification < / code > is not an instance of
 * { @ link AlarmNotification } . */
public boolean isNotificationEnabled ( Notification notification ) { } }

implementation:
if ( ! ( notification instanceof AlarmNotification ) ) return false ; if ( minLevel_10 != null ) { // SLEE 1.0 comparison
Level alarmLevel = ( ( AlarmNotification ) notification ) . getLevel ( ) ; return alarmLevel != null && ! minLevel_10 . isHigherLevel ( alarmLevel ) ; } else { // SLEE 1.1 comparison
AlarmLevel alarmLevel = ( ( AlarmNotification ) notification ) . getAlarmLevel ( ) ; return alarmLevel != null && ! minLevel_11 . isHigherLevel ( alarmLevel ) ; }


signature:
public class SbbDescriptorFactoryImpl { /** * Builds a list of { @ link SbbDescriptorImpl } objects , from an { @ link InputStream } containing the sbb jar xml .
 * @ param inputStream
 * @ return
 * @ throws DeploymentException */
public List < SbbDescriptorImpl > parse ( InputStream inputStream ) throws DeploymentException { } }

implementation: Object jaxbPojo = buildJAXBPojo ( inputStream ) ; List < SbbDescriptorImpl > result = new ArrayList < SbbDescriptorImpl > ( ) ; boolean isSlee11 = false ; MSbbJar mSbbJar = null ; if ( jaxbPojo instanceof org . mobicents . slee . container . component . deployment . jaxb . slee . sbb . SbbJar ) { mSbbJar = new MSbbJar ( ( org . mobicents . slee . container . component . deployment . jaxb . slee . sbb . SbbJar ) jaxbPojo ) ; } else if ( jaxbPojo instanceof org . mobicents . slee . container . component . deployment . jaxb . slee11 . sbb . SbbJar ) { mSbbJar = new MSbbJar ( ( org . mobicents . slee . container . component . deployment . jaxb . slee11 . sbb . SbbJar ) jaxbPojo ) ; isSlee11 = true ; } else { throw new SLEEException ( "unexpected class of jaxb pojo built: " + ( jaxbPojo != null ? jaxbPojo . getClass ( ) : null ) ) ; } MSecurityPermissions mSbbJarSecurityPermissions = mSbbJar . getSecurityPermissions ( ) ; for ( MSbb mSbb : mSbbJar . getSbb ( ) ) { result . add ( new SbbDescriptorImpl ( mSbb , mSbbJarSecurityPermissions , isSlee11 ) ) ; } return result ;


signature:
public class LogStructureTreePanel { /** * TMP DEV METHODS */
private TreeItem doTree ( FQDNNode localRoot ) { } }

implementation: TreeItem localLeaf = new TreeItem ( ) ; LogTreeNode logTreeNode = new LogTreeNode ( browseContainer , localRoot . getShortName ( ) , localRoot . getFqdName ( ) , localRoot . isWasLeaf ( ) , this ) ; localLeaf . setWidget ( logTreeNode ) ; if ( localRoot . getChildren ( ) . size ( ) > 0 ) { Tree t = new Tree ( ) ; ArrayList names = new ArrayList ( localRoot . getChildrenNames ( ) ) ; Collections . sort ( names ) ; Iterator it = names . iterator ( ) ; while ( it . hasNext ( ) ) { t . addItem ( doTree ( localRoot . getChild ( ( String ) it . next ( ) ) ) ) ; } localLeaf . addItem ( t ) ; } return localLeaf ;


signature:
public class RootSbbEntityID { /** * ( non - Javadoc )
 * @ see java . io . Externalizable # readExternal ( java . io . ObjectInput ) */
@ Override public void readExternal ( ObjectInput in ) throws IOException , ClassNotFoundException { } }

implementation: serviceID = new ServiceID ( in . readUTF ( ) , in . readUTF ( ) , in . readUTF ( ) ) ; convergenceName = in . readUTF ( ) ;


signature:
public class RootSbbEntityID { /** * ( non - Javadoc )
 * @ see java . io . Externalizable # writeExternal ( java . io . ObjectOutput ) */
@ Override public void writeExternal ( ObjectOutput out ) throws IOException { } }

implementation: out . writeUTF ( serviceID . getName ( ) ) ; out . writeUTF ( serviceID . getVendor ( ) ) ; out . writeUTF ( serviceID . getVersion ( ) ) ; out . writeUTF ( convergenceName ) ;


signature:
public class SbbManagementImpl { /** * / * ( non - Javadoc )
 * @ see org . mobicents . slee . container . management . SbbManagement # serviceInstall ( org . mobicents . slee . core . component . service . ServiceComponent ) */
public void serviceInstall ( ServiceComponent serviceComponent ) { } }

implementation:
// create object pools
for ( SbbID sbbID : serviceComponent . getSbbIDs ( sleeContainer . getComponentRepository ( ) ) ) { // create the pool for the given SbbID
sbbPoolManagement . createObjectPool ( serviceComponent . getServiceID ( ) , sleeContainer . getComponentRepository ( ) . getComponentByID ( sbbID ) , sleeContainer . getTransactionManager ( ) ) ; }


signature:
public class SbbManagementImpl { /** * / * ( non - Javadoc )
 * @ see org . mobicents . slee . container . management . SbbManagement # serviceUninstall ( org . mobicents . slee . core . component . service . ServiceComponent ) */
public void serviceUninstall ( ServiceComponent serviceComponent ) { } }

implementation:
// remove sbb object pools
for ( SbbID sbbID : serviceComponent . getSbbIDs ( sleeContainer . getComponentRepository ( ) ) ) { // remove the pool for the given SbbID
sbbPoolManagement . removeObjectPool ( serviceComponent . getServiceID ( ) , sleeContainer . getComponentRepository ( ) . getComponentByID ( sbbID ) , sleeContainer . getTransactionManager ( ) ) ; }


signature:
public class SbbManagementImpl { /** * / * ( non - Javadoc )
 * @ see org . mobicents . slee . container . management . SbbManagement # getObjectPool ( javax . slee . ServiceID , javax . slee . SbbID ) */
public SbbObjectPoolImpl getObjectPool ( ServiceID serviceID , SbbID sbbID ) { } }

implementation: return sbbPoolManagement . getObjectPool ( serviceID , sbbID ) ;


signature:
public class SbbManagementImpl { /** * ( non - Javadoc )
 * @ see org . mobicents . slee . container . management . SbbManagement # installSbb ( org . mobicents . slee . core . component . sbb . SbbComponent ) */
public void installSbb ( final SbbComponent sbbComponent ) throws Exception { } }

implementation:
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 ) ; }


signature:
public class SbbManagementImpl { /** * ( non - Javadoc )
 * @ see org . mobicents . slee . container . management . SbbManagement # uninstallSbb ( org . mobicents . slee . core . component . sbb . SbbComponent ) */
public void uninstallSbb ( final SbbComponent sbbComponent ) throws SystemException , Exception , NamingException { } }

implementation:
final SleeTransactionManager sleeTransactionManager = sleeContainer . getTransactionManager ( ) ; sleeTransactionManager . mandateTransaction ( ) ; if ( logger . isDebugEnabled ( ) ) logger . debug ( "Uninstalling " + sbbComponent ) ; // remove sbb from trace and alarm facilities
sleeContainer . getTraceManagement ( ) . getTraceFacility ( ) . unSetTraceLevel ( sbbComponent . getSbbID ( ) ) ; sleeContainer . getAlarmManagement ( ) . unRegisterComponent ( sbbComponent . getSbbID ( ) ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Removed SBB " + sbbComponent . getSbbID ( ) + " from trace and alarm facilities" ) ; } sleeContainer . getJndiManagement ( ) . componentUninstall ( sbbComponent ) ; // if we are in cluster mode we need to remove the sbb class loader domain from the replication class loader
if ( ! sleeContainer . getCluster ( ) . getMobicentsCache ( ) . isLocalMode ( ) ) { final ReplicationClassLoader replicationClassLoader = sleeContainer . getReplicationClassLoader ( ) ; TransactionalAction action2 = new TransactionalAction ( ) { public void execute ( ) { replicationClassLoader . removeDomain ( sbbComponent . getClassLoaderDomain ( ) ) ; } } ; sleeTransactionManager . getTransactionContext ( ) . getAfterCommitActions ( ) . add ( action2 ) ; }


signature:
public class SbbEntityFactoryImpl { /** * Removes the specified sbb entity but without changing to sbb ' s class
 * loader first .
 * @ param sbbEntity
 * the sbb entity to remove */
private void removeSbbEntityWithCurrentClassLoader ( final SbbEntity sbbEntity ) { } }

implementation:
// remove entity
sbbEntity . remove ( ) ; // remove from tx data
final TransactionContext txContext = sleeContainer . getTransactionManager ( ) . getTransactionContext ( ) ; final SbbEntityID sbbEntityID = sbbEntity . getSbbEntityId ( ) ; txContext . getData ( ) . remove ( sbbEntityID ) ; // if sbb entity is root add a tx action to ensure lock is removed
if ( sbbEntityID . isRootSbbEntity ( ) ) { TransactionalAction txAction = new TransactionalAction ( ) { @ Override public void execute ( ) { lockFacility . remove ( sbbEntityID ) ; } } ; txContext . getAfterCommitActions ( ) . add ( txAction ) ; }


signature:
public class DeploymentMBeanImpl { /** * ( non - Javadoc )
 * @ see javax . slee . management . DeploymentMBean # install ( java . lang . String ) */
public DeployableUnitID install ( String url ) throws NullPointerException , MalformedURLException , AlreadyDeployedException , DeploymentException , ManagementException { } }

implementation:
try { final SleeContainer sleeContainer = getSleeContainer ( ) ; final DeployableUnitBuilder deployableUnitBuilder = sleeContainer . getDeployableUnitManagement ( ) . getDeployableUnitBuilder ( ) ; final SleeTransactionManager sleeTransactionManager = sleeContainer . getTransactionManager ( ) ; final ComponentRepository componentRepositoryImpl = sleeContainer . getComponentRepository ( ) ; final DeployableUnitManagement deployableUnitManagement = sleeContainer . getDeployableUnitManagement ( ) ; synchronized ( sleeContainer . getManagementMonitor ( ) ) { DeployableUnitID deployableUnitID = new DeployableUnitID ( url ) ; logger . info ( "Installing " + deployableUnitID ) ; if ( deployableUnitManagement . getDeployableUnit ( deployableUnitID ) != null ) { throw new AlreadyDeployedException ( "there is already a DU deployed for url " + url ) ; } DeployableUnit deployableUnit = null ; Thread currentThread = Thread . currentThread ( ) ; ClassLoader currentClassLoader = currentThread . getContextClassLoader ( ) ; Set < SleeComponent > componentsInstalled = new HashSet < SleeComponent > ( ) ; boolean rollback = true ; try { // start transaction
sleeTransactionManager . begin ( ) ; // build du
deployableUnit = deployableUnitBuilder . build ( url , tempDUJarsDeploymentRoot , componentRepositoryImpl ) ; // install each component built
for ( LibraryComponent component : deployableUnit . getLibraryComponents ( ) . values ( ) ) { componentRepositoryImpl . putComponent ( component ) ; updateSecurityPermissions ( component , false ) ; logger . info ( "Installed " + component ) ; } for ( EventTypeComponent component : deployableUnit . getEventTypeComponents ( ) . values ( ) ) { componentRepositoryImpl . putComponent ( component ) ; logger . info ( "Installed " + component ) ; } for ( ResourceAdaptorTypeComponent component : deployableUnit . getResourceAdaptorTypeComponents ( ) . values ( ) ) { componentRepositoryImpl . putComponent ( component ) ; currentThread . setContextClassLoader ( component . getClassLoader ( ) ) ; sleeContainer . getResourceManagement ( ) . installResourceAdaptorType ( component ) ; componentsInstalled . add ( component ) ; logger . info ( "Installed " + component ) ; } // before executing the logic to install an profile spec , ra
// or sbb insert the components in the repo , a component can
// require that another is already in repo
for ( ProfileSpecificationComponent component : deployableUnit . getProfileSpecificationComponents ( ) . values ( ) ) { componentRepositoryImpl . putComponent ( component ) ; } for ( ResourceAdaptorComponent component : deployableUnit . getResourceAdaptorComponents ( ) . values ( ) ) { componentRepositoryImpl . putComponent ( component ) ; } for ( SbbComponent component : deployableUnit . getSbbComponents ( ) . values ( ) ) { componentRepositoryImpl . putComponent ( component ) ; } // run the install logic to install an profile spec , ra or
// sbb
for ( ProfileSpecificationComponent component : deployableUnit . getProfileSpecificationComponents ( ) . values ( ) ) { currentThread . setContextClassLoader ( component . getClassLoader ( ) ) ; sleeContainer . getSleeProfileTableManager ( ) . installProfileSpecification ( component ) ; componentsInstalled . add ( component ) ; updateSecurityPermissions ( component , false ) ; logger . info ( "Installed " + component ) ; } for ( ResourceAdaptorComponent component : deployableUnit . getResourceAdaptorComponents ( ) . values ( ) ) { currentThread . setContextClassLoader ( component . getClassLoader ( ) ) ; sleeContainer . getResourceManagement ( ) . installResourceAdaptor ( component ) ; componentsInstalled . add ( component ) ; updateSecurityPermissions ( component , false ) ; logger . info ( "Installed " + component ) ; } for ( SbbComponent component : deployableUnit . getSbbComponents ( ) . values ( ) ) { currentThread . setContextClassLoader ( component . getClassLoader ( ) ) ; sleeContainer . getSbbManagement ( ) . installSbb ( component ) ; componentsInstalled . add ( component ) ; updateSecurityPermissions ( component , false ) ; logger . info ( "Installed " + component ) ; } // finally install the services
currentThread . setContextClassLoader ( currentClassLoader ) ; for ( ServiceComponent component : deployableUnit . getServiceComponents ( ) . values ( ) ) { componentRepositoryImpl . putComponent ( component ) ; sleeContainer . getServiceManagement ( ) . installService ( component ) ; componentsInstalled . add ( component ) ; logger . info ( "Installed " + component + ". Root sbb is " + component . getRootSbbComponent ( ) ) ; } deployableUnitManagement . addDeployableUnit ( deployableUnit ) ; logger . info ( "Installed " + deployableUnitID ) ; updateSecurityPermissions ( null , true ) ; rollback = false ; return deployableUnitID ; } finally { currentThread . setContextClassLoader ( currentClassLoader ) ; try { if ( rollback ) { if ( deployableUnit != null ) { // remove all components added to repo
// put all components in the repo again
for ( LibraryComponent component : deployableUnit . getLibraryComponents ( ) . values ( ) ) { removeSecurityPermissions ( component , false ) ; componentRepositoryImpl . removeComponent ( component . getLibraryID ( ) ) ; logger . info ( "Uninstalled " + component + " due to tx rollback" ) ; } for ( EventTypeComponent component : deployableUnit . getEventTypeComponents ( ) . values ( ) ) { componentRepositoryImpl . removeComponent ( component . getEventTypeID ( ) ) ; logger . info ( "Uninstalled " + component + " due to tx rollback" ) ; } for ( ResourceAdaptorTypeComponent component : deployableUnit . getResourceAdaptorTypeComponents ( ) . values ( ) ) { removeSecurityPermissions ( component , false ) ; if ( componentsInstalled . contains ( component ) ) { sleeContainer . getResourceManagement ( ) . uninstallResourceAdaptorType ( component ) ; } componentRepositoryImpl . removeComponent ( component . getResourceAdaptorTypeID ( ) ) ; logger . info ( "Uninstalled " + component + " due to tx rollback" ) ; } for ( ProfileSpecificationComponent component : deployableUnit . getProfileSpecificationComponents ( ) . values ( ) ) { if ( componentsInstalled . contains ( component ) ) { sleeContainer . getSleeProfileTableManager ( ) . uninstallProfileSpecification ( component ) ; } componentRepositoryImpl . removeComponent ( component . getProfileSpecificationID ( ) ) ; logger . info ( "Uninstalled " + component + " due to tx rollback" ) ; } for ( ResourceAdaptorComponent component : deployableUnit . getResourceAdaptorComponents ( ) . values ( ) ) { removeSecurityPermissions ( component , false ) ; if ( componentsInstalled . contains ( component ) ) { sleeContainer . getResourceManagement ( ) . uninstallResourceAdaptor ( component ) ; } componentRepositoryImpl . removeComponent ( component . getResourceAdaptorID ( ) ) ; logger . info ( "Uninstalled " + component + " due to tx rollback" ) ; } for ( SbbComponent component : deployableUnit . getSbbComponents ( ) . values ( ) ) { removeSecurityPermissions ( component , false ) ; if ( componentsInstalled . contains ( component ) ) { sleeContainer . getSbbManagement ( ) . uninstallSbb ( component ) ; } componentRepositoryImpl . removeComponent ( component . getSbbID ( ) ) ; logger . info ( "Uninstalled " + component + " due to tx rollback" ) ; } for ( ServiceComponent component : deployableUnit . getServiceComponents ( ) . values ( ) ) { if ( componentsInstalled . contains ( component ) ) { sleeContainer . getServiceManagement ( ) . uninstallService ( component ) ; } componentRepositoryImpl . removeComponent ( component . getServiceID ( ) ) ; logger . info ( "Uninstalled " + component + " due to tx rollback" ) ; } removeSecurityPermissions ( null , true ) ; // undeploy the unit
deployableUnit . undeploy ( ) ; } sleeTransactionManager . rollback ( ) ; } else { sleeTransactionManager . commit ( ) ; } } catch ( Exception ex ) { throw new ManagementException ( "Exception while completing transaction" , ex ) ; } } } } catch ( AlreadyDeployedException e ) { throw e ; } catch ( DeploymentException e ) { // This will remove stack trace ;
// throw e ;
throw new DeploymentException ( "Failure encountered during deploy process." , e ) ; } catch ( Throwable e ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( e . getMessage ( ) , e ) ; } throw new ManagementException ( e . getMessage ( ) , e ) ; }


signature:
public class DeploymentMBeanImpl { /** * ( non - Javadoc )
 * @ see javax . slee . management . DeploymentMBean # uninstall ( javax . slee . management . DeployableUnitID ) */
public void uninstall ( DeployableUnitID deployableUnitID ) throws NullPointerException , UnrecognizedDeployableUnitException , DependencyException , InvalidStateException , ManagementException { } }

implementation:
logger . info ( "Uninstalling " + deployableUnitID ) ; final SleeContainer sleeContainer = getSleeContainer ( ) ; final SleeTransactionManager sleeTransactionManager = sleeContainer . getTransactionManager ( ) ; final ServiceManagement serviceManagement = sleeContainer . getServiceManagement ( ) ; final ResourceManagement resourceManagement = sleeContainer . getResourceManagement ( ) ; final DeployableUnitManagement deployableUnitManagement = sleeContainer . getDeployableUnitManagement ( ) ; final ComponentRepository componentRepositoryImpl = sleeContainer . getComponentRepository ( ) ; // we sync on the container ' s monitor object
synchronized ( sleeContainer . getManagementMonitor ( ) ) { if ( this . isInstalled ( deployableUnitID ) ) { Thread currentThread = Thread . currentThread ( ) ; ClassLoader currentClassLoader = currentThread . getContextClassLoader ( ) ; DeployableUnit deployableUnit = null ; boolean rollback = true ; try { // start transaction
sleeTransactionManager . begin ( ) ; // get du
deployableUnit = deployableUnitManagement . getDeployableUnit ( deployableUnitID ) ; // Check if its safe to remove the deployable unit .
for ( SleeComponent sleeComponent : deployableUnit . getDeployableUnitComponents ( ) ) { for ( SleeComponent referringComponent : sleeContainer . getComponentRepository ( ) . getReferringComponents ( sleeComponent ) ) { if ( ! referringComponent . getDeployableUnit ( ) . getDeployableUnitID ( ) . equals ( deployableUnitID ) ) { throw new DependencyException ( "Component " + referringComponent + " refers DU component " + sleeComponent ) ; } } } for ( ServiceComponent component : deployableUnit . getServiceComponents ( ) . values ( ) ) { serviceManagement . uninstallService ( component ) ; componentRepositoryImpl . removeComponent ( component . getServiceID ( ) ) ; logger . info ( "Uninstalled " + component ) ; } for ( SbbComponent component : deployableUnit . getSbbComponents ( ) . values ( ) ) { currentThread . setContextClassLoader ( component . getClassLoader ( ) ) ; removeSecurityPermissions ( component , false ) ; sleeContainer . getSbbManagement ( ) . uninstallSbb ( component ) ; componentRepositoryImpl . removeComponent ( component . getSbbID ( ) ) ; logger . info ( "Uninstalled " + component ) ; } for ( ResourceAdaptorComponent component : deployableUnit . getResourceAdaptorComponents ( ) . values ( ) ) { removeSecurityPermissions ( component , false ) ; resourceManagement . uninstallResourceAdaptor ( component ) ; componentRepositoryImpl . removeComponent ( component . getResourceAdaptorID ( ) ) ; logger . info ( "Uninstalled " + component ) ; } for ( ProfileSpecificationComponent component : deployableUnit . getProfileSpecificationComponents ( ) . values ( ) ) { currentThread . setContextClassLoader ( component . getClassLoader ( ) ) ; removeSecurityPermissions ( component , false ) ; sleeContainer . getSleeProfileTableManager ( ) . uninstallProfileSpecification ( component ) ; componentRepositoryImpl . removeComponent ( component . getProfileSpecificationID ( ) ) ; logger . info ( "Uninstalled " + component ) ; } for ( ResourceAdaptorTypeComponent component : deployableUnit . getResourceAdaptorTypeComponents ( ) . values ( ) ) { resourceManagement . uninstallResourceAdaptorType ( component ) ; componentRepositoryImpl . removeComponent ( component . getResourceAdaptorTypeID ( ) ) ; logger . info ( "Uninstalled " + component ) ; } for ( EventTypeID componentID : deployableUnit . getEventTypeComponents ( ) . keySet ( ) ) { componentRepositoryImpl . removeComponent ( componentID ) ; logger . info ( "Uninstalled " + componentID ) ; } for ( LibraryID componentID : deployableUnit . getLibraryComponents ( ) . keySet ( ) ) { removeSecurityPermissions ( componentRepositoryImpl . getComponentByID ( componentID ) , false ) ; componentRepositoryImpl . removeComponent ( componentID ) ; logger . info ( "Uninstalled " + componentID ) ; } removeSecurityPermissions ( null , true ) ; // remove du
deployableUnitManagement . removeDeployableUnit ( deployableUnitID ) ; rollback = false ; logger . info ( "Uninstalled " + deployableUnitID ) ; } catch ( InvalidStateException ex ) { logger . error ( ex . getMessage ( ) , ex ) ; throw ex ; } catch ( DependencyException ex ) { logger . error ( ex . getMessage ( ) , ex ) ; throw ex ; } catch ( Throwable ex ) { if ( logger . isDebugEnabled ( ) ) logger . debug ( ex . getMessage ( ) , ex ) ; throw new ManagementException ( "Exception removing deployable Unit " , ex ) ; } finally { currentThread . setContextClassLoader ( currentClassLoader ) ; try { if ( rollback ) { if ( deployableUnit != null ) { // put all components in the repo again
for ( LibraryComponent component : deployableUnit . getLibraryComponents ( ) . values ( ) ) { if ( componentRepositoryImpl . putComponent ( component ) ) { updateSecurityPermissions ( component , false ) ; logger . info ( "Reinstalled " + component + " due to tx rollback" ) ; } } for ( EventTypeComponent component : deployableUnit . getEventTypeComponents ( ) . values ( ) ) { if ( componentRepositoryImpl . putComponent ( component ) ) { logger . info ( "Reinstalled " + component + " due to tx rollback" ) ; } } for ( ResourceAdaptorTypeComponent component : deployableUnit . getResourceAdaptorTypeComponents ( ) . values ( ) ) { if ( componentRepositoryImpl . putComponent ( component ) ) { logger . info ( "Reinstalled " + component + " due to tx rollback" ) ; } } for ( ProfileSpecificationComponent component : deployableUnit . getProfileSpecificationComponents ( ) . values ( ) ) { if ( componentRepositoryImpl . putComponent ( component ) ) { updateSecurityPermissions ( component , false ) ; logger . info ( "Reinstalled " + component + " due to tx rollback" ) ; } } for ( ResourceAdaptorComponent component : deployableUnit . getResourceAdaptorComponents ( ) . values ( ) ) { if ( componentRepositoryImpl . putComponent ( component ) ) { updateSecurityPermissions ( component , false ) ; logger . info ( "Reinstalled " + component + " due to tx rollback" ) ; } } for ( SbbComponent component : deployableUnit . getSbbComponents ( ) . values ( ) ) { if ( componentRepositoryImpl . putComponent ( component ) ) { updateSecurityPermissions ( component , false ) ; logger . info ( "Reinstalled " + component + " due to tx rollback" ) ; } } for ( ServiceComponent component : deployableUnit . getServiceComponents ( ) . values ( ) ) { if ( componentRepositoryImpl . putComponent ( component ) ) { logger . info ( "Reinstalled " + component + " due to tx rollback" ) ; } } updateSecurityPermissions ( null , true ) ; deployableUnitManagement . addDeployableUnit ( deployableUnit ) ; } sleeTransactionManager . rollback ( ) ; } else { sleeTransactionManager . commit ( ) ; // FIXME : For JBoss 7.2.0 . Final :
// we have a problem with org . hibernate . service . UnknownServiceException :
// Unknown service requested [ org . hibernate . event . service . spi . EventListenerRegistry ]
// see https : / / hibernate . atlassian . net / browse / HHH - 8586
for ( ProfileSpecificationComponent component : deployableUnit . getProfileSpecificationComponents ( ) . values ( ) ) { currentThread . setContextClassLoader ( component . getClassLoader ( ) ) ; removeSecurityPermissions ( component , false ) ; sleeContainer . getSleeProfileTableManager ( ) . closeEntityManagerFactory ( component ) ; logger . info ( "Finalized " + component ) ; } // Clean up all the class files .
deployableUnit . undeploy ( ) ; } } catch ( Throwable ex ) { throw new ManagementException ( "Exception while completing transaction" , ex ) ; } } } else { throw new UnrecognizedDeployableUnitException ( "deployable unit " + deployableUnitID ) ; } }


signature:
public class DeploymentMBeanImpl { /** * ( non - Javadoc )
 * @ see javax . slee . management . DeploymentMBean # getDeployableUnit ( java . lang . String ) */
public DeployableUnitID getDeployableUnit ( String deploymentUrl ) throws NullPointerException , UnrecognizedDeployableUnitException , ManagementException { } }

implementation: DeployableUnitID deployableUnitID = new DeployableUnitID ( deploymentUrl ) ; boolean duExists = true ; try { if ( getSleeContainer ( ) . getDeployableUnitManagement ( ) . getDeployableUnit ( deployableUnitID ) == null ) { duExists = false ; } } catch ( Throwable e ) { throw new ManagementException ( e . getMessage ( ) , e ) ; } if ( duExists ) { return deployableUnitID ; } else { throw new UnrecognizedDeployableUnitException ( deploymentUrl ) ; }


signature:
public class DeploymentMBeanImpl { /** * ( non - Javadoc )
 * @ see javax . slee . management . DeploymentMBean # getDeployableUnits ( ) */
public DeployableUnitID [ ] getDeployableUnits ( ) throws ManagementException { } }

implementation: try { return getSleeContainer ( ) . getDeployableUnitManagement ( ) . getDeployableUnits ( ) ; } catch ( Throwable e ) { throw new ManagementException ( "failed to get deployable units" , e ) ; }


signature:
public class DeploymentMBeanImpl { /** * ( non - Javadoc )
 * @ see javax . slee . management . DeploymentMBean # getSbbs ( ) */
public SbbID [ ] getSbbs ( ) throws ManagementException { } }

implementation: try { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "getSbbs()" ) ; } return getSleeContainer ( ) . getComponentRepository ( ) . getSbbIDs ( ) . toArray ( new SbbID [ 0 ] ) ; } catch ( Throwable ex ) { throw new ManagementException ( ex . getMessage ( ) , ex ) ; }


signature:
public class DeploymentMBeanImpl { /** * ( non - Javadoc )
 * @ see javax . slee . management . DeploymentMBean # getEventTypes ( ) */
public EventTypeID [ ] getEventTypes ( ) throws ManagementException { } }

implementation: try { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "getEventTypes()" ) ; } return getSleeContainer ( ) . getComponentRepository ( ) . getEventComponentIDs ( ) . toArray ( new EventTypeID [ 0 ] ) ; } catch ( Throwable ex ) { throw new ManagementException ( ex . getMessage ( ) , ex ) ; }


signature:
public class DeploymentMBeanImpl { /** * ( non - Javadoc )
 * @ see javax . slee . management . DeploymentMBean # getProfileSpecifications ( ) */
public ProfileSpecificationID [ ] getProfileSpecifications ( ) throws ManagementException { } }

implementation: try { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "getProfileSpecifications()" ) ; } return getSleeContainer ( ) . getComponentRepository ( ) . getProfileSpecificationIDs ( ) . toArray ( new ProfileSpecificationID [ 0 ] ) ; } catch ( Throwable ex ) { throw new ManagementException ( ex . getMessage ( ) , ex ) ; }


signature:
public class DeploymentMBeanImpl { /** * ( non - Javadoc )
 * @ see javax . slee . management . DeploymentMBean # getServices ( ) */
public ServiceID [ ] getServices ( ) throws ManagementException { } }

implementation: try { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "getServices()" ) ; } return getSleeContainer ( ) . getComponentRepository ( ) . getServiceIDs ( ) . toArray ( new ServiceID [ 0 ] ) ; } catch ( Throwable ex ) { throw new ManagementException ( ex . getMessage ( ) , ex ) ; }


signature:
public class DeploymentMBeanImpl { /** * ( non - Javadoc )
 * @ see javax . slee . management . DeploymentMBean # getResourceAdaptorTypes ( ) */
public ResourceAdaptorTypeID [ ] getResourceAdaptorTypes ( ) throws ManagementException { } }

implementation: try { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "getResourceAdaptorTypes()" ) ; } return getSleeContainer ( ) . getComponentRepository ( ) . getResourceAdaptorTypeIDs ( ) . toArray ( new ResourceAdaptorTypeID [ 0 ] ) ; } catch ( Throwable ex ) { throw new ManagementException ( ex . getMessage ( ) , ex ) ; }


signature:
public class DeploymentMBeanImpl { /** * ( non - Javadoc )
 * @ see javax . slee . management . DeploymentMBean # getResourceAdaptors ( ) */
public ResourceAdaptorID [ ] getResourceAdaptors ( ) throws ManagementException { } }

implementation: try { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "getResourceAdaptors()" ) ; } return getSleeContainer ( ) . getComponentRepository ( ) . getResourceAdaptorIDs ( ) . toArray ( new ResourceAdaptorID [ 0 ] ) ; } catch ( Throwable ex ) { throw new ManagementException ( ex . getMessage ( ) , ex ) ; }


signature:
public class DeploymentMBeanImpl { /** * ( non - Javadoc )
 * @ see javax . slee . management . DeploymentMBean # getReferringComponents ( javax . slee . ComponentID ) */
public ComponentID [ ] getReferringComponents ( ComponentID componentId ) throws NullPointerException , UnrecognizedComponentException , ManagementException { } }

implementation: try { return getSleeContainer ( ) . getComponentRepository ( ) . getReferringComponents ( componentId ) ; } catch ( NullPointerException ex ) { throw ex ; } catch ( UnrecognizedComponentException ex ) { throw ex ; } catch ( Throwable ex ) { throw new ManagementException ( ex . getMessage ( ) , ex ) ; }


signature:
public class DeploymentMBeanImpl { /** * ( non - Javadoc )
 * @ see javax . slee . management . DeploymentMBean # getDescriptor ( javax . slee . management . DeployableUnitID ) */
public DeployableUnitDescriptor getDescriptor ( DeployableUnitID deployableUnitID ) throws NullPointerException , UnrecognizedDeployableUnitException , ManagementException { } }

implementation: if ( deployableUnitID == null ) throw new NullPointerException ( "deployableUnitID should not be null" ) ; DeployableUnitDescriptor dud = null ; try { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "getDescriptor " + deployableUnitID ) ; } DeployableUnit du = getSleeContainer ( ) . getDeployableUnitManagement ( ) . getDeployableUnit ( deployableUnitID ) ; if ( du != null ) { dud = du . getSpecsDeployableUnitDescriptor ( ) ; } } catch ( Throwable ex ) { throw new ManagementException ( ex . getMessage ( ) , ex ) ; } if ( dud == null ) { throw new UnrecognizedDeployableUnitException ( "unrecognized deployable unit " + deployableUnitID ) ; } else { return dud ; }


signature:
public class DeploymentMBeanImpl { /** * ( non - Javadoc )
 * @ see javax . slee . management . DeploymentMBean # getDescriptors ( javax . slee . management . DeployableUnitID [ ] ) */
public DeployableUnitDescriptor [ ] getDescriptors ( DeployableUnitID [ ] duIds ) throws NullPointerException , ManagementException { } }

implementation: if ( duIds == null ) throw new NullPointerException ( "Null arg!" ) ; final DeployableUnitManagement deployableUnitManagement = getSleeContainer ( ) . getDeployableUnitManagement ( ) ; try { Set < DeployableUnitDescriptor > result = new HashSet < DeployableUnitDescriptor > ( ) ; for ( DeployableUnitID deployableUnitID : deployableUnitManagement . getDeployableUnits ( ) ) { DeployableUnit deployableUnit = deployableUnitManagement . getDeployableUnit ( deployableUnitID ) ; result . add ( deployableUnit . getSpecsDeployableUnitDescriptor ( ) ) ; } return result . toArray ( new DeployableUnitDescriptor [ 0 ] ) ; } catch ( Throwable ex ) { throw new ManagementException ( "Error in tx manager " , ex ) ; }


signature:
public class DeploymentMBeanImpl { /** * ( non - Javadoc )
 * @ see javax . slee . management . DeploymentMBean # getDescriptor ( javax . slee . ComponentID ) */
public ComponentDescriptor getDescriptor ( ComponentID componentID ) throws NullPointerException , UnrecognizedComponentException , ManagementException { } }

implementation: if ( componentID == null ) throw new NullPointerException ( "null component ID" ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "getDescriptor: componentID " + componentID ) ; } try { ComponentRepository componentRepositoryImpl = getSleeContainer ( ) . getComponentRepository ( ) ; SleeComponent component = null ; if ( componentID instanceof EventTypeID ) { component = componentRepositoryImpl . getComponentByID ( ( EventTypeID ) componentID ) ; } else if ( componentID instanceof LibraryID ) { component = componentRepositoryImpl . getComponentByID ( ( LibraryID ) componentID ) ; } else if ( componentID instanceof ProfileSpecificationID ) { component = componentRepositoryImpl . getComponentByID ( ( ProfileSpecificationID ) componentID ) ; } else if ( componentID instanceof ResourceAdaptorID ) { component = componentRepositoryImpl . getComponentByID ( ( ResourceAdaptorID ) componentID ) ; } else if ( componentID instanceof ResourceAdaptorTypeID ) { component = componentRepositoryImpl . getComponentByID ( ( ResourceAdaptorTypeID ) componentID ) ; } else if ( componentID instanceof SbbID ) { component = componentRepositoryImpl . getComponentByID ( ( SbbID ) componentID ) ; } else if ( componentID instanceof ServiceID ) { component = componentRepositoryImpl . getComponentByID ( ( ServiceID ) componentID ) ; } if ( component != null ) return component . getComponentDescriptor ( ) ; else return null ; } catch ( Throwable ex ) { throw new ManagementException ( ex . getMessage ( ) , ex ) ; }


signature:
public class DeploymentMBeanImpl { /** * ( non - Javadoc )
 * @ see javax . slee . management . DeploymentMBean # getDescriptors ( javax . slee . ComponentID [ ] ) */
public ComponentDescriptor [ ] getDescriptors ( ComponentID [ ] componentIds ) throws NullPointerException , ManagementException { } }

implementation: if ( componentIds == null ) throw new NullPointerException ( "null component ids" ) ; try { ComponentDescriptor [ ] descriptors = new ComponentDescriptor [ componentIds . length ] ; for ( int i = 0 ; i < descriptors . length ; i ++ ) { descriptors [ i ] = getDescriptor ( componentIds [ i ] ) ; } return descriptors ; } catch ( ManagementException ex ) { throw ex ; } catch ( Throwable ex ) { throw new ManagementException ( ex . getMessage ( ) , ex ) ; }


signature:
public class DeploymentMBeanImpl { /** * ( non - Javadoc )
 * @ see javax . slee . management . DeploymentMBean # isInstalled ( javax . slee . management . DeployableUnitID ) */
public boolean isInstalled ( DeployableUnitID deployableUnitID ) throws NullPointerException , ManagementException { } }

implementation: if ( deployableUnitID == null ) throw new NullPointerException ( "null deployableUnitID" ) ; try { return getSleeContainer ( ) . getDeployableUnitManagement ( ) . getDeployableUnit ( deployableUnitID ) != null ; } catch ( Throwable ex ) { throw new ManagementException ( ex . getMessage ( ) , ex ) ; }


signature:
public class DeploymentMBeanImpl { /** * ( non - Javadoc )
 * @ see javax . slee . management . DeploymentMBean # isInstalled ( javax . slee . ComponentID ) */
public boolean isInstalled ( ComponentID componentID ) throws NullPointerException , ManagementException { } }

implementation: if ( componentID == null ) throw new NullPointerException ( "null componentID" ) ; try { return getSleeContainer ( ) . getComponentRepository ( ) . isInstalled ( componentID ) ; } catch ( Throwable ex ) { throw new ManagementException ( ex . getMessage ( ) , ex ) ; }


signature:
public class EventRouterStatisticsImpl { /** * / * ( non - Javadoc )
 * @ see org . mobicents . slee . core . eventrouter . stats . EventRouterStatisticsMBean # getActivitiesMapped ( ) */
public int getActivitiesMapped ( ) { } }

implementation: int result = 0 ; for ( int i = 0 ; i < getExecutors ( ) . length ; i ++ ) { result += getActivitiesMapped ( i ) ; } return result ;


signature:
public class EventRouterStatisticsImpl { /** * / * ( non - Javadoc )
 * @ see org . mobicents . slee . core . eventrouter . stats . EventRouterStatisticsMBean # getActivitiesMapped ( int ) */
public int getActivitiesMapped ( int executor ) { } }

implementation: final EventRouterExecutorStatistics executorStats = getExecutors ( ) [ executor ] . getStatistics ( ) ; return executorStats == null ? 0 : executorStats . getActivitiesMapped ( ) ;


signature:
public class EventRouterStatisticsImpl { /** * ( non - Javadoc )
 * @ see org . mobicents . slee . container . eventrouter . stats . EventRouterExecutorStatistics # getAverageEventRoutingTime ( ) */
public long getAverageEventRoutingTime ( ) { } }

implementation: long time = 0L ; long events = 0L ; for ( EventTypeID eventTypeID : eventRouter . getSleeContainer ( ) . getComponentManagement ( ) . getComponentRepository ( ) . getEventComponentIDs ( ) ) { for ( int i = 0 ; i < getExecutors ( ) . length ; i ++ ) { final EventRouterExecutorStatistics eventRouterExecutorStatistics = getEventRouterExecutorStatistics ( i ) ; if ( eventRouterExecutorStatistics != null ) { EventTypeRoutingStatistics eventTypeRoutingStatistics = eventRouterExecutorStatistics . getEventTypeRoutingStatistics ( eventTypeID ) ; if ( eventTypeRoutingStatistics != null ) { time += eventTypeRoutingStatistics . getRoutingTime ( ) ; events += eventTypeRoutingStatistics . getEventsRouted ( ) ; } } } } return time == 0L ? 0L : time / events ;


signature:
public class EventRouterStatisticsImpl { /** * ( non - Javadoc )
 * @ see org . mobicents . slee . container . eventrouter . stats . EventRouterExecutorStatistics # getAverageEventRoutingTime ( javax . slee . EventTypeID ) */
public long getAverageEventRoutingTime ( EventTypeID eventTypeID ) { } }

implementation: long time = 0L ; long events = 0L ; for ( int i = 0 ; i < getExecutors ( ) . length ; i ++ ) { final EventRouterExecutorStatistics eventRouterExecutorStatistics = getEventRouterExecutorStatistics ( i ) ; if ( eventRouterExecutorStatistics != null ) { EventTypeRoutingStatistics eventTypeRoutingStatistics = eventRouterExecutorStatistics . getEventTypeRoutingStatistics ( eventTypeID ) ; if ( eventTypeRoutingStatistics != null ) { time += eventTypeRoutingStatistics . getRoutingTime ( ) ; events += eventTypeRoutingStatistics . getEventsRouted ( ) ; } } } return time == 0L ? 0L : time / events ;


signature:
public class EventRouterStatisticsImpl { /** * ( non - Javadoc )
 * @ see org . mobicents . slee . container . eventrouter . stats . EventRouterStatistics # getAverageEventRoutingTime ( int ) */
public long getAverageEventRoutingTime ( int executor ) { } }

implementation: final EventRouterExecutorStatistics executorStats = getExecutors ( ) [ executor ] . getStatistics ( ) ; return executorStats == null ? 0 : executorStats . getAverageEventRoutingTime ( ) ;


signature:
public class EventRouterStatisticsImpl { /** * / * ( non - Javadoc )
 * @ see org . mobicents . slee . runtime . eventrouter . stats . EventRouterStatisticsMBean # getEventsRouted ( javax . slee . EventTypeID ) */
public long getEventsRouted ( EventTypeID eventTypeID ) { } }

implementation: long result = 0L ; for ( int i = 0 ; i < getExecutors ( ) . length ; i ++ ) { result += getEventsRouted ( i , eventTypeID ) ; } return result ;


signature:
public class EventRouterStatisticsImpl { /** * / * ( non - Javadoc )
 * @ see org . mobicents . slee . runtime . eventrouter . stats . EventRouterStatisticsMBean # getEventsRouted ( int , javax . slee . EventTypeID ) */
public long getEventsRouted ( int executor , EventTypeID eventTypeID ) { } }

implementation: final EventRouterExecutorStatistics executorStats = getExecutors ( ) [ executor ] . getStatistics ( ) ; return executorStats == null ? 0 : executorStats . getEventsRouted ( eventTypeID ) ;


signature:
public class EventRouterStatisticsImpl { /** * / * ( non - Javadoc )
 * @ see org . mobicents . slee . runtime . eventrouter . stats . EventRouterStatisticsMBean # getExecutedTasks ( ) */
public long getExecutedTasks ( ) { } }

implementation: long result = 0L ; for ( int i = 0 ; i < getExecutors ( ) . length ; i ++ ) { result += getExecutedTasks ( i ) ; } return result ;


signature:
public class EventRouterStatisticsImpl { /** * / * ( non - Javadoc )
 * @ see org . mobicents . slee . runtime . eventrouter . stats . EventRouterStatisticsMBean # getExecutedTasks ( int ) */
public long getExecutedTasks ( int executor ) { } }

implementation: final EventRouterExecutorStatistics executorStats = getExecutors ( ) [ executor ] . getStatistics ( ) ; return executorStats == null ? 0 : executorStats . getExecutedTasks ( ) ;


signature:
public class EventRouterStatisticsImpl { /** * / * ( non - Javadoc )
 * @ see org . mobicents . slee . runtime . eventrouter . stats . EventRouterStatisticsMBean # getExecutingTime ( int ) */
public long getExecutingTime ( int executor ) { } }

implementation: final EventRouterExecutorStatistics executorStats = getExecutors ( ) [ executor ] . getStatistics ( ) ; return executorStats == null ? 0 : executorStats . getExecutingTime ( ) ;


signature:
public class EventRouterStatisticsImpl { /** * / * ( non - Javadoc )
 * @ see org . mobicents . slee . runtime . eventrouter . stats . EventRouterStatisticsMBean # getIdleTime ( int ) */
public long getIdleTime ( int executor ) { } }

implementation: final EventRouterExecutorStatistics executorStats = getExecutors ( ) [ executor ] . getStatistics ( ) ; return executorStats == null ? 0 : executorStats . getIdleTime ( ) ;


signature:
public class EventRouterStatisticsImpl { /** * / * ( non - Javadoc )
 * @ see org . mobicents . slee . runtime . eventrouter . stats . EventRouterStatisticsMBean # getMiscTasksExecuted ( ) */
public long getMiscTasksExecuted ( ) { } }

implementation: long result = 0L ; for ( int i = 0 ; i < getExecutors ( ) . length ; i ++ ) { result += getMiscTasksExecuted ( i ) ; } return result ;


signature:
public class EventRouterStatisticsImpl { /** * / * ( non - Javadoc )
 * @ see org . mobicents . slee . runtime . eventrouter . stats . EventRouterStatisticsMBean # getMiscTasksExecuted ( int ) */
public long getMiscTasksExecuted ( int executor ) { } }

implementation: final EventRouterExecutorStatistics executorStats = getExecutors ( ) [ executor ] . getStatistics ( ) ; return executorStats == null ? 0 : executorStats . getMiscTasksExecuted ( ) ;


signature:
public class EventRouterStatisticsImpl { /** * / * ( non - Javadoc )
 * @ see org . mobicents . slee . runtime . eventrouter . stats . EventRouterStatisticsMBean # getMiscTasksExecutingTime ( int ) */
public long getMiscTasksExecutingTime ( int executor ) { } }

implementation: final EventRouterExecutorStatistics executorStats = getExecutors ( ) [ executor ] . getStatistics ( ) ; return executorStats == null ? 0 : executorStats . getMiscTasksExecutingTime ( ) ;


signature:
public class EventRouterStatisticsImpl { /** * / * ( non - Javadoc )
 * @ see org . mobicents . slee . runtime . eventrouter . stats . EventRouterStatisticsMBean # getRoutingTime ( javax . slee . EventTypeID ) */
public long getRoutingTime ( EventTypeID eventTypeID ) { } }

implementation: long result = 0L ; for ( int i = 0 ; i < getExecutors ( ) . length ; i ++ ) { result += getRoutingTime ( i , eventTypeID ) ; } return result ;


signature:
public class EventRouterStatisticsImpl { /** * ( non - Javadoc )
 * @ see org . mobicents . slee . container . eventrouter . stats . EventRouterStatistics # getWorkingQueueSize ( int ) */
@ Override public int getWorkingQueueSize ( int executor ) { } }

implementation: final EventRouterExecutorStatistics executorStats = getExecutors ( ) [ executor ] . getStatistics ( ) ; return executorStats == null ? 0 : executorStats . getWorkingQueueSize ( ) ;


signature:
public class UsageNotificationManagerMBeanImpl { /** * Indicates if notifications are enabled for the specified parameter name
 * @ param paramName
 * @ return */
public boolean getNotificationsEnabled ( String paramName ) { } }

implementation:
Boolean areNotificationsEnabled = paramNames . get ( paramName ) ; if ( ! isSlee11 ) { if ( areNotificationsEnabled == null || areNotificationsEnabled . booleanValue ( ) ) { // considering that notifications are enabled , by default , for each
// param
return true ; } else { return false ; } } else { if ( areNotificationsEnabled != null && areNotificationsEnabled . booleanValue ( ) ) { // considering that notifications are enabled , by default , for each
// param
return true ; } else { return false ; } }


signature:
public class ServiceManagementImpl { /** * ( non - Javadoc )
 * @ see
 * javax . slee . management . ServiceManagementMBean # getState ( javax . slee . ServiceID */
public ServiceState getState ( ServiceID serviceID ) throws NullPointerException , UnrecognizedServiceException , ManagementException { } }

implementation: if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Service.getState " + serviceID ) ; } if ( serviceID == null ) throw new NullPointerException ( "Null service ID!" ) ; final ServiceComponent serviceComponent = componentRepositoryImpl . getComponentByID ( serviceID ) ; if ( serviceComponent == null ) throw new UnrecognizedServiceException ( serviceID . toString ( ) ) ; return serviceComponent . getServiceState ( ) ;


signature:
public class ServiceManagementImpl { /** * ( non - Javadoc )
 * @ see javax . slee . management . ServiceManagementMBean # getServices ( javax . slee .
 * management . ServiceState ) */
public ServiceID [ ] getServices ( ServiceState serviceState ) throws NullPointerException , ManagementException { } }

implementation: if ( serviceState == null ) throw new NullPointerException ( "Passed a null state" ) ; try { ArrayList < ServiceID > retval = new ArrayList < ServiceID > ( ) ; for ( ServiceID serviceID : componentRepositoryImpl . getServiceIDs ( ) ) { ServiceComponent service = componentRepositoryImpl . getComponentByID ( serviceID ) ; if ( service == null ) { throw new UnrecognizedServiceException ( serviceID . toString ( ) ) ; } if ( service . getServiceState ( ) . equals ( serviceState ) ) { retval . add ( serviceID ) ; } } return retval . toArray ( new ServiceID [ retval . size ( ) ] ) ; } catch ( Exception e ) { throw new ManagementException ( "Error getting services by state!" , e ) ; }


signature:
public class ServiceManagementImpl { /** * Retrieves the set of ra entity link names referenced by the service
 * componen , which do not exist
 * @ param serviceComponent */
public Set < String > getReferencedRAEntityLinksWhichNotExists ( ServiceComponent serviceComponent ) { } }

implementation: Set < String > result = new HashSet < String > ( ) ; Set < String > raLinkNames = sleeContainer . getResourceManagement ( ) . getLinkNamesSet ( ) ; for ( String raLink : serviceComponent . getResourceAdaptorEntityLinks ( componentRepositoryImpl ) ) { if ( ! raLinkNames . contains ( raLink ) ) { result . add ( raLink ) ; } } return result ;


signature:
public class ServiceManagementImpl { /** * ( non - Javadoc )
 * @ see org . mobicents . slee . container . management . ServiceManagement # activate ( javax . slee . ServiceID ) */
public void activate ( ServiceID serviceID ) throws NullPointerException , UnrecognizedServiceException , InvalidStateException , InvalidLinkNameBindingStateException { } }

implementation: activate ( serviceID , null ) ;


signature:
public class ServiceManagementImpl { /** * ( non - Javadoc )
 * @ see
 * javax . slee . management . ServiceManagementMBean # activate ( javax . slee . ServiceID */
public void activate ( ServiceID [ ] serviceIDs ) throws NullPointerException , InvalidArgumentException , UnrecognizedServiceException , InvalidStateException , ManagementException { } }

implementation: if ( serviceIDs . length == 0 ) { throw new InvalidArgumentException ( "InvalidArgumentException" ) ; } for ( int i = 0 ; i < serviceIDs . length ; i ++ ) { if ( serviceIDs [ i ] == null ) { throw new InvalidArgumentException ( "InvalidArgumentException" ) ; } } for ( int i = 0 ; i < serviceIDs . length - 1 ; i ++ ) for ( int j = i + 1 ; j < serviceIDs . length ; j ++ ) if ( serviceIDs [ i ] == ( serviceIDs [ j ] ) ) { throw new InvalidArgumentException ( "InvalidArgumentException" ) ; } for ( int i = 0 ; i < serviceIDs . length ; i ++ ) { activate ( serviceIDs [ i ] ) ; }


signature:
public class ServiceManagementImpl { /** * ( non - Javadoc )
 * @ see
 * javax . slee . management . ServiceManagementMBean # deactivate ( javax . slee . ServiceID */
public void deactivate ( final ServiceID serviceID ) throws NullPointerException , UnrecognizedServiceException , InvalidStateException , ManagementException { } }

implementation:
if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Deactivating " + serviceID ) ; } if ( serviceID == null ) throw new NullPointerException ( "NullPointerException" ) ; synchronized ( sleeContainer . getManagementMonitor ( ) ) { final ServiceComponent serviceComponent = componentRepositoryImpl . getComponentByID ( serviceID ) ; if ( serviceComponent == null ) throw new UnrecognizedServiceException ( "Service not found for " + serviceID ) ; if ( logger . isDebugEnabled ( ) ) logger . debug ( serviceID . toString ( ) + " state = " + serviceComponent . getServiceState ( ) ) ; final SleeState sleeState = sleeContainer . getSleeState ( ) ; if ( serviceComponent . getServiceState ( ) == ServiceState . STOPPING ) throw new InvalidStateException ( "Service is STOPPING" ) ; if ( serviceComponent . getServiceState ( ) == ServiceState . INACTIVE ) { throw new InvalidStateException ( "Service already deactivated" ) ; } serviceComponent . setServiceState ( ServiceState . STOPPING ) ; // warn ra entities about state change
final ResourceManagement resourceManagement = sleeContainer . getResourceManagement ( ) ; for ( String raEntityName : resourceManagement . getResourceAdaptorEntities ( ) ) { resourceManagement . getResourceAdaptorEntity ( raEntityName ) . serviceStopping ( serviceID ) ; } // only end activity if slee was running and is single node in
// cluster , otherwise not needed ( cluster ) or
// slee already did it
if ( sleeContainer . getCluster ( ) . isSingleMember ( ) && ( sleeState == SleeState . RUNNING || sleeState == SleeState . STOPPING ) ) { if ( sleeState == SleeState . RUNNING ) { endServiceActivity ( serviceID ) ; } else { // chance of concurrency with activity end
synchronized ( serviceComponent ) { if ( serviceComponent . isActivityEnded ( ) ) { // activity already ended but service was not in stopping state
completeServiceStop ( serviceComponent ) ; } } } } else { serviceComponent . setServiceState ( ServiceState . INACTIVE ) ; // warn ra entities about state change
for ( String raEntityName : resourceManagement . getResourceAdaptorEntities ( ) ) { resourceManagement . getResourceAdaptorEntity ( raEntityName ) . serviceInactive ( serviceID ) ; } logger . info ( "Deactivated " + serviceID ) ; } // remove runtime cache related with this service
for ( EventEntryDescriptor mEventEntry : serviceComponent . getRootSbbComponent ( ) . getDescriptor ( ) . getEventEntries ( ) . values ( ) ) { if ( mEventEntry . isInitialEvent ( ) ) { EventTypeComponent eventTypeComponent = componentRepositoryImpl . getComponentByID ( mEventEntry . getEventReference ( ) ) ; eventTypeComponent . deactivatedServiceWhichDefineEventAsInitial ( serviceComponent ) ; } } }


signature:
public class ServiceManagementImpl { /** * ( non - Javadoc )
 * @ see
 * javax . slee . management . ServiceManagementMBean # deactivate ( javax . slee . ServiceID */
public void deactivate ( ServiceID [ ] arg0 ) throws NullPointerException , InvalidArgumentException , UnrecognizedServiceException , InvalidStateException , ManagementException { } }

implementation: if ( arg0 . length == 0 ) { throw new InvalidArgumentException ( "InvalidArgumentException" ) ; } for ( int i = 0 ; i < arg0 . length ; i ++ ) { if ( arg0 [ i ] == null ) { throw new InvalidArgumentException ( "InvalidArgumentException" ) ; } } for ( int i = 0 ; i < arg0 . length - 1 ; i ++ ) for ( int j = i + 1 ; j < arg0 . length ; j ++ ) if ( arg0 [ i ] == ( arg0 [ j ] ) ) { throw new InvalidArgumentException ( "InvalidArgumentException" ) ; } try { for ( int i = 0 ; i < arg0 . length ; i ++ ) { deactivate ( arg0 [ i ] ) ; } } catch ( InvalidStateException ise ) { throw ise ; } catch ( Exception ex ) { throw new ManagementException ( "system exception starting service" , ex ) ; }


signature:
public class ServiceManagementImpl { /** * ( non - Javadoc )
 * @ see
 * javax . slee . management . ServiceManagementMBean # deactivateAndActivate ( javax
 * . slee . ServiceID , javax . slee . ServiceID ) */
public void deactivateAndActivate ( ServiceID arg0 , ServiceID arg1 ) throws NullPointerException , InvalidArgumentException , UnrecognizedServiceException , InvalidStateException , ManagementException { } }

implementation: if ( logger . isInfoEnabled ( ) ) logger . debug ( "deactivateAndActivate (" + arg0 + " , " + arg1 ) ; if ( arg0 == arg1 ) throw new InvalidArgumentException ( "Activating and deactivating the same service!" ) ; if ( ( arg0 == null ) || ( arg1 == null ) ) throw new InvalidArgumentException ( "The service(s) are null!" ) ; try { ServiceComponent serviceToDeactivate = componentRepositoryImpl . getComponentByID ( arg0 ) ; if ( serviceToDeactivate == null ) { throw new UnrecognizedServiceException ( ) ; } else { activate ( arg1 , arg0 ) ; deactivate ( arg0 ) ; } } catch ( InvalidStateException ise ) { throw ise ; } catch ( Exception ex ) { throw new ManagementException ( "exception in deactivating/activating service ! " ) ; }


signature:
public class ServiceManagementImpl { /** * ( non - Javadoc )
 * @ see
 * javax . slee . management . ServiceManagementMBean # deactivateAndActivate ( javax
 * . slee . ServiceID [ ] , javax . slee . ServiceID [ ] ) */
public void deactivateAndActivate ( ServiceID [ ] arg0 , ServiceID [ ] arg1 ) throws NullPointerException , InvalidArgumentException , UnrecognizedServiceException , InvalidStateException , ManagementException { } }

implementation: if ( arg0 . length == 0 || arg1 . length == 0 ) throw new InvalidArgumentException ( "The parameter array(s) must not be empty." ) ; if ( arg0 . length != arg1 . length ) throw new InvalidArgumentException ( "The parameter arrays must have same lenght." ) ; Set < ServiceID > services = new HashSet < ServiceID > ( ) ; for ( int i = 0 ; i < arg0 . length - 1 ; i ++ ) { if ( arg0 [ i ] == null || arg1 [ i ] == null ) { throw new InvalidArgumentException ( "Null entry found in parameter array(s)." ) ; } if ( ! services . add ( arg0 [ i ] ) || ! services . add ( arg1 [ i ] ) ) { throw new InvalidArgumentException ( "Repeated entry found in parameter array(s)." ) ; } } try { for ( int i = 0 ; i < arg0 . length ; i ++ ) { deactivateAndActivate ( arg0 [ i ] , arg1 [ i ] ) ; } } catch ( InvalidStateException ise ) { throw ise ; } catch ( ManagementException me ) { throw me ; }


signature:
public class ServiceManagementImpl { /** * ( non - Javadoc )
 * @ see
 * javax . slee . management . ServiceManagementMBean # getServiceUsageMBean ( javax
 * . slee . ServiceID ) */
public ObjectName getServiceUsageMBean ( ServiceID serviceID ) throws NullPointerException , UnrecognizedServiceException , ManagementException { } }

implementation: if ( logger . isDebugEnabled ( ) ) { logger . debug ( "getServiceUsageMBean " + serviceID ) ; } final ServiceComponent serviceComponent = componentRepositoryImpl . getComponentByID ( serviceID ) ; if ( serviceComponent != null ) { return serviceComponent . getServiceUsageMBean ( ) . getObjectName ( ) ; } else { throw new UnrecognizedServiceException ( serviceID . toString ( ) ) ; }


signature:
public class ServiceManagementImpl { /** * Install a service into SLEE
 * @ param serviceComponent
 * @ throws Exception */
public void installService ( final ServiceComponent serviceComponent ) throws Exception { } }

implementation:
if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Installing Service " + serviceComponent ) ; } // creates and registers the service usage mbean
final ServiceUsageMBean serviceUsageMBean = sleeContainer . getUsageParametersManagement ( ) . newServiceUsageMBean ( serviceComponent ) ; // add rollback action to remove state created
TransactionalAction action = new TransactionalAction ( ) { public void execute ( ) { try { serviceUsageMBean . remove ( ) ; } catch ( Throwable e ) { logger . error ( e . getMessage ( ) , e ) ; } } } ; final TransactionContext txContext = sleeContainer . getTransactionManager ( ) . getTransactionContext ( ) ; txContext . getAfterRollbackActions ( ) . add ( action ) ; // register notification sources for all sbbs
final TraceManagement traceMBeanImpl = sleeContainer . getTraceManagement ( ) ; for ( final SbbID sbbID : serviceComponent . getSbbIDs ( componentRepositoryImpl ) ) { // Tracer must be available for both 1.1 and 1.0 sbb components
// SbbComponent sbbComponent =
// componentRepositoryImpl . getComponentByID ( sbbID ) ;
// if ( sbbComponent . isSlee11 ( ) )
{ traceMBeanImpl . registerNotificationSource ( new SbbNotification ( serviceComponent . getServiceID ( ) , sbbID ) ) ; // add rollback action to remove state created
action = new TransactionalAction ( ) { public void execute ( ) { // remove notification sources for all sbbs
traceMBeanImpl . deregisterNotificationSource ( new SbbNotification ( serviceComponent . getServiceID ( ) , sbbID ) ) ; } } ; txContext . getAfterRollbackActions ( ) . add ( action ) ; } // this might be used not only by 1.1 sbbs . . .
NotificationSourceWrapperImpl sbbMNotificationSource = new NotificationSourceWrapperImpl ( new SbbNotification ( serviceComponent . getServiceID ( ) , sbbID ) ) ; serviceComponent . getAlarmNotificationSources ( ) . putIfAbsent ( sbbID , sbbMNotificationSource ) ; } sleeContainer . getSbbManagement ( ) . serviceInstall ( serviceComponent ) ;