signature:
public class ProfileEntityArrayAttributeValue { /** * Stores the attr value , converting and storing in the string field of the
 * entity
 * @ param attrValue */
public void setFloat ( Float attrValue ) { } }


signature:
public class ProfileEntityArrayAttributeValue { /** * Stores the attr value , converting and storing in the string field of the
 * entity
 * @ param attrValue */
public void setInteger ( Integer attrValue ) { } }

implementation: if ( attrValue != null ) { setString ( attrValue . toString ( ) ) ; } else { setString ( null ) ; }


signature:
public class ProfileEntityArrayAttributeValue { /** * Stores the attr value , converting and storing in the string field of the
 * entity
 * @ param attrValue */
public void setLong ( Long attrValue ) { } }


signature:
public class ProfileEntityArrayAttributeValue { /** * Stores the attr value , converting and storing in the string field of the
 * entity
 * @ param attrValue */
public void setShort ( Short attrValue ) { } }


signature:
public class ProfileEntityArrayAttributeValue { /** * Stores the attr value , converting and storing in the string field of the
 * entity
 * @ param attrValue */
public void setAddress ( Address attrValue ) { } }

implementation: if ( attrValue != null ) { setString ( attrValue . toString ( ) ) ; } else { setString ( null ) ; } setSerializable ( attrValue ) ;


signature:
public class TimerFacilityConfiguration { /** * ( non - Javadoc )
 * @ see
 * org . mobicents . slee . container . management . jmx . TimerFacilityConfigurationMBean
 * # setTimerThreads ( int ) */
public void setTimerThreads ( int value ) { } }

implementation: if ( this . timerThreads == null ) { logger . info ( "SLEE Timer facility initiated with " + value + " threads." ) ; } else { logger . warn ( "Setting timer facility threads to " + value + ". If called with server running a stop and start is need to apply changes." ) ; } this . timerThreads = value ;


signature:
public class Level { /** * Determine if this Level object represents a level that is higher or more severe
 * that some other Level object . For the purposes of the comparison OFF
 * is considered a higher level than SEVERE .
 * @ param other the < code > Level < / code > object to compare this with .
 * @ return < code > true < / code > if the level represented by this < code > Level < / code >
 * object is a higher level than the level represented by the specified
 * < code > Level < / code > object , < code > false < / code > otherwise .
 * @ throws NullPointerException if < code > other < / code > is < code > null < / code > .
 * @ deprecated Trace and alarm levels now defined in { @ link TraceLevel } and { @ link AlarmLevel } . */
public boolean isHigherLevel ( Level other ) throws NullPointerException { } }

implementation: if ( other == null ) throw new NullPointerException ( "other is null" ) ; return this . level < other . level ;


signature:
public class Level { /** * Resolve deserialisation references so that the singleton property of each
 * enumerated object is preserved . */
private Object readResolve ( ) throws StreamCorruptedException { } }

implementation: if ( level == LEVEL_OFF ) return OFF ; if ( level == LEVEL_SEVERE ) return SEVERE ; if ( level == LEVEL_WARNING ) return WARNING ; if ( level == LEVEL_INFO ) return INFO ; if ( level == LEVEL_CONFIG ) return CONFIG ; if ( level == LEVEL_FINE ) return FINE ; if ( level == LEVEL_FINER ) return FINER ; if ( level == LEVEL_FINEST ) return FINEST ; throw new StreamCorruptedException ( "Invalid internal state found" ) ;


signature:
public class DeployConfigParser { /** * Parser for the deployment config xml .
 * @ throws SAXException
 * @ throws ParserConfigurationException
 * @ throws IOException
 * @ throws Exception */
private void parseDeployConfig ( InputStream deployConfigInputStream , ResourceManagement resourceManagement ) throws SAXException , ParserConfigurationException , IOException { } }

implementation:
if ( deployConfigInputStream == null ) { throw new NullPointerException ( "null deploy config input stream" ) ; } Document doc = null ; try { // Read the file into a Document
SchemaFactory schemaFactory = SchemaFactory . newInstance ( XMLConstants . W3C_XML_SCHEMA_NS_URI ) ; Schema schema = schemaFactory . newSchema ( DeployConfigParser . class . getClassLoader ( ) . getResource ( "deploy-config.xsd" ) ) ; DocumentBuilderFactory factory = DocumentBuilderFactory . newInstance ( ) ; // factory . setValidating ( false ) ;
factory . setSchema ( schema ) ; DocumentBuilder builder = factory . newDocumentBuilder ( ) ; builder . setErrorHandler ( new ErrorHandler ( ) { public void error ( SAXParseException e ) throws SAXException { logger . error ( "Error parsing deploy-config.xml" , e ) ; return ; } public void fatalError ( SAXParseException e ) throws SAXException { logger . error ( "Fatal error parsing deploy-config.xml" , e ) ; return ; } public void warning ( SAXParseException e ) throws SAXException { logger . warn ( "Warning parsing deploy-config.xml" , e ) ; return ; } } ) ; doc = builder . parse ( deployConfigInputStream ) ; } finally { try { deployConfigInputStream . close ( ) ; } catch ( IOException e ) { logger . error ( "failed to close deploy config input stream" , e ) ; } } Map < String , Collection < ManagementAction > > postInstallActions = new HashMap < String , Collection < ManagementAction > > ( ) ; Map < String , Collection < ManagementAction > > preUninstallActions = new HashMap < String , Collection < ManagementAction > > ( ) ; // By now we only care about < ra - entity > nodes
NodeList raEntities = doc . getElementsByTagName ( "ra-entity" ) ; // The RA identifier
String raId = null ; // The collection of Post - Install Actions
Collection < ManagementAction > cPostInstallActions = new ArrayList < ManagementAction > ( ) ; // The collection of Pre - Uninstall Actions
Collection < ManagementAction > cPreUninstallActions = new ArrayList < ManagementAction > ( ) ; // Iterate through each ra - entity node
for ( int i = 0 ; i < raEntities . getLength ( ) ; i ++ ) { Element raEntity = ( Element ) raEntities . item ( i ) ; // Get the component ID
ComponentIDPropertyEditor cidpe = new ComponentIDPropertyEditor ( ) ; cidpe . setAsText ( raEntity . getAttribute ( "resource-adaptor-id" ) ) ; raId = cidpe . getValue ( ) . toString ( ) ; // The RA Entity Name
String entityName = raEntity . getAttribute ( "entity-name" ) ; // Select the properties node
NodeList propsNodeList = raEntity . getElementsByTagName ( "properties" ) ; if ( propsNodeList . getLength ( ) > 1 ) { logger . warn ( "Invalid ra-entity element, has more than one properties child. Reading only first." ) ; } // The properties for this RA
ConfigProperties props = new ConfigProperties ( ) ; Element propsNode = ( Element ) propsNodeList . item ( 0 ) ; // Do we have any properties at all ?
if ( propsNode != null ) { // Select the property elements
NodeList propsList = propsNode . getElementsByTagName ( "property" ) ; // For each element , add it to the Properties object
for ( int j = 0 ; j < propsList . getLength ( ) ; j ++ ) { Element property = ( Element ) propsList . item ( j ) ; String propertyName = property . getAttribute ( "name" ) ; String propertyType = property . getAttribute ( "type" ) ; String propertyValue = property . getAttribute ( "value" ) ; props . addProperty ( new ConfigProperties . Property ( propertyName , propertyType , ConfigProperties . Property . toObject ( propertyType , propertyValue ) ) ) ; } } // Create the Resource Adaptor ID
cidpe . setAsText ( raEntity . getAttribute ( "resource-adaptor-id" ) ) ; ResourceAdaptorID componentID = ( ResourceAdaptorID ) cidpe . getValue ( ) ; // Add the Create and Activate RA Entity actions to the Post - Install
// Actions
cPostInstallActions . add ( new CreateResourceAdaptorEntityAction ( componentID , entityName , props , resourceManagement ) ) ; cPostInstallActions . add ( new ActivateResourceAdaptorEntityAction ( entityName , resourceManagement ) ) ; // Each RA might have zero or more links . . get them
NodeList links = raEntity . getElementsByTagName ( "ra-link" ) ; for ( int j = 0 ; j < links . getLength ( ) ; j ++ ) { String linkName = ( ( Element ) links . item ( j ) ) . getAttribute ( "name" ) ; cPostInstallActions . add ( new BindLinkNameAction ( linkName , entityName , resourceManagement ) ) ; cPreUninstallActions . add ( new UnbindLinkNameAction ( linkName , resourceManagement ) ) ; } // Add the Deactivate and Remove RA Entity actions to the
// Pre - Uninstall Actions
cPreUninstallActions . add ( new DeactivateResourceAdaptorEntityAction ( entityName , resourceManagement ) ) ; cPreUninstallActions . add ( new RemoveResourceAdaptorEntityAction ( entityName , resourceManagement ) ) ; // Finally add the actions to the respective hashmap .
if ( raId != null ) { // We need to check if we are updating or adding new ones .
if ( postInstallActions . containsKey ( raId ) ) { postInstallActions . get ( raId ) . addAll ( cPostInstallActions ) ; } else { postInstallActions . put ( raId , cPostInstallActions ) ; } // Same here . . .
if ( preUninstallActions . containsKey ( raId ) ) { preUninstallActions . get ( raId ) . addAll ( cPreUninstallActions ) ; } else { preUninstallActions . put ( raId , cPreUninstallActions ) ; } } // recreate the lists for the next round ( might come a new RA ID ) . . .
cPostInstallActions = new ArrayList < ManagementAction > ( ) ; cPreUninstallActions = new ArrayList < ManagementAction > ( ) ; raId = null ; } this . postInstallActions = Collections . unmodifiableMap ( postInstallActions ) ; this . preUninstallActions = Collections . unmodifiableMap ( preUninstallActions ) ;


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

implementation: Object jaxbPojo = buildJAXBPojo ( inputStream ) ; List < ServiceDescriptorImpl > result = new ArrayList < ServiceDescriptorImpl > ( ) ; MServiceXML serviceXML = null ; if ( jaxbPojo instanceof org . mobicents . slee . container . component . deployment . jaxb . slee . service . ServiceXml ) { serviceXML = new MServiceXML ( ( org . mobicents . slee . container . component . deployment . jaxb . slee . service . ServiceXml ) jaxbPojo ) ; } else if ( jaxbPojo instanceof org . mobicents . slee . container . component . deployment . jaxb . slee11 . service . ServiceXml ) { serviceXML = new MServiceXML ( ( org . mobicents . slee . container . component . deployment . jaxb . slee11 . service . ServiceXml ) jaxbPojo ) ; } else { throw new SLEEException ( "unexpected class of jaxb pojo built: " + ( jaxbPojo != null ? jaxbPojo . getClass ( ) : null ) ) ; } for ( MService mService : serviceXML . getMServices ( ) ) { result . add ( new ServiceDescriptorImpl ( mService ) ) ; } return result ;


signature:
public class ClassPool { /** * cleans up the class pool cache */
public void clean ( ) { } }

implementation: for ( ClassPath classPath : classPaths ) { classPool . removeClassPath ( classPath ) ; } for ( String classMade : classesMade ) { try { classPool . get ( classMade ) . detach ( ) ; } catch ( NotFoundException e ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Failed to detach class " + classMade + " from class pool" , e ) ; } } }


signature:
public class SleeConnectionServiceImpl { /** * / * ( non - Javadoc )
 * @ see javax . slee . connection . SleeConnection # createActivityHandle ( ) */
public ExternalActivityHandle createActivityHandle ( ) throws ResourceException { } }

implementation: if ( sleeContainer == null ) { throw new ResourceException ( "Connection is in closed state" ) ; } if ( sleeContainer . getSleeState ( ) != SleeState . RUNNING ) { throw new ResourceException ( "Container is not in running state." ) ; } return sleeContainer . getNullActivityFactory ( ) . createNullActivityHandle ( ) ;


signature:
public class SleeConnectionServiceImpl { /** * / * ( non - Javadoc )
 * @ see javax . slee . connection . SleeConnection # fireEvent ( java . lang . Object , javax . slee . EventTypeID , javax . slee . connection . ExternalActivityHandle , javax . slee . Address ) */
public void fireEvent ( Object event , EventTypeID eventType , ExternalActivityHandle activityHandle , Address address ) throws NullPointerException , UnrecognizedActivityException , UnrecognizedEventException , ResourceException { } }

implementation:
if ( sleeContainer == null ) { throw new ResourceException ( "Connection is in closed state" ) ; } if ( sleeContainer . getSleeState ( ) != SleeState . RUNNING ) { throw new ResourceException ( "Container is not in running state." ) ; } if ( logger . isDebugEnabled ( ) ) { logger . debug ( "fireEvent(event=" + event + ",eventType=" + eventType + ",activityHandle=" + activityHandle + ",address=" + address + ")" ) ; } if ( event == null ) { throw new NullPointerException ( "event is null" ) ; } if ( eventType == null ) { throw new NullPointerException ( "event type is null" ) ; } if ( activityHandle == null ) { throw new NullPointerException ( "activity handle is null" ) ; } EventTypeComponent eventTypeComponent = sleeContainer . getComponentRepository ( ) . getComponentByID ( eventType ) ; if ( eventTypeComponent == null ) { throw new UnrecognizedEventException ( "event type not installed" ) ; } if ( ! eventTypeComponent . getEventTypeClass ( ) . isAssignableFrom ( event . getClass ( ) ) ) { logger . info ( "" + eventTypeComponent . getEventTypeClass ( ) . toString ( ) ) ; logger . info ( "" + eventTypeComponent . getEventTypeClass ( ) . getCanonicalName ( ) ) ; logger . info ( "" + Arrays . toString ( eventTypeComponent . getEventTypeClass ( ) . getDeclaredMethods ( ) ) ) ; logger . info ( "" + eventTypeComponent . getEventTypeClass ( ) . getClass ( ) . toString ( ) ) ; logger . info ( "" + eventTypeComponent . getEventTypeClass ( ) . getClass ( ) . getCanonicalName ( ) ) ; logger . info ( "" + event . getClass ( ) . toString ( ) ) ; logger . info ( "" + event . getClass ( ) . getCanonicalName ( ) ) ; logger . info ( "" + Arrays . toString ( event . getClass ( ) . getDeclaredMethods ( ) ) ) ; logger . info ( "*" + eventTypeComponent ) ; logger . info ( "*" + eventTypeComponent . getEventTypeID ( ) ) ; logger . info ( "*" + event ) ; logger . info ( "&" + eventTypeComponent . getClassLoader ( ) ) ; logger . info ( "&" + eventTypeComponent . getEventTypeClass ( ) . getClassLoader ( ) ) ; logger . info ( "&" + event . getClass ( ) . getClassLoader ( ) ) ; // throw new UnrecognizedEventException (
// " the class of the event object fired is not assignable to the event class of the event type . \ n " +
// " EventClass : " + event . getClass ( ) + " , component class : " + eventTypeComponent . getEventTypeClass ( ) ) ;
} if ( ! ( activityHandle instanceof NullActivityHandle ) ) { throw new UnrecognizedActivityException ( activityHandle ) ; } // check container state is running
SleeContainer sleeContainer = SleeContainer . lookupFromJndi ( ) ; if ( sleeContainer . getSleeState ( ) != SleeState . RUNNING ) { throw new IllegalStateException ( "Container is not running" ) ; } SleeTransactionManager txMgr = sleeContainer . getTransactionManager ( ) ; boolean newTx = txMgr . requireTransaction ( ) ; boolean rollback = true ; try { final NullActivityHandle nullActivityHandle = ( NullActivityHandle ) activityHandle ; final ActivityContextHandle ach = nullActivityHandle . getActivityContextHandle ( ) ; ActivityContext ac = sleeContainer . getActivityContextFactory ( ) . getActivityContext ( ach ) ; if ( ac == null ) { sleeContainer . getNullActivityFactory ( ) . createNullActivity ( nullActivityHandle , false ) ; ac = sleeContainer . getActivityContextFactory ( ) . getActivityContext ( ach ) ; if ( ac == null ) { throw new SLEEException ( "unable to create null ac for external activity handle " + activityHandle ) ; } } ac . fireEvent ( eventType , event , address , null , null , null , null ) ; rollback = false ; } catch ( Throwable ex ) { logger . error ( "Exception in fireEvent!" , ex ) ; } finally { if ( newTx ) { if ( rollback ) { try { txMgr . rollback ( ) ; } catch ( Throwable e ) { logger . error ( "failed to rollback implicit tx" , e ) ; } } else { try { txMgr . commit ( ) ; } catch ( Throwable e ) { logger . error ( "failed to commit implicit tx" , e ) ; } } } // else ignore , specs say there is no need to rollback a tx if event
// queuing failed
}


signature:
public class SleeConnectionServiceImpl { /** * / * ( non - Javadoc )
 * @ see javax . slee . connection . SleeConnection # getEventTypeID ( java . lang . String , java . lang . String , java . lang . String ) */
public EventTypeID getEventTypeID ( String name , String vendor , String version ) throws UnrecognizedEventException , ResourceException { } }

implementation: if ( sleeContainer == null ) { throw new ResourceException ( "Connection is in closed state" ) ; } if ( sleeContainer . getSleeState ( ) != SleeState . RUNNING ) { throw new ResourceException ( "Container is not in running state." ) ; } EventTypeID eventTypeID = new EventTypeID ( name , vendor , version ) ; EventTypeComponent eventTypeComponent = sleeContainer . getComponentRepository ( ) . getComponentByID ( eventTypeID ) ; if ( eventTypeComponent == null ) { throw new UnrecognizedEventException ( "event type not installed" ) ; } else { return eventTypeID ; }


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

implementation: parentSbbEntityID = ( SbbEntityID ) in . readObject ( ) ; parentChildRelation = in . readUTF ( ) ; childID = in . readUTF ( ) ;


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

implementation: out . writeObject ( parentSbbEntityID ) ; out . writeUTF ( parentChildRelation ) ; out . writeUTF ( childID ) ;


signature:
public class ProfileEditCommand { /** * / * ( non - Javadoc )
 * @ see org . mobicents . tools . twiddle . AbstractSleeCommand # processArguments ( java . lang . String [ ] ) */
@ Override protected void processArguments ( String [ ] args ) throws CommandException { } }

implementation:
// first , we must get atleast - t , possibly - p , depending on those we call different method on ProfileProvisioningMBean
// String sopts = " : t : p : ldwecrog : s " ;
String sopts = "-:l:xdwecrog:s" ; LongOpt [ ] lopts = { // conf part
// new LongOpt ( " table " , LongOpt . REQUIRED _ ARGUMENT , null , ' t ' ) ,
// new LongOpt ( " profile " , LongOpt . REQUIRED _ ARGUMENT , null , ' p ' ) ,
new LongOpt ( "noprefix" , LongOpt . NO_ARGUMENT , null , 0x1000 ) , // operration part
new LongOpt ( "list" , LongOpt . NO_ARGUMENT , null , 'l' ) , new LongOpt ( "extlist" , LongOpt . NO_ARGUMENT , null , 'x' ) , new LongOpt ( "dirty" , LongOpt . NO_ARGUMENT , null , 'd' ) , new LongOpt ( "write" , LongOpt . NO_ARGUMENT , null , 'w' ) , new LongOpt ( "edit" , LongOpt . NO_ARGUMENT , null , 'e' ) , new LongOpt ( "commit" , LongOpt . NO_ARGUMENT , null , 'c' ) , new LongOpt ( "restore" , LongOpt . NO_ARGUMENT , null , 'r' ) , new LongOpt ( "close" , LongOpt . NO_ARGUMENT , null , 'o' ) , // get , set , bussines
new LongOpt ( "get" , LongOpt . REQUIRED_ARGUMENT , null , 'g' ) , new LongOpt ( "set" , LongOpt . NO_ARGUMENT , null , 's' ) , // options for set
new LongOpt ( "name" , LongOpt . REQUIRED_ARGUMENT , null , SetAttributeOperation . name ) , new LongOpt ( "separator" , LongOpt . OPTIONAL_ARGUMENT , null , SetAttributeOperation . separator ) , new LongOpt ( "value" , LongOpt . OPTIONAL_ARGUMENT , null , SetAttributeOperation . value ) , // new LongOpt ( " bussines " , LongOpt . NO _ ARGUMENT , null , ' b ' ) ,
} ; Getopt getopt = new Getopt ( null , args , sopts , lopts ) ; getopt . setOpterr ( false ) ; int nonOptArgIndex = 0 ; int code ; while ( ( code = getopt . getopt ( ) ) != - 1 ) { switch ( code ) { case ':' : throw new CommandException ( "Option requires an argument: " + args [ getopt . getOptind ( ) - 1 ] ) ; case '?' : throw new CommandException ( "Invalid (or ambiguous) option: " + args [ getopt . getOptind ( ) - 1 ] ) ; // CONF PART
// case ' t ' :
// this . profileTableName = getopt . getOptarg ( ) ;
// break ;
// case ' p ' :
// this . profileName = getopt . getOptarg ( ) ;
// break ;
// OPERATION PART
case 0x1000 : break ; case 1 : // non opt args , table and profile name ( maybe )
switch ( nonOptArgIndex ) { case 0 : profileTableName = getopt . getOptarg ( ) ; nonOptArgIndex ++ ; break ; case 1 : profileName = getopt . getOptarg ( ) ; nonOptArgIndex ++ ; break ; default : throw new CommandException ( "Command: \"" + getName ( ) + "\" expects at most two non opt arguments!" ) ; } break ; case 'l' : // list
super . operation = new ListOperation ( super . context , super . log , this ) ; prepareCommand ( ) ; super . operation . buildOperation ( getopt , args ) ; break ; case 'x' : // extlist
super . operation = new ExtListOperation ( super . context , super . log , this ) ; prepareCommand ( ) ; super . operation . buildOperation ( getopt , args ) ; break ; case 'd' : // dirt
super . operation = new SimpleInvokeOperation ( super . context , super . log , this , "isProfileDirty" ) ; prepareCommand ( ) ; super . operation . buildOperation ( getopt , args ) ; break ; case 'w' : // write
super . operation = new SimpleInvokeOperation ( super . context , super . log , this , "isProfileWriteable" ) ; prepareCommand ( ) ; super . operation . buildOperation ( getopt , args ) ; break ; case 'e' : // edit
super . operation = new SimpleInvokeOperation ( super . context , super . log , this , "editProfile" ) ; prepareCommand ( ) ; super . operation . buildOperation ( getopt , args ) ; break ; case 'c' : // commit
super . operation = new SimpleInvokeOperation ( super . context , super . log , this , "commitProfile" ) ; prepareCommand ( ) ; super . operation . buildOperation ( getopt , args ) ; break ; case 'r' : // restore
super . operation = new SimpleInvokeOperation ( super . context , super . log , this , "restoreProfile" ) ; prepareCommand ( ) ; super . operation . buildOperation ( getopt , args ) ; break ; case 'o' : // close
super . operation = new SimpleInvokeOperation ( super . context , super . log , this , "closeProfile" ) ; prepareCommand ( ) ; super . operation . buildOperation ( getopt , args ) ; break ; case 'g' : // get
super . operation = new GetAttributeOperation ( super . context , super . log , this ) ; prepareCommand ( ) ; super . operation . buildOperation ( getopt , args ) ; break ; case 's' : // set
super . operation = new SetAttributeOperation ( super . context , super . log , this ) ; prepareCommand ( ) ; super . operation . buildOperation ( getopt , args ) ; break ; // case ' b ' :
// / / bussines
// super . operation = new BussinesMethodOperation ( super . context , super . log , this ) ;
// super . operation . buildOperation ( getopt , args ) ;
// break ;
default : throw new CommandException ( "Command: \"" + getName ( ) + "\", found unexpected opt: " + args [ getopt . getOptind ( ) - 1 ] ) ; } }


signature:
public class ProfileCallRecorderTransactionData { /** * Adds call to this profile .
 * @ param po
 * @ throws SLEEException */
@ SuppressWarnings ( "unchecked" ) public static void addProfileCall ( ProfileObjectImpl po ) throws SLEEException { } }

implementation:
SleeTransactionManager sleeTransactionManager = sleeContainer . getTransactionManager ( ) ; try { if ( sleeTransactionManager . getTransaction ( ) == null ) { return ; } } catch ( SystemException se ) { throw new SLEEException ( "Unable to verify SLEE Transaction." , se ) ; } String key = makeKey ( po ) ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Recording call to profile. Key[" + key + "]" ) ; } final TransactionContext txContext = sleeTransactionManager . getTransactionContext ( ) ; ProfileCallRecorderTransactionData data = ( ProfileCallRecorderTransactionData ) txContext . getData ( ) . get ( TRANSACTION_CONTEXT_KEY ) ; // If data does not exist , create it
if ( data == null ) { data = new ProfileCallRecorderTransactionData ( ) ; txContext . getData ( ) . put ( TRANSACTION_CONTEXT_KEY , data ) ; } if ( ! po . isProfileReentrant ( ) ) { // we need to check
if ( data . invokedProfiles . contains ( key ) && data . invokedProfiles . getLast ( ) . compareTo ( key ) != 0 ) { throw new SLEEException ( "Detected loopback call. Call sequence: " + data . invokedProfiles ) ; } data . invokedProfiles . add ( key ) ; data . invokedProfileTablesNames . add ( po . getProfileTable ( ) . getProfileTableName ( ) ) ; }


signature:
public class ProfileTableTransactionView { /** * Retrieves a profile object for the table and specified profile name ,
 * there is only one profile object per profile entity per transaction
 * @ param profileName
 * @ return
 * @ throws TransactionRequiredLocalException
 * @ throws SLEEException */
public ProfileObjectImpl getProfile ( String profileName ) throws TransactionRequiredLocalException , SLEEException { } }

implementation: Map txData = getTxData ( ) ; ProfileTransactionID key = new ProfileTransactionID ( profileName , profileTable . getProfileTableName ( ) ) ; ProfileObjectImpl value = ( ProfileObjectImpl ) txData . get ( key ) ; if ( value == null ) { ProfileObjectPool pool = profileTable . getProfileManagement ( ) . getObjectPoolManagement ( ) . getObjectPool ( profileTable . getProfileTableName ( ) ) ; value = pool . borrowObject ( ) ; passivateProfileObjectOnTxEnd ( profileTable . getSleeContainer ( ) . getTransactionManager ( ) , value , pool ) ; try { value . profileActivate ( profileName ) ; } catch ( UnrecognizedProfileNameException e ) { value . invalidateObject ( ) ; pool . invalidateObject ( value ) ; return null ; } txData . put ( key , value ) ; } return value ;


signature:
public class ProfileTableTransactionView { /** * Adds transactional actions to the active transaction to passivate a
 * profile object .
 * @ param txManager
 * @ param profileObject
 * @ param pool */
public static void passivateProfileObjectOnTxEnd ( SleeTransactionManager txManager , final ProfileObjectImpl profileObject , final ProfileObjectPool pool ) { } }

implementation: TransactionalAction afterRollbackAction = new TransactionalAction ( ) { public void execute ( ) { profileObject . invalidateObject ( ) ; pool . returnObject ( profileObject ) ; } } ; TransactionalAction beforeCommitAction = new TransactionalAction ( ) { public void execute ( ) { if ( profileObject . getState ( ) == ProfileObjectState . READY ) { if ( ! profileObject . getProfileEntity ( ) . isRemove ( ) ) { profileObject . fireAddOrUpdatedEventIfNeeded ( ) ; profileObject . profilePassivate ( ) ; } else { profileObject . profileRemove ( true , false ) ; } pool . returnObject ( profileObject ) ; } } } ; final TransactionContext txContext = txManager . getTransactionContext ( ) ; txContext . getAfterRollbackActions ( ) . add ( afterRollbackAction ) ; txContext . getBeforeCommitActions ( ) . add ( beforeCommitAction ) ;


signature:
public class ProfileSpecificationComponentValidator { /** * ( non - Javadoc )
 * @ see
 * org . mobicents . slee . container . component . validator . Validator # validate ( ) */
public boolean validate ( ) { } }

implementation:
boolean passed = true ; try { if ( ! validateDescriptor ( ) ) { // this is quick fail
passed = false ; return passed ; } // we cant validate some parts on fail here
if ( ! validateCMPInterface ( ) ) { passed = false ; } else { if ( ! validateProfileTableInterface ( ) ) { passed = false ; } } if ( ! validateProfileLocalInterface ( ) ) { passed = false ; } if ( ! validateProfileManagementInterface ( ) ) { passed = false ; } if ( ! validateAbstractClass ( ) ) { passed = false ; } } catch ( Exception e ) { e . printStackTrace ( ) ; } return passed ;


signature:
public class ProfileSpecificationComponentValidator { /** * Should not be called when CMP interface validation fails cause it depends
 * on result of it
 * @ return */
boolean validateProfileManagementInterface ( ) { } }

implementation:
// this is optional
boolean passed = true ; String errorBuffer = new String ( "" ) ; if ( this . component . getProfileManagementInterfaceClass ( ) == null ) { // it can hapen when its not present
return passed ; } try { Class profileManagementInterfaceClass = this . component . getProfileManagementInterfaceClass ( ) ; if ( ! profileManagementInterfaceClass . isInterface ( ) ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification profile management interface is not an interface class!!!" , "10.10" , errorBuffer ) ; return passed ; } if ( this . component . isSlee11 ( ) && profileManagementInterfaceClass . getPackage ( ) == null ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification profile management interface must be declared within named package." , "10.10" , errorBuffer ) ; } if ( ! Modifier . isPublic ( profileManagementInterfaceClass . getModifiers ( ) ) ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification profile management interface must be declaredas public." , "10.10" , errorBuffer ) ; } // now here comes the fun . methods are subject to restrictions form
// 10.17 and 10.18 , BUT interface may implement or just define CMPs
// that MUST reasemlbe CMPs definition from CMP interface - that is
// all getter / setter methods defined
Set < String > ignore = new HashSet < String > ( ) ; ignore . add ( "java.lang.Object" ) ; Map < String , Method > cmpInterfaceMethods = ClassUtils . getAllInterfacesMethods ( this . component . getProfileCmpInterfaceClass ( ) , ignore ) ; Map < String , Method > managementInterfaceMethods = ClassUtils . getAllInterfacesMethods ( profileManagementInterfaceClass , ignore ) ; // we cant simply remove all methods from
// managementInterfaceMethods . removeAll ( cmpInterfaceMethods ) since
// with abstract classes it becomes comp ; licated
// we can have doubling definition with for instance return type or
// throws clause ( as diff ) which until concrete class wont be
// noticed - and is an error . . . .
// FIXME : does mgmt interface have to define both CMP accessors ?
Iterator < Entry < String , Method > > entryIterator = managementInterfaceMethods . entrySet ( ) . iterator ( ) ; while ( entryIterator . hasNext ( ) ) { Entry < String , Method > entry = entryIterator . next ( ) ; String key = entry . getKey ( ) ; if ( cmpInterfaceMethods . containsKey ( key ) ) { // FIXME : possibly we shoudl iterate over names ?
if ( ! compareMethod ( entry . getValue ( ) , cmpInterfaceMethods . get ( key ) ) ) { // return type or throws clause , or modifiers differ
passed = false ; errorBuffer = appendToBuffer ( "Profile specification profile management interface declares method which has signature simlar to CMP method, but it has different throws clause, return type or modifiers, which is wrong." , "10.10" , errorBuffer ) ; } } else { // we can have setter / getter like as stand alone ?
if ( _FORBIDEN_METHODS . contains ( key ) ) { // this is forrbiden , section 10.18
passed = false ; errorBuffer = appendToBuffer ( "Profile specification profile management interface declares method from forbiden list, method: " + entry . getKey ( ) , "10.18" , errorBuffer ) ; continue ; } // is this the right place ? This tells validator
// wheather it should require profile abstract class in
// case of 1.1
requiredProfileAbstractClass = true ; // we know that name is ok .
// FIXME : SPECS Are weird - Management methods may not
// have the same name and arguments as a Profile CMP
// field get or set accessor method . < - - - - ITS CMP
// METHOD < SIGNATURE IS NAME AND
// PARAMETERS and its implemented if its doubled from
// CMP or this interface extends CMP
// interface . . . . . ! ! ! ! !
if ( key . startsWith ( "ejb" ) ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification profile management interface declares method with wrong prefix, method: " + entry . getKey ( ) , "10.18" , errorBuffer ) ; continue ; } // there are no reqs other than parameters ?
Class [ ] params = entry . getValue ( ) . getParameterTypes ( ) ; for ( int index = 0 ; index < params . length ; index ++ ) { if ( _ALLOWED_MANAGEMENT_TYPES . contains ( params [ index ] . toString ( ) ) || ClassUtils . checkInterfaces ( params [ index ] , "java.io.Serializable" ) != null ) { } else { passed = false ; errorBuffer = appendToBuffer ( "Profile specification profile management interface declares management method with wrong parameter at index[" + index + "], method: " + entry . getKey ( ) , "10.18" , errorBuffer ) ; } } } } } finally { if ( ! passed ) { if ( logger . isEnabledFor ( Level . ERROR ) ) logger . error ( errorBuffer ) ; // System . err . println ( errorBuffer ) ;
} } return passed ;


signature:
public class ProfileSpecificationComponentValidator { /** * shoudl not be run if other interfaces vaildation fails .
 * @ return */
boolean validateAbstractClass ( ) { } }

implementation:
boolean passed = true ; String errorBuffer = new String ( "" ) ; try { if ( this . component . getDescriptor ( ) . getProfileAbstractClass ( ) == null ) { if ( this . requiredProfileAbstractClass ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification profile management abstract class must be present" , "3.X" , errorBuffer ) ; return passed ; } } else { if ( this . component . getProfileAbstractClass ( ) == null ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification profile management abstract class has not been loaded" , "3.X" , errorBuffer ) ; return passed ; } } Class profileAbstractClass = this . component . getProfileAbstractClass ( ) ; // FIXME : Alexandre : Added this , was making some tests fail . Review !
if ( profileAbstractClass == null ) { return passed ; } // if ( profileAbstractClass . isInterface ( )
// | | profileAbstractClass . isEnum ( ) ) {
// passed = false ;
// errorBuffer = appendToBuffer (
// " Profile specification profile abstract class in not a clas . " ,
// "10.11 " , errorBuffer ) ;
// return passed ;
if ( this . component . isSlee11 ( ) ) { if ( profileAbstractClass . getPackage ( ) == null ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification profile abstract class must be defined in package." , "10.11" , errorBuffer ) ; } // FIXME : what about 1.0 ?
// public , no arg constructor without throws clause
Constructor c = null ; try { c = profileAbstractClass . getConstructor ( null ) ; } catch ( Exception e ) { // TODO Auto - generated catch block
// e . printStackTrace ( ) ;
} if ( c == null ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification profile abstract class must define public no arg constructor." , "10.11" , errorBuffer ) ; } else { if ( ! Modifier . isPublic ( c . getModifiers ( ) ) ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification profile abstract class must define public no arg constructor." , "10.11" , errorBuffer ) ; } if ( c . getExceptionTypes ( ) . length > 0 ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification profile abstract class must define public no arg constructor without throws clause." , "10.11" , errorBuffer ) ; } } } int modifiers = profileAbstractClass . getModifiers ( ) ; if ( ! Modifier . isAbstract ( modifiers ) ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification profile abstract class must be defined abstract." , "10.11" , errorBuffer ) ; } if ( ! Modifier . isPublic ( modifiers ) ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification profile abstract class must be defined public." , "10.11" , errorBuffer ) ; } // in case of 1.0 it has to implement as concrete methods from
// javax . slee . profile . ProfileManagement - section 10.8 of 1.0 specs
Map < String , Method > requiredLifeCycleMethods = null ; Set < String > ignore = new HashSet < String > ( ) ; ignore . add ( "java.lang.Object" ) ; if ( this . component . isSlee11 ( ) ) { Class javaxSleeProfileProfileClass = ClassUtils . checkInterfaces ( profileAbstractClass , "javax.slee.profile.Profile" ) ; if ( javaxSleeProfileProfileClass == null ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification profile abstract class must implement javax.slee.profile.Profile." , "10.11" , errorBuffer ) ; requiredLifeCycleMethods = ClassUtils . getAllInterfacesMethods ( javax . slee . profile . ProfileLocalObject . class , ignore ) ; } else { requiredLifeCycleMethods = ClassUtils . getAllInterfacesMethods ( javaxSleeProfileProfileClass , ignore ) ; } } else { Class javaxSleeProfileProfileManagement = ClassUtils . checkInterfaces ( profileAbstractClass , "javax.slee.profile.ProfileManagement" ) ; if ( javaxSleeProfileProfileManagement == null ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification profile abstract class must implement javax.slee.profile.ProfileManagement." , "10.8" , errorBuffer ) ; requiredLifeCycleMethods = ClassUtils . getAllInterfacesMethods ( javax . slee . profile . ProfileManagement . class , ignore ) ; } else { requiredLifeCycleMethods = ClassUtils . getAllInterfacesMethods ( javaxSleeProfileProfileManagement , ignore ) ; } } Map < String , Method > abstractMethods = ClassUtils . getAbstractMethodsFromClass ( profileAbstractClass ) ; Map < String , Method > abstractMethodsFromSuperClasses = ClassUtils . getAbstractMethodsFromSuperClasses ( profileAbstractClass ) ; Map < String , Method > concreteMethods = ClassUtils . getConcreteMethodsFromClass ( profileAbstractClass ) ; Map < String , Method > concreteMethodsFromSuperClasses = ClassUtils . getConcreteMethodsFromSuperClasses ( profileAbstractClass ) ; // FIXME : Alexandre : Verify if this is correct
// The isProfileDirty , markProfileDirty and isProfileValid methods must not be
// implemented as they are implemented by the SLEE . These three methods are implemented by the
// SLEE at deployment time .
Set < String > toBeImplementedBySlee = new HashSet < String > ( ) ; toBeImplementedBySlee . add ( "isProfileDirty" ) ; toBeImplementedBySlee . add ( "markProfileDirty" ) ; toBeImplementedBySlee . add ( "isProfileValid" ) ; for ( Entry < String , Method > entry : requiredLifeCycleMethods . entrySet ( ) ) { Method m = entry . getValue ( ) ; Method methodFromClass = ClassUtils . getMethodFromMap ( m . getName ( ) , m . getParameterTypes ( ) , concreteMethods , concreteMethodsFromSuperClasses ) ; if ( methodFromClass == null ) { if ( this . component . isSlee11 ( ) || ( ! this . component . isSlee11 ( ) && ! toBeImplementedBySlee . contains ( m . getName ( ) ) ) ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification profile abstract class must implement certain lifecycle methods. Method not found in concrete(non private) methods: " + m . getName ( ) , "10.11" , errorBuffer ) ; } continue ; } if ( methodFromClass != null && toBeImplementedBySlee . contains ( m . getName ( ) ) ) { passed = false ; errorBuffer = appendToBuffer ( "[JAIN SLEE 1.0] The " + m . getName ( ) + " method must not be implemented as they are implemented by the SLEE." , "10.11" , errorBuffer ) ; continue ; } // it concrete - must check return type
if ( ! m . getReturnType ( ) . getName ( ) . equals ( methodFromClass . getReturnType ( ) . getName ( ) ) ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification profile abstract class must implement certain lifecycle methods. Method with name: " + m . getName ( ) + " found in concrete(non private) methods has different return type: " + methodFromClass . getReturnType ( ) + ", than one declared in interface: " + m . getReturnType ( ) , "10.11" , errorBuffer ) ; } if ( ! Arrays . equals ( m . getExceptionTypes ( ) , methodFromClass . getExceptionTypes ( ) ) ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification profile abstract class must implement certain lifecycle methods. Method with name: " + m . getName ( ) + " found in concrete(non private) methods has different throws clause than one found in class." , "10.11" , errorBuffer ) ; } // must be public , not abstract , not final , not static
modifiers = methodFromClass . getModifiers ( ) ; if ( ! Modifier . isPublic ( modifiers ) ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification profile abstract class must implement certain lifecycle methods. Method with name: " + m . getName ( ) + " found in concrete(non private) methods must be public." , "10.11" , errorBuffer ) ; } if ( Modifier . isStatic ( modifiers ) ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification profile abstract class must implement certain lifecycle methods. Method with name: " + m . getName ( ) + " found in concrete(non private) methods must not be static." , "10.11" , errorBuffer ) ; } if ( Modifier . isFinal ( modifiers ) ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification profile abstract class must implement certain lifecycle methods. Method with name: " + m . getName ( ) + " found in concrete(non private) methods must not be final." , "10.11" , errorBuffer ) ; } // FIXME : native ?
} // in 1.1 and 1.0 it must implement CMP interfaces , but methods
// defined there MUST stay abstract
Class profileCMPInterface = ClassUtils . checkInterfaces ( profileAbstractClass , this . component . getProfileCmpInterfaceClass ( ) . getName ( ) ) ; if ( profileCMPInterface == null ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification profile abstract class must implement profile CMP interface." , "10.11" , errorBuffer ) ; return passed ; } // abstract class implements CMP Interface , but leaves all methods
// as abstract
Map < String , Method > cmpInterfaceMethods = ClassUtils . getAllInterfacesMethods ( profileCMPInterface , ignore ) ; if ( profileCMPInterface == null ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification profile abstract class must implement defined profile CMP interface." , "10.11" , errorBuffer ) ; } else { for ( Entry < String , Method > entry : cmpInterfaceMethods . entrySet ( ) ) { Method m = entry . getValue ( ) ; Method methodFromClass = ClassUtils . getMethodFromMap ( m . getName ( ) , m . getParameterTypes ( ) , concreteMethods , concreteMethodsFromSuperClasses ) ; if ( methodFromClass != null ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification profile abstract class must leave CMP interface methods as abstract, it can not be concrete: " + m . getName ( ) , "10.11" , errorBuffer ) ; continue ; } methodFromClass = ClassUtils . getMethodFromMap ( m . getName ( ) , m . getParameterTypes ( ) , abstractMethods , abstractMethodsFromSuperClasses ) ; // it concrete - must check return type
if ( m . getReturnType ( ) . getName ( ) . compareTo ( methodFromClass . getReturnType ( ) . getName ( ) ) != 0 ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification profile abstract class must not decalre methods from CMP interface with different return type. Method with name: " + m . getName ( ) + " found in (non private) class methods has different return type: " + methodFromClass . getReturnType ( ) + ", than one declared in interface: " + m . getReturnType ( ) , "10.11" , errorBuffer ) ; } if ( ! Arrays . equals ( m . getExceptionTypes ( ) , methodFromClass . getExceptionTypes ( ) ) ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification profile abstract class must not change throws clause. Method with name: " + m . getName ( ) + " found in (non private) class methods has different throws clause than one found in class." , "10.11" , errorBuffer ) ; } // FIXME : should we do that ?
abstractMethods . remove ( entry . getKey ( ) ) ; abstractMethodsFromSuperClasses . remove ( entry . getKey ( ) ) ; } } // those checks are . . . . .
// 1.0 and 1.1 if we define management interface we have to
// implement it , and all methods that are not CMPs
if ( this . component . getDescriptor ( ) . getProfileManagementInterface ( ) != null ) { Class profileManagementInterfaceClass = this . component . getProfileManagementInterfaceClass ( ) ; // if abstract class and management interface are both defined than abstract class must implement the management interface
if ( this . component . getProfileAbstractClass ( ) != null && ! profileManagementInterfaceClass . isAssignableFrom ( this . component . getProfileAbstractClass ( ) ) ) { passed = false ; errorBuffer = appendToBuffer ( "Profile abstract class must implement profile management interface if both are specified" , "10.11" , errorBuffer ) ; } Map < String , Method > profileManagementInterfaceMethods = ClassUtils . getAllInterfacesMethods ( profileManagementInterfaceClass , ignore ) ; // methods except those defined in CMP interface must be
// concrete
for ( Entry < String , Method > entry : profileManagementInterfaceMethods . entrySet ( ) ) { Method m = entry . getValue ( ) ; // CMP methods must stay abstract
// check if this method is the same as in CMP interface is
// done elsewhere
// that check shoudl be ok to run this one ! ! ! XXX
if ( cmpInterfaceMethods . containsKey ( entry . getKey ( ) ) ) { // we do nothing , cmp interface is validate above
} else { // 10.8/10.11
Method concreteMethodFromAbstractClass = ClassUtils . getMethodFromMap ( m . getName ( ) , m . getParameterTypes ( ) , concreteMethods , concreteMethodsFromSuperClasses ) ; if ( concreteMethodFromAbstractClass == null ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification profile abstract class must implement as non private methods from profile management interface other than CMP methods" , "10.11" , errorBuffer ) ; continue ; } int concreteMethodModifiers = concreteMethodFromAbstractClass . getModifiers ( ) ; // public , and cannot be static , abstract , or final .
if ( ! Modifier . isPublic ( concreteMethodModifiers ) ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification profile abstract class must implement methods from profile management interface as public, offending method: " + concreteMethodFromAbstractClass . getName ( ) , "10.11" , errorBuffer ) ; } if ( Modifier . isStatic ( concreteMethodModifiers ) ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification profile abstract class must implement methods from profile management interface as not static, offending method: " + concreteMethodFromAbstractClass . getName ( ) , "10.11" , errorBuffer ) ; } if ( Modifier . isFinal ( concreteMethodModifiers ) ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification profile abstract class must implement methods from profile management interface as not final, offending method: " + concreteMethodFromAbstractClass . getName ( ) , "10.11" , errorBuffer ) ; } } } } if ( this . component . isSlee11 ( ) ) { // ProfileLocalObject and UsageInterface are domains of 1.1
// uff , ProfileLocal again that stupid check cross two
// interfaces and one abstract class . . . . .
if ( this . component . getDescriptor ( ) . getProfileLocalInterface ( ) != null ) { // abstract class MUST NOT implement it
if ( ClassUtils . checkInterfaces ( profileAbstractClass , this . component . getDescriptor ( ) . getProfileLocalInterface ( ) . getProfileLocalInterfaceName ( ) ) != null || ClassUtils . checkInterfaces ( profileAbstractClass , "javax.slee.profile.ProfileLocalObject" ) != null ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification profile abstract class must not implement profile local interface in any way(only methods must be implemented)" , "10.11" , errorBuffer ) ; } Class profileLocalObjectClass = this . component . getProfileLocalInterfaceClass ( ) ; ignore . add ( "javax.slee.profile.ProfileLocalObject" ) ; Map < String , Method > profileLocalObjectInterfaceMethods = ClassUtils . getAllInterfacesMethods ( profileLocalObjectClass , ignore ) ; ignore . remove ( "javax.slee.profile.ProfileLocalObject" ) ; // methods except those defined in CMP interface must be
// concrete
for ( Entry < String , Method > entry : profileLocalObjectInterfaceMethods . entrySet ( ) ) { Method m = entry . getValue ( ) ; // CMP methods must stay abstract
// check if this method is the same as in CMP interface
// is done elsewhere
// that check shoudl be ok to run this one ! ! ! XXX
if ( cmpInterfaceMethods . containsKey ( entry . getKey ( ) ) ) { // we do nothing , cmp interface is validate above
} else { // 10.8/10.11
Method concreteMethodFromAbstractClass = ClassUtils . getMethodFromMap ( m . getName ( ) , m . getParameterTypes ( ) , concreteMethods , concreteMethodsFromSuperClasses ) ; if ( concreteMethodFromAbstractClass == null ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification profile abstract class must implement as non private methods from profile local interface other than CMP methods" , "10.11" , errorBuffer ) ; continue ; } int concreteMethodModifiers = concreteMethodFromAbstractClass . getModifiers ( ) ; // public , and cannot be static , abstract , or final .
if ( ! Modifier . isPublic ( concreteMethodModifiers ) ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification profile abstract class must implement methods from profile local interface as public, offending method: " + concreteMethodFromAbstractClass . getName ( ) , "10.11" , errorBuffer ) ; } if ( Modifier . isStatic ( concreteMethodModifiers ) ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification profile abstract class must implement methods from profile local interface as not static, offending method: " + concreteMethodFromAbstractClass . getName ( ) , "10.11" , errorBuffer ) ; } if ( Modifier . isFinal ( concreteMethodModifiers ) ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification profile abstract class must implement methods from profile management interface as not final, offending method: " + concreteMethodFromAbstractClass . getName ( ) , "10.11" , errorBuffer ) ; } } } } // usage parameters
if ( this . component . getDescriptor ( ) . getProfileUsageParameterInterface ( ) != null ) { if ( ! validateProfileUsageInterface ( abstractMethods , abstractMethodsFromSuperClasses ) ) { passed = false ; } } } // FIXME : add check on abstract methods same as in SBB ?
} finally { if ( ! passed ) { if ( logger . isEnabledFor ( Level . ERROR ) ) logger . error ( errorBuffer ) ; // System . err . println ( errorBuffer ) ;
} } return passed ;


signature:
public class ProfileSpecificationComponentValidator { /** * Validated descriptor against some basic constraints : all references are
 * correct , some fields are declaredproperly , no double definitions , if
 * proper elements are present - for instance some elements exclude others .
 * @ return */
boolean validateDescriptor ( ) { } }

implementation:
boolean passed = true ; String errorBuffer = new String ( "" ) ; if ( ! this . component . isSlee11 ( ) ) { return passed ; // there is not much we can do for those oldies .
} try { HashSet < String > collatorAlliases = new HashSet < String > ( ) ; ProfileSpecificationDescriptorImpl desc = this . component . getDescriptor ( ) ; for ( CollatorDescriptor mc : desc . getCollators ( ) ) { if ( collatorAlliases . contains ( mc . getCollatorAlias ( ) ) ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification declares collator alias twice: " + mc . getCollatorAlias ( ) , "3.3.7" , errorBuffer ) ; } else { collatorAlliases . add ( mc . getCollatorAlias ( ) ) ; } } // double deifnition of refs is allowed .
Map < String , ProfileCMPFieldDescriptor > cmpName2Field = new HashMap < String , ProfileCMPFieldDescriptor > ( ) ; for ( ProfileCMPFieldDescriptor c : desc . getProfileCMPInterface ( ) . getCmpFields ( ) ) { if ( ! Character . isLowerCase ( c . getCmpFieldName ( ) . charAt ( 0 ) ) ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification declares wrong cmp field name, first char is not lower case, field: " + c . getCmpFieldName ( ) , "3.3.7" , errorBuffer ) ; } if ( cmpName2Field . containsKey ( c . getCmpFieldName ( ) ) ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification declares cmp field twice: " + c . getCmpFieldName ( ) , "3.3.7" , errorBuffer ) ; } else { cmpName2Field . put ( c . getCmpFieldName ( ) , c ) ; } if ( c . getUniqueCollatorRef ( ) != null && ! collatorAlliases . contains ( c . getUniqueCollatorRef ( ) ) ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification declares cmp field: " + c . getCmpFieldName ( ) + ", with wrong collator reference: " + c . getUniqueCollatorRef ( ) , "3.3.7" , errorBuffer ) ; } for ( IndexHintDescriptor indexHint : c . getIndexHints ( ) ) { if ( indexHint . getCollatorRef ( ) != null && ! collatorAlliases . contains ( indexHint . getCollatorRef ( ) ) ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification declares cmp field: " + c . getCmpFieldName ( ) + ", with index hint declaring wrong collator reference: " + c . getUniqueCollatorRef ( ) , "3.3.7" , errorBuffer ) ; } } } Set < String > queriesNames = new HashSet < String > ( ) ; for ( QueryDescriptor mq : desc . getQueryElements ( ) ) { if ( queriesNames . contains ( mq . getName ( ) ) ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification declares queries with the same name: " + mq . getName ( ) , "3.3.7" , errorBuffer ) ; } else { // FIXME : all declaredparameters have to be used in
// expressions ?
HashSet < String > decalredParameters = new HashSet < String > ( ) ; HashSet < String > usedParameters = new HashSet < String > ( ) ; for ( QueryParameterDescriptor mqp : mq . getQueryParameters ( ) ) { if ( decalredParameters . contains ( mqp . getName ( ) ) ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification declares query parameter twice, parameter name: " + mqp . getName ( ) + ", in query: " + mq . getName ( ) , "3.3.7" , errorBuffer ) ; } else { decalredParameters . add ( mqp . getName ( ) ) ; } } if ( ! validateExpression ( mq . getName ( ) , mq . getQueryExpression ( ) , usedParameters , cmpName2Field . keySet ( ) , collatorAlliases ) ) { passed = false ; } if ( ! usedParameters . containsAll ( decalredParameters ) && ! decalredParameters . containsAll ( usedParameters ) ) { passed = false ; decalredParameters . retainAll ( usedParameters ) ; errorBuffer = appendToBuffer ( "Profile specification declares query parameter that are not used, in query: " + mq . getName ( ) + ", not used parameters: " + Arrays . toString ( decalredParameters . toArray ( ) ) , "3.3.7" , errorBuffer ) ; } } } // FIXME : this should be here or not ?
if ( ! validateEnvEntries ( ) ) { passed = false ; } } finally { if ( ! passed ) { if ( logger . isEnabledFor ( Level . ERROR ) ) logger . error ( errorBuffer ) ; // System . err . println ( errorBuffer ) ;
} } return passed ;


signature:
public class ProfileSpecificationComponentValidator { /** * Checks expression to check if collator refs and cmp fields are referenced
 * correctly . type constraints are checked later . Since in case of lack of
 * parameter we have to relly totaly on CMP field type . Additionaly this
 * check if parameter and value are present together .
 * @ param queryName
 * @ param cmpInterfaceClass
 * @ param expression
 * @ param decalredQueryParameter
 * @ param usedQueryParameter
 * @ return */
boolean validateExpression ( String queryName , QueryExpressionDescriptor expression , Set < String > usedQueryParameter , Set < String > cmpFieldNames , Set < String > collatorAliasses ) { } }

implementation:
boolean passed = true ; String attributeName = null ; String collatorRef = null ; String parameter = null ; String value = null ; boolean ignoreAbsence = false ; // We dont have access to type of cmp , we just simply check parameter
String errorBuffer = new String ( "" ) ; try { switch ( expression . getType ( ) ) { // " complex types "
case And : for ( QueryExpressionDescriptor mqe : expression . getAnd ( ) ) { if ( ! validateExpression ( queryName , mqe , usedQueryParameter , cmpFieldNames , collatorAliasses ) ) { passed = false ; } } break ; case Or : for ( QueryExpressionDescriptor mqe : expression . getOr ( ) ) { if ( ! validateExpression ( queryName , mqe , usedQueryParameter , cmpFieldNames , collatorAliasses ) ) { passed = false ; } } break ; // " simple " types
case Not : // this is one akward case : )
if ( ! validateExpression ( queryName , expression . getNot ( ) , usedQueryParameter , cmpFieldNames , collatorAliasses ) ) { passed = false ; } break ; case Compare : attributeName = expression . getCompare ( ) . getAttributeName ( ) ; collatorRef = expression . getCompare ( ) . getCollatorRef ( ) ; parameter = expression . getCompare ( ) . getParameter ( ) ; value = expression . getCompare ( ) . getValue ( ) ; break ; case HasPrefix : attributeName = expression . getHasPrefix ( ) . getAttributeName ( ) ; collatorRef = expression . getHasPrefix ( ) . getCollatorRef ( ) ; parameter = expression . getHasPrefix ( ) . getParameter ( ) ; value = expression . getHasPrefix ( ) . getValue ( ) ; break ; case LongestPrefixMatch : attributeName = expression . getLongestPrefixMatch ( ) . getAttributeName ( ) ; collatorRef = expression . getLongestPrefixMatch ( ) . getCollatorRef ( ) ; parameter = expression . getLongestPrefixMatch ( ) . getParameter ( ) ; value = expression . getLongestPrefixMatch ( ) . getValue ( ) ; break ; case RangeMatch : attributeName = expression . getRangeMatch ( ) . getAttributeName ( ) ; collatorRef = expression . getRangeMatch ( ) . getCollatorRef ( ) ; RangeMatchDescriptor mrm = expression . getRangeMatch ( ) ; ignoreAbsence = true ; if ( mrm . getFromParameter ( ) == null && mrm . getFromValue ( ) == null ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification declares in static query wrong properties, either fromValue or fromParameter can be present, query name: " + queryName , "10.20.2" , errorBuffer ) ; } if ( mrm . getFromParameter ( ) != null && mrm . getFromValue ( ) != null ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification declares in static query wrong properties, either fromValue or fromParameter can be present, not both, query name: " + queryName , "10.20.2" , errorBuffer ) ; } if ( mrm . getToParameter ( ) == null && mrm . getToValue ( ) == null ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification declares in static query wrong properties, either toValue or toParameter can be present, query name: " + queryName , "10.20.2" , errorBuffer ) ; } if ( mrm . getToParameter ( ) != null && mrm . getToValue ( ) != null ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification declares in static query wrong properties, either toValue or toParameter can be present, not both, query name: " + queryName , "10.20.2" , errorBuffer ) ; } if ( mrm . getFromParameter ( ) != null ) { usedQueryParameter . add ( mrm . getFromParameter ( ) ) ; } if ( mrm . getToParameter ( ) != null ) { usedQueryParameter . add ( mrm . getToParameter ( ) ) ; } break ; } // This will hapen for Not , And , Or operators
if ( attributeName != null ) { if ( ! Character . isLowerCase ( attributeName . charAt ( 0 ) ) ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification declares in static query usage of cmp attribute that is not valid cmp identifier, declared cmp field: " + attributeName + ", query name: " + queryName , "10.20.2" , errorBuffer ) ; } else if ( ! cmpFieldNames . contains ( attributeName ) && ! checkForCmpMethodFromFieldName ( attributeName ) ) { // we have to check this . stupid specs for profile cmps are not so strict . . . . . You can defined CMP methods but not define them in descriptor . . . . . ! ! ! ! !
passed = false ; errorBuffer = appendToBuffer ( "Profile specification declares in static query usage of cmp field that does not exist(its not declared in descritpro and in cmp interface), declared cmp field: " + attributeName + ", query name: " + queryName , "10.20.2" , errorBuffer ) ; } if ( collatorRef != null && ! collatorAliasses . contains ( collatorRef ) ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification declares in static query usage of collator that is not aliased, collator alias: " + collatorRef + ", query name: " + queryName , "10.20.2" , errorBuffer ) ; } if ( ! ignoreAbsence && parameter != null && value != null ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification declares in static query wrong properties, value and parameter can not be present at the same time, query name: " + queryName , "10.20.2" , errorBuffer ) ; } if ( ! ignoreAbsence && parameter == null && value == null ) { passed = false ; errorBuffer = appendToBuffer ( "Profile specification declares in static query wrong properties, either value or parameter must be present, query name: " + queryName , "10.20.2" , errorBuffer ) ; } if ( parameter != null ) { usedQueryParameter . add ( parameter ) ; } } } finally { if ( ! passed ) { if ( logger . isEnabledFor ( Level . ERROR ) ) logger . error ( errorBuffer ) ; // System . err . println ( errorBuffer ) ;
} } return passed ;


signature:
public class ComponentIDArrayPropertyEditor { /** * Set the element as text value , parse it and setValue .
 * The separator is CID _ SEPARATOR */
public void setAsText ( String text ) { } }

implementation:
if ( text == null || text . equals ( "" ) ) { super . setValue ( new ComponentID [ 0 ] ) ; } else { java . util . ArrayList results = new java . util . ArrayList ( ) ; // the format for component ID is name vendor version .
java . util . StringTokenizer st = new java . util . StringTokenizer ( text , CID_SEPARATOR , true ) ; ComponentIDPropertyEditor cidPropEditor = new ComponentIDPropertyEditor ( ) ; while ( st . hasMoreTokens ( ) ) { cidPropEditor . setAsText ( st . nextToken ( ) ) ; if ( st . hasMoreTokens ( ) ) { st . nextToken ( ) ; } results . add ( cidPropEditor . getValue ( ) ) ; } ComponentID [ ] cid = new ComponentID [ results . size ( ) ] ; results . toArray ( cid ) ; this . setValue ( cid ) ; }


signature:
public class EventRouterExecutorImpl { /** * ( non - Javadoc )
 * @ see
 * org . mobicents . slee . runtime . eventrouter . EventRouterExecutor # execute ( java
 * . lang . Runnable ) */
public void execute ( Runnable task ) { } }

implementation: if ( stats == null ) { executor . execute ( task ) ; } else { executor . execute ( new MiscTaskStatsCollector ( task ) ) ; }


signature:
public class EventRouterExecutorImpl { /** * / * ( non - Javadoc )
 * @ see org . mobicents . slee . core . runtime . eventrouter . EventRouterExecutor # executeNow ( java . lang . Runnable ) */
public void executeNow ( Runnable task ) throws InterruptedException , ExecutionException { } }

implementation: if ( stats == null ) { executor . submit ( task ) . get ( ) ; } else { executor . submit ( new MiscTaskStatsCollector ( task ) ) . get ( ) ; }


signature:
public class EventRouterExecutorImpl { /** * / * ( non - Javadoc )
 * @ see org . mobicents . slee . runtime . eventrouter . EventRouterExecutor # routeEvent ( org . mobicents . slee . core . event . SleeEvent ) */
public void routeEvent ( EventContext event ) { } }

implementation: final EventRoutingTaskImpl eventRoutingTask = new EventRoutingTaskImpl ( event , sleeContainer ) ; if ( stats == null ) { executor . execute ( eventRoutingTask ) ; } else { executor . execute ( new EventRoutingTaskStatsCollector ( eventRoutingTask ) ) ; }


signature:
public class ResourceManagementMBeanImpl { /** * - - - - - MANAGEMENT OPERATIONS */
public void createResourceAdaptorEntity ( ResourceAdaptorID id , String entityName , ConfigProperties properties ) throws NullPointerException , InvalidArgumentException , UnrecognizedResourceAdaptorException , ResourceAdaptorEntityAlreadyExistsException , InvalidConfigurationException , ManagementException { } }

implementation: try { synchronized ( getSleeContainer ( ) . getManagementMonitor ( ) ) { resourceManagement . createResourceAdaptorEntity ( id , entityName , properties ) ; } } catch ( NullPointerException e ) { throw e ; } catch ( InvalidArgumentException e ) { throw e ; } catch ( UnrecognizedResourceAdaptorException e ) { throw e ; } catch ( ResourceAdaptorEntityAlreadyExistsException e ) { throw e ; } catch ( InvalidConfigurationException e ) { throw e ; } catch ( Throwable e ) { String s = "failed to create RA entity with name " + entityName ; logger . error ( s , e ) ; throw new ManagementException ( s , e ) ; }


signature:
public class ConcreteActivityContextInterfaceGenerator { /** * Generate the Activity Context Interface Class
 * @ param activityContextInterfaceName
 * the name of the Activity Context Interface
 * @ return the concrete Activity Context Interface class implementing the
 * Activity Context Interface */
public Class generateActivityContextInterfaceConcreteClass ( ) throws DeploymentException { } }

implementation:
String tmpClassName = ConcreteClassGeneratorUtils . CONCRETE_ACTIVITY_INTERFACE_CLASS_NAME_PREFIX + activityContextInterfaceName + ConcreteClassGeneratorUtils . CONCRETE_ACTIVITY_INTERFACE_CLASS_NAME_SUFFIX ; concreteActivityContextInterface = pool . makeClass ( tmpClassName ) ; CtClass sbbActivityContextInterface = null ; try { activityContextInterface = pool . get ( activityContextInterfaceName ) ; sbbActivityContextInterface = pool . get ( SbbActivityContextInterfaceImpl . class . getName ( ) ) ; } catch ( NotFoundException nfe ) { throw new DeploymentException ( "Could not find aci " + activityContextInterfaceName , nfe ) ; } // Generates the extends link
ConcreteClassGeneratorUtils . createInheritanceLink ( concreteActivityContextInterface , sbbActivityContextInterface ) ; // Generates the implements link
ConcreteClassGeneratorUtils . createInterfaceLinks ( concreteActivityContextInterface , new CtClass [ ] { activityContextInterface } ) ; // Generates the methods to implement from the interface
Map interfaceMethods = ClassUtils . getInterfaceMethodsFromInterface ( activityContextInterface ) ; generateConcreteMethods ( interfaceMethods ) ; // generates the class
String sbbDeploymentPathStr = deployDir ; try { concreteActivityContextInterface . writeFile ( sbbDeploymentPathStr ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Concrete Class " + tmpClassName + " generated in the following path " + sbbDeploymentPathStr ) ; } } catch ( Exception e ) { logger . error ( "problem generating concrete class" , e ) ; throw new DeploymentException ( "problem generating concrete class! " , e ) ; } // load the class
Class clazz = null ; try { clazz = Thread . currentThread ( ) . getContextClassLoader ( ) . loadClass ( tmpClassName ) ; } catch ( Exception e1 ) { logger . error ( "problem loading generated class" , e1 ) ; throw new DeploymentException ( "problem loading the generated class! " , e1 ) ; } this . concreteActivityContextInterface . defrost ( ) ; return clazz ;


signature:
public class ConcreteActivityContextInterfaceGenerator { /** * Generates the concrete methods of the class It generates a specific
 * method implementation for the javax . slee . ActivityContextInterface methods
 * for the methods coming from the ActivityContextInterface developer the
 * call is routed to the base asbtract class
 * @ param interfaceMethods
 * the methods to implement coming from the
 * ActivityContextInterface developer */
private void generateConcreteMethods ( Map interfaceMethods ) { } }

implementation:
if ( interfaceMethods == null ) return ; Iterator it = interfaceMethods . values ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { CtMethod interfaceMethod = ( CtMethod ) it . next ( ) ; if ( interfaceMethod != null // & & isBaseInterfaceMethod ( interfaceMethod . getName ( ) ) )
&& ( interfaceMethod . getDeclaringClass ( ) . getName ( ) . equals ( javax . slee . ActivityContextInterface . class . getName ( ) ) || interfaceMethod . getDeclaringClass ( ) . getName ( ) . equals ( ActivityContextInterfaceExt . class . getName ( ) ) ) ) continue ; // @ todo : need to check args also
try { // copy method from abstract to concrete class
CtMethod concreteMethod = CtNewMethod . copy ( interfaceMethod , concreteActivityContextInterface , null ) ; // create the method body
String fieldName = interfaceMethod . getName ( ) . substring ( 3 ) ; fieldName = fieldName . substring ( 0 , 1 ) . toLowerCase ( ) + fieldName . substring ( 1 ) ; String concreteMethodBody = null ; if ( interfaceMethod . getName ( ) . startsWith ( "get" ) ) { concreteMethodBody = "{ return ($r)getFieldValue(\"" + fieldName + "\"," + concreteMethod . getReturnType ( ) . getName ( ) + ".class); }" ; } else if ( interfaceMethod . getName ( ) . startsWith ( "set" ) ) { concreteMethodBody = "{ setFieldValue(\"" + fieldName + "\",$1); }" ; } else { throw new SLEEException ( "unexpected method name <" + interfaceMethod . getName ( ) + "> to implement in sbb aci interface" ) ; } if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Generated method " + interfaceMethod . getName ( ) + " , body = " + concreteMethodBody ) ; } concreteMethod . setBody ( concreteMethodBody ) ; concreteActivityContextInterface . addMethod ( concreteMethod ) ; } catch ( Exception cce ) { throw new SLEEException ( "Cannot compile method " + interfaceMethod . getName ( ) , cce ) ; } }


signature:
public class ProfileAttributeArrayValueUtils { /** * TODO
 * @ param profileAttrArrayValueClass
 * @ return */
private static ProfileEntityArrayAttributeValue newProfileEntityArrayAttributeValueInstance ( Class < ? > profileAttrArrayValueClass , ProfileEntity owner ) { } }

implementation: ProfileEntityArrayAttributeValue profileAttrArrayValue = null ; try { profileAttrArrayValue = ( ProfileEntityArrayAttributeValue ) profileAttrArrayValueClass . newInstance ( ) ; profileAttrArrayValue . setProfileEntity ( owner ) ; } catch ( Throwable e ) { throw new SLEEException ( e . getMessage ( ) , e ) ; } return profileAttrArrayValue ;


signature:
public class MobicentsManagement { /** * public String getLoggingConfiguration ( String profile ) throws ManagementException {
 * try {
 * return readFile ( getLog4jPath ( profile ) ) ;
 * catch ( IOException ioe ) {
 * throw new ManagementException ( " Failed to read log4j configuration file for profile ' " + profile + " ' . Does it exists ? " , ioe ) ;
 * public void setLoggingConfiguration ( String profile , String contents ) throws ManagementException {
 * try {
 * writeFile ( getLog4jPath ( profile ) , contents ) ;
 * catch ( IOException ioe ) {
 * throw new ManagementException ( " Failed to update log4j configuration file for profile ' " + profile + " ' . " , ioe ) ;
 * public void switchLoggingConfiguration ( String newProfile ) throws ManagementException {
 * try {
 * A direct copy would have better performance , but since we
 * already have and need to have these methods , let ' s use them .
 * String srcPath = getLog4jPath ( newProfile ) ;
 * String destPath = getLog4jPath ( " " ) ;
 * writeFile ( destPath , readFile ( srcPath ) ) ;
 * catch ( IOException ioe ) {
 * throw new ManagementException ( " Failed to update log4j configuration file for profile ' " + newProfile + " ' . " , ioe ) ; */
private String getLog4jPath ( String profile ) { } }

implementation: return ( profile == null || profile . equals ( "" ) || profile . equalsIgnoreCase ( "current" ) ) ? log4jConfigFilePath : log4jTemplatesPath + profile ;


signature:
public class Alarm { /** * Compare this alarm 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 .
 * Alarm ordering is determined by comparing unique the alarm identifier .
 * @ param obj the object to compare this with .
 * @ return a negative integer , zero , or a positive integer if this alarm
 * object is considered less than , equal to , or greater than the
 * specified object .
 * @ throws ClassCastException if < code > obj < / code > is not an instance of this
 * class .
 * @ see Comparable # compareTo ( Object ) */
public int compareTo ( Object obj ) { } }

implementation:
if ( obj == this ) return 0 ; if ( ! ( obj instanceof Alarm ) ) throw new ClassCastException ( "Not a javax.slee.management.Alarm: " + obj ) ; Alarm that = ( Alarm ) obj ; // compare alarm identifiers
return this . alarmID . compareTo ( that . alarmID ) ;


signature:
public class ResourceAdaptorComponentImpl { /** * Retrieves the JAIN SLEE specs descriptor
 * @ return */
public javax . slee . resource . ResourceAdaptorDescriptor getSpecsDescriptor ( ) { } }

implementation: if ( specsDescriptor == null ) { final LibraryID [ ] libraryIDs = descriptor . getLibraryRefs ( ) . toArray ( new LibraryID [ descriptor . getLibraryRefs ( ) . size ( ) ] ) ; final ResourceAdaptorTypeID [ ] raTypeIDs = descriptor . getResourceAdaptorTypeRefs ( ) . toArray ( new ResourceAdaptorTypeID [ descriptor . getResourceAdaptorTypeRefs ( ) . size ( ) ] ) ; Set < ProfileSpecificationID > profileSpecSet = new HashSet < ProfileSpecificationID > ( ) ; for ( ProfileSpecRefDescriptor mProfileSpecRef : descriptor . getProfileSpecRefs ( ) ) { profileSpecSet . add ( mProfileSpecRef . getComponentID ( ) ) ; } ProfileSpecificationID [ ] profileSpecs = profileSpecSet . toArray ( new ProfileSpecificationID [ profileSpecSet . size ( ) ] ) ; specsDescriptor = new javax . slee . resource . ResourceAdaptorDescriptor ( getResourceAdaptorID ( ) , getDeployableUnit ( ) . getDeployableUnitID ( ) , getDeploymentUnitSource ( ) , libraryIDs , raTypeIDs , profileSpecs , getDescriptor ( ) . getSupportsActiveReconfiguration ( ) ) ; } return specsDescriptor ;


signature:
public class ResourceAdaptorComponentImpl { /** * Creates an instance of the { @ link ConfigProperties } for this component
 * @ return */
public ConfigProperties getDefaultConfigPropertiesInstance ( ) { } }

implementation: ConfigProperties defaultProperties = new ConfigProperties ( ) ; for ( ConfigPropertyDescriptor mConfigProperty : getDescriptor ( ) . getConfigProperties ( ) ) { Object configPropertyValue = mConfigProperty . getConfigPropertyValue ( ) == null ? null : ConfigProperties . Property . toObject ( mConfigProperty . getConfigPropertyType ( ) , mConfigProperty . getConfigPropertyValue ( ) ) ; defaultProperties . addProperty ( new ConfigProperties . Property ( mConfigProperty . getConfigPropertyName ( ) , mConfigProperty . getConfigPropertyType ( ) , configPropertyValue ) ) ; } return defaultProperties ;


signature:
public class ActivityContextImpl { /** * Retrieve the { @ link ActivityFlags } for this activity context
 * @ return */
public int getActivityFlags ( ) { } }

implementation:
if ( flags == null ) { // instance has no flags stored , check local ac
if ( localActivityContext != null ) { flags = localActivityContext . getActivityFlags ( ) ; } else { // local ac does not exists , get from cache
flags = ( Integer ) cacheData . getObject ( NODE_MAP_KEY_ACTIVITY_FLAGS ) ; } } return flags != null ? flags : ActivityFlags . NO_FLAGS ;


signature:
public class ActivityContextImpl { /** * Set a shared data item for the ACI
 * @ param key
 * - - name of the shared data item .
 * @ param newValue
 * - - value of the shared data item . */
public void setDataAttribute ( String key , Object newValue ) { } }

implementation: cacheData . setCmpAttribute ( key , newValue ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Activity context with handle " + getActivityContextHandle ( ) + " set cmp attribute named " + key + " to value " + newValue ) ; }


signature:
public class ActivityContextImpl { /** * add a naming binding to this activity context .
 * @ param aciName
 * - new name binding to be added . */
public void addNameBinding ( String aciName ) { } }

implementation: cacheData . nameBound ( aciName ) ; if ( acReferencesHandler != null ) { acReferencesHandler . nameReferenceCreated ( ) ; }


signature:
public class ActivityContextImpl { /** * This is called to release all the name bindings after the activity end
 * event is delivered to the sbb . */
private void removeNamingBindings ( ) { } }

implementation: ActivityContextNamingFacility acf = sleeContainer . getActivityContextNamingFacility ( ) ; for ( Object obj : cacheData . getNamesBoundCopy ( ) ) { String aciName = ( String ) obj ; try { acf . removeName ( aciName ) ; } catch ( Exception e ) { logger . warn ( "failed to unbind name: " + aciName + " from ac:" + getActivityContextHandle ( ) , e ) ; } }


signature:
public class ActivityContextImpl { /** * Add the given name to the set of activity context names that we are bound
 * to . The AC Naming facility implicitly ends the activity after all names
 * are unbound .
 * @ param aciName
 * - - name to which we are bound .
 * @ return true if name bind was removed ; false otherwise */
public boolean removeNameBinding ( String aciName ) { } }

implementation: boolean removed = cacheData . nameUnbound ( aciName ) ; if ( removed && acReferencesHandler != null ) { acReferencesHandler . nameReferenceRemoved ( ) ; } return removed ;


signature:
public class ActivityContextImpl { /** * attach the given timer to the current activity context .
 * @ param timerID
 * - - timer id to attach . */
public boolean attachTimer ( TimerID timerID ) { } }

implementation: if ( cacheData . attachTimer ( timerID ) ) { if ( acReferencesHandler != null ) { acReferencesHandler . timerReferenceCreated ( ) ; } return true ; } else { return false ; }


signature:
public class ActivityContextImpl { /** * Detach timer
 * @ param timerID */
public boolean detachTimer ( TimerID timerID ) { } }

implementation: boolean detached = cacheData . detachTimer ( timerID ) ; if ( detached && acReferencesHandler != null ) { acReferencesHandler . timerReferenceRemoved ( ) ; } return detached ;


signature:
public class ActivityContextImpl { /** * End Event has been delivered on the Activity Context . */
private void removeFromTimers ( ) { } }

implementation:
TimerFacility timerFacility = sleeContainer . getTimerFacility ( ) ; // Iterate through the attached timers , telling the timer facility to
// remove them
for ( Object obj : cacheData . getAttachedTimers ( ) ) { timerFacility . cancelTimer ( ( TimerID ) obj , false ) ; }


signature:
public class ActivityContextImpl { /** * attach an sbb entity to this AC .
 * @ param sbbEntityId
 * - - sbb entity to attach .
 * @ return true if the SBB Entity is attached successfully , otherwise when
 * the SBB Entitiy has already been attached before , return false */
public boolean attachSbbEntity ( SbbEntityID sbbEntityId ) { } }

implementation: boolean attached = cacheData . attachSbbEntity ( sbbEntityId ) ; if ( attached ) { if ( acReferencesHandler != null ) { acReferencesHandler . sbbeReferenceCreated ( false ) ; } } if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Attachement from sbb entity " + sbbEntityId + " to AC " + getActivityContextHandle ( ) + " result: " + attached ) ; } return attached ;


signature:
public class ActivityContextImpl { /** * Detach the sbb entity
 * @ param sbbEntityId */
public void detachSbbEntity ( SbbEntityID sbbEntityId ) throws javax . slee . TransactionRequiredLocalException { } }

implementation: boolean detached = cacheData . detachSbbEntity ( sbbEntityId ) ; if ( detached && acReferencesHandler != null && ! isEnding ( ) ) { acReferencesHandler . sbbeReferenceRemoved ( ) ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Detached sbb entity " + sbbEntityId + " from AC with handle " + getActivityContextHandle ( ) ) ; } }


signature:
public class ActivityContextImpl { /** * get an ordered copy of the set of SBBs attached to this ac . The ordering
 * is by SBB priority .
 * @ return list of SbbEIDs */
public Set < SbbEntityID > getSortedSbbAttachmentSet ( Set < SbbEntityID > excludeSet ) { } }

implementation: final Set < SbbEntityID > sbbAttachementSet = cacheData . getSbbEntitiesAttached ( ) ; Set < SbbEntityID > result = new HashSet < SbbEntityID > ( ) ; for ( SbbEntityID sbbEntityId : sbbAttachementSet ) { if ( ! excludeSet . contains ( sbbEntityId ) ) { result . add ( sbbEntityId ) ; } } if ( result . size ( ) > 1 ) { result = sleeContainer . getSbbEntityFactory ( ) . sortByPriority ( result ) ; } return result ;


signature:
public class ActivityContextImpl { /** * - - - private helpers */
private void updateLastAccessTime ( boolean creation ) { } }

implementation:
if ( creation ) { cacheData . putObject ( NODE_MAP_KEY_LAST_ACCESS , Long . valueOf ( System . currentTimeMillis ( ) ) ) ; } else { ActivityManagementConfiguration configuration = factory . getConfiguration ( ) ; Long lastUpdate = ( Long ) cacheData . getObject ( NODE_MAP_KEY_LAST_ACCESS ) ; if ( lastUpdate != null ) { final long now = System . currentTimeMillis ( ) ; if ( ( now - configuration . getMinTimeBetweenUpdatesInMs ( ) ) > lastUpdate . longValue ( ) ) { // last update
if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Updating access time for AC with handle " + getActivityContextHandle ( ) ) ; } cacheData . putObject ( NODE_MAP_KEY_LAST_ACCESS , Long . valueOf ( now ) ) ; } else { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Skipping update of access time for AC with handle " + getActivityContextHandle ( ) ) ; } } } else { cacheData . putObject ( NODE_MAP_KEY_LAST_ACCESS , Long . valueOf ( System . currentTimeMillis ( ) ) ) ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Updating access time for AC with handle " + getActivityContextHandle ( ) ) ; } } }


signature:
public class ActivityContextImpl { /** * ( non - Javadoc )
 * @ see
 * org . mobicents . slee . container . activity . ActivityContext # fireEvent ( javax
 * . slee . EventTypeID , java . lang . Object , javax . slee . Address ,
 * javax . slee . ServiceID ,
 * org . mobicents . slee . container . event . EventProcessingSucceedCallback ,
 * org . mobicents . slee . container . event . EventProcessingFailedCallback ,
 * org . mobicents . slee . container . event . EventUnreferencedCallback ) */
public void fireEvent ( EventTypeID eventTypeId , Object event , Address address , ServiceID serviceID , EventProcessingSucceedCallback succeedCallback , EventProcessingFailedCallback failedCallback , EventUnreferencedCallback unreferencedCallback ) throws ActivityIsEndingException , SLEEException { } }

implementation: if ( isEnding ( ) ) { throw new ActivityIsEndingException ( getActivityContextHandle ( ) . toString ( ) ) ; } if ( acReferencesHandler != null ) { acReferencesHandler . eventReferenceCreated ( ) ; } fireEvent ( sleeContainer . getEventContextFactory ( ) . createEventContext ( eventTypeId , event , this , address , serviceID , succeedCallback , failedCallback , unreferencedCallback ) , sleeContainer . getTransactionManager ( ) . getTransactionContext ( ) ) ;


signature:
public class ActivityContextImpl { /** * Ends the activity context . */
public void endActivity ( ) { } }

implementation: if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Ending activity context with handle " + getActivityContextHandle ( ) ) ; } if ( cacheData . setEnding ( true ) ) { fireEvent ( sleeContainer . getEventContextFactory ( ) . createActivityEndEventContext ( this , new ActivityEndEventUnreferencedCallback ( getActivityContextHandle ( ) , factory ) ) , sleeContainer . getTransactionManager ( ) . getTransactionContext ( ) ) ; }


signature:
public class DeployableUnit { /** * Adder method for a Deployable Component .
 * @ param dc the deployable component object . */
public void addComponent ( DeployableComponent dc ) { } }

implementation:
if ( logger . isTraceEnabled ( ) ) logger . trace ( "Adding Component " + dc . getComponentKey ( ) ) ; // Add the component . .
components . add ( dc ) ; // . . the key . .
componentIDs . add ( dc . getComponentKey ( ) ) ; // . . the dependencies . .
dependencies . addAll ( dc . getDependencies ( ) ) ; // . . the install actions to be taken . .
installActions . addAll ( dc . getInstallActions ( ) ) ; // . . post - install actions ( if any ) . .
Collection < ManagementAction > postInstallActionsStrings = postInstallActions . remove ( dc . getComponentKey ( ) ) ; if ( postInstallActionsStrings != null && ! postInstallActionsStrings . isEmpty ( ) ) { installActions . addAll ( postInstallActionsStrings ) ; } // . . pre - uninstall actions ( if any ) . .
Collection < ManagementAction > preUninstallActionsStrings = preUninstallActions . remove ( dc . getComponentKey ( ) ) ; if ( preUninstallActionsStrings != null ) uninstallActions . addAll ( preUninstallActionsStrings ) ; // . . and finally the uninstall actions to the DU .
uninstallActions . addAll ( dc . getUninstallActions ( ) ) ;


signature:
public class DeployableUnit { /** * Method for obtaining the external dependencies for this DU , if any .
 * @ return a Collection of external dependencies identifiers . */
public Collection < String > getExternalDependencies ( ) { } }

implementation:
// Take all dependencies . . .
Collection < String > externalDependencies = new HashSet < String > ( dependencies ) ; // Remove those which are contained in this DU
externalDependencies . removeAll ( componentIDs ) ; // Return what ' s left .
return externalDependencies ;


signature:
public class DeployableUnit { /** * Method for checking if the DU has all the dependencies needed to be deployed .
 * @ param showMissing param to set whether to show or not missing dependencies .
 * @ return true if all the dependencies are satisfied . */
public boolean hasDependenciesSatisfied ( boolean showMissing ) { } }

implementation:
// First of all check if it is self - sufficient
if ( isSelfSufficient ( ) ) return true ; // If not self - sufficient , get the remaining dependencies
Collection < String > externalDependencies = getExternalDependencies ( ) ; // Remove those that are already installed . . .
externalDependencies . removeAll ( sleeContainerDeployer . getDeploymentManager ( ) . getDeployedComponents ( ) ) ; // Some remaining ?
if ( ! externalDependencies . isEmpty ( ) ) { if ( showMissing ) { // List them to the user . . .
String missingDepList = "" ; for ( String missingDep : externalDependencies ) missingDepList += "\r\n +-- " + missingDep ; logger . info ( "Missing dependencies for " + this . diShortName + ":" + missingDepList ) ; } // Return dependencies not satified .
return false ; } // OK , dependencies satisfied !
return true ;


signature:
public class DeployableUnit { /** * Method for checking if this DU contains any component that is already deployed .
 * @ return true if there ' s a component that is already deployed . */
public boolean hasDuplicates ( ) { } }

implementation:
ArrayList < String > duplicates = new ArrayList < String > ( ) ; // For each component in the DU . .
for ( String componentId : componentIDs ) { // Check if it is already deployed
if ( sleeContainerDeployer . getDeploymentManager ( ) . getDeployedComponents ( ) . contains ( componentId ) ) { duplicates . add ( componentId ) ; } } if ( ! duplicates . isEmpty ( ) ) { logger . warn ( "The deployable unit '" + this . diShortName + "' contains components that are already deployed. The following are already installed:" ) ; for ( String dupComponent : duplicates ) { logger . warn ( " - " + dupComponent ) ; } return true ; } // If we got here , there ' s no dups .
return false ;


signature:
public class DeployableUnit { /** * Getter for the Install Actions .
 * @ return a Collection of actions . */
public Collection < ManagementAction > getInstallActions ( ) { } }

implementation:
ArrayList < ManagementAction > iActions = new ArrayList < ManagementAction > ( ) ; // if we have some remaining post install actions it means it is actions related with components already installed
// thus should be executed first
if ( ! postInstallActions . values ( ) . isEmpty ( ) ) { for ( String componentId : postInstallActions . keySet ( ) ) { iActions . addAll ( postInstallActions . get ( componentId ) ) ; } } iActions . addAll ( installActions ) ; return iActions ;


signature:
public class DeployableUnit { /** * Getter for the Uninstall Actions .
 * @ return a Collection of actions . */
public Collection < ManagementAction > getUninstallActions ( ) { } }

implementation:
Collection < ManagementAction > uActions = new ArrayList < ManagementAction > ( uninstallActions ) ; // ensures uninstall is the last action related with DU components
uActions . add ( new UninstallDeployableUnitAction ( diURL . toString ( ) , sleeContainerDeployer . getDeploymentMBean ( ) ) ) ; // if we have some remaining uninstall actions it means it is actions related with components not in DU
// thus should be executed last
if ( ! preUninstallActions . values ( ) . isEmpty ( ) ) { for ( String componentId : preUninstallActions . keySet ( ) ) { uActions . addAll ( preUninstallActions . get ( componentId ) ) ; } } return uActions ;


signature:
public class DeployableUnit { /** * Method for checking if this DU components are referred by any others .
 * @ return true if there are other DUs installed referring this .
 * @ throws Exception */
private boolean hasReferringDU ( ) throws Exception { } }

implementation:
// Get SleeContainer instance from JNDI
SleeContainer sC = SleeContainer . lookupFromJndi ( ) ; for ( String componentIdString : this . getComponents ( ) ) { ComponentIDPropertyEditor cidpe = new ComponentIDPropertyEditor ( ) ; cidpe . setAsText ( componentIdString ) ; ComponentID componentId = ( ComponentID ) cidpe . getValue ( ) ; for ( ComponentID referringComponentId : sC . getComponentRepository ( ) . getReferringComponents ( componentId ) ) { ComponentIDPropertyEditor rcidpe = new ComponentIDPropertyEditor ( ) ; rcidpe . setValue ( referringComponentId ) ; String referringComponentIdString = rcidpe . getAsText ( ) ; if ( ! this . getComponents ( ) . contains ( referringComponentIdString ) ) { return true ; } } } return false ;


signature:
public class DeployableUnit { /** * Parser for the deployment config xml .
 * @ throws Exception */
private void parseDUDeployConfig ( ) throws Exception { } }

implementation:
JarFile componentJarFile = new JarFile ( diURL . getFile ( ) ) ; try { // Get the JarEntry for the deploy - config . xml
JarEntry deployInfoXML = componentJarFile . getJarEntry ( "META-INF/deploy-config.xml" ) ; if ( deployInfoXML != null ) { DeployConfigParser deployConfigParser = new DeployConfigParser ( componentJarFile . getInputStream ( deployInfoXML ) , sleeContainerDeployer . getSleeContainer ( ) . getResourceManagement ( ) ) ; for ( Entry < String , Collection < ManagementAction > > e : deployConfigParser . getPostInstallActions ( ) . entrySet ( ) ) { postInstallActions . put ( e . getKey ( ) , e . getValue ( ) ) ; } for ( Entry < String , Collection < ManagementAction > > e : deployConfigParser . getPreUninstallActions ( ) . entrySet ( ) ) { preUninstallActions . put ( e . getKey ( ) , e . getValue ( ) ) ; } } } finally { componentJarFile . close ( ) ; }


signature:
public class AbstractProfileMBeanImpl { /** * Closes and unregisters the mbean for the specified profile , if exists
 * @ param profileTableName
 * @ param profileName */
public static void close ( String profileTableName , String profileName ) { } }

implementation: final ObjectName objectName = getObjectName ( profileTableName , profileName ) ; if ( sleeContainer . getMBeanServer ( ) . isRegistered ( objectName ) ) { Runnable r = new Runnable ( ) { public void run ( ) { try { sleeContainer . getMBeanServer ( ) . invoke ( objectName , "close" , new Object [ ] { } , new String [ ] { } ) ; } catch ( Throwable e ) { logger . error ( e . getMessage ( ) , e ) ; } } } ; Thread t = new Thread ( r ) ; t . start ( ) ; }


signature:
public class AbstractProfileMBeanImpl { /** * Retrieves the JMX ObjectName for a profile , given its profile name and
 * profile table name
 * @ param profileTableName
 * @ param profileName
 * @ return
 * @ throws MalformedObjectNameException */
public static ObjectName getObjectName ( String profileTableName , String profileName ) { } }

implementation:
// FIXME use only the " quoted " version when issue is fully solved at the JMX Console side
try { return new ObjectName ( ProfileMBean . BASE_OBJECT_NAME + ',' + ProfileMBean . PROFILE_TABLE_NAME_KEY + '=' + profileTableName + ',' + ProfileMBean . PROFILE_NAME_KEY + '=' + ( profileName != null ? profileName : "" ) ) ; } catch ( Throwable e ) { try { return new ObjectName ( ProfileMBean . BASE_OBJECT_NAME + ',' + ProfileMBean . PROFILE_TABLE_NAME_KEY + '=' + ObjectName . quote ( profileTableName ) + ',' + ProfileMBean . PROFILE_NAME_KEY + '=' + ObjectName . quote ( profileName != null ? profileName : "" ) ) ; } catch ( Throwable f ) { throw new SLEEException ( e . getMessage ( ) , e ) ; } }


signature:
public class AbstractProfileMBeanImpl { /** * Moves to the write mode , using specified object . The current java transaction will be suspended .
 * @ throws ManagementException */
private void writeMode ( ) throws SLEEException , ManagementException { } }

implementation:
if ( ! isProfileWriteable ( ) ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Changing state to read-write, for profile mbean with name " + profileName + ", from table with name " + this . profileTable . getProfileTableName ( ) ) ; } // get object & make it writable
ProfileObjectImpl profileObject = profileTable . getProfile ( profileName ) ; profileObject . getProfileEntity ( ) . setReadOnly ( false ) ; // change state
state = State . write ; } else { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Already in write state, for profile mbean with name " + profileName + ", from table with name " + this . profileTable . getProfileTableName ( ) ) ; } }


signature:
public class AbstractProfileMBeanImpl { /** * ( non - Javadoc )
 * @ see javax . slee . profile . ProfileMBean # closeProfile ( ) */
public void closeProfile ( ) throws InvalidStateException , ManagementException { } }

implementation:
if ( logger . isDebugEnabled ( ) ) { logger . debug ( "closeProfile() on: " + profileName + ", from table:" + profileTable . getProfileTableName ( ) ) ; } // The closeProfile method must throw a javax . slee . InvalidStateException if the Profile MBean object is in the read - write state .
if ( this . isProfileWriteable ( ) ) throw new InvalidStateException ( ) ; // unregister mbean
unregister ( ) ;


signature:
public class AbstractProfileMBeanImpl { /** * ( non - Javadoc )
 * @ see javax . slee . profile . ProfileMBean # commitProfile ( )
 * This method commits profile . See descritpion - profile becomes visible for slee ONLY when its commited . */
public void commitProfile ( ) throws InvalidStateException , ProfileVerificationException , ManagementException { } }

implementation:
if ( logger . isDebugEnabled ( ) ) { logger . debug ( "commitProfile() on: " + profileName + ", from table:" + profileTable . getProfileTableName ( ) ) ; } if ( ! this . isProfileWriteable ( ) ) throw new InvalidStateException ( "not in write state" ) ; final SleeTransactionManager txManager = sleeContainer . getTransactionManager ( ) ; ProfileEntity profileEntity = null ; try { // resume tx
txManager . resume ( this . transaction ) ; // verify state
ProfileObjectImpl profileObject = getProfileObject ( ) ; profileObject . profileVerify ( ) ; // check if the tx is marked for rollback
if ( txManager . getRollbackOnly ( ) ) { // FIXME can ' t undertsand why the rollback and change of state , perhaps tests / profiles / lifecycle / Test1110227Test . xml is faulty ? ?
// FIXME : Do we need to close EntityManager here ?
EntityManager em = getEntityManager ( txManager ) ; txManager . rollback ( ) ; if ( em != null && em . isOpen ( ) ) { em . close ( ) ; } readMode ( ) ; this . transaction = null ; throw new RollbackException ( "the tx is marked for rollback, can't proceeed with commit" ) ; } // " save " profile entity , we may need to recover its current state
profileEntity = profileObject . getProfileEntity ( ) ; // commit tx
this . transaction = null ; txManager . commit ( ) ; // change mode
readMode ( ) ; } catch ( ProfileVerificationException e ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( e . getMessage ( ) , e ) ; } throw e ; } catch ( RollbackException e ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( e . getMessage ( ) , e ) ; } if ( e . getCause ( ) instanceof PersistenceException && e . getCause ( ) . getCause ( ) instanceof ConstraintViolationException ) { throw new ProfileVerificationException ( e . getCause ( ) . getMessage ( ) , e ) ; } else if ( e . getCause ( ) != null && e . getCause ( ) . getClass ( ) == Throwable . class && e . getCause ( ) . getMessage ( ) != null && e . getCause ( ) . getMessage ( ) . equals ( "setRollbackOnly called from:" ) ) { // workaround for issue with jboss AS 5.1.0 GA / Hibernate Entity Manager 3.4.0 . GA / JBoss TS 4.6.1 . GA , the persistentexception is not thrown
throw new ProfileVerificationException ( e . getCause ( ) . getMessage ( ) , e ) ; } else { throw new ManagementException ( e . getMessage ( ) , e ) ; } } catch ( Throwable e ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( e . getMessage ( ) , e ) ; } throw new ManagementException ( e . getMessage ( ) , e ) ; } finally { if ( this . transaction == null ) { if ( isProfileWriteable ( ) ) { // still in write mode
if ( logger . isDebugEnabled ( ) ) { logger . debug ( "The tx commit failed, recreating tx with current profile entity state" ) ; } try { txManager . begin ( ) ; this . transaction = txManager . getTransaction ( ) ; ProfileEntity newTxProfileEntity = profileEntity . isCreate ( ) ? profileTable . createProfile ( profileName ) . getProfileEntity ( ) : getProfileObject ( ) . getProfileEntity ( ) ; profileTable . getProfileSpecificationComponent ( ) . getProfileEntityFramework ( ) . getProfileEntityFactory ( ) . copyAttributes ( profileEntity , newTxProfileEntity ) ; newTxProfileEntity . setReadOnly ( false ) ; txManager . suspend ( ) ; } catch ( Throwable e ) { throw new ManagementException ( e . getMessage ( ) , e ) ; } } } else { // tx still valid
try { txManager . suspend ( ) ; } catch ( Throwable f ) { logger . error ( f . getMessage ( ) , f ) ; } } }


signature:
public class AbstractProfileMBeanImpl { /** * Logic to execute before invoking a cmp setter method on the mbean
 * @ return true if the method resumed a transaction
 * @ throws ManagementException */
protected void beforeSetCmpField ( ) throws ManagementException , InvalidStateException { } }

implementation: if ( logger . isDebugEnabled ( ) ) { logger . debug ( "beforeSetCmpField() on profile with name " + profileName + " of table " + profileTable . getProfileTableName ( ) ) ; } if ( isProfileWriteable ( ) ) { try { sleeContainer . getTransactionManager ( ) . resume ( transaction ) ; } catch ( Throwable e ) { throw new ManagementException ( e . getMessage ( ) , e ) ; } } else { throw new InvalidStateException ( ) ; }