Input: Updates the ra configuration . [CODESPLIT] public void raConfigurationUpdate ( ConfigProperties properties ) throws InvalidConfigurationException { if ( doTraceLogs ) { logger . trace ( "raConfigurationUpdate( properties = " + properties + " )" ) ; } verifyConfigProperties ( properties ) ; object . raConfigurationUpdate ( configProperties ) ; }


Input: Merges the current properties values with the new ones and uses the ra to verify the configuration [CODESPLIT] private void verifyConfigProperties ( ConfigProperties newProperties ) throws InvalidConfigurationException { if ( doTraceLogs ) { logger . trace ( "verifyConfigProperties( newProperties = " + newProperties + " )" ) ; } // merge properties for ( ConfigProperties . Property configProperty : configProperties . getProperties ( ) ) { if ( newProperties . getProperty ( configProperty . getName ( ) ) == null ) { newProperties . addProperty ( configProperty ) ; } } // validate result for ( ConfigProperties . Property entityProperty : newProperties . getProperties ( ) ) { if ( entityProperty . getValue ( ) == null ) { throw new InvalidConfigurationException ( "the property " + entityProperty . getName ( ) + " has null value" ) ; } } // validate in ra object object . raVerifyConfiguration ( newProperties ) ; // ok, switch config configProperties = newProperties ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public void raActive ( ) throws InvalidStateException { if ( doTraceLogs ) { logger . trace ( "raActive()" ) ; } if ( state == ResourceAdaptorObjectState . INACTIVE ) { state = ResourceAdaptorObjectState . ACTIVE ; object . raActive ( ) ; } else { throw new InvalidStateException ( "ra object is in state " + state ) ; } }


Input: Requests the stopping of the ra object . If the operation succeeds the ra will transition to STOPPING state . [CODESPLIT] public void raStopping ( ) throws InvalidStateException { if ( doTraceLogs ) { logger . trace ( "raStopping()" ) ; } if ( state == ResourceAdaptorObjectState . ACTIVE ) { state = ResourceAdaptorObjectState . STOPPING ; object . raStopping ( ) ; } else { throw new InvalidStateException ( "ra object is in state " + state ) ; } }


Input: Requests the deactivation of the ra object . If the operation succeeds the ra will transition to INACTIVE state . [CODESPLIT] public void raInactive ( ) throws InvalidStateException { if ( doTraceLogs ) { logger . trace ( "raInactive()" ) ; } if ( state == ResourceAdaptorObjectState . STOPPING ) { state = ResourceAdaptorObjectState . INACTIVE ; object . raInactive ( ) ; } else { throw new InvalidStateException ( "ra object is in state " + state ) ; } }


Input: Unconfigures the ra object [CODESPLIT] public void raUnconfigure ( ) throws InvalidStateException { if ( doTraceLogs ) { logger . trace ( "raUnconfigure()" ) ; } if ( state == ResourceAdaptorObjectState . INACTIVE ) { state = ResourceAdaptorObjectState . UNCONFIGURED ; object . raUnconfigure ( ) ; } else { throw new InvalidStateException ( "ra object is in state " + state ) ; } }


Input: Unsets the context of the ra object . [CODESPLIT] public void unsetResourceAdaptorContext ( ) throws InvalidStateException { if ( doTraceLogs ) { logger . trace ( "unsetResourceAdaptorContext()" ) ; } if ( state == ResourceAdaptorObjectState . UNCONFIGURED ) { object . unsetResourceAdaptorContext ( ) ; state = null ; } else { throw new InvalidStateException ( "ra object is in state " + state ) ; } }


Input: Unsets the ft context of the ra object . [CODESPLIT] @ SuppressWarnings ( "unchecked" ) public void unsetFaultTolerantResourceAdaptorContext ( ) throws IllegalArgumentException { if ( doTraceLogs ) { logger . trace ( "unsetFaultTolerantResourceAdaptorContext()" ) ; } if ( isFaultTolerant ( ) ) { ( ( FaultTolerantResourceAdaptor < Serializable , Serializable > ) this . object ) . unsetFaultTolerantResourceAdaptorContext ( ) ; } else { throw new IllegalArgumentException ( "RA Object is not fault tolerant!" ) ; } }


Input:
Builds the profile attribute map using the cmp interface class [CODESPLIT] private void buildProfileAttributeMap ( ) throws DeploymentException { HashMap < String , ProfileAttribute > map = new HashMap < String , ProfileAttribute > ( ) ; Class < ? > cmpInterface = getProfileCmpInterfaceClass ( ) ; String attributeGetterMethodPrefix = "get" ; for ( Method method : cmpInterface . getMethods ( ) ) { if ( ! method . getDeclaringClass ( ) . equals ( Object . class ) && method . getName ( ) . startsWith ( attributeGetterMethodPrefix ) ) { String attributeName = method . getName ( ) . substring ( attributeGetterMethodPrefix . length ( ) ) ; switch ( attributeName . length ( ) ) { case 0 : throw new DeploymentException ( "the profile cmp interface class has an invalid attribute getter method name > " + method . getName ( ) ) ; case 1 : attributeName = attributeName . toLowerCase ( ) ; break ; default : attributeName = attributeName . substring ( 0 , 1 ) . toLowerCase ( ) + attributeName . substring ( 1 ) ; break ; } ProfileAttributeImpl profileAttribute = null ; try { profileAttribute = new ProfileAttributeImpl ( attributeName , method . getReturnType ( ) ) ; } catch ( Throwable e ) { throw new DeploymentException ( "Invalid profile cmp interface attribute getter method definition ( name = " + attributeName + " , type = " + method . getReturnType ( ) + " )" , e ) ; } if ( isSlee11 ( ) ) { for ( ProfileCMPFieldDescriptor cmpField : getDescriptor ( ) . getProfileCMPInterface ( ) . getCmpFields ( ) ) { if ( cmpField . getCmpFieldName ( ) . equals ( attributeName ) ) { // TODO add index hints ?
 profileAttribute . setUnique ( cmpField . isUnique ( ) ) ; } } } else { for ( ProfileIndexDescriptor profileIndex : getDescriptor ( ) . getIndexedAttributes ( ) ) { if ( profileIndex . getName ( ) . equals ( attributeName ) ) { profileAttribute . setIndex ( true ) ; profileAttribute . setUnique ( profileIndex . getUnique ( ) ) ; } } } map . put ( attributeName , profileAttribute ) ; } } profileAttributeMap = Collections . unmodifiableMap ( map ) ; }


Input: Retrieves the JAIN SLEE specs descriptor [CODESPLIT] public javax . slee . profile . ProfileSpecificationDescriptor getSpecsDescriptor ( ) { if ( specsDescriptor == null ) { final LibraryID [ ] libraryIDs = descriptor . getLibraryRefs ( ) . toArray ( new LibraryID [ descriptor . getLibraryRefs ( ) . size ( ) ] ) ; final ProfileSpecificationID [ ] profileSpecs = new ProfileSpecificationID [ descriptor . getProfileSpecRefs ( ) . size ( ) ] ; for ( int i = 0 ; i < profileSpecs . length ; i ++ ) { profileSpecs [ i ] = descriptor . getProfileSpecRefs ( ) . get ( i ) . getComponentID ( ) ; } specsDescriptor = new javax . slee . profile . ProfileSpecificationDescriptor ( getProfileSpecificationID ( ) , getDeployableUnit ( ) . getDeployableUnitID ( ) , getDeploymentUnitSource ( ) , libraryIDs , profileSpecs , getDescriptor ( ) . getProfileCMPInterface ( ) . getProfileCmpInterfaceName ( ) ) ; } return specsDescriptor ; }


Input: the real logic to resume the event context [CODESPLIT] private void resume ( ) { // create runnable to resume the event context Runnable runnable = new Runnable ( ) { public void run ( ) { if ( scheduledFuture == null ) { // already resumed return ; } // cancel timer task scheduledFuture . cancel ( false ) ; scheduledFuture = null ; // send events frozen to event router again, will be processed only after this one ends (this one is already being executed) for ( EventContext ec : barriedEvents ) { ec . getLocalActivityContext ( ) . getExecutorService ( ) . routeEvent ( ec ) ; } barriedEvents = null ; // remove barrier on activity event queue event . getLocalActivityContext ( ) . getEventQueueManager ( ) . removeBarrier ( transaction ) ; // remove suspension suspended = false ; // continue routing the event related with this context event . getLocalActivityContext ( ) . getCurrentEventRoutingTask ( ) . run ( ) ; } } ; // run it using the activity executor service to avoid thread concurrency event . getLocalActivityContext ( ) . getExecutorService ( ) . execute ( runnable ) ; }


Input: / * ( non - Javadoc ) [CODESPLIT] @ SuppressWarnings ( "unchecked" ) public void wonOwnership ( ClusteredCacheData clusteredCacheData ) { ra . failOver ( ( K ) clusteredCacheData . getNodeFqn ( ) . getLastElement ( ) ) ; }


Input: Retrieves a set containing all activity context handles in the factory s cache data [CODESPLIT] @ SuppressWarnings ( "unchecked" ) public Set < ActivityContextHandle > getActivityContextHandles ( ) { final Node node = getNode ( ) ; return node != null ? node . getChildrenNames ( ) : Collections . emptySet ( ) ; }


Input: / * ( non - Javadoc ) [CODESPLIT] @ Override public TimerTask newTimerTask ( TimerTaskData data ) { FaultTolerantTimerTaskDataWrapper dataWrapper = ( FaultTolerantTimerTaskDataWrapper ) data ; FaultTolerantTimerTask task = taskFactory . getTask ( dataWrapper . getWrappedData ( ) ) ; return new FaultTolerantTimerTaskWrapper ( task , dataWrapper ) ; }


Input: Compare this notification source with the specified object for order . Returns a negative integer zero or a positive integer if this object is less than equal to or greater than the specified object . <p > If <code > obj< / code > is a <code > ProfileTableNotification< / code > order is determined by comparing the encapsulated profile table name . Otherwise if <code > obj< / code > is a <code > NotificationSource< / code > ordering is determined by comparing the class name of this class with the class name of <code > obj< / code > . [CODESPLIT] public int compareTo ( Object obj ) { // can't compare with null if ( obj == null ) throw new NullPointerException ( "obj is null" ) ; if ( obj == this ) return 0 ; if ( obj instanceof ProfileTableNotification ) { // compare the profile table name ProfileTableNotification that = ( ProfileTableNotification ) obj ; return this . profileTableName . compareTo ( that . profileTableName ) ; } else { return super . compareTo ( TYPE , obj ) ; } }


Input: Create a new instance of this object and set the SbbContext This places it into the object pool . [CODESPLIT] public Object makeObject ( ) { if ( logger . isTraceEnabled ( ) ) { logger . trace ( "makeObject()" ) ; } ProfileObjectImpl profileObject = new ProfileObjectImpl ( profileTable ) ; profileObject . setProfileContext ( new ProfileContextImpl ( profileTable ) ) ; return profileObject ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public List < LibraryDescriptorImpl > parse ( InputStream inputStream ) throws DeploymentException { Object jaxbPojo = buildJAXBPojo ( inputStream ) ; List < LibraryDescriptorImpl > result = new ArrayList < LibraryDescriptorImpl > ( ) ; // Only exists in JAIN SLEE 1.1 boolean isSlee11 = true ; MLibraryJar mLibraryJar = null ; if ( jaxbPojo instanceof org . mobicents . slee . container . component . deployment . jaxb . slee11 . library . LibraryJar ) { mLibraryJar = new MLibraryJar ( ( org . mobicents . slee . container . component . deployment . jaxb . slee11 . library . LibraryJar ) jaxbPojo ) ; } else { throw new SLEEException ( "unexpected class of jaxb pojo built: " + ( jaxbPojo != null ? jaxbPojo . getClass ( ) : null ) ) ; } MSecurityPermissions securityPermissions = mLibraryJar . getSecurityPermissions ( ) ; for ( MLibrary mLibrary : mLibraryJar . getLibrary ( ) ) { result . add ( new LibraryDescriptorImpl ( mLibrary , securityPermissions , isSlee11 ) ) ; } return result ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public ProfileTableUsageMBean newProfileTableUsageMBean ( String profileTableName , ProfileSpecificationComponent component ) throws NotCompliantMBeanException , MalformedObjectNameException , NullPointerException { return new ProfileTableUsageMBeanImpl ( profileTableName , component , sleeContainer ) ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public ResourceUsageMBean newResourceUsageMBean ( String entityName , ResourceAdaptorComponent component ) throws NotCompliantMBeanException , MalformedObjectNameException , NullPointerException { return new ResourceUsageMBeanImpl ( entityName , component , sleeContainer ) ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public ServiceUsageMBean newServiceUsageMBean ( ServiceComponent component ) throws NotCompliantMBeanException , MalformedObjectNameException , NullPointerException { return new ServiceUsageMBeanImpl ( component , sleeContainer ) ; }


Input: Removes the mbean [CODESPLIT] public void remove ( ) { Logger logger = getLogger ( ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Closing " + toString ( ) ) ; } final MBeanServer mbeanServer = sleeContainer . getMBeanServer ( ) ; try { mbeanServer . unregisterMBean ( getObjectName ( ) ) ; } catch ( Exception e ) { logger . error ( "failed to remove " + toString ( ) , e ) ; } // remove all usage param if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Removing all named usage parameters of " + toString ( ) ) ; } for ( String name : usageMBeans . keySet ( ) ) { try { _removeUsageParameterSet ( name , false ) ; } catch ( Throwable e ) { logger . error ( e . getMessage ( ) , e ) ; } } // also remove the default try { removeUsageParameterSet ( ) ; } catch ( Throwable e ) { logger . error ( e . getMessage ( ) , e ) ; } }


Input: Creates the usage param ( and its mbean ) for the specified name [CODESPLIT] public void createUsageParameterSet ( String paramSetName ) throws NullPointerException , InvalidArgumentException , UsageParameterSetNameAlreadyExistsException , ManagementException { if ( paramSetName == null ) throw new NullPointerException ( "usage param set is null" ) ; if ( paramSetName . length ( ) == 0 ) throw new InvalidArgumentException ( "The lenght of the Usage Parameter Set Name is zero!" ) ; if ( ! isValidUsageParameterName ( paramSetName ) ) throw new InvalidArgumentException ( "The lenght of the Usage Parameter Set Name is zero!" ) ; _createUsageParameterSet ( paramSetName ) ; }


Input: Retrieves the object name for the usage param mbean with the specified name [CODESPLIT] public ObjectName getUsageMBean ( String paramSetName ) throws NullPointerException , UnrecognizedUsageParameterSetNameException , ManagementException { if ( paramSetName == null ) throw new NullPointerException ( "Sbb usage param set is null" ) ; return _getUsageMBean ( paramSetName ) ; }


Input: Removes the usage param ( and its mbean ) for the specified name [CODESPLIT] public void removeUsageParameterSet ( String paramSetName ) throws NullPointerException , UnrecognizedUsageParameterSetNameException , ManagementException { if ( paramSetName == null ) throw new NullPointerException ( "usage param set is null" ) ; //FIXME: should we recreate beans here as well ? _removeUsageParameterSet ( paramSetName , true ) ; }


Input: Convenience method to retrieve the { @link AbstractUsageParameterSet } for the specified param set name . [CODESPLIT] public AbstractUsageParameterSet getInstalledUsageParameterSet ( String name ) { if ( name == null ) { return getDefaultInstalledUsageParameterSet ( ) ; } else { UsageMBeanImpl usageMBean = usageMBeans . get ( name ) ; if ( usageMBean == null ) { return null ; } else { return usageMBean . getUsageParameter ( ) ; } } }


Input: / * ( non - Javadoc ) [CODESPLIT] public List < ResourceAdaptorDescriptorImpl > parse ( InputStream inputStream ) throws DeploymentException { Object jaxbPojo = buildJAXBPojo ( inputStream ) ; List < ResourceAdaptorDescriptorImpl > result = new ArrayList < ResourceAdaptorDescriptorImpl > ( ) ; boolean isSlee11 = false ; MResourceAdaptorJar mResourceAdaptorJar = null ; if ( jaxbPojo instanceof org . mobicents . slee . container . component . deployment . jaxb . slee . ra . ResourceAdaptorJar ) { mResourceAdaptorJar = new MResourceAdaptorJar ( ( org . mobicents . slee . container . component . deployment . jaxb . slee . ra . ResourceAdaptorJar ) jaxbPojo ) ; } else if ( jaxbPojo instanceof org . mobicents . slee . container . component . deployment . jaxb . slee11 . ra . ResourceAdaptorJar ) { mResourceAdaptorJar = new MResourceAdaptorJar ( ( org . mobicents . slee . container . component . deployment . jaxb . slee11 . ra . ResourceAdaptorJar ) jaxbPojo ) ; isSlee11 = true ; } else { throw new SLEEException ( "unexpected class of jaxb pojo built: " + ( jaxbPojo != null ? jaxbPojo . getClass ( ) : null ) ) ; } MSecurityPermissions securityPermissions = mResourceAdaptorJar . getSecurityPermissions ( ) ; for ( MResourceAdaptor mResourceAdaptor : mResourceAdaptorJar . getResourceAdaptor ( ) ) { result . add ( new ResourceAdaptorDescriptorImpl ( mResourceAdaptor , securityPermissions , isSlee11 ) ) ; } return result ; }


Input:
Decorate the abstract Class [CODESPLIT] public boolean decorateAbstractClass ( ) throws DeploymentException { ClassPool pool = component . getClassPool ( ) ; ProfileAbstractClassDescriptor abstractClass = component . getDescriptor ( ) . getProfileAbstractClass ( ) ; if ( abstractClass == null ) { return false ; } String abstractClassName = abstractClass . getProfileAbstractClassName ( ) ; try { ctClass = pool . get ( abstractClassName ) ; } catch ( NotFoundException nfe ) { throw new DeploymentException ( "Could not find Abstract Class: " + abstractClassName , nfe ) ; } decorateClassJNDIAddToEnvironmentCalls ( ) ; if ( isAbstractClassDecorated ) { try { String deployDir = component . getDeploymentDir ( ) . getAbsolutePath ( ) ; ctClass . writeFile ( deployDir ) ; ctClass . detach ( ) ; // the file on disk is now in sync with the latest in-memory version
 if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Modified Abstract Class " + ctClass . getName ( ) + " generated in the following path " + deployDir ) ; } } catch ( Throwable e ) { throw new SLEEException ( e . getMessage ( ) , e ) ; } finally { ctClass . defrost ( ) ; } return true ; } else { return false ; } }


Input: / * ( non - Javadoc ) [CODESPLIT] public boolean create ( ) { ConcurrentHashMap < String , UsageParamSetLocalData > notificationSourceUsageParamSets = notificationSourceUsageParamSetsMap . get ( notificationSource ) ; if ( notificationSourceUsageParamSets == null ) { ConcurrentHashMap < String , UsageParamSetLocalData > newNotificationSourceUsageParamSets = new ConcurrentHashMap < String , UsageParamSetLocalData > ( ) ; notificationSourceUsageParamSets = notificationSourceUsageParamSetsMap . putIfAbsent ( notificationSource , newNotificationSourceUsageParamSets ) ; if ( notificationSourceUsageParamSets == null ) { notificationSourceUsageParamSets = newNotificationSourceUsageParamSets ; } } if ( ! notificationSourceUsageParamSets . containsKey ( usageParameterSetName ) ) { return notificationSourceUsageParamSets . putIfAbsent ( usageParameterSetName , new UsageParamSetLocalData ( usageParameterSetName ) ) == null ; } else { return false ; } }


Input: / * ( non - Javadoc ) [CODESPLIT] public UsageParameter getParameter ( String parameterName ) { Map < String , UsageParamSetLocalData > notificationSourceUsageParamSets = notificationSourceUsageParamSetsMap . get ( notificationSource ) ; if ( notificationSourceUsageParamSets != null ) { UsageParamSetLocalData data = notificationSourceUsageParamSets . get ( usageParameterSetName ) ; if ( data != null ) { return data . getUsageParam ( parameterName ) ; } else { return null ; } } else { return null ; } }


Input: / * ( non - Javadoc ) [CODESPLIT] public Collection < String > getParameterNames ( ) { Map < String , UsageParamSetLocalData > notificationSourceUsageParamSets = notificationSourceUsageParamSetsMap . get ( notificationSource ) ; if ( notificationSourceUsageParamSets != null ) { UsageParamSetLocalData data = notificationSourceUsageParamSets . get ( usageParameterSetName ) ; if ( data != null ) { return data . getParameterNames ( ) ; } else { throw new IllegalStateException ( "Usage param set not found ( notification source = " + notificationSource + " , usage param set name = " + usageParameterSetName + " ) " ) ; } } else { throw new IllegalStateException ( "Notification source usage param sets not found ( notification source = " + notificationSource + " ) " ) ; } }


Input: / * ( non - Javadoc ) [CODESPLIT] public boolean remove ( ) { final Map < String , UsageParamSetLocalData > notificationSourceUsageParamSets = notificationSourceUsageParamSetsMap . get ( notificationSource ) ; if ( notificationSourceUsageParamSets != null ) { return notificationSourceUsageParamSets . remove ( usageParameterSetName ) != null ; } else { return false ; } }


Input: / * ( non - Javadoc ) [CODESPLIT] public void setParameter ( String parameterName , UsageParameter usageParameter ) { final Map < String , UsageParamSetLocalData > notificationSourceUsageParamSets = notificationSourceUsageParamSetsMap . get ( notificationSource ) ; if ( notificationSourceUsageParamSets != null ) { UsageParamSetLocalData data = notificationSourceUsageParamSets . get ( usageParameterSetName ) ; if ( data != null ) { data . setUsageParam ( parameterName , usageParameter ) ; } else { throw new IllegalStateException ( "Usage param set not found ( notification source = " + notificationSource + " , usage param set name = " + usageParameterSetName + " ) " ) ; } } else { throw new IllegalStateException ( "Notification source usage param sets not found ( notification source = " + notificationSource + " ) " ) ; } }


Input: Retrieves the { [CODESPLIT] public static ChildRelation getChildRelation ( SbbEntity sbbEntity , String childRelationMethodName ) { if ( sbbEntity . getSbbObject ( ) . getState ( ) != SbbObjectState . READY ) throw new IllegalStateException ( "Could not invoke getChildRelation Method, Sbb Object is not in the READY state!" ) ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( "ChildRelation Interceptor:" + childRelationMethodName ) ; } return sbbEntity . getChildRelation ( childRelationMethodName ) ; }


Input: The logic to fire an event from an SLEE 1 . 0 Sbb [CODESPLIT] public static void fireEvent ( SbbEntity sbbEntity , EventTypeID eventTypeID , Object eventObject , ActivityContextInterface aci , Address address ) { fireEvent ( sbbEntity , eventTypeID , eventObject , aci , address , null ) ; }


Input: The logic to fire an event from an SLEE 1 . 1 Sbb [CODESPLIT] public static void fireEvent ( SbbEntity sbbEntity , EventTypeID eventTypeID , Object eventObject , ActivityContextInterface aci , Address address , ServiceID serviceID ) { if ( sleeContainer . getCongestionControl ( ) . refuseFireEvent ( ) ) { throw new SLEEException ( "congestion control refused event" ) ; } // JAIN SLEE (TM) specs - Section 8.4.1 // The SBB object must have an assigned SBB entity when it invokes this // method. // Otherwise, this method throws a java.lang.IllegalStateException. if ( sbbEntity == null || sbbEntity . getSbbObject ( ) == null || sbbEntity . getSbbObject ( ) . getState ( ) != SbbObjectState . READY ) throw new IllegalStateException ( "SbbObject not assigned!" ) ; // JAIN SLEE (TM) specs - Section 8.4.1 // The event ... cannot be null. If ... argument is null, the fire // event method throws a java.lang.NullPointerException. if ( eventObject == null ) throw new NullPointerException ( "JAIN SLEE (TM) specs - Section 8.4.1: The event ... cannot be null. If ... argument is null, the fire event method throws a java.lang.NullPointerException." ) ; // JAIN SLEE (TM) specs - Section 8.4.1 // The activity ... cannot be null. If ... argument is null, the fire // event method throws a java.lang.NullPointerException. if ( aci == null ) throw new NullPointerException ( "JAIN SLEE (TM) specs - Section 8.4.1: The activity ... cannot be null. If ... argument is null, the fire event method throws a java.lang.NullPointerException." ) ; // JAIN SLEE (TM) specs - Section 8.4.1 // It is a mandatory transactional method (see Section 9.6.1). final SleeTransactionManager txManager = sleeContainer . getTransactionManager ( ) ; txManager . mandateTransaction ( ) ; // rebuild the ac from the aci in the 2nd argument of the invoked // method, check it's state ActivityContext ac = ( ( org . mobicents . slee . container . activity . ActivityContextInterface ) aci ) . getActivityContext ( ) ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( "invoke(): firing event on " + ac ) ; } // exception not in specs by mandated by // tests/activities/activitycontext/Test560Test.xml , it's preferable to // do double check on here than have the aci fire method throwing it and // the ra slee endpoint having to translate it to activity ending // exception, it is not common to have custom event firing in sbbs if ( ac . isEnding ( ) ) { throw new IllegalStateException ( "activity context " + ac . getActivityContextHandle ( ) + " is ending" ) ; } final EventRoutingTransactionData transactionData = txManager . getTransactionContext ( ) . getEventRoutingTransactionData ( ) ; if ( transactionData != null ) { final EventContext eventBeingDelivered = transactionData . getEventBeingDelivered ( ) ; if ( eventBeingDelivered != null && eventBeingDelivered . getEvent ( ) == eventObject ) { // there is an event being delivered by this tx and it matches the event being fired, lets copy the ref handler // fire the event ac . fireEvent ( eventTypeID , eventObject , ( Address ) address , serviceID , eventBeingDelivered ) ; return ; } } // seems it is not a refire ac . fireEvent ( eventTypeID , eventObject , ( Address ) address , serviceID , null , null , null ) ; }


Input: Retrieves a profile given the cmp method name and profile id [CODESPLIT] public static Object getProfileCMPMethod ( SbbEntity sbbEntity , String getProfileCMPMethodName , ProfileID profileID ) throws UnrecognizedProfileTableNameException , UnrecognizedProfileNameException { GetProfileCMPMethodDescriptor mGetProfileCMPMethod = sbbEntity . getSbbComponent ( ) . getDescriptor ( ) . getGetProfileCMPMethods ( ) . get ( getProfileCMPMethodName ) ; if ( mGetProfileCMPMethod == null ) throw new AbstractMethodError ( "Profile CMP Method not found" ) ; if ( sbbEntity . getSbbObject ( ) . getState ( ) != SbbObjectState . READY ) { throw new IllegalStateException ( "Could not invoke getProfileCMP Method, Sbb Object is not in the READY state!" ) ; } ProfileManagement sleeProfileManager = sleeContainer . getSleeProfileTableManager ( ) ; ProfileTable profileTable = sleeProfileManager . getProfileTable ( profileID . getProfileTableName ( ) ) ; if ( ! profileTable . profileExists ( profileID . getProfileName ( ) ) ) { throw new UnrecognizedProfileNameException ( profileID . toString ( ) ) ; } return profileTable . getProfile ( profileID . getProfileName ( ) ) . getProfileCmpSlee10Wrapper ( ) ; }


Input: SBB USAGE PARAMS [CODESPLIT] public static Object getSbbUsageParameterSet ( SbbEntity sbbEntity , String name ) throws UnrecognizedUsageParameterSetNameException { if ( logger . isTraceEnabled ( ) ) { logger . trace ( "getSbbUsageParameterSet(): serviceId = " + sbbEntity . getSbbEntityId ( ) . getServiceID ( ) + " , sbbID = " + sbbEntity . getSbbId ( ) + " , name = " + name ) ; } return getServiceUsageMBeanImpl ( sbbEntity . getSbbEntityId ( ) . getServiceID ( ) ) . getInstalledUsageParameterSet ( sbbEntity . getSbbId ( ) , name ) ; }


Input:
/ * ( non - Javadoc ) [CODESPLIT] public NullActivityImpl createNullActivity ( NullActivityHandle nullActivityHandle , boolean mandateTransaction ) throws TransactionRequiredLocalException , FactoryException { // check mandated by SLEE TCK test CreateActivityWhileStoppingTest
 if ( sleeContainer . getSleeState ( ) != SleeState . RUNNING ) { return null ; } if ( mandateTransaction ) { sleeContainer . getTransactionManager ( ) . mandateTransaction ( ) ; } // create activity
 NullActivityImpl nullActivity = new NullActivityImpl ( nullActivityHandle ) ; // get an activity context for it
 try { sleeContainer . getActivityContextFactory ( ) . createActivityContext ( new NullActivityContextHandle ( nullActivityHandle ) , ActivityFlags . REQUEST_ACTIVITY_UNREFERENCED_CALLBACK ) ; } catch ( ActivityAlreadyExistsException e ) { throw new FactoryException ( e . getMessage ( ) , e ) ; } if ( logger . isDebugEnabled ( ) ) { logger . debug ( "NullActivityFactory.createNullActivity() Created null activity " + nullActivity ) ; } return nullActivity ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public void afterCompletion ( int status ) { TransactionContextThreadLocal . setTransactionContext ( null ) ; switch ( status ) { case Status . STATUS_COMMITTED : if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Completed commit of tx " + tx ) ; } txContext . executeAfterCommitPriorityActions ( ) ; txContext . executeAfterCommitActions ( ) ; break ; case Status . STATUS_ROLLEDBACK : if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Completed rollback of tx " + tx ) ; } txContext . executeAfterRollbackActions ( ) ; break ; default : throw new IllegalStateException ( "Unexpected transaction state " + status ) ; } txContext . cleanup ( ) ; }


Input:
Compute a convergence name for the Sbb for the given Slee event . Convergence names are used to instantiate the Sbb . I really ought to move this to SleeContainer . java [CODESPLIT] private String computeConvergenceName ( EventContext eventContext , ServiceComponent serviceComponent , SleeContainer sleeContainer ) throws Exception { final SbbComponent sbbComponent = serviceComponent . getRootSbbComponent ( ) ; final EventEntryDescriptor eventEntryDescriptor = sbbComponent . getDescriptor ( ) . getEventEntries ( ) . get ( eventContext . getEventTypeId ( ) ) ; StringBuilder buff = null ; /*
		 * An initial-event-selector-method-name element. This element is
		 * optional and is meaningful only if initial-event is true. It
		 * identifies an in itial event selector method. The SLEE invokes this
		 * optional method to d etermine if an event of the specified event type
		 * is an initial event if the SBB is a root SBB of a Service (see
		 * Section 8.5.4). Note that this method is not static. You can either
		 * used a pooled instance of the object or create a new instance of the
		 * object to run the specified method.
		 */ if ( eventEntryDescriptor . getInitialEventSelectorMethod ( ) != null ) { // IES METHOD DEFINED // invoke method InitialEventSelectorImpl selector = new InitialEventSelectorImpl ( eventContext , eventEntryDescriptor ) ; SbbObjectPool pool = sleeContainer . getSbbManagement ( ) . getObjectPool ( serviceComponent . getServiceID ( ) , sbbComponent . getSbbID ( ) ) ; SbbObject sbbObject = pool . borrowObject ( ) ; Object [ ] args = new Object [ ] { selector } ; ClassLoader oldCl = Thread . currentThread ( ) . getContextClassLoader ( ) ; final JndiManagement jndiManagement = sleeContainer . getJndiManagement ( ) ; jndiManagement . pushJndiContext ( sbbComponent ) ; try { Thread . currentThread ( ) . setContextClassLoader ( sbbComponent . getClassLoader ( ) ) ; final Method m = sbbComponent . getInitialEventSelectorMethods ( ) . get ( eventEntryDescriptor . getInitialEventSelectorMethod ( ) ) ; selector = ( InitialEventSelectorImpl ) m . invoke ( sbbObject . getSbbConcrete ( ) , args ) ; if ( selector == null ) { return null ; } if ( ! selector . isInitialEvent ( ) ) { return null ; } } finally { jndiManagement . popJndiContext ( ) ; Thread . currentThread ( ) . setContextClassLoader ( oldCl ) ; pool . returnObject ( sbbObject ) ; } // build convergence name // AC VARIABLE if ( selector . isActivityContextSelected ( ) ) { buff = new StringBuilder ( eventContext . getLocalActivityContext ( ) . getStringId ( ) ) ; } else { buff = new StringBuilder ( NOT_SELECTED_STRING ) ; } // ADDRESS VARIABLE if ( selector . isAddressSelected ( ) && selector . getAddress ( ) != null ) { buff . append ( selector . getAddress ( ) . toString ( ) ) ; } else { buff . append ( NOT_SELECTED ) ; } // EVENT TYPE if ( selector . isEventTypeSelected ( ) ) { buff . append ( eventContext . getEventTypeId ( ) ) ; } else { buff . append ( NOT_SELECTED ) ; } // EVENT if ( selector . isEventSelected ( ) ) { buff . append ( eventContext . getEventContextHandle ( ) . getId ( ) ) ; } else { buff . append ( NOT_SELECTED ) ; } // ADDRESS PROFILE if ( selector . isAddressProfileSelected ( ) && selector . getAddress ( ) != null ) { final Collection < ProfileID > profileIDs = getAddressProfilesMatching ( selector . getAddress ( ) , serviceComponent , sbbComponent , sleeContainer ) ; if ( profileIDs . isEmpty ( ) ) // no profiles located return null ; else { buff . append ( profileIDs . iterator ( ) . next ( ) ) ; } } else { buff . append ( NOT_SELECTED ) ; } // CUSTOM NAME if ( selector . getCustomName ( ) != null ) { buff . append ( selector . getCustomName ( ) ) ; } } else { // NO IES METHOD DEFINED // build convergence name considering the variabes selected in sbb's xml descriptor // AC VARIABLE final InitialEventSelectorVariables initialEventSelectorVariables = eventEntryDescriptor . getInitialEventSelectVariables ( ) ; if ( initialEventSelectorVariables . isActivityContextSelected ( ) ) { if ( initialEventSelectorVariables . isActivityContextOnlySelected ( ) ) { // special most used case where convergence name is only bound to activity context return new StringBuilder ( eventContext . getLocalActivityContext ( ) . getStringId ( ) ) . append ( ALL_NOT_SELECTED_EXCEPT_AC ) . toString ( ) ; } else { buff = new StringBuilder ( eventContext . getLocalActivityContext ( ) . getStringId ( ) ) ; } } else { buff = new StringBuilder ( NOT_SELECTED_STRING ) ; } // ADDRESS VARIABLE if ( initialEventSelectorVariables . isAddressSelected ( ) && eventContext . getAddress ( ) != null ) { buff . append ( eventContext . getAddress ( ) . toString ( ) ) ; } else { buff . append ( NOT_SELECTED ) ; } // EVENT TYPE if ( initialEventSelectorVariables . isEventTypeSelected ( ) ) { buff . append ( eventContext . getEventTypeId ( ) ) ; } else { buff . append ( NOT_SELECTED ) ; } // EVENT if ( initialEventSelectorVariables . isEventSelected ( ) ) { buff . append ( eventContext . getEventContextHandle ( ) . getId ( ) ) ; } else { buff . append ( NOT_SELECTED ) ; } // ADDRESS PROFILE if ( initialEventSelectorVariables . isAddressProfileSelected ( ) && eventContext . getAddress ( ) != null ) { final Collection < ProfileID > profileIDs = getAddressProfilesMatching ( eventContext . getAddress ( ) , serviceComponent , sbbComponent , sleeContainer ) ; if ( profileIDs . isEmpty ( ) ) // no profiles located return null ; else { buff . append ( profileIDs . iterator ( ) . next ( ) ) ; } } else { buff . append ( NOT_SELECTED ) ; } } return buff . toString ( ) ; }


Input: Returns the set of names representing valid full access ( read&write ) JavaBean properties declared in the given class . NOTE : the implementation is not as strict as in Introspector ( @see java . beans . Introspector#getTargetPropertyInfo () ) . It probably should be . [CODESPLIT] public static Set getCMPFields ( CtClass clazz ) { Set properties = new HashSet ( ) ; // Apply some reflection to the current class. // First get an array of all the public methods at this level Set methods = getPublicAbstractMethods ( clazz ) ; // remove non-public methods Iterator iter = methods . iterator ( ) ; // the key in the getter/setter tables will be method name HashMap getters = new HashMap ( ) ; HashMap setters = new HashMap ( ) ; // split out getters and setters; ignore the rest while ( iter . hasNext ( ) ) { CtMethod method = ( CtMethod ) iter . next ( ) ; String mname = method . getName ( ) ; // skip static methods if ( Modifier . isStatic ( method . getModifiers ( ) ) ) continue ; String property = "" ; try { // skip methods, which throw exceptions if ( method . getExceptionTypes ( ) . length > 0 ) continue ; if ( mname . startsWith ( GET_PREFIX ) ) { property = mname . substring ( GET_PREFIX . length ( ) ) ; getters . put ( property , method ) ; } else if ( mname . startsWith ( IS_PREFIX ) && method . getReturnType ( ) . equals ( CtClass . booleanType ) ) { property = mname . substring ( IS_PREFIX . length ( ) ) ; getters . put ( property , method ) ; } else if ( mname . startsWith ( SET_PREFIX ) ) { property = mname . substring ( SET_PREFIX . length ( ) ) ; setters . put ( property , method ) ; } } catch ( NotFoundException e ) { logger . warn ( e ) ; } if ( property . length ( ) == 0 || ! Character . isUpperCase ( property . charAt ( 0 ) ) || property . equals ( PUBLIC_IDENTIFIER ) ) { logger . warn ( "Method " + mname + " has a non-capitalized first character of the JavaBean property." ) ; getters . remove ( property ) ; setters . remove ( property ) ; } } // iterate over getters and find matching setters iter = getters . entrySet ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { Map . Entry entry = ( Map . Entry ) iter . next ( ) ; String property = ( String ) entry . getKey ( ) ; CtMethod getter = ( CtMethod ) entry . getValue ( ) ; // find matching setter CtMethod setter = ( CtMethod ) setters . get ( property ) ; // if setter is null, the property is not full access (read&write), therefore ignored  try { if ( setter != null ) { CtClass [ ] sparams = setter . getParameterTypes ( ) ; if ( sparams . length == 1 && sparams [ 0 ] . equals ( getter . getReturnType ( ) ) ) { properties . add ( property ) ; } } } catch ( NotFoundException e ) { logger . warn ( e ) ; } } return properties ; }


Input: Return the String allowing one to create an Object ( Integer Boolean Byte ... ) from a primitive type given in parameter . [CODESPLIT] public static String getObjectFromPrimitiveType ( String argumentType , String argument ) { if ( argumentType . equals ( "int" ) ) return "new Integer(" + argument + ")" ; if ( argumentType . equals ( "boolean" ) ) return "new Boolean(" + argument + ")" ; if ( argumentType . equals ( "byte" ) ) return "new Byte(" + argument + ")" ; if ( argumentType . equals ( "char" ) ) return "new Character(" + argument + ")" ; if ( argumentType . equals ( "double" ) ) return "new Double(" + argument + ")" ; if ( argumentType . equals ( "float" ) ) return "new Float(" + argument + ")" ; if ( argumentType . equals ( "long" ) ) return "new Long(" + argument + ")" ; if ( argumentType . equals ( "short" ) ) return "new Short(" + argument + ")" ; return null ; }


Input: Return the String allowing one to create an Object ( Integer Boolean Byte ... ) from a primitive type given in parameter . [CODESPLIT] public static String getClassFromPrimitiveType ( String argumentType ) { if ( argumentType . equals ( "int" ) ) return "java.lang.Integer" ; if ( argumentType . equals ( "boolean" ) ) return "java.lang.Boolean" ; if ( argumentType . equals ( "byte" ) ) return "java.lang.Byte" ; if ( argumentType . equals ( "char" ) ) return "java.lang.Character" ; if ( argumentType . equals ( "double" ) ) return "java.lang.Double" ; if ( argumentType . equals ( "float" ) ) return "java.lang.Float" ; if ( argumentType . equals ( "long" ) ) return "java.lang.Long" ; if ( argumentType . equals ( "short" ) ) return "java.lang.Short" ; return null ; }


Input: Return the String allowing one to create a primitive type ( Integer Boolean Byte ... ) from a primitive type given in parameter . [CODESPLIT] public static String getPrimitiveTypeFromObject ( String argumentType , String argument ) { if ( argumentType . equals ( "int" ) ) return "((Integer)" + argument + ").intValue()" ; if ( argumentType . equals ( "boolean" ) ) return "((Boolean)" + argument + ").booleanValue()" ; if ( argumentType . equals ( "byte" ) ) return "((Byte)" + argument + ").byteValue()" ; if ( argumentType . equals ( "char" ) ) return "((Character)" + argument + ").charValue()" ; if ( argumentType . equals ( "double" ) ) return "((Double)" + argument + ").doubleValue()" ; if ( argumentType . equals ( "float" ) ) return "((Float)" + argument + ").floatValue()" ; if ( argumentType . equals ( "long" ) ) return "((Long)" + argument + ").longValue()" ; if ( argumentType . equals ( "short" ) ) return "((Short)" + argument + ").shortValue()" ; return null ; }


Input: Retrieve all abstract methods from a class [CODESPLIT] public static Map getAbstractMethodsFromClass ( CtClass sbbAbstractClass ) { HashMap abstractMethods = new HashMap ( ) ; CtMethod [ ] methods = sbbAbstractClass . getDeclaredMethods ( ) ; for ( int i = 0 ; i < methods . length ; i ++ ) { if ( Modifier . isAbstract ( methods [ i ] . getModifiers ( ) ) ) { abstractMethods . put ( methods [ i ] . getName ( ) , methods [ i ] ) ; } } return abstractMethods ; }


Input: Retrieve all concrete ( non - abstract and non - native ) methods from a class Stored under key Name + signature [CODESPLIT] public static Map getConcreteMethodsFromClass ( CtClass sbbClass ) { HashMap concreteMethods = new HashMap ( ) ; CtMethod [ ] methods = sbbClass . getDeclaredMethods ( ) ; for ( int i = 0 ; i < methods . length ; i ++ ) { int mods = methods [ i ] . getModifiers ( ) ; if ( ! Modifier . isAbstract ( mods ) && ! Modifier . isNative ( mods ) ) { concreteMethods . put ( getMethodKey ( methods [ i ] ) , methods [ i ] ) ; } } return concreteMethods ; }


Input: Retrieve all concrete ( non - abstract and non - native ) methods names from a class [CODESPLIT] public static Set getConcreteMethodsNamesFromClass ( CtClass sbbClass ) { Set concreteMethods = new HashSet ( ) ; CtMethod [ ] methods = sbbClass . getDeclaredMethods ( ) ; for ( int i = 0 ; i < methods . length ; i ++ ) { int mods = methods [ i ] . getModifiers ( ) ; if ( ! Modifier . isAbstract ( mods ) && ! Modifier . isNative ( mods ) ) { concreteMethods . add ( methods [ i ] . getName ( ) ) ; } } return concreteMethods ; }


Input: Collects all methods of the interfaces implemented / extended by the specified { [CODESPLIT] public static Map getSuperClassesAbstractMethodsFromInterface ( CtClass sbbAbstractClass ) { HashMap abstractMethods = new HashMap ( ) ; CtMethod [ ] methods = null ; ArrayList < CtClass > superClasses = new ArrayList < CtClass > ( ) ; superClasses . add ( sbbAbstractClass ) ; ArrayList < CtClass > superClassesProcessed = new ArrayList < CtClass > ( ) ; try { while ( ! superClasses . isEmpty ( ) ) { // remove head CtClass ctClass = superClasses . remove ( 0 ) ; superClassesProcessed . add ( ctClass ) ; // get its methods methods = ctClass . getDeclaredMethods ( ) ; for ( CtMethod ctMethod : methods ) { abstractMethods . put ( getMethodKey ( ctMethod ) , ctMethod ) ; } // get super interfaces for ( CtClass anotherCtClass : ctClass . getInterfaces ( ) ) { if ( ! superClassesProcessed . contains ( anotherCtClass ) ) { superClasses . add ( anotherCtClass ) ; } } try { ctClass . detach ( ) ; } catch ( Exception e ) { // ignore } } } catch ( NotFoundException e ) { logger . error ( e ) ; } return abstractMethods ; }


Input: Retrieve all methods from an interface including super interfaces except the ones specified in the provided map [CODESPLIT] public static Map getInterfaceMethodsFromInterface ( CtClass interfaceClass , Map exceptMethods ) { HashMap interfaceMethods = new HashMap ( ) ; CtMethod [ ] methods = interfaceClass . getDeclaredMethods ( ) ; for ( int i = 0 ; i < methods . length ; i ++ ) { if ( exceptMethods . get ( methods [ i ] . getName ( ) ) == null ) { ConcreteClassGeneratorUtils . logger . trace ( methods [ i ] . getName ( ) ) ; interfaceMethods . put ( getMethodKey ( methods [ i ] ) , methods [ i ] ) ; } } Map temp = getSuperClassesAbstractMethodsFromInterface ( interfaceClass ) ; for ( Iterator i = temp . keySet ( ) . iterator ( ) ; i . hasNext ( ) ; ) { String key = ( String ) i . next ( ) ; if ( ! exceptMethods . containsKey ( key ) ) { interfaceMethods . put ( key , temp . get ( key ) ) ; } } return interfaceMethods ; }


Input: Creates an object pool for the specified profile table . If a transaction manager is used then and if the tx rollbacks the pool will be removed . [CODESPLIT] public void createObjectPool ( final ProfileTableImpl profileTable , final SleeTransactionManager sleeTransactionManager ) { if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Creating Pool for " + profileTable ) ; } createObjectPool ( profileTable ) ; if ( sleeTransactionManager != null ) { // add a rollback action to remove sbb object pool TransactionalAction action = new TransactionalAction ( ) { public void execute ( ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Due to tx rollback, removing pool for " + profileTable ) ; } try { removeObjectPool ( profileTable ) ; } catch ( Throwable e ) { logger . error ( "Failed to remove table's " + profileTable + " object pool" , e ) ; } } } ; sleeTransactionManager . getTransactionContext ( ) . getAfterRollbackActions ( ) . add ( action ) ; } }


Input: Removes the object pool for the specified profile table . If a transaction manager is used then the removal is only after the tx commit . [CODESPLIT] public void removeObjectPool ( final ProfileTableImpl profileTable , final SleeTransactionManager sleeTransactionManager ) { TransactionalAction action = new TransactionalAction ( ) { public void execute ( ) { if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Removing Pool for " + profileTable ) ; } removeObjectPool ( profileTable ) ; } } ; if ( sleeTransactionManager != null ) { sleeTransactionManager . getTransactionContext ( ) . getAfterCommitActions ( ) . add ( action ) ; } else { action . execute ( ) ; } }


Input: Removes the pool for the specified ids [CODESPLIT] private void removeObjectPool ( final ProfileTableImpl profileTable ) { final ProfileObjectPool objectPool = pools . remove ( profileTable . getProfileTableName ( ) ) ; if ( objectPool != null ) { try { objectPool . close ( ) ; } catch ( Exception e ) { logger . error ( "failed to close pool" , e ) ; } } if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Removed Pool for " + profileTable ) ; } }


Input: ---- MBEAN METHODS [CODESPLIT] public void register ( ) { MBeanServer mBeanServer = sleeContainer . getMBeanServer ( ) ; try { mBeanServer . registerMBean ( this , new ObjectName ( MBEAN_NAME ) ) ; } catch ( Exception e ) { logger . error ( "Failed to register" , e ) ; } }


Input: / * private class DataRemovaClusterListener implements DataRemovalListener { [CODESPLIT] @ CacheEntryRemoved public void onNodeRemovedEvent ( CacheEntryRemovedEvent event ) { if ( ! event . isOriginLocal ( ) && ! event . isPre ( ) ) { // remote node removal Fqn fqn = ( ( NodeKey ) event . getKey ( ) ) . getFqn ( ) ; if ( fqn != null ) { if ( doInfoLogs ) { logger . info ( "onNodeRemovedEvent( fqn = " + fqn + ", size = " + fqn . size ( ) + " )" ) ; } if ( fqn . get ( 0 ) . equals ( SbbEntityFactoryCacheData . SBB_ENTITY_FACTORY_FQN_NAME ) ) { // is child of sbb entity factory cache data, i.e., /sbbe int fqnSize = fqn . size ( ) ; if ( fqnSize < 3 ) { return ; } SbbEntityID sbbEntityID = null ; if ( fqnSize == 3 ) { // /sbbe/serviceid/convergenceName root sbb entity ServiceID serviceID = ( ServiceID ) fqn . get ( 1 ) ; String convergenceName = ( String ) fqn . get ( 2 ) ; sbbEntityID = new RootSbbEntityID ( serviceID , convergenceName ) ; if ( doInfoLogs ) { logger . info ( "Root sbb entity " + sbbEntityID + " was remotely removed, ensuring there is no local lock" ) ; } } else { // must end as /chd/chdRelationName/childId if ( ! fqn . get ( fqnSize - 3 ) . equals ( SbbEntityCacheData . CHILD_RELATIONs_CHILD_NODE_NAME ) ) { return ; } // let get the party started and rebuild the sbb entity id! ServiceID serviceID = ( ServiceID ) fqn . get ( 1 ) ; String convergenceName = ( String ) fqn . get ( 2 ) ; sbbEntityID = new RootSbbEntityID ( serviceID , convergenceName ) ; int i = 3 ; while ( fqnSize >= i + 3 ) { // fqn get(i) is chd, skip String childRelationName = ( String ) fqn . get ( i + 1 ) ; String childId = ( String ) fqn . get ( i + 2 ) ; sbbEntityID = new NonRootSbbEntityID ( sbbEntityID , childRelationName , childId ) ; i += 3 ; } if ( doInfoLogs ) { logger . info ( "Non root sbb entity " + sbbEntityID + " was remotely removed, ensuring there is no local lock" ) ; } } if ( locks . remove ( sbbEntityID ) != null ) { if ( doInfoLogs ) { logger . info ( "Remotely removed lock for " + sbbEntityID ) ; } } } } } }


Input: / * ( non - Javadoc ) [CODESPLIT] @ Override public void undeployed ( ) { super . undeployed ( ) ; usageNotificationManagerMBeanConcreteInterface = null ; usageNotificationManagerMBeanImplConcreteClass = null ; usageParametersConcreteClass = null ; usageParametersInterface = null ; usageParametersMBeanConcreteInterface = null ; usageParametersMBeanImplConcreteClass = null ; }


Input: { [CODESPLIT] @ Override protected void populateModel ( ModelNode operation , ModelNode model ) throws OperationFailedException { log . info ( "Populating the model" ) ; //model.setEmptyObject(); for ( AttributeDefinition ad : SleeSubsystemDefinition . ATTRIBUTES ) { ad . validateAndSet ( operation , model ) ; } }


Input: { [CODESPLIT] @ Override public void performBoottime ( OperationContext context , ModelNode operation , ModelNode model , ServiceVerificationHandler verificationHandler , List < ServiceController < ? > > newControllers ) throws OperationFailedException { // Add deployment processors here // Remove this if you don't need to hook into the deployers, or you can add as many as you like // see SubDeploymentProcessor for explanation of the phases context . addStep ( new AbstractDeploymentChainStep ( ) { public void execute ( DeploymentProcessorTarget processorTarget ) { processorTarget . addDeploymentProcessor ( SleeExtension . SUBSYSTEM_NAME , SleeDeploymentParseProcessor . PHASE , SleeDeploymentParseProcessor . PRIORITY , new SleeDeploymentParseProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( SleeExtension . SUBSYSTEM_NAME , SleeDeploymentInstallProcessor . PHASE , SleeDeploymentInstallProcessor . PRIORITY , new SleeDeploymentInstallProcessor ( ) ) ; } } , OperationContext . Stage . RUNTIME ) ; ModelNode fullModel = Resource . Tools . readModel ( context . readResource ( PathAddress . EMPTY_ADDRESS ) ) ; final ModelNode cacheConfigModel = SleeSubsystemDefinition . CACHE_CONFIG . resolveModelAttribute ( context , model ) ; final String cacheConfig = cacheConfigModel . isDefined ( ) ? cacheConfigModel . asString ( ) : null ; // Installs the msc service which builds the SleeContainer instance and its modules final ServiceTarget target = context . getServiceTarget ( ) ; final SleeContainerService sleeContainerService = new SleeContainerService ( fullModel , cacheConfig ) ; String dbConfigMBean = getPropertyString ( fullModel , "ProfileManagement" , "dbConfigMBean" , "H2DBConfig" ) ; String datasourceServiceName = getPropertyString ( fullModel , dbConfigMBean , "datasourceServiceName" , "ExampleDS" ) ; final ServiceBuilder < ? > sleeContainerServiceBuilder = target . addService ( SleeServiceNames . SLEE_CONTAINER , sleeContainerService ) . addDependency ( PathManagerService . SERVICE_NAME , PathManager . class , sleeContainerService . getPathManagerInjector ( ) ) . addDependency ( MBeanServerService . SERVICE_NAME , MBeanServer . class , sleeContainerService . getMbeanServer ( ) ) . addDependency ( TransactionManagerService . SERVICE_NAME , TransactionManager . class , sleeContainerService . getTransactionManager ( ) ) . addDependency ( DataSourceReferenceFactoryService . SERVICE_NAME_BASE . append ( datasourceServiceName ) , ManagedReferenceFactory . class , sleeContainerService . getManagedReferenceFactory ( ) ) ; newControllers . add ( sleeContainerServiceBuilder . setInitialMode ( Mode . ACTIVE ) . install ( ) ) ; }


Input: Determine whether the specified notification should be delivered to notification listeners using this notification filter . [CODESPLIT] public boolean isNotificationEnabled ( Notification notification ) { if ( ! ( notification instanceof UsageNotification ) ) return false ; UsageNotification usageNotification = ( UsageNotification ) notification ; if ( service != null ) { // SLEE 1.0 comparison return service . equals ( usageNotification . getService ( ) ) && sbb . equals ( usageNotification . getSbb ( ) ) && paramName . equals ( usageNotification . getUsageParameterName ( ) ) && ( usageNotification . getValue ( ) < lowValue || usageNotification . getValue ( ) > highValue ) ; } else { // SLEE 1.1 comparison return notificationSource . equals ( usageNotification . getNotificationSource ( ) ) && paramName . equals ( usageNotification . getUsageParameterName ( ) ) && ( usageNotification . getValue ( ) < lowValue || usageNotification . getValue ( ) > highValue ) ; } }


Input: Get an <code > AddressPresentation< / code > object from an integer value . [CODESPLIT] public static AddressPresentation fromInt ( int value ) throws IllegalArgumentException { switch ( value ) { case ADDRESS_PRESENTATION_UNDEFINED : return UNDEFINED ; case ADDRESS_PRESENTATION_ALLOWED : return ALLOWED ; case ADDRESS_PRESENTATION_RESTRICTED : return RESTRICTED ; case ADDRESS_PRESENTATION_ADDRESS_NOT_AVAILABLE : return ADDRESS_NOT_AVAILABLE ; default : throw new IllegalArgumentException ( "Invalid value: " + value ) ; } }


Input: Get an <code > AddressPresentation< / code > object from a string value . [CODESPLIT] public static AddressPresentation fromString ( String value ) throws NullPointerException , IllegalArgumentException { if ( value == null ) throw new NullPointerException ( "value is null" ) ; if ( value . equalsIgnoreCase ( UNDEFINED_STRING ) ) return UNDEFINED ; if ( value . equalsIgnoreCase ( ALLOWED_STRING ) ) return ALLOWED ; if ( value . equalsIgnoreCase ( RESTRICTED_STRING ) ) return RESTRICTED ; if ( value . equalsIgnoreCase ( ADDRESS_NOT_AVAILABLE_STRING ) ) return ADDRESS_NOT_AVAILABLE ; throw new IllegalArgumentException ( "Invalid value: " + value ) ; }


Input:
/ * ( non - Javadoc ) [CODESPLIT] public boolean clearAlarm ( String alarmID ) throws NullPointerException , ManagementException { if ( alarmID == null ) { throw new NullPointerException ( "AlarmID must not be null" ) ; } AlarmPlaceHolder aph = alarmIdToAlarm . remove ( alarmID ) ; placeHolderToNotificationSource . remove ( aph ) ; if ( aph == null ) { return false ; } else { // we clear?
 try { generateNotification ( aph , true ) ; } catch ( Exception e ) { throw new ManagementException ( "Failed to clear alarm due to: " + e ) ; } return true ; } }


Input: / * ( non - Javadoc ) [CODESPLIT] public int clearAlarms ( NotificationSource notificationSource ) throws NullPointerException , UnrecognizedNotificationSourceException , ManagementException { if ( notificationSource == null ) { throw new NullPointerException ( "NotificationSource must not be null" ) ; } mandateSource ( notificationSource ) ; int count = 0 ; try { for ( Map . Entry < AlarmPlaceHolder , NotificationSource > e : placeHolderToNotificationSource . entrySet ( ) ) { if ( e . getValue ( ) . equals ( notificationSource ) ) { if ( clearAlarm ( e . getKey ( ) . getAlarm ( ) . getAlarmID ( ) ) ) { count ++ ; } } } } catch ( Exception e ) { throw new ManagementException ( "Failed to get alarm id list due to: " , e ) ; } return count ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public String [ ] getAlarms ( ) throws ManagementException { try { Set < String > ids = new HashSet < String > ( ) ; ids . addAll ( alarmIdToAlarm . keySet ( ) ) ; return ids . toArray ( new String [ ids . size ( ) ] ) ; } catch ( Exception e ) { throw new ManagementException ( "Failed to get list of active alarms due to." , e ) ; } }


Input: / * ( non - Javadoc ) [CODESPLIT] public String [ ] getAlarms ( NotificationSource notificationSource ) throws NullPointerException , UnrecognizedNotificationSourceException , ManagementException { if ( notificationSource == null ) { throw new NullPointerException ( "NotificationSource must not be null" ) ; } mandateSource ( notificationSource ) ; try { Set < String > ids = new HashSet < String > ( ) ; for ( Map . Entry < AlarmPlaceHolder , NotificationSource > e : placeHolderToNotificationSource . entrySet ( ) ) { if ( e . getValue ( ) . equals ( notificationSource ) ) { ids . add ( e . getKey ( ) . getAlarm ( ) . getAlarmID ( ) ) ; } } return ids . toArray ( new String [ ids . size ( ) ] ) ; } catch ( Exception e ) { throw new ManagementException ( "Failed to get alarm id list due to: " , e ) ; } }


Input: / * ( non - Javadoc ) [CODESPLIT] public Alarm getDescriptor ( String alarmID ) throws NullPointerException , ManagementException { if ( alarmID == null ) { throw new NullPointerException ( "AlarmID must not be null" ) ; } AlarmPlaceHolder aph = this . alarmIdToAlarm . get ( alarmID ) ; if ( aph == null ) return null ; return aph . getAlarm ( ) ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public Alarm [ ] getDescriptors ( String [ ] alarmIDs ) throws NullPointerException , ManagementException { if ( alarmIDs == null ) { throw new NullPointerException ( "AlarmID[] must not be null" ) ; } Set < Alarm > alarms = new HashSet < Alarm > ( ) ; try { for ( String id : alarmIDs ) { Alarm a = getDescriptor ( id ) ; if ( a != null ) alarms . add ( a ) ; } return alarms . toArray ( new Alarm [ alarms . size ( ) ] ) ; } catch ( Exception e ) { throw new ManagementException ( "Failed to get desciptors." , e ) ; } }


Input: NON MBEAN - used only internal those methods are not exposed via jmx [CODESPLIT] public boolean isSourceOwnerOfAlarm ( NotificationSourceWrapper notificationSource , String alarmID ) { AlarmPlaceHolder aph = this . alarmIdToAlarm . get ( alarmID ) ; if ( aph == null ) return false ; return aph . getNotificationSource ( ) . getNotificationSource ( ) . equals ( notificationSource . getNotificationSource ( ) ) ; }


Input:
THis methods raises alarm . It MUST not receive AlarmLevel . CLEAR it has to be filtered . [CODESPLIT] public String raiseAlarm ( NotificationSourceWrapper notificationSource , String alarmType , String instanceID , AlarmLevel level , String message , Throwable cause ) { synchronized ( notificationSource ) { if ( isAlarmAlive ( notificationSource , alarmType , instanceID ) ) { // Alarm a = this.placeHolderToAlarm.get(new
 // AlarmPlaceHolder(notificationSource, alarmType, instanceID));
 Alarm a = null ; // unconveniant....
 try { AlarmPlaceHolder localAPH = new AlarmPlaceHolder ( notificationSource , alarmType , instanceID ) ; for ( Map . Entry < String , AlarmPlaceHolder > e : this . alarmIdToAlarm . entrySet ( ) ) { if ( e . getValue ( ) . equals ( localAPH ) ) { a = e . getValue ( ) . getAlarm ( ) ; break ; } } } catch ( Exception e ) { // ignore
 } if ( a != null ) { return a . getAlarmID ( ) ; } else { return this . raiseAlarm ( notificationSource , alarmType , instanceID , level , message , cause ) ; } } else { Alarm a = new Alarm ( UUID . randomUUID ( ) . toString ( ) , notificationSource . getNotificationSource ( ) , alarmType , instanceID , level , message , cause , System . currentTimeMillis ( ) ) ; AlarmPlaceHolder aph = new AlarmPlaceHolder ( notificationSource , alarmType , instanceID , a ) ; this . alarmIdToAlarm . put ( a . getAlarmID ( ) , aph ) ; // this.placeHolderToAlarm.put(aph, a);
 this . placeHolderToNotificationSource . put ( aph , aph . getNotificationSource ( ) . getNotificationSource ( ) ) ; generateNotification ( aph , false ) ; return a . getAlarmID ( ) ; } } }


Input: Usage methods . Here we can be static for sure . Rest must be tested . [CODESPLIT] public static Object getUsageParameterSet ( ProfileObjectImpl profileObject , String name ) throws UnrecognizedUsageParameterSetNameException { if ( logger . isDebugEnabled ( ) ) { logger . info ( "[getUsageParameterSet(" + name + ")] @ " + profileObject ) ; } if ( name == null ) { throw new NullPointerException ( "UsageParameterSet name must not be null." ) ; } ProfileTableImpl profileTable = profileObject . getProfileTable ( ) ; Object result = profileTable . getProfileTableUsageMBean ( ) . getInstalledUsageParameterSet ( name ) ; if ( result == null ) { throw new UnrecognizedUsageParameterSetNameException ( ) ; } else { return result ; } }


Input: / * ( non - Javadoc ) [CODESPLIT] @ Override public void readExternal ( ObjectInput in ) throws IOException , ClassNotFoundException { this . activityHandle = new NullActivityHandleImpl ( in . readUTF ( ) ) ; }


Input: / * ( non - Javadoc ) [CODESPLIT] @ Override public void writeExternal ( ObjectOutput out ) throws IOException { out . writeUTF ( ( ( NullActivityHandleImpl ) activityHandle ) . getId ( ) ) ; }


Input: Retrieves the JAIN SLEE specs event type descriptor [CODESPLIT] public javax . slee . management . EventTypeDescriptor getSpecsDescriptor ( ) { if ( specsDescriptor == null ) { specsDescriptor = new javax . slee . management . EventTypeDescriptor ( getEventTypeID ( ) , getDeployableUnit ( ) . getDeployableUnitID ( ) , getDeploymentUnitSource ( ) , descriptor . getLibraryRefs ( ) . toArray ( new LibraryID [ descriptor . getLibraryRefs ( ) . size ( ) ] ) , getDescriptor ( ) . getEventClassName ( ) ) ; } return specsDescriptor ; }


Input:
Signals that the specified { [CODESPLIT] public void activatedServiceWhichDefineEventAsInitial ( ServiceComponent serviceComponent ) { // create new ordered set
 SortedSet < ServiceComponent > activeServicesWhichDefineEventAsInitial = new TreeSet < ServiceComponent > ( new ActiveServicesWhichDefineEventAsInitialComparator ( ) ) ; // add all existent active services, except old version, this allows smooth service upgrade
 ServiceID oldVersion = serviceComponent . getOldVersion ( ) ; if ( oldVersion == null ) { activeServicesWhichDefineEventAsInitial . addAll ( this . activeServicesWhichDefineEventAsInitial ) ; } else { for ( ServiceComponent existentServiceComponent : this . activeServicesWhichDefineEventAsInitial ) { if ( ! existentServiceComponent . getServiceID ( ) . equals ( oldVersion ) ) { activeServicesWhichDefineEventAsInitial . add ( existentServiceComponent ) ; } } } // add new service
 activeServicesWhichDefineEventAsInitial . add ( serviceComponent ) ; // replace old set
 this . activeServicesWhichDefineEventAsInitial = activeServicesWhichDefineEventAsInitial ; }


Input:
Signals that the specified { [CODESPLIT] public void deactivatedServiceWhichDefineEventAsInitial ( ServiceComponent serviceComponent ) { // create new ordered set
 SortedSet < ServiceComponent > activeServicesWhichDefineEventAsInitial = new TreeSet < ServiceComponent > ( new ActiveServicesWhichDefineEventAsInitialComparator ( ) ) ; // add all existent active services, except one deactivated
 for ( ServiceComponent existentServiceComponent : this . activeServicesWhichDefineEventAsInitial ) { if ( ! existentServiceComponent . equals ( serviceComponent ) ) { activeServicesWhichDefineEventAsInitial . add ( existentServiceComponent ) ; } } // replace old set
 this . activeServicesWhichDefineEventAsInitial = activeServicesWhichDefineEventAsInitial ; }


Input: Method for deciding whether or not to accept the file . [CODESPLIT] public boolean accepts ( URL deployableUnitURL , String deployableUnitName ) { DeployableUnitWrapper du = new DeployableUnitWrapper ( deployableUnitURL , deployableUnitName ) ; URL url = du . getUrl ( ) ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Method accepts called for " + url + " [DU: " + deployableUnitName + "]" ) ; } try { String fullPath = url . getFile ( ) ; String fileName = fullPath . substring ( fullPath . lastIndexOf ( ' ' ) + 1 , fullPath . length ( ) ) ; // Is it in the toAccept list ? Direct accept. if ( toAccept . containsKey ( fileName ) ) { if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Accepting " + url . toString ( ) + "." ) ; } return true ; } // If not it the accept list but it's a jar might be a DU jar... else if ( fileName . endsWith ( ".jar" ) ) { JarFile duJarFile = null ; try { // Try to obtain the DU descriptor, if we got it, we're // accepting it! if ( du . getEntry ( "META-INF/deployable-unit.xml" ) != null ) { if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Accepting " + url . toString ( ) + "." ) ; } return true ; } } finally { // Clean up! if ( duJarFile != null ) { try { duJarFile . close ( ) ; } catch ( IOException ignore ) { } finally { duJarFile = null ; } } } } } catch ( Exception ignore ) { // Ignore.. will reject. } // Uh-oh.. looks like it will stay outside. return false ; }


Input: Initializer method for accepted files . Will parse descriptors at this point . [CODESPLIT] public void init ( URL deployableUnitURL , String deployableUnitName ) throws DeploymentException { URL url = deployableUnitURL ; DeployableUnitWrapper du = new DeployableUnitWrapper ( deployableUnitURL , deployableUnitName ) ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Method init called for " + deployableUnitURL + " [DU: " + deployableUnitName + "]" ) ; } // Get the full path and filename for this du String fullPath = du . getFullPath ( ) ; String fileName = du . getFileName ( ) ; try { DeployableUnitWrapper duWrapper = null ; // If we're able to remove it from toAccept was because it was // there! if ( ( duWrapper = toAccept . remove ( fileName ) ) != null ) { // Create a new Deployable Component from this DI. DeployableComponent dc = new DeployableComponent ( du , url , fileName , sleeContainerDeployer ) ; // Also get the deployable unit for this (it exists, we've // checked!) DeployableUnit deployerDU = deployableUnits . get ( duWrapper . getFileName ( ) ) ; for ( DeployableComponent subDC : dc . getSubComponents ( ) ) { // Add the sub-component to the DU object. deployerDU . addComponent ( subDC ) ; } } // If the DU for this component doesn't exists.. it's a new DU! else if ( fileName . endsWith ( ".jar" ) ) { JarFile duJarFile = null ; try { // Get a reference to the DU jar file duJarFile = new JarFile ( fullPath ) ; // Try to get the Deployable Unit descriptor JarEntry duXmlEntry = duJarFile . getJarEntry ( "META-INF/deployable-unit.xml" ) ; // Got descriptor? if ( duXmlEntry != null ) { // Create a new Deployable Unit object. DeployableUnit deployerDU = new DeployableUnit ( du , sleeContainerDeployer ) ; // Let's parse the descriptor to see what we've got... DeployableUnitDescriptorFactory dudf = sleeContainerDeployer . getSleeContainer ( ) . getComponentManagement ( ) . getDeployableUnitManagement ( ) . getDeployableUnitDescriptorFactory ( ) ; DeployableUnitDescriptor duDesc = dudf . parse ( duJarFile . getInputStream ( duXmlEntry ) ) ; // If the filename is present, an undeploy in on the way... let's wait while ( deployableUnits . containsKey ( fileName ) ) { Thread . sleep ( getWaitTimeBetweenOperations ( ) ) ; } // Add it to the deployable units map. deployableUnits . put ( fileName , deployerDU ) ; // Go through each jar entry in the DU descriptor for ( String componentJarName : duDesc . getJarEntries ( ) ) { // Might have path... strip it! int beginIndex ; if ( ( beginIndex = componentJarName . lastIndexOf ( ' ' ) ) == - 1 ) beginIndex = componentJarName . lastIndexOf ( ' ' ) ; beginIndex ++ ; // Got a clean jar name, no paths. componentJarName = componentJarName . substring ( beginIndex , componentJarName . length ( ) ) ; // Put it in the accept list. toAccept . put ( componentJarName , du ) ; } // Do the same as above... but for services for ( String serviceXMLName : duDesc . getServiceEntries ( ) ) { // Might have path... strip it! int beginIndex ; if ( ( beginIndex = serviceXMLName . lastIndexOf ( ' ' ) ) == - 1 ) beginIndex = serviceXMLName . lastIndexOf ( ' ' ) ; beginIndex ++ ; // Got a clean XML filename serviceXMLName = serviceXMLName . substring ( beginIndex , serviceXMLName . length ( ) ) ; // Add it to the accept list. toAccept . put ( serviceXMLName , du ) ; } } } finally { // Clean up! if ( duJarFile != null ) { try { duJarFile . close ( ) ; } catch ( IOException ignore ) { } finally { duJarFile = null ; } } } } } catch ( Exception e ) { // Something went wrong... logger . error ( "Deployment of " + fileName + " failed. " , e ) ; return ; } }


Input: This is where the fun begins . Time to deploy! [CODESPLIT] public void start ( URL deployableUnitURL , String deployableUnitName ) throws DeploymentException { DeployableUnitWrapper du = new DeployableUnitWrapper ( deployableUnitURL , deployableUnitName ) ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Method start called for " + du . getUrl ( ) + " [DU: " + deployableUnitName + "]" ) ; } try { // Get the deployable unit object DeployableUnit realDU = deployableUnits . get ( du . getFileName ( ) ) ; // If it exists, install it. if ( realDU != null ) { while ( isInUndeployList ( du . getFileName ( ) ) ) { Thread . sleep ( getWaitTimeBetweenOperations ( ) ) ; } sleeContainerDeployer . getDeploymentManager ( ) . installDeployableUnit ( realDU ) ; } } catch ( Exception e ) { logger . error ( "" , e ) ; } }


Input: Fun has ended . Time to undeploy . [CODESPLIT] public void stop ( URL deployableUnitURL , String deployableUnitName ) throws DeploymentException { if ( logger . isTraceEnabled ( ) ) { logger . trace ( "stop( deployableUnitURL = : " + deployableUnitURL + " )" ) ; } DeployableUnitWrapper du = new DeployableUnitWrapper ( deployableUnitURL , deployableUnitName ) ; DeployableUnit realDU = null ; String fileName = du . getFileName ( ) ; if ( ( realDU = deployableUnits . get ( du . getFileName ( ) ) ) != null ) { if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Got DU: " + realDU . getDeploymentInfoShortName ( ) ) ; } if ( ! isInUndeployList ( fileName ) ) { addToUndeployList ( fileName ) ; } try { // Uninstall it sleeContainerDeployer . getDeploymentManager ( ) . uninstallDeployableUnit ( realDU ) ; // Remove it from list if successful deployableUnits . remove ( fileName ) ; removeFromUndeployList ( fileName ) ; } catch ( DependencyException e ) { // ignore, will be tried again once there is another undeployment } catch ( Exception e ) { Throwable cause = e . getCause ( ) ; if ( cause instanceof InvalidStateException ) { logger . warn ( cause . getLocalizedMessage ( ) + "... WAITING ..." ) ; } else if ( e instanceof DeploymentException ) { throw new IllegalStateException ( e . getLocalizedMessage ( ) , e ) ; } else { logger . error ( e . getMessage ( ) , e ) ; } } } }


Input:
MBean operation for getting Deployer status . [CODESPLIT] public String showStatus ( ) throws DeploymentException { String output = "" ; output += "
Deployable Units List:
" ; for ( String key : deployableUnits . keySet ( ) ) { output += "<" + key + "> [" + deployableUnits . get ( key ) + "]
" ; for ( String duComponent : deployableUnits . get ( key ) . getComponents ( ) ) { output += "+-- " + duComponent + "
" ; } } output += "
To Accept List:
" ; for ( String key : toAccept . keySet ( ) ) { output += "<" + key + "> [" + toAccept . get ( key ) + "]
" ; } output += "
Undeployments running:
" ; for ( String undeploy : undeploys ) { output += "+-- " + undeploy + "
" ; } output += "
Deployment Manager Status
" ; output += sleeContainerDeployer . getDeploymentManager ( ) . showStatus ( ) ; return output ; }


Input: ------------------------------------------------------------ [CODESPLIT] private boolean addToUndeployList ( String du ) { if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Adding " + du + " to running undeployments list ..." ) ; logger . trace ( "Current Undeploy List: " + undeploys . toString ( ) ) ; } boolean added = undeploys . add ( du ) ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Added  " + du + " to running undeployments list = " + added ) ; logger . trace ( "Current Undeploy List: " + undeploys . toString ( ) ) ; } return added ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public void mandateTransaction ( ) throws TransactionRequiredLocalException { try { final Transaction tx = getTransaction ( ) ; if ( tx == null ) throw new TransactionRequiredLocalException ( "Transaction Mandatory" ) ; final int status = tx . getStatus ( ) ; if ( status != Status . STATUS_ACTIVE && status != Status . STATUS_MARKED_ROLLBACK ) { throw new IllegalStateException ( "There is no active tx, tx is in state: " + status ) ; } } catch ( SystemException e ) { throw new SLEEException ( e . getMessage ( ) , e ) ; } }


Input: / * ( non - Javadoc ) [CODESPLIT] public boolean requireTransaction ( ) { try { final Transaction tx = getTransaction ( ) ; if ( tx == null ) { begin ( ) ; return true ; } else { final int status = tx . getStatus ( ) ; if ( status != Status . STATUS_ACTIVE && status != Status . STATUS_MARKED_ROLLBACK ) { begin ( ) ; return true ; } } } catch ( NotSupportedException e ) { logger . error ( "Exception creating transaction" , e ) ; } catch ( SystemException e ) { logger . error ( "Caught SystemException in checking transaction" , e ) ; } return false ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public void requireTransactionEnd ( boolean terminateTx , boolean doRollback ) throws IllegalStateException , SecurityException , SystemException , RollbackException , HeuristicMixedException , HeuristicRollbackException { if ( terminateTx ) { if ( doRollback ) { rollback ( ) ; } else { commit ( ) ; } } else { if ( doRollback ) { setRollbackOnly ( ) ; } } }


Input: / * ( non - Javadoc ) [CODESPLIT] public void asyncCommit ( CommitListener commitListener ) throws IllegalStateException , SecurityException { if ( doTraceLogs ) { logger . trace ( "asyncCommit( commitListener = " + commitListener + " )" ) ; } try { final SleeTransaction sleeTransaction = getSleeTransaction ( ) ; if ( sleeTransaction == null ) { throw new IllegalStateException ( "no transaction" ) ; } else { sleeTransaction . asyncCommit ( commitListener ) ; } } catch ( SystemException e ) { if ( commitListener != null ) { commitListener . systemException ( e ) ; } } }


Input: / * ( non - Javadoc ) [CODESPLIT] public void asyncRollback ( RollbackListener rollbackListener ) throws IllegalStateException , SecurityException { if ( doTraceLogs ) { logger . trace ( "asyncRollback( rollbackListener = " + rollbackListener + " )" ) ; } try { final SleeTransaction sleeTransaction = getSleeTransaction ( ) ; if ( sleeTransaction == null ) { throw new IllegalStateException ( "no transaction" ) ; } else { sleeTransaction . asyncRollback ( rollbackListener ) ; } } catch ( SystemException e ) { if ( rollbackListener != null ) { rollbackListener . systemException ( e ) ; } } }


Input: / * ( non - Javadoc ) [CODESPLIT] public SleeTransaction beginSleeTransaction ( ) throws NotSupportedException , SystemException { // begin transaction transactionManager . begin ( ) ; // get tx does the rest return getAsSleeTransaction ( transactionManager . getTransaction ( ) , true ) ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public SleeTransaction asSleeTransaction ( Transaction transaction ) throws NullPointerException , IllegalArgumentException , SystemException { if ( transaction == null ) { throw new NullPointerException ( "null transaction" ) ; } if ( transaction . getClass ( ) == SleeTransactionImpl . class ) { return ( SleeTransaction ) transaction ; } if ( transaction instanceof TransactionImple ) { return new SleeTransactionImpl ( ( TransactionImple ) transaction , getTransactionContext ( ) , this ) ; } throw new IllegalArgumentException ( "unexpected transaction class type " + transaction . getClass ( ) ) ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public void commit ( ) throws RollbackException , HeuristicMixedException , HeuristicRollbackException , SecurityException , IllegalStateException , SystemException { if ( doTraceLogs ) { logger . trace ( "Starting commit of tx " + transactionManager . getTransaction ( ) ) ; } transactionManager . commit ( ) ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public void resume ( Transaction transaction ) throws InvalidTransactionException , IllegalStateException , SystemException { if ( transaction . getClass ( ) == SleeTransactionImpl . class ) { final SleeTransactionImpl sleeTransactionImpl = ( SleeTransactionImpl ) transaction ; if ( doTraceLogs ) { logger . trace ( "Resuming tx " + sleeTransactionImpl . getWrappedTransaction ( ) ) ; } // resume wrapped tx transactionManager . resume ( sleeTransactionImpl . getWrappedTransaction ( ) ) ; // store tx context in thread  TransactionContextThreadLocal . setTransactionContext ( sleeTransactionImpl . getTransactionContext ( ) ) ; } else { throw new InvalidTransactionException ( ) ; } }


Input: / * ( non - Javadoc ) [CODESPLIT] public void rollback ( ) throws IllegalStateException , SecurityException , SystemException { if ( doTraceLogs ) { logger . trace ( "Starting rollback of tx " + transactionManager . getTransaction ( ) ) ; } transactionManager . rollback ( ) ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public void setRollbackOnly ( ) throws IllegalStateException , SystemException { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Marking tx " + transactionManager . getTransaction ( ) + " for rollback." ) ; } transactionManager . setRollbackOnly ( ) ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public Transaction suspend ( ) throws SystemException { if ( doTraceLogs ) { logger . trace ( "Suspending tx " + transactionManager . getTransaction ( ) ) ; } final Transaction tx = getAsSleeTransaction ( transactionManager . suspend ( ) , false ) ; if ( tx != null ) { // remove tx context from thread TransactionContextThreadLocal . setTransactionContext ( null ) ; return tx ; } else { return null ; } }


Input: / * ( non - Javadoc ) [CODESPLIT] public TransactionContext getTransactionContext ( ) { TransactionContext txContext = TransactionContextThreadLocal . getTransactionContext ( ) ; if ( txContext == null ) { try { final Transaction tx = transactionManager . getTransaction ( ) ; if ( tx != null && tx . getStatus ( ) == Status . STATUS_ACTIVE ) { // a tx was started with the real tx manager, lets try to hook the sync handler and a new tx context txContext = bindToTransaction ( tx ) ; } } catch ( Throwable e ) { throw new SLEEException ( e . getMessage ( ) , e ) ; } } return txContext ; }


Input: Executes actions scheduled after commit succeeds [CODESPLIT] protected void executeAfterCommitActions ( ) { if ( afterCommitActions != null ) { if ( trace ) { logger . trace ( "Executing after commit actions" ) ; } executeActions ( afterCommitActions , trace ) ; afterCommitActions = null ; } }


Input: Executes actions scheduled to run first after commit succeeds [CODESPLIT] protected void executeAfterCommitPriorityActions ( ) { if ( afterCommitPriorityActions != null ) { if ( trace ) { logger . trace ( "Executing after commit priority actions" ) ; } executeActions ( afterCommitPriorityActions , trace ) ; afterCommitPriorityActions = null ; } }


Input: Executes actions scheduled for after a rollback [CODESPLIT] protected void executeAfterRollbackActions ( ) { if ( afterRollbackActions != null ) { if ( trace ) { logger . trace ( "Executing rollback actions" ) ; } executeActions ( afterRollbackActions , trace ) ; afterRollbackActions = null ; } }


Input: Executes actions scheduled for before commit [CODESPLIT] protected void executeBeforeCommitActions ( ) { if ( beforeCommitActions != null ) { if ( trace ) { logger . trace ( "Executing before commit actions" ) ; } executeActions ( beforeCommitActions , trace ) ; beforeCommitActions = null ; } }


Input: Executes actions scheduled for before commit at first [CODESPLIT] protected void executeBeforeCommitPriorityActions ( ) { if ( beforeCommitPriorityActions != null ) { if ( trace ) { logger . trace ( "Executing before commit priority actions" ) ; } executeActions ( beforeCommitPriorityActions , trace ) ; beforeCommitPriorityActions = null ; } }


Input: This method raturns tracer names of tracers that have been requested directly from NotificationSource ( like through SbbContext RAContext etc ) [CODESPLIT] public String [ ] getRequestedTracerNames ( ) { Set < String > names = new HashSet < String > ( ) ; for ( TracerImpl t : this . tracers . values ( ) ) { if ( t . isRequestedBySource ( ) ) names . add ( t . getTracerName ( ) ) ; } if ( names . isEmpty ( ) ) return new String [ 0 ] ; return names . toArray ( new String [ names . size ( ) ] ) ; }


Input: This method returns tracer names that have been defined explicitly via setTraceLevel from TraceMBean [CODESPLIT] public String [ ] getDefinedTracerNames ( ) { Set < String > names = new HashSet < String > ( ) ; for ( TracerImpl t : this . tracers . values ( ) ) { if ( t . isExplicitlySetTracerLevel ( ) ) names . add ( t . getTracerName ( ) ) ; } if ( names . isEmpty ( ) ) return new String [ 0 ] ; return names . toArray ( new String [ names . size ( ) ] ) ; }


Input: This method can be called multiple times . [CODESPLIT] public Tracer createTracer ( String tracerName , boolean requestedBySource ) { TracerImpl tparent = null ; TracerImpl t = tracers . get ( tracerName ) ; if ( t == null ) { String [ ] split = tracerName . split ( "\\." ) ; String currentName = "" ; for ( String s : split ) { if ( tparent == null ) { // first loop tparent = rootTracer ; currentName = s ; } else { currentName = currentName + "." + s ; } t = tracers . get ( currentName ) ; if ( t == null ) { t = new TracerImpl ( currentName , tparent , this . notificationSource , this . traceFacility ) ; final TracerImpl u = tracers . putIfAbsent ( t . getTracerName ( ) , t ) ; if ( u != null ) { t = u ; } } tparent = t ; } } if ( requestedBySource ) t . setRequestedBySource ( requestedBySource ) ; return t ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public void bind ( ActivityContextInterface aci , String aciName ) throws NullPointerException , IllegalArgumentException , TransactionRequiredLocalException , NameAlreadyBoundException , FacilityException { // Check if we are in the context of a transaction. sleeContainer . getTransactionManager ( ) . mandateTransaction ( ) ; if ( aciName == null ) throw new NullPointerException ( "null aci name" ) ; else if ( aciName . equals ( "" ) ) throw new IllegalArgumentException ( "empty name" ) ; else if ( aci == null ) throw new NullPointerException ( "Null ACI! " ) ; try { org . mobicents . slee . container . activity . ActivityContextInterface sleeAci = ( org . mobicents . slee . container . activity . ActivityContextInterface ) aci ; ActivityContext ac = sleeAci . getActivityContext ( ) ; ActivityContextHandle ach = ac . getActivityContextHandle ( ) ; cacheData . bindName ( ach , aciName ) ; ac . addNameBinding ( aciName ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( "aci name " + aciName + " bound to " + ach + " . Tx is " + sleeContainer . getTransactionManager ( ) . getTransaction ( ) ) ; } } catch ( NameAlreadyBoundException ex ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "name already bound " + aciName ) ; } throw ex ; } catch ( Exception e ) { throw new FacilityException ( "Failed to put ac name binding in cache" , e ) ; } }


Input: / * ( non - Javadoc ) [CODESPLIT] public void unbind ( String aciName ) throws NullPointerException , TransactionRequiredLocalException , NameNotBoundException , FacilityException { //Check if we are in the context of a transaction. sleeContainer . getTransactionManager ( ) . mandateTransaction ( ) ; if ( aciName == null ) throw new NullPointerException ( "null activity context name!" ) ; try { ActivityContextHandle ach = ( ActivityContextHandle ) cacheData . unbindName ( aciName ) ; ActivityContext ac = sleeContainer . getActivityContextFactory ( ) . getActivityContext ( ach ) ; if ( ac != null ) ac . removeNameBinding ( aciName ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( "aci name " + aciName + " unbound from " + ach + " . Tx is " + sleeContainer . getTransactionManager ( ) . getTransaction ( ) ) ; } } catch ( NameNotBoundException ex ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "Name not bound " + aciName ) ; } throw ex ; } catch ( Exception e ) { throw new FacilityException ( "Failed to remove ac name binding from cache" , e ) ; } }


Input: / * ( non - Javadoc ) [CODESPLIT] public ActivityContextInterface lookup ( String acName ) throws NullPointerException , TransactionRequiredLocalException , FacilityException { sleeContainer . getTransactionManager ( ) . mandateTransaction ( ) ; if ( acName == null ) throw new NullPointerException ( "null ac name" ) ; try { ActivityContextHandle ach = ( ActivityContextHandle ) cacheData . lookupName ( acName ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( "lookup of aci name " + acName + " result is " + ach + " . Tx is " + sleeContainer . getTransactionManager ( ) . getTransaction ( ) ) ; } if ( ach == null ) { return null ; } ActivityContext ac = sleeContainer . getActivityContextFactory ( ) . getActivityContext ( ach ) ; if ( ac == null ) { cacheData . unbindName ( acName ) ; throw new FacilityException ( "name found but unable to retrieve activity context" ) ; } return ac . getActivityContextInterface ( ) ; } catch ( Exception e ) { throw new FacilityException ( "Failed to look-up ac name binding" , e ) ; } }


Input:
Generates the Profile MBean interface [CODESPLIT] public void generateProfileMBeanInterface ( ) throws Exception { if ( SleeProfileClassCodeGenerator . checkCombination ( component ) == - 1 ) { throw new DeploymentException ( "Profile Specification doesn't match any combination " + "from the JSLEE spec 1.0 section 10.5.2" ) ; } String profileMBeanConcreteInterfaceName = cmpProfileInterfaceName + "MBean" ; profileMBeanConcreteInterface = pool . makeInterface ( profileMBeanConcreteInterfaceName ) ; try { cmpProfileInterface = pool . get ( cmpProfileInterfaceName ) ; profileManagementInterface = profileManagementInterfaceName != null ? pool . get ( profileManagementInterfaceName ) : null ; } catch ( NotFoundException nfe ) { throw new DeploymentException ( "Failed to locate CMP/Management Interface for " + component , nfe ) ; } // set interface
 try { profileMBeanConcreteInterface . addInterface ( pool . get ( AbstractProfileMBean . class . getName ( ) ) ) ; } catch ( Throwable e ) { throw new SLEEException ( e . getMessage ( ) , e ) ; } // gather exceptions that the mbean methods may throw
 CtClass [ ] managementMethodExceptions = new CtClass [ 3 ] ; try { managementMethodExceptions [ 0 ] = pool . get ( ManagementException . class . getName ( ) ) ; managementMethodExceptions [ 1 ] = pool . get ( InvalidStateException . class . getName ( ) ) ; managementMethodExceptions [ 2 ] = pool . get ( ProfileImplementationException . class . getName ( ) ) ; } catch ( NotFoundException e ) { throw new SLEEException ( e . getMessage ( ) , e ) ; } CtClass [ ] cmpGetAcessorMethodExceptions = new CtClass [ ] { managementMethodExceptions [ 0 ] } ; CtClass [ ] cmpSetAcessorMethodExceptions = new CtClass [ ] { managementMethodExceptions [ 0 ] , managementMethodExceptions [ 1 ] } ; // gather all Object class methods, we don't want those in the mbean
 Set < CtMethod > objectMethods = new HashSet < CtMethod > ( ) ; try { CtClass objectClass = pool . get ( Object . class . getName ( ) ) ; for ( CtMethod ctMethod : objectClass . getMethods ( ) ) { objectMethods . add ( ctMethod ) ; } } catch ( NotFoundException e ) { throw new SLEEException ( e . getMessage ( ) , e ) ; } // gather methods to copy
 Set < CtMethod > cmpAcessorMethods = new HashSet < CtMethod > ( ) ; Set < CtMethod > managementMethods = new HashSet < CtMethod > ( ) ; if ( profileManagementInterface != null ) { // If the Profile Specification defines a Profile Management Interface, the profileMBean interface has the same methods
 // 1. gather all methods from management interface
 for ( CtMethod ctMethod : profileManagementInterface . getMethods ( ) ) { if ( ! objectMethods . contains ( ctMethod ) ) { managementMethods . add ( ctMethod ) ; } } // 2. gather all methods present also in cmp interface, removing those from the ones gather from management interface
 for ( CtMethod ctMethod : cmpProfileInterface . getMethods ( ) ) { if ( ! objectMethods . contains ( ctMethod ) ) { if ( managementMethods . remove ( ctMethod ) ) { cmpAcessorMethods . add ( ctMethod ) ; } } } } else { for ( CtMethod ctMethod : cmpProfileInterface . getMethods ( ) ) { if ( ! objectMethods . contains ( ctMethod ) ) { cmpAcessorMethods . add ( ctMethod ) ; } } } // copy cmp acessor & mngt methods
 for ( CtMethod ctMethod : cmpAcessorMethods ) { // copy method
 CtMethod methodCopy = new CtMethod ( ctMethod , profileMBeanConcreteInterface , null ) ; // set exceptions
 CtClass [ ] exceptions = null ; if ( ctMethod . getName ( ) . startsWith ( "set" ) ) { exceptions = cmpSetAcessorMethodExceptions ; } else if ( ctMethod . getName ( ) . startsWith ( "get" ) ) { exceptions = cmpGetAcessorMethodExceptions ; } else { throw new DeploymentException ( "unexpected method in profile cmp interface " + ctMethod ) ; } methodCopy . setExceptionTypes ( exceptions ) ; // add to class
 profileMBeanConcreteInterface . addMethod ( methodCopy ) ; // store in set to be used in mbean impl
 mBeanCmpAcessorMethods . add ( methodCopy ) ; } for ( CtMethod ctMethod : managementMethods ) { // copy method
 CtMethod methodCopy = new CtMethod ( ctMethod , profileMBeanConcreteInterface , null ) ; // set exceptions
 methodCopy . setExceptionTypes ( managementMethodExceptions ) ; // add to class
 profileMBeanConcreteInterface . addMethod ( methodCopy ) ; // store in set to be used in mbean impl
 mBeanManagementMethods . add ( methodCopy ) ; } // write class file
 try { profileMBeanConcreteInterface . writeFile ( this . component . getDeploymentDir ( ) . getAbsolutePath ( ) ) ; } catch ( Throwable e ) { throw new SLEEException ( e . getMessage ( ) , e ) ; } finally { profileMBeanConcreteInterface . defrost ( ) ; } // and load it to the component
 try { this . component . setProfileMBeanConcreteInterfaceClass ( Thread . currentThread ( ) . getContextClassLoader ( ) . loadClass ( profileMBeanConcreteInterfaceName ) ) ; } catch ( Throwable e ) { throw new SLEEException ( e . getMessage ( ) , e ) ; } }


Input:
This method generates concrete class of MBean impl [CODESPLIT] public void generateProfileMBean ( ) throws Exception { if ( SleeProfileClassCodeGenerator . checkCombination ( component ) == - 1 ) { throw new DeploymentException ( "Profile Specification doesn't match any combination " + "from the JSLEE spec 1.0 section 10.5.2" ) ; } String profileMBeanConcreteClassName = profileMBeanConcreteInterface . getName ( ) + "Impl" ; profileMBeanConcreteClass = pool . makeClass ( profileMBeanConcreteClassName ) ; // set interface & super class
 try { profileMBeanConcreteClass . setInterfaces ( new CtClass [ ] { profileMBeanConcreteInterface } ) ; profileMBeanConcreteClass . setSuperclass ( pool . get ( AbstractProfileMBeanImpl . class . getName ( ) ) ) ; } catch ( NotFoundException e ) { throw new SLEEException ( e . getMessage ( ) , e ) ; } // implement cmp acessor & management methods gather in the mbean interface building
 for ( CtMethod method : mBeanCmpAcessorMethods ) { // copy method & remove abstract modifier
 CtMethod newMethod = CtNewMethod . copy ( method , profileMBeanConcreteClass , null ) ; // generate body
 String body = null ; if ( method . getName ( ) . startsWith ( "set" ) ) { body = "{ " + "	beforeSetCmpField();" + "	try { " + "		((" + component . getProfileCmpConcreteClass ( ) . getName ( ) + ")getProfileObject().getProfileConcrete())." + method . getName ( ) + "($1);" + "	} finally {" + "		afterSetCmpField();" + "	}" + "}" ; } else { body = "{ " + "	boolean activatedTransaction = beforeGetCmpField();" + "	try { " + "		return ($r) ((" + component . getProfileCmpConcreteClass ( ) . getName ( ) + ")getProfileObject().getProfileConcrete())." + method . getName ( ) + "();" + "	} finally {" + "		afterGetCmpField(activatedTransaction);" + "	}" + "}" ; } if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Implemented profile mbean method named " + method . getName ( ) + ", with body:\n" + body ) ; } newMethod . setBody ( body ) ; profileMBeanConcreteClass . addMethod ( newMethod ) ; } for ( CtMethod method : mBeanManagementMethods ) { // copy method & remove abstract modifier
 CtMethod newMethod = CtNewMethod . copy ( method , profileMBeanConcreteClass , null ) ; // generate body
 boolean voidReturnType = newMethod . getReturnType ( ) . equals ( CtClass . voidType ) ; String body = "{ boolean activatedTransaction = beforeManagementMethodInvocation(); try { " ; if ( ! voidReturnType ) { body += "return ($r) " ; } body += "((" + component . getProfileCmpConcreteClass ( ) . getName ( ) + ")getProfileObject().getProfileConcrete())." + method . getName ( ) + "($$); } catch(Throwable t) { throwableOnManagementMethodInvocation(t); } finally { afterManagementMethodInvocation(activatedTransaction); }" ; if ( ! voidReturnType ) { body += "throw new " + SLEEException . class . getName ( ) + "(\"bad code generated\");" ; } body += " }" ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Implemented profile mbean method named " + method . getName ( ) + ", with body:\n" + body ) ; } newMethod . setBody ( body ) ; profileMBeanConcreteClass . addMethod ( newMethod ) ; } try { profileMBeanConcreteClass . writeFile ( this . component . getDeploymentDir ( ) . getAbsolutePath ( ) ) ; } catch ( Throwable e ) { throw new SLEEException ( e . getMessage ( ) , e ) ; } finally { profileMBeanConcreteClass . defrost ( ) ; } try { component . setProfileMBeanConcreteImplClass ( Thread . currentThread ( ) . getContextClassLoader ( ) . loadClass ( profileMBeanConcreteClassName ) ) ; } catch ( Throwable e ) { throw new SLEEException ( e . getMessage ( ) , e ) ; } }


Input: / * ( non - Javadoc ) [CODESPLIT] public ReplicatedDataWithFailover < K , V > getReplicatedDataWithFailover ( boolean activateDataRemovedCallback ) { if ( replicatedDataWithFailover == null ) { replicatedDataWithFailover = new ReplicatedDataWithFailoverImpl < K , V > ( REPLICATED_DATA_WITH_FAILOVER_NAME , raEntity , sleeContainer . getCluster ( ) , ra , activateDataRemovedCallback ) ; } return replicatedDataWithFailover ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public ReplicatedData < K , V > getReplicateData ( boolean activateDataRemovedCallback ) { if ( replicatedData == null ) { replicatedData = new ReplicatedDataImpl < K , V > ( REPLICATED_DATA_NAME , raEntity , sleeContainer . getCluster ( ) , ra , activateDataRemovedCallback ) ; } return replicatedData ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public MemberAddress [ ] getMembers ( ) { final Address [ ] addresses = sleeContainer . getCluster ( ) . getClusterMembers ( ) . toArray ( EMPTY_ADDRESS_ARRAY ) ; final MemberAddressImpl [ ] members = new MemberAddressImpl [ addresses . length ] ; for ( int i = 0 ; i < members . length ; i ++ ) { members [ i ] = new MemberAddressImpl ( addresses [ i ] ) ; } return members ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public MemberAddress getLocalAddress ( ) { Address localAddress = sleeContainer . getCluster ( ) . getLocalAddress ( ) ; return localAddress != null ? new MemberAddressImpl ( localAddress ) : null ; }


Input: Removes all replicated data [CODESPLIT] public void removeReplicateData ( ) { if ( replicatedDataWithFailover != null ) { replicatedDataWithFailover . remove ( ) ; replicatedDataWithFailover = null ; } if ( replicatedData != null ) { replicatedData . remove ( ) ; replicatedData = null ; } }


Input: Register the property editors for jboss jmx console so non string SLEE api types can be used in specs mbeans methods as args [CODESPLIT] public void register ( ) { PropertyEditorManager . registerEditor ( ComponentID . class , ComponentIDPropertyEditor . class ) ; PropertyEditorManager . registerEditor ( EventTypeID . class , ComponentIDPropertyEditor . class ) ; PropertyEditorManager . registerEditor ( LibraryID . class , ComponentIDPropertyEditor . class ) ; PropertyEditorManager . registerEditor ( ProfileSpecificationID . class , ComponentIDPropertyEditor . class ) ; PropertyEditorManager . registerEditor ( ResourceAdaptorID . class , ComponentIDPropertyEditor . class ) ; PropertyEditorManager . registerEditor ( ResourceAdaptorTypeID . class , ComponentIDPropertyEditor . class ) ; PropertyEditorManager . registerEditor ( SbbID . class , ComponentIDPropertyEditor . class ) ; PropertyEditorManager . registerEditor ( ServiceID . class , ComponentIDPropertyEditor . class ) ; PropertyEditorManager . registerEditor ( ComponentID [ ] . class , ComponentIDArrayPropertyEditor . class ) ; PropertyEditorManager . registerEditor ( EventTypeID [ ] . class , ComponentIDArrayPropertyEditor . class ) ; PropertyEditorManager . registerEditor ( LibraryID [ ] . class , ComponentIDArrayPropertyEditor . class ) ; PropertyEditorManager . registerEditor ( ProfileSpecificationID [ ] . class , ComponentIDArrayPropertyEditor . class ) ; PropertyEditorManager . registerEditor ( ResourceAdaptorID [ ] . class , ComponentIDArrayPropertyEditor . class ) ; PropertyEditorManager . registerEditor ( ResourceAdaptorTypeID [ ] . class , ComponentIDArrayPropertyEditor . class ) ; PropertyEditorManager . registerEditor ( SbbID [ ] . class , ComponentIDArrayPropertyEditor . class ) ; PropertyEditorManager . registerEditor ( ServiceID [ ] . class , ComponentIDArrayPropertyEditor . class ) ; PropertyEditorManager . registerEditor ( DeployableUnitID . class , DeployableUnitIDPropertyEditor . class ) ; PropertyEditorManager . registerEditor ( Level . class , LevelPropertyEditor . class ) ; PropertyEditorManager . registerEditor ( TraceLevel . class , TraceLevelPropertyEditor . class ) ; PropertyEditorManager . registerEditor ( ConfigProperties . class , ConfigPropertiesPropertyEditor . class ) ; PropertyEditorManager . registerEditor ( NotificationSource . class , NotificationSourcePropertyEditor . class ) ; PropertyEditorManager . registerEditor ( Object . class , ObjectPropertyEditor . class ) ; PropertyEditorManager . registerEditor ( ServiceState . class , ServiceStatePropertyEditor . class ) ; PropertyEditorManager . registerEditor ( ResourceAdaptorEntityState . class , ResourceAdaptorEntityStatePropertyEditor . class ) ; PropertyEditorManager . registerEditor ( Address . class , AddressPropertyEditor . class ) ; }


Input: Generates classes for a slee component which defines usage parameters [CODESPLIT] public void process ( SleeComponentWithUsageParametersInterface component ) throws DeploymentException { ClassPool classPool = component . getClassPool ( ) ; String deploymentDir = component . getDeploymentDir ( ) . getAbsolutePath ( ) ; Class < ? > usageParametersInterface = component . getUsageParametersInterface ( ) ; if ( usageParametersInterface != null ) { try { // generate the concrete usage param set class component . setUsageParametersConcreteClass ( new ConcreteUsageParameterClassGenerator ( usageParametersInterface . getName ( ) , deploymentDir , classPool ) . generateConcreteUsageParameterClass ( ) ) ; if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "Generated usage parameter impl class for " + component ) ; } // generate the mbeans new ConcreteUsageParameterMBeanGenerator ( component ) . generateConcreteUsageParameterMBean ( ) ; if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "Generated usage mbean (interface and impl) for " + component ) ; } } catch ( DeploymentException ex ) { throw ex ; } catch ( Exception ex ) { throw new DeploymentException ( "Failed to generate " + component + " usage parameter class" , ex ) ; } } }