Input: Generates a class that extends { [CODESPLIT] private Class < ? > generateProfileAttributeArrayValueClass ( CtClass concreteProfileEntityClass , String profileAttributeName , boolean unique ) { CtClass concreteArrayValueClass = null ; try { // define the concrete profile attribute array value class name String concreteArrayValueClassName = profileComponent . getProfileCmpInterfaceClass ( ) . getName ( ) + "PEAAV_" + ClassGeneratorUtils . capitalize ( profileAttributeName ) ; // create javassist class concreteArrayValueClass = ClassGeneratorUtils . createClass ( concreteArrayValueClassName , new String [ ] { Serializable . class . getName ( ) } ) ; // set inheritance ClassGeneratorUtils . createInheritanceLink ( concreteArrayValueClass , ProfileEntityArrayAttributeValue . class . getName ( ) ) ; // annotate class with @Entity ClassGeneratorUtils . addAnnotation ( Entity . class . getName ( ) , new LinkedHashMap < String , Object > ( ) , concreteArrayValueClass ) ; // generate a random table name addTableAnnotationToPEAAV ( "SLEE_PEAAV_" + profileComponent . getProfileCmpInterfaceClass ( ) . getSimpleName ( ) + "_" + Math . abs ( ( long ) profileComponent . getComponentID ( ) . hashCode ( ) ) + profileAttributeName , unique , concreteArrayValueClass ) ; // override @id String getIdNameMethodSrc = "public long getId() { return super.getId(); }" ; CtMethod getIdNameMethod = CtNewMethod . make ( getIdNameMethodSrc , concreteArrayValueClass ) ; ClassGeneratorUtils . addAnnotation ( Id . class . getName ( ) , new LinkedHashMap < String , Object > ( ) , getIdNameMethod ) ; ClassGeneratorUtils . addAnnotation ( GeneratedValue . class . getName ( ) , new LinkedHashMap < String , Object > ( ) , getIdNameMethod ) ; concreteArrayValueClass . addMethod ( getIdNameMethod ) ; // override getter methods String getSerializableMethodSrc = "public " + Serializable . class . getName ( ) + " getSerializable() { return super.getSerializable(); }" ; CtMethod getSerializableMethod = CtNewMethod . make ( getSerializableMethodSrc , concreteArrayValueClass ) ; LinkedHashMap < String , Object > map = new LinkedHashMap < String , Object > ( ) ; map . put ( "name" , "serializable" ) ; map . put ( "length" , 512 ) ; //if (unique)map.put("unique", true); ClassGeneratorUtils . addAnnotation ( Column . class . getName ( ) , map , getSerializableMethod ) ; concreteArrayValueClass . addMethod ( getSerializableMethod ) ; String getStringMethodSrc = "public String getString() { return super.getString(); }" ; CtMethod getStringMethod = CtNewMethod . make ( getStringMethodSrc , concreteArrayValueClass ) ; map = new LinkedHashMap < String , Object > ( ) ; map . put ( "name" , "string" ) ; //if (unique)map.put("unique", true); ClassGeneratorUtils . addAnnotation ( Column . class . getName ( ) , map , getStringMethod ) ; concreteArrayValueClass . addMethod ( getStringMethod ) ; // FIXME add join columns here or in profile entity class to make // the relation without a join table, atm if this is changed, the // inserts on this table go with profile and table name as null %) // THE PROFILENTITY FIELD IN AAV CLASS IS REQUIRED FOR THE RELATION WITH PROFILE ENTITY CLASS WITHOUT A JOIN TABLE // add join column regarding the relation from array attr value to profile entity CtField ctField = ClassGeneratorUtils . addField ( concreteProfileEntityClass , "owner" , concreteArrayValueClass ) ; ClassGeneratorUtils . generateSetter ( ctField , null ) ; CtMethod getter = ClassGeneratorUtils . generateGetter ( ctField , null ) ; //ClassGeneratorUtils.addAnnotation(ManyToOne.class.getName(), new LinkedHashMap<String, Object>(), getter); // ---- ConstPool cp = getter . getMethodInfo ( ) . getConstPool ( ) ; AnnotationsAttribute attr = ( AnnotationsAttribute ) getter . getMethodInfo ( ) . getAttribute ( AnnotationsAttribute . visibleTag ) ; if ( attr == null ) { attr = new AnnotationsAttribute ( cp , AnnotationsAttribute . visibleTag ) ; } Annotation manyToOne = new Annotation ( ManyToOne . class . getName ( ) , cp ) ; manyToOne . addMemberValue ( "optional" , new BooleanMemberValue ( false , cp ) ) ; attr . addAnnotation ( manyToOne ) ; Annotation joinColumns = new Annotation ( JoinColumns . class . getName ( ) , cp ) ; Annotation joinColumn1 = new Annotation ( JoinColumn . class . getName ( ) , cp ) ; joinColumn1 . addMemberValue ( "name" , new StringMemberValue ( "owner_tableName" , cp ) ) ; joinColumn1 . addMemberValue ( "referencedColumnName" , new StringMemberValue ( "tableName" , cp ) ) ; Annotation joinColumn2 = new Annotation ( JoinColumn . class . getName ( ) , cp ) ; joinColumn2 . addMemberValue ( "name" , new StringMemberValue ( "owner_profileName" , cp ) ) ; joinColumn2 . addMemberValue ( "referencedColumnName" , new StringMemberValue ( "profileName" , cp ) ) ; ArrayMemberValue joinColumnsMemberValue = new ArrayMemberValue ( cp ) ; joinColumnsMemberValue . setValue ( new MemberValue [ ] { new AnnotationMemberValue ( joinColumn1 , cp ) , new AnnotationMemberValue ( joinColumn2 , cp ) } ) ; joinColumns . addMemberValue ( "value" , joinColumnsMemberValue ) ; attr . addAnnotation ( joinColumns ) ; getter . getMethodInfo ( ) . addAttribute ( attr ) ; // generate concrete setProfileEntity method String setProfileEntityMethodSrc = "public void setProfileEntity(" + ProfileEntity . class . getName ( ) + " profileEntity){ setOwner((" + concreteProfileEntityClass . getName ( ) + ")profileEntity); }" ; CtMethod setProfileEntityMethod = CtMethod . make ( setProfileEntityMethodSrc , concreteArrayValueClass ) ; concreteArrayValueClass . addMethod ( setProfileEntityMethod ) ; // write and load the attr array value class String deployDir = profileComponent . getDeploymentDir ( ) . getAbsolutePath ( ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Writing PROFILE ATTR ARRAY VALUE CONCRETE CLASS ( " + concreteArrayValueClass . getName ( ) + " ) to: " + deployDir ) ; } concreteArrayValueClass . writeFile ( deployDir ) ; return Thread . currentThread ( ) . getContextClassLoader ( ) . loadClass ( concreteArrayValueClass . getName ( ) ) ; } catch ( Throwable e ) { throw new SLEEException ( e . getMessage ( ) , e ) ; } finally { if ( concreteArrayValueClass != null ) { concreteArrayValueClass . defrost ( ) ; } } }


Input: / * ( non - Javadoc ) [CODESPLIT] public int compare ( SbbEntityID sbbEntityID1 , SbbEntityID sbbEntityID2 ) { if ( sbbEntityID1 == sbbEntityID2 ) { return 0 ; } if ( sbbEntityID1 == null ) { return 1 ; } if ( sbbEntityID2 == null ) { return - 1 ; } return higherPrioritySbb ( sbbEntityID1 , sbbEntityID2 ) ; }


Input:
/ * ( non - Javadoc ) [CODESPLIT] @ SuppressWarnings ( "unchecked" ) public Collection < ProfileEntity > findProfilesByAttribute ( String profileTable , ProfileAttribute profileAttribute , Object attributeValue ) { if ( logger . isTraceEnabled ( ) ) { logger . trace ( "findProfilesByAttribute( profileTable = " + profileTable + " , profileAttribute = " + profileAttribute + " , attributeValue = " + attributeValue + " )" ) ; } EntityManager em = getEntityManager ( ) ; Query query = null ; if ( profileAttribute == null ) { query = em . createQuery ( "SELECT x FROM " + profileEntityClassName + " x WHERE x.tableName = :tableName" ) . setParameter ( "tableName" , profileTable ) ; } else { if ( profileAttribute . isArray ( ) ) { query = em . createQuery ( "SELECT x FROM " + profileEntityClassName + " x , IN (x.c" + profileAttribute . getName ( ) + ") y WHERE x.tableName = :tableName AND y.string = :attrValue" ) . setParameter ( "tableName" , profileTable ) . setParameter ( "attrValue" , attributeValue . toString ( ) ) ; } else { // TODO handle Address objects in this use case, they can't be // binary for search query = em . createQuery ( "SELECT x FROM " + profileEntityClassName + " x WHERE x.tableName = :tableName AND x.c" + profileAttribute . getName ( ) + " = :attrValue" ) . setParameter ( "tableName" , profileTable ) . setParameter ( "attrValue" , attributeValue ) ; } } Collection < ProfileEntity > result = query . getResultList ( ) ; /*
		if (logger.isDebugEnabled()) {
			logger.debug("findProfilesByAttribute : query = "
					+ ((org.hibernate.ejb.QueryImpl) query).getHibernateQuery().getQueryString()
					+ " , result = " + result);
		}
		*/ return result ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public ProfileEntity findProfile ( String profileTable , String profileName ) { EntityManager em = getEntityManager ( ) ; Query query = em . createQuery ( "FROM " + profileEntityClassName + " WHERE tableName = ?1 AND profileName = ?2" ) . setParameter ( 1 , profileTable ) . setParameter ( 2 , profileName ) ; List < ? > resultList = query . getResultList ( ) ; if ( resultList . isEmpty ( ) ) { return null ; } else { return ( ProfileEntity ) resultList . get ( 0 ) ; } }


Input: / * ( non - Javadoc ) [CODESPLIT] @ SuppressWarnings ( "unchecked" ) public Collection < ProfileEntity > getProfilesByStaticQuery ( String profileTable , String queryName , final Object [ ] parameters ) throws NullPointerException , UnrecognizedQueryNameException , AttributeTypeMismatchException , InvalidArgumentException { // TODO check for exceptions final QueryWrapper wQuery = JPAQueryBuilder . getQuery ( queryName ) ; final EntityManager em = getEntityManager ( ) ; if ( System . getSecurityManager ( ) == null ) { Query staticQuery = em . createQuery ( wQuery . getQuerySQL ( profileEntityClassName ) ) ; if ( wQuery . getMaxMatches ( ) > 0 ) staticQuery . setMaxResults ( ( int ) wQuery . getMaxMatches ( ) ) ; for ( int i = 0 ; i < parameters . length ; i ++ ) { try { staticQuery . setParameter ( i + 1 , parameters [ i ] ) ; } catch ( Exception ignore ) { // We don't care, it's because there's no such parameter. } } return staticQuery . getResultList ( ) ; } else { try { return AccessController . doPrivileged ( new PrivilegedExceptionAction < Collection < ProfileEntity > > ( ) { public Collection < ProfileEntity > run ( ) throws Exception { Query staticQuery = em . createQuery ( wQuery . getQuerySQL ( profileEntityClassName ) ) ; if ( wQuery . getMaxMatches ( ) > 0 ) staticQuery . setMaxResults ( ( int ) wQuery . getMaxMatches ( ) ) ; for ( int i = 0 ; i < parameters . length ; i ++ ) { try { staticQuery . setParameter ( i + 1 , parameters [ i ] ) ; } catch ( Exception ignore ) { // We don't care, it's because there's no such parameter. } } return staticQuery . getResultList ( ) ; } } ) ; } catch ( PrivilegedActionException e ) { Throwable t = e . getCause ( ) ; if ( t instanceof NullPointerException ) throw ( NullPointerException ) t ; if ( t instanceof UnrecognizedQueryNameException ) throw ( UnrecognizedQueryNameException ) t ; if ( t instanceof AttributeTypeMismatchException ) throw ( AttributeTypeMismatchException ) t ; if ( t instanceof InvalidArgumentException ) throw ( InvalidArgumentException ) t ; //? throw new SLEEException ( "" , t ) ; } } }


Input: / * ( non - Javadoc ) [CODESPLIT] @ SuppressWarnings ( "unchecked" ) public Collection < ProfileEntity > getProfilesByDynamicQuery ( String profileTable , QueryExpression expr ) throws UnrecognizedAttributeException , AttributeTypeMismatchException { // TODO check for exceptions QueryWrapper wQuery = JPAQueryBuilder . parseDynamicQuery ( expr ) ; EntityManager em = getEntityManager ( ) ; Query dynamicQuery = em . createQuery ( wQuery . getQuerySQL ( profileEntityClassName ) ) ; int i = 1 ; for ( Object param : wQuery . getDynamicParameters ( ) ) { dynamicQuery . setParameter ( i ++ , param ) ; } if ( wQuery . getMaxMatches ( ) > 0 ) dynamicQuery . setMaxResults ( ( int ) wQuery . getMaxMatches ( ) ) ; return dynamicQuery . getResultList ( ) ; }


Input:
/ * ( non - Javadoc ) [CODESPLIT] public void persistProfile ( ProfileEntity profileEntity ) { EntityManager em = null ; // if(checkUniqueFields(profileObject)) // { em = getEntityManager ( ) ; em . persist ( profileEntity ) ; /*
		 * } else { // FIXME: We need to throw this PVException! //throw new
		 * ProfileVerificationException
		 * ("Failed to persist profile due to uniqueness constraint."); throw
		 * new
		 * SLEEException("Failed to persist profile due to uniqueness constraint."
		 * ); }
		 */ }


Input: / * ( non - Javadoc ) [CODESPLIT] public ProfileEntity retrieveProfile ( String profileTable , String profileName ) { if ( logger . isTraceEnabled ( ) ) { logger . trace ( "retrieveProfile( profileTableName = " + profileTable + " , profileName = " + profileName + " )" ) ; } if ( profileName == null ) { profileName = DEFAULT_PROFILE_NAME ; } EntityManager em = getEntityManager ( ) ; final Query q = em . createQuery ( "FROM " + profileEntityClassName + " WHERE tableName = ?1 AND profileName = ?2" ) . setParameter ( 1 , profileTable ) . setParameter ( 2 , profileName ) ; if ( System . getSecurityManager ( ) == null ) { List < ? > resultList = q . getResultList ( ) ; if ( resultList . size ( ) > 0 ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "ProfileEntity retrieved -> " + resultList . get ( 0 ) ) ; } return ( ProfileEntity ) resultList . get ( 0 ) ; } else { return null ; } } else { return AccessController . doPrivileged ( new PrivilegedAction < ProfileEntity > ( ) { public ProfileEntity run ( ) { List < ? > resultList = q . getResultList ( ) ; if ( resultList . size ( ) > 0 ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "ProfileEntity retrieved -> " + resultList . get ( 0 ) ) ; } return ( ProfileEntity ) resultList . get ( 0 ) ; } else { return null ; } } } ) ; } }


Input: / * ( non - Javadoc ) [CODESPLIT] public void renameProfileTable ( String oldProfileTableName , String newProfileTableName ) { EntityManager em = getEntityManager ( ) ; final Query q = em . createQuery ( "UPDATE " + profileEntityClassName + " SET tableName = ?1 WHERE tableName = ?2" ) . setParameter ( 1 , newProfileTableName ) . setParameter ( 2 , oldProfileTableName ) ; q . executeUpdate ( ) ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public void install ( ) { synchronized ( this ) { // generate profile entity & related classes new ConcreteProfileEntityGenerator ( component , this ) . generateClasses ( ) ; // this one is just a runtime optimization for faster query building // now, later to use named queries profileEntityClassName = profileEntityClass . getName ( ) ; profileEntityFactoryClass = new ConcreteProfileEntityFactoryGenerator ( component , profileEntityClass , profileEntityArrayAttrValueClassMap ) . generateClass ( ) ; try { profileEntityFactory = ( ProfileEntityFactory ) profileEntityFactoryClass . newInstance ( ) ; } catch ( Throwable e ) { throw new SLEEException ( e . getMessage ( ) , e ) ; } // 1. Generate CMP Interface Impl with JPA Annotations component . setProfileCmpConcreteClass ( new ConcreteProfileGenerator ( component ) . generateConcreteProfile ( ) ) ; // 2. Create the corresponding JPA PU -- FIXME: Should be somewhere // else? createPersistenceUnit ( component ) ; new JPAQueryBuilder ( component ) . parseStaticQueries ( ) ; } }


Input: / * ( non - Javadoc ) [CODESPLIT] public void uninstall ( ) { synchronized ( this ) { Transaction tx = null ; try { tx = sleeTransactionManager . suspend ( ) ; } catch ( Throwable e ) { throw new SLEEException ( e . getMessage ( ) , e ) ; } if ( entityManagerFactory != null ) { entityManagerFactory . close ( ) ; } try { sleeTransactionManager . resume ( tx ) ; } catch ( Throwable e ) { throw new SLEEException ( e . getMessage ( ) , e ) ; } //component.setProfileEntityFramework(null); } }


Input:
Retrieves the entity manager for the current tx and the framework profile spec [CODESPLIT] @ SuppressWarnings ( "unchecked" ) private EntityManager getEntityManager ( ) { if ( txDataKey == null ) { txDataKey = new StringBuilder ( "jpapef.em." ) . append ( component . getProfileSpecificationID ( ) ) . toString ( ) ; } final TransactionContext txContext = sleeTransactionManager . getTransactionContext ( ) ; // look in tx Map transactionContextData = txContext . getData ( ) ; EntityManager result = ( EntityManager ) transactionContextData . get ( txDataKey ) ; if ( result == null ) { // create using factory result = entityManagerFactory . createEntityManager ( ) ; // store in tx context data transactionContextData . put ( txDataKey , result ) ; // add a tx action to close it before tx commits // FIXME: Do we need this after-rollback action here /*
			final EntityManager em = result;
			TransactionalAction action = new TransactionalAction() {
				public void execute() {
					try {
						em.close();
					} catch (Throwable e) {
						logger.error(e.getMessage(), e);
					}
				}
			};

			txContext.getAfterRollbackActions().add(action);
			*/ } return result ; }


Input:
Start the SLEE container [CODESPLIT] public void start ( ) throws InvalidStateException , ManagementException { try { // request to change to STARTING
 final SleeStateChangeRequest startingRequest = new SleeStateChangeRequest ( ) { @ Override public void stateChanged ( SleeState oldState ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( generateMessageWithLogo ( "starting" ) ) ; } notifyStateChange ( oldState , getNewState ( ) ) ; } @ Override public void requestCompleted ( ) { // inner request, executed when the parent completes, to change to RUNNING
 final SleeStateChangeRequest runningRequest = new SleeStateChangeRequest ( ) { private SleeState oldState ; @ Override public void stateChanged ( SleeState oldState ) { logger . info ( generateMessageWithLogo ( "started" ) ) ; this . oldState = oldState ; } @ Override public void requestCompleted ( ) { notifyStateChange ( oldState , getNewState ( ) ) ; } @ Override public boolean isBlockingRequest ( ) { return true ; } @ Override public SleeState getNewState ( ) { return SleeState . RUNNING ; } } ; try { sleeContainer . setSleeState ( runningRequest ) ; } catch ( Throwable e ) { logger . error ( "Failed to set container in RUNNING state" , e ) ; try { stop ( false ) ; } catch ( Throwable f ) { logger . error ( "Failed to set container in STOPPED state, after failure to set in RUNNING state" , e ) ; } } } @ Override public boolean isBlockingRequest ( ) { // should be false, but the tck doesn't like it
 return true ; } @ Override public SleeState getNewState ( ) { return SleeState . STARTING ; } } ; sleeContainer . setSleeState ( startingRequest ) ; } catch ( InvalidStateException ex ) { throw ex ; } catch ( Exception ex ) { throw new ManagementException ( ex . getMessage ( ) , ex ) ; } }


Input: Shutdown the SLEE processes . The spec requires that System . exit () be called before this methods returns . We are not convinced this is necessary yet . A trivial implementation would be to make a call to the JBoss server shutdown () [CODESPLIT] public void shutdown ( ) throws InvalidStateException , ManagementException { logger . info ( generateMessageWithLogo ( "shutdown" ) ) ; try { sleeContainer . shutdownSlee ( ) ; } catch ( InvalidStateException ex ) { throw ex ; } catch ( Exception ex ) { throw new ManagementException ( ex . getMessage ( ) ) ; } }


Input: / * ( non - Javadoc ) [CODESPLIT] public void addNotificationListener ( NotificationListener listener , NotificationFilter filter , Object handback ) throws IllegalArgumentException { notificationBroadcaster . addNotificationListener ( listener , filter , handback ) ; }


Input:
See section 1 . 3 of jslee 1 . 1 specs [CODESPLIT] boolean validateCompatibilityReferenceConstraints ( ) { boolean passed = true ; String errorBuffer = new String ( "" ) ; try { if ( ! this . component . isSlee11 ( ) ) { // A 1.0 SBB must not reference or use a 1.1 Profile
 // Specification. This must be enforced by a 1.1
 // JAIN SLEE.
 ServiceComponent specComponent = this . repository . getComponentByID ( this . component . getServiceID ( ) ) ; if ( specComponent == null ) { // should not happen
 passed = false ; errorBuffer = appendToBuffer ( "Referenced " + this . component . getServiceID ( ) + " was not found in component repository, this should not happen since dependencies were already verified" , "1.3" , errorBuffer ) ; } else { if ( specComponent . isSlee11 ( ) ) { passed = false ; errorBuffer = appendToBuffer ( "Service is following 1.0 JSLEE contract, it must not reference 1.1 Sbb as root: " + this . component . getServiceID ( ) , "1.3" , errorBuffer ) ; } } } } finally { if ( ! passed ) { if ( logger . isEnabledFor ( Level . ERROR ) ) { logger . error ( errorBuffer ) ; } } } return passed ; }


Input:
/ * ( non - Javadoc ) [CODESPLIT] @ Override protected void processArguments ( String [ ] args ) throws CommandException { String sopts = ":bu:a:d:cr:plg" ; LongOpt [ ] lopts = { new LongOpt ( "bind" , LongOpt . NO_ARGUMENT , null , ' ' ) , //common options
 new LongOpt ( "link-name" , LongOpt . REQUIRED_ARGUMENT , null , BindOperation . ra_link_name ) , new LongOpt ( "entity-name" , LongOpt . REQUIRED_ARGUMENT , null , BindOperation . ra_entity_name ) , new LongOpt ( "unbind" , LongOpt . REQUIRED_ARGUMENT , null , ' ' ) , new LongOpt ( "activate" , LongOpt . REQUIRED_ARGUMENT , null , ' ' ) , new LongOpt ( "deactivate" , LongOpt . REQUIRED_ARGUMENT , null , ' ' ) , new LongOpt ( "create" , LongOpt . NO_ARGUMENT , null , ' ' ) , //entity-name is covered
 new LongOpt ( "ra-id" , LongOpt . REQUIRED_ARGUMENT , null , CreateOperation . ra_id ) , new LongOpt ( "config" , LongOpt . REQUIRED_ARGUMENT , null , CreateOperation . config ) , new LongOpt ( "remove" , LongOpt . REQUIRED_ARGUMENT , null , ' ' ) , new LongOpt ( "update-config" , LongOpt . NO_ARGUMENT , null , ' ' ) , //entity-name and config are already covered
 new LongOpt ( "list" , LongOpt . NO_ARGUMENT , null , ' ' ) , new LongOpt ( "ra-entities" , LongOpt . OPTIONAL_ARGUMENT , null , ListOperation . ra_entities ) , new LongOpt ( "ra-entities-in-state" , LongOpt . REQUIRED_ARGUMENT , null , ListOperation . ra_entities_in_state ) , new LongOpt ( "ra-entities-by-link" , LongOpt . REQUIRED_ARGUMENT , null , ListOperation . ra_entities_by_link ) , new LongOpt ( "links" , LongOpt . OPTIONAL_ARGUMENT , null , ListOperation . links ) , new LongOpt ( "sbbs" , LongOpt . REQUIRED_ARGUMENT , null , ListOperation . sbbs ) , new LongOpt ( "get" , LongOpt . NO_ARGUMENT , null , ' ' ) , //ra-id is covered
 new LongOpt ( "state" , LongOpt . REQUIRED_ARGUMENT , null , GetOperation . state ) , new LongOpt ( "config-by-id" , LongOpt . REQUIRED_ARGUMENT , null , GetOperation . config_by_id ) , new LongOpt ( "config-by-name" , LongOpt . REQUIRED_ARGUMENT , null , GetOperation . config_by_name ) , //new LongOpt("usage-mbean", LongOpt.REQUIRED_ARGUMENT, null, GetOperation.usage_mbean),
 } ; Getopt getopt = new Getopt ( null , args , sopts , lopts ) ; // getopt.setOpterr(false);
 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 ] ) ; case ' ' : super . operation = new BindOperation ( super . context , super . log , this ) ; super . operation . buildOperation ( getopt , args ) ; break ; case ' ' : super . operation = new UnBindOperation ( super . context , super . log , this ) ; super . operation . buildOperation ( getopt , args ) ; break ; case ' ' : super . operation = new ActivateOperation ( super . context , super . log , this ) ; super . operation . buildOperation ( getopt , args ) ; break ; case ' ' : super . operation = new DeactivateOperation ( super . context , super . log , this ) ; super . operation . buildOperation ( getopt , args ) ; break ; case ' ' : super . operation = new CreateOperation ( super . context , super . log , this ) ; super . operation . buildOperation ( getopt , args ) ; break ; case ' ' : super . operation = new RemoveOperation ( super . context , super . log , this ) ; super . operation . buildOperation ( getopt , args ) ; break ; case ' ' : super . operation = new UpdateConfigOperation ( super . context , super . log , this ) ; super . operation . buildOperation ( getopt , args ) ; break ; case ' ' : super . operation = new ListOperation ( super . context , super . log , this ) ; super . operation . buildOperation ( getopt , args ) ; break ; case ' ' : super . operation = new GetOperation ( super . context , super . log , this ) ; super . operation . buildOperation ( getopt , args ) ; break ; default : throw new CommandException ( "Command: \"" + getName ( ) + "\", found unexpected opt: " + args [ getopt . getOptind ( ) - 1 ] ) ; } } }


Input: This method depending if SecurityManger is present switches class loader using priviledged action this is requried as some action may be initiated by unsecure domains . [CODESPLIT] public static ClassLoader switchSafelyClassLoader ( final ClassLoader cl , final ProfileObject po ) { ClassLoader _cl = null ; if ( System . getSecurityManager ( ) != null ) { _cl = ( ClassLoader ) AccessController . doPrivileged ( new PrivilegedAction ( ) { public Object run ( ) { return _switchSafelyClassLoader ( cl , po ) ; } } ) ; } else { _cl = _switchSafelyClassLoader ( cl , po ) ; } return _cl ; }


Input: Its used to embed calls in AccessController in case of insturmented code cause javassist does not support anonmous inner class . [CODESPLIT] public static Object makeSafeProxyCall ( final Object proxy , final String methodToCallname , final Class [ ] signature , final Object [ ] values ) throws PrivilegedActionException { //Here we execute in sbb/profile or any other slee component domain // so no security calls can be made try { //AccessControlContext acc = new AccessControlContext(new ProtectionDomain[]{proxy.getClass().getProtectionDomain()}); return AccessController . doPrivileged ( new PrivilegedExceptionAction ( ) { public Object run ( ) throws Exception { final Method m = proxy . getClass ( ) . getMethod ( methodToCallname , signature ) ; //Here we cross to org.mobicents domain, with all perms, once m.invoke is called, we go into proxy object domain, effective rightsd are cross section of All + proxy object domain permissions //This is used when isolate security permissions is set to true; return m . invoke ( proxy , values ) ; //}},acc); } } ) ; } catch ( SecurityException e ) { // TODO Auto-generated catch block e . printStackTrace ( ) ; } catch ( PrivilegedActionException e ) { e . printStackTrace ( ) ; } return null ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public boolean isIdentical ( javax . slee . profile . ProfileLocalObject other ) throws SLEEException { if ( ! ( other instanceof ProfileLocalObjectImpl ) ) { return false ; } return this . _equals ( other ) ; }


Input:
/ * ( non - Javadoc ) [CODESPLIT] public void remove ( ) throws TransactionRequiredLocalException , TransactionRolledbackLocalException , SLEEException { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "removing profile with name " + getProfileName ( ) + " from table with name " + getProfileTableName ( ) ) ; } sleeContainer . getTransactionManager ( ) . mandateTransaction ( ) ; try { ProfileEntity profileEntity = profileObject . getProfileEntity ( ) ; if ( profileEntity != null ) { // confirm it is still the same tx
 checkTransaction ( ) ; // remove
 profileEntity . remove ( ) ; } else { // there is no profile assigned to the object
 if ( getProfileTable ( ) . find ( getProfileName ( ) ) == null ) { // this exception has priority
 throw new NoSuchObjectLocalException ( "the profile with name " + getProfileName ( ) + " was not found on table with name " + getProfileTableName ( ) ) ; } else { throw new IllegalStateException ( "the profile object is no longer valid" ) ; } } } catch ( RuntimeException e ) { try { profileObject . invalidateObject ( ) ; sleeContainer . getTransactionManager ( ) . setRollbackOnly ( ) ; } catch ( SystemException e1 ) { throw new SLEEException ( e1 . getMessage ( ) , e1 ) ; } ; throw new TransactionRolledbackLocalException ( e . getMessage ( ) , e ) ; } }


Input: Verifies that the current transaction is still the one used to create the object [CODESPLIT] protected void checkTransaction ( ) throws IllegalStateException { try { if ( ! sleeContainer . getTransactionManager ( ) . getTransaction ( ) . equals ( this . transaction ) ) { throw new IllegalStateException ( ) ; } } catch ( SystemException e ) { throw new IllegalStateException ( ) ; } }


Input: Process a { [CODESPLIT] protected void processRuntimeException ( RuntimeException e ) throws SLEEException , TransactionRolledbackLocalException { try { profileObject . invalidateObject ( ) ; sleeContainer . getTransactionManager ( ) . setRollbackOnly ( ) ; } catch ( SystemException e1 ) { throw new SLEEException ( e1 . getMessage ( ) , e1 ) ; } throw new TransactionRolledbackLocalException ( e . getMessage ( ) , e ) ; }


Input: Process a { [CODESPLIT] protected void processPrivilegedActionException ( PrivilegedActionException e ) throws Exception , TransactionRolledbackLocalException { if ( e . getCause ( ) instanceof RuntimeException ) { processRuntimeException ( ( RuntimeException ) e . getCause ( ) ) ; } else if ( e . getCause ( ) instanceof Exception ) { throw ( Exception ) e . getCause ( ) ; } else { throw new SLEEException ( "unexpected type of cause" , e . getCause ( ) ) ; } }


Input: Calculates the Activity TTL [CODESPLIT] private static String toTTL ( String lastAccess , long timeout ) { Long ttl = timeout - ( ( System . currentTimeMillis ( ) - Long . parseLong ( lastAccess ) ) / 1000 ) ; return ttl . toString ( ) ; }


Input: Verifies if the specified class can be loaded by current thread class loader [CODESPLIT] boolean isProfileClassVisible ( ) { try { Thread . currentThread ( ) . getContextClassLoader ( ) . loadClass ( profileAfterAction . getClass ( ) . getName ( ) ) ; return true ; } catch ( Throwable e ) { return false ; } }


Input:
Retrieves a local object valid for thus current transaction . [CODESPLIT] ProfileObjectImpl getProfileObjectValidInCurrentTransaction ( ProfileEntity profileEntity ) throws TransactionRequiredLocalException { // check tx
 final SleeTransactionManager txManager = profileManagement . getSleeContainer ( ) . getTransactionManager ( ) ; txManager . mandateTransaction ( ) ; // look for an assigned object in local map
 if ( txData == null ) { txData = new HashMap < ProfileEntity , ProfileObjectImpl > ( ) ; } ProfileObjectImpl profileObject = ( ProfileObjectImpl ) txData . get ( profileEntity ) ; if ( profileObject == null ) { // get an object from the table
 profileEntity . setReadOnly ( true ) ; profileEntity . setDirty ( false ) ; ProfileObjectPool pool = profileManagement . getObjectPoolManagement ( ) . getObjectPool ( profileEntity . getTableName ( ) ) ; profileObject = pool . borrowObject ( ) ; profileObject . profileActivate ( profileEntity ) ; ProfileTableTransactionView . passivateProfileObjectOnTxEnd ( txManager , profileObject , pool ) ; txData . put ( profileEntity , profileObject ) ; } return profileObject ; }


Input: SImilar to LoggingMXBean return list of available loggers . Filter is string that has to occur in loggers name . [CODESPLIT] public List < String > getLoggerNames ( String regex ) throws ManagementConsoleException { try { return ( List < String > ) this . mbeanServer . invoke ( logMgmtMBeanName , "getLoggerNames" , new Object [ ] { regex } , new String [ ] { "java.lang.String" } ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; throw new ManagementConsoleException ( SleeManagementMBeanUtils . doMessage ( e ) ) ; } }


Input: Resets all loggers level to default one [CODESPLIT] public void resetLoggerLevels ( ) throws ManagementConsoleException { try { this . mbeanServer . invoke ( logMgmtMBeanName , "resetLoggerLevels" , null , null ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; throw new ManagementConsoleException ( SleeManagementMBeanUtils . doMessage ( e ) ) ; } }


Input: Removes all loggers under certain branch . [CODESPLIT] public void clearLoggers ( String name ) throws ManagementConsoleException { try { this . mbeanServer . invoke ( logMgmtMBeanName , "clearLoggers" , new Object [ ] { name } , new String [ ] { "java.lang.String" } ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; throw new ManagementConsoleException ( SleeManagementMBeanUtils . doMessage ( e ) ) ; } }


Input: Tries to add logger if it doesnt exist [CODESPLIT] public boolean addLogger ( String name , Level level ) throws NullPointerException , ManagementConsoleException { try { return ( ( Boolean ) this . mbeanServer . invoke ( logMgmtMBeanName , "addLogger" , new Object [ ] { name , level } , new String [ ] { "java.lang.String" , "java.util.logging.Level" } ) ) . booleanValue ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; throw new ManagementConsoleException ( SleeManagementMBeanUtils . doMessage ( e ) ) ; } }


Input: Adds SocketHandler to certain logger this logger must exist prior this function is called [CODESPLIT] public void addSocketHandler ( String loggerName , Level handlerLevel , String handlerName , String formaterClassName , String filterClassName , String host , int port ) throws ManagementConsoleException { try { this . mbeanServer . invoke ( logMgmtMBeanName , "addSocketHandler" , new Object [ ] { loggerName , handlerLevel , handlerName , formaterClassName , filterClassName , host , port } , new String [ ] { "java.lang.String" , "java.util.logging.Level" , "java.lang.String" , "java.lang.String" , "java.lang.String" , "java.lang.String" , "int" } ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; throw new ManagementConsoleException ( SleeManagementMBeanUtils . doMessage ( e ) ) ; } }


Input: Tries to remove handler from logger . [CODESPLIT] public boolean removeHandler ( String loggerName , String handlerName ) throws ManagementConsoleException { try { return ( ( Boolean ) this . mbeanServer . invoke ( logMgmtMBeanName , "removeHandler" , new Object [ ] { loggerName , handlerName } , new String [ ] { "java.lang.String" , "java.lang.String" } ) ) . booleanValue ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; throw new ManagementConsoleException ( SleeManagementMBeanUtils . doMessage ( e ) ) ; } }


Input: Adds notification handler to logger if it exists . Its name is set to <b > NOTIFICATION< / b > . There can be only one notification handler . This handler holds reference to up to numberOfEntries log entries and fires notification . Notification can be triggered prematurely in case when someone calls fetchLogContent function this will cause notification to be fired along with log entries return as outcome of invocation . [CODESPLIT] public void addNotificationHandler ( String loggerName , int numberOfEntries , Level level , String formaterClassName , String filterClassName ) throws IllegalArgumentException , IllegalStateException , NullPointerException , ManagementConsoleException { try { this . mbeanServer . invoke ( logMgmtMBeanName , "addNotificationHandler" , new Object [ ] { loggerName , numberOfEntries , level , formaterClassName , filterClassName } , new String [ ] { "java.lang.String" , "int" , "java.util.logging.Logger" , "java.lang.String" , "java.lang.String" } ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; throw new ManagementConsoleException ( SleeManagementMBeanUtils . doMessage ( e ) ) ; } }


Input:
/ * ( non - Javadoc ) [CODESPLIT] public void onShow ( ) { ListPanel operations = new ListPanel ( ) ; operations . setWidth ( "100%" ) ; this . display . setHorizontalAlignment ( DockPanel . ALIGN_CENTER ) ; this . display . setVerticalAlignment ( DockPanel . ALIGN_TOP ) ; this . display . add ( operations , DockPanel . CENTER ) ; this . display . setCellHeight ( operations , "100%" ) ; this . display . setCellWidth ( operations , "100%" ) ; operations . setHeader ( 0 , "Operation name" ) ; operations . setHeader ( 1 , "Parameters" ) ; operations . setHeader ( 2 , "Operation trigger" ) ; // operations.setHeader(3, "Operation detials");
 operations . setColumnWidth ( 0 , "33%" ) ; operations . setColumnWidth ( 1 , "33%" ) ; operations . setColumnWidth ( 2 , "33%" ) ; // operations.setColumnWidth(3, "55%");
 // Operations
 // Set degault logger level
 operations . setCellText ( 1 , 0 , "Default logger level" ) ; operations . setCell ( 1 , 1 , null ) ; operations . setCell ( 1 , 2 , _defaultLoggerLevel ) ; // operations.setCellText(1, 3, _ll_Explanation);
 _defaultLoggerLevel . setTitle ( _ll_Explanation ) ; // Set default handler level
 operations . setCellText ( 2 , 0 , "Default handler level" ) ; operations . setCell ( 2 , 1 , null ) ; operations . setCell ( 2 , 2 , _defaultHandlerLevel ) ; // operations.setCell(2, 3, new Label(_hl_Explanation,true));
 _defaultHandlerLevel . setTitle ( _hl_Explanation ) ; // read cfg
 Hyperlink readLink = new Hyperlink ( "Trigger" , null ) ; // final TextBox uri=new TextBox();
 operations . setCellText ( 3 , 0 , "Read logger cfg" ) ; operations . setCell ( 3 , 1 , _readUri ) ; operations . setCell ( 3 , 2 , readLink ) ; // operations.setCellText(3, 3, _cfg_Explanation);
 readLink . setTitle ( _cfg_Explanation ) ; // reset loggers
 Hyperlink resetLink = new Hyperlink ( "Trigger" , null ) ; // final TextBox resetRegex=new TextBox();
 operations . setCellText ( 4 , 0 , "Reset loggers level" ) ; operations . setCell ( 4 , 1 , _resetLoggerList ) ; operations . setCell ( 4 , 2 , resetLink ) ; resetLink . setTitle ( _reset_Explanation ) ; // clear loggers loggers
 Hyperlink clearLink = new Hyperlink ( "Trigger" , null ) ; // final TextBox clearRegex=new TextBox();
 operations . setCellText ( 5 , 0 , "Turns off loggers" ) ; operations . setCell ( 5 , 1 , _clearLoggerList ) ; operations . setCell ( 5 , 2 , clearLink ) ; clearLink . setTitle ( _cclear_Explanation ) ; // clear loggers loggers
 Hyperlink addLogger = new Hyperlink ( "Trigger" , null ) ; // final TextBox clearRegex = new TextBox();
 operations . setCellText ( 6 , 0 , "Add logger" ) ; operations . setCell ( 6 , 1 , _newLoggerName ) ; operations . setCell ( 6 , 2 , addLogger ) ; addLogger . setTitle ( _add_Logger_Explanation ) ; Hyperlink setInterval = new Hyperlink ( "Trigger" , null ) ; // final TextBox clearRegex = new TextBox();
 operations . setCellText ( 7 , 0 , "Default notification" ) ; operations . setCell ( 7 , 1 , _defaultNotificationInterval ) ; operations . setCell ( 7 , 2 , setInterval ) ; // clearLink.setTitle(_add_Logger_Explanation);
 // Click listeners
 _defaultLoggerLevel . addClickListener ( new ClickListener ( ) { public void onClick ( Widget arg0 ) { ServerConnection . logServiceAsync . setDefaultLoggerLevel ( _defaultLoggerLevel . getItemText ( _defaultLoggerLevel . getSelectedIndex ( ) ) , new AsyncCallback ( ) { public void onFailure ( Throwable t ) { UserInterface . getLogPanel ( ) . error ( "Failed to set value due to:" + t . getMessage ( ) ) ; } public void onSuccess ( Object arg0 ) { // TODO Auto-generated method stub
 } } ) ; } } ) ; _defaultHandlerLevel . addClickListener ( new ClickListener ( ) { public void onClick ( Widget arg0 ) { ServerConnection . logServiceAsync . setDefaultHandlerLevel ( _defaultHandlerLevel . getItemText ( _defaultHandlerLevel . getSelectedIndex ( ) ) , new AsyncCallback ( ) { public void onFailure ( Throwable t ) { UserInterface . getLogPanel ( ) . error ( "Failed to set value due to:" + t . getMessage ( ) ) ; } public void onSuccess ( Object arg0 ) { // TODO Auto-generated method stub
 } } ) ; } } ) ; readLink . addClickListener ( new ClickListener ( ) { public void onClick ( Widget arg0 ) { ServerConnection . logServiceAsync . reReadConf ( _readUri . getText ( ) , new AsyncCallback ( ) { public void onFailure ( Throwable t ) { UserInterface . getLogPanel ( ) . error ( "Failed to set value due to:" + t . getMessage ( ) ) ; } public void onSuccess ( Object arg0 ) { logStructureTreePanel . refreshData ( ) ; } } ) ; } } ) ; resetLink . addClickListener ( new ClickListener ( ) { public void onClick ( Widget arg0 ) { ServerConnection . logServiceAsync . resetLoggerLevel ( _resetLoggerList . getText ( ) , new AsyncCallback ( ) { public void onFailure ( Throwable t ) { UserInterface . getLogPanel ( ) . error ( "Failed to set value due to:" + t . getMessage ( ) ) ; } public void onSuccess ( Object arg0 ) { logStructureTreePanel . refreshData ( ) ; } } ) ; } } ) ; clearLink . addClickListener ( new ClickListener ( ) { public void onClick ( Widget arg0 ) { ServerConnection . logServiceAsync . clearLoggers ( _clearLoggerList . getText ( ) , new AsyncCallback ( ) { public void onFailure ( Throwable t ) { UserInterface . getLogPanel ( ) . error ( "Failed to set value due to:" + t . getMessage ( ) ) ; } public void onSuccess ( Object arg0 ) { logStructureTreePanel . refreshData ( ) ; } } ) ; } } ) ; addLogger . addClickListener ( new ClickListener ( ) { public void onClick ( Widget arg0 ) { ServerConnection . logServiceAsync . addLogger ( _newLoggerName . getText ( ) , _defaultLoggerLevel . getItemText ( _defaultLoggerLevel . getSelectedIndex ( ) ) , new AsyncCallback ( ) { public void onFailure ( Throwable t ) { UserInterface . getLogPanel ( ) . error ( "Failed to set value due to:" + t . getMessage ( ) ) ; } public void onSuccess ( Object arg0 ) { logStructureTreePanel . refreshData ( ) ; } } ) ; } } ) ; setInterval . addClickListener ( new ClickListener ( ) { public void onClick ( Widget arg0 ) { int di = - 1 ; try { di = Integer . valueOf ( _defaultNotificationInterval . getText ( ) ) . intValue ( ) ; } catch ( Exception e ) { UserInterface . getLogPanel ( ) . error ( "Failed to parse due:" + e . getMessage ( ) ) ; return ; } ServerConnection . logServiceAsync . setDefaultNotificationInterval ( di , new AsyncCallback ( ) { public void onFailure ( Throwable t ) { UserInterface . getLogPanel ( ) . error ( "Failed to set value due to:" + t . getMessage ( ) ) ; } public void onSuccess ( Object arg0 ) { // TODO Auto-generated method stub
 } } ) ; } } ) ; // Some fetches:
 ServerConnection . logServiceAsync . getDefaultNotificationInterval ( new AsyncCallback ( ) { public void onFailure ( Throwable t ) { UserInterface . getLogPanel ( ) . error ( "Failed to get value of default notification interval due to:" + t . getMessage ( ) ) ; } public void onSuccess ( Object o ) { _defaultNotificationInterval . setText ( o + "" ) ; } } ) ; ServerConnection . logServiceAsync . getDefaultHandlerLevel ( new AsyncCallback ( ) { public void onFailure ( Throwable t ) { UserInterface . getLogPanel ( ) . error ( "Failed to get value of default handler level due to:" + t . getMessage ( ) ) ; } public void onSuccess ( Object arg0 ) { setValue ( ( String ) arg0 , _defaultHandlerLevel ) ; } } ) ; ServerConnection . logServiceAsync . getDefaultLoggerLevel ( new AsyncCallback ( ) { public void onFailure ( Throwable t ) { UserInterface . getLogPanel ( ) . error ( "Failed to get value of default handler level due to:" + t . getMessage ( ) ) ; } public void onSuccess ( Object arg0 ) { setValue ( ( String ) arg0 , _defaultLoggerLevel ) ; } } ) ; }


Input: Get an <code > AddressScreening< / code > object from an integer value . [CODESPLIT] public static AddressScreening fromInt ( int value ) throws IllegalArgumentException { switch ( value ) { case ADDRESS_SCREENING_UNDEFINED : return UNDEFINED ; case ADDRESS_SCREENING_USER_NOT_VERIFIED : return USER_NOT_VERIFIED ; case ADDRESS_SCREENING_USER_VERIFIED_PASSED : return USER_VERIFIED_PASSED ; case ADDRESS_SCREENING_USER_VERIFIED_FAILED : return USER_VERIFIED_FAILED ; case ADDRESS_SCREENING_NETWORK : return NETWORK ; default : throw new IllegalArgumentException ( "Invalid value: " + value ) ; } }


Input: Get an <code > AddressScreening< / code > object from a string value . [CODESPLIT] public AddressScreening fromString ( String value ) throws NullPointerException , IllegalArgumentException { if ( value == null ) throw new NullPointerException ( "value is null" ) ; if ( value . equalsIgnoreCase ( UNDEFINED_STRING ) ) return UNDEFINED ; if ( value . equalsIgnoreCase ( USER_NOT_VERIFIED_STRING ) ) return USER_NOT_VERIFIED ; if ( value . equalsIgnoreCase ( USER_VERIFIED_PASSED_STRING ) ) return USER_VERIFIED_PASSED ; if ( value . equalsIgnoreCase ( USER_VERIFIED_FAILED_STRING ) ) return USER_VERIFIED_FAILED ; if ( value . equalsIgnoreCase ( NETWORK_STRING ) ) return NETWORK ; throw new IllegalArgumentException ( "Invalid value: " + value ) ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public List < ResourceAdaptorTypeDescriptorImpl > parse ( InputStream inputStream ) throws DeploymentException { Object jaxbPojo = buildJAXBPojo ( inputStream ) ; List < ResourceAdaptorTypeDescriptorImpl > result = new ArrayList < ResourceAdaptorTypeDescriptorImpl > ( ) ; boolean isSlee11 = false ; MResourceAdaptorTypeJar mResourceAdaptorTypeJar = null ; if ( jaxbPojo instanceof org . mobicents . slee . container . component . deployment . jaxb . slee . ratype . ResourceAdaptorTypeJar ) { mResourceAdaptorTypeJar = new MResourceAdaptorTypeJar ( ( org . mobicents . slee . container . component . deployment . jaxb . slee . ratype . ResourceAdaptorTypeJar ) jaxbPojo ) ; } else if ( jaxbPojo instanceof org . mobicents . slee . container . component . deployment . jaxb . slee11 . ratype . ResourceAdaptorTypeJar ) { mResourceAdaptorTypeJar = new MResourceAdaptorTypeJar ( ( org . mobicents . slee . container . component . deployment . jaxb . slee11 . ratype . ResourceAdaptorTypeJar ) jaxbPojo ) ; isSlee11 = true ; } else { throw new SLEEException ( "unexpected class of jaxb pojo built: " + ( jaxbPojo != null ? jaxbPojo . getClass ( ) : null ) ) ; } for ( MResourceAdaptorType mResourceAdaptorType : mResourceAdaptorTypeJar . getResourceAdaptorType ( ) ) { result . add ( new ResourceAdaptorTypeDescriptorImpl ( mResourceAdaptorType , isSlee11 ) ) ; } return result ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public Object getCMPField ( String cmpFieldName ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "Sbb entity " + getSbbEntityId ( ) + " getting cmp field " + cmpFieldName ) ; } sleeContainer . getTransactionManager ( ) . mandateTransaction ( ) ; return cacheData . getCmpField ( cmpFieldName ) ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public void setCMPField ( String cmpFieldName , Object cmpFieldValue ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "Sbb entity " + getSbbEntityId ( ) + " setting cmp field " + cmpFieldName + " to value " + cmpFieldValue ) ; } sleeContainer . getTransactionManager ( ) . mandateTransaction ( ) ; cacheData . setCmpField ( cmpFieldName , cmpFieldValue ) ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public void afterACAttach ( ActivityContextHandle ach ) { // add to cache cacheData . attachActivityContext ( ach ) ; // update event mask Set < EventTypeID > maskedEvents = getSbbComponent ( ) . getDescriptor ( ) . getDefaultEventMask ( ) ; if ( maskedEvents != null && ! maskedEvents . isEmpty ( ) ) { cacheData . updateEventMask ( ach , new HashSet < EventTypeID > ( maskedEvents ) ) ; } if ( log . isDebugEnabled ( ) ) { log . debug ( "Sbb entity " + getSbbEntityId ( ) + " attached to AC with handle " + ach + " , events added to current mask: " + maskedEvents ) ; } }


Input: / * ( non - Javadoc ) [CODESPLIT] public void afterACDetach ( ActivityContextHandle ach ) { // remove from cache cacheData . detachActivityContext ( ach ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( "Sbb entity " + getSbbEntityId ( ) + " detached from AC with handle " + ach ) ; } }


Input: / * ( non - Javadoc ) [CODESPLIT] public byte getPriority ( ) { if ( priority == null ) { priority = cacheData . getPriority ( ) ; } if ( priority == null ) { // TODO check if alternative to fetch default priority and have non null only for custom performs good return 0 ; } return priority . byteValue ( ) ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public void setPriority ( byte value ) { priority = Byte . valueOf ( value ) ; cacheData . setPriority ( priority ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( "Sbb entity " + getSbbEntityId ( ) + " priority set to " + priority ) ; } }


Input: / * ( non - Javadoc ) [CODESPLIT] public void remove ( ) { if ( doTraceLogs ) { log . trace ( "remove()" ) ; } // removes the SBB entity from all Activity Contexts. for ( Iterator < ActivityContextHandle > i = this . getActivityContexts ( ) . iterator ( ) ; i . hasNext ( ) ; ) { ActivityContextHandle ach = i . next ( ) ; // get ac ActivityContext ac = sleeContainer . getActivityContextFactory ( ) . getActivityContext ( ach ) ; // remove the sbb entity from the attachment set. if ( ac != null && ! ac . isEnding ( ) ) { ac . detachSbbEntity ( this . sbbeId ) ; } // no need to remove ac from entity because the entity is being // removed } // It invokes the appropriate life cycle methods (see Section 6.3) of an // SBB object that caches the SBB entity state. boolean invokingServiceSet = SleeThreadLocals . getInvokingService ( ) != null ; if ( ! invokingServiceSet ) { SleeThreadLocals . setInvokingService ( getServiceId ( ) ) ; } try { if ( this . sbbObject == null ) { this . assignSbbObject ( ) ; } removeAndReleaseSbbObject ( ) ; } catch ( Exception e ) { try { sleeContainer . getTransactionManager ( ) . setRollbackOnly ( ) ; this . trashObject ( ) ; } catch ( Exception e2 ) { throw new RuntimeException ( "Transaction Failure." , e2 ) ; } } finally { if ( ! invokingServiceSet ) { SleeThreadLocals . setInvokingService ( null ) ; } } // remove children for ( SbbEntityID childSbbEntityId : cacheData . getAllChildSbbEntities ( ) ) { SbbEntity childSbbEntity = sbbEntityFactory . getSbbEntity ( childSbbEntityId , false ) ; if ( childSbbEntity != null ) { // recreate the sbb entity and remove it sbbEntityFactory . removeSbbEntity ( childSbbEntity , false ) ; } } cacheData . remove ( ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( "Removed sbb entity " + getSbbEntityId ( ) ) ; } }


Input: / * ( non - Javadoc ) [CODESPLIT] public void trashObject ( ) { try { // FIXME shouldn't just return the object to the pool? getObjectPool ( ) . returnObject ( sbbObject ) ; this . sbbObject = null ; } catch ( Exception e ) { throw new RuntimeException ( "Unexpected exception " , e ) ; } }


Input: / * ( non - Javadoc ) [CODESPLIT] public void sbbRolledBack ( Object event , ActivityContextInterface activityContextInterface , boolean removeRollback ) { if ( sbbObject != null ) { sbbObject . sbbRolledBack ( event , activityContextInterface , removeRollback ) ; passivateAndReleaseSbbObject ( ) ; } }


Input: / * ( non - Javadoc ) [CODESPLIT] public SbbID getSbbId ( ) { if ( _sbbID == null ) { ServiceComponent serviceComponent = sleeContainer . getComponentRepository ( ) . getComponentByID ( getServiceId ( ) ) ; SbbComponent sbbComponent = null ; if ( sbbeId . isRootSbbEntity ( ) ) { _sbbID = serviceComponent . getRootSbbComponent ( ) . getSbbID ( ) ; } else { // put chain of parent sbb entity ids in a stack  final LinkedList < SbbEntityID > stack = new LinkedList < SbbEntityID > ( ) ; SbbEntityID sbbEntityID = sbbeId . getParentSBBEntityID ( ) ; while ( ! sbbEntityID . isRootSbbEntity ( ) ) { stack . push ( sbbEntityID ) ; sbbEntityID = sbbEntityID . getParentSBBEntityID ( ) ; } // now find out the sbb component of the parent sbbComponent = serviceComponent . getRootSbbComponent ( ) ; GetChildRelationMethodDescriptor getChildRelationMethodDescriptor = null ; while ( ! stack . isEmpty ( ) ) { sbbEntityID = stack . pop ( ) ; getChildRelationMethodDescriptor = sbbComponent . getDescriptor ( ) . getGetChildRelationMethodsMap ( ) . get ( sbbEntityID . getParentChildRelation ( ) ) ; sbbComponent = sleeContainer . getComponentRepository ( ) . getComponentByID ( getChildRelationMethodDescriptor . getSbbID ( ) ) ; } getChildRelationMethodDescriptor = sbbComponent . getDescriptor ( ) . getGetChildRelationMethodsMap ( ) . get ( sbbeId . getParentChildRelation ( ) ) ; _sbbID = getChildRelationMethodDescriptor . getSbbID ( ) ; } } return _sbbID ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public void invokeEventHandler ( EventContext sleeEvent , ActivityContext ac , EventContext eventContextImpl ) throws Exception { // get event handler method final SbbComponent sbbComponent = getSbbComponent ( ) ; final EventHandlerMethod eventHandlerMethod = sbbComponent . getEventHandlerMethods ( ) . get ( sleeEvent . getEventTypeId ( ) ) ; // build aci ActivityContextInterface aci = asSbbActivityContextInterface ( ac . getActivityContextInterface ( ) ) ; // now build the param array final Object [ ] parameters ; if ( eventHandlerMethod . getHasEventContextParam ( ) ) { parameters = new Object [ ] { sleeEvent . getEvent ( ) , aci , eventContextImpl } ; } else { parameters = new Object [ ] { sleeEvent . getEvent ( ) , aci } ; } // store some info about the invocation in the tx context final EventRoutingTransactionData data = new EventRoutingTransactionDataImpl ( sleeEvent , aci ) ; final TransactionContext txContext = sleeContainer . getTransactionManager ( ) . getTransactionContext ( ) ; txContext . setEventRoutingTransactionData ( data ) ; // track sbb entity invocations if reentrant Set < SbbEntityID > invokedSbbentities = null ; if ( ! isReentrant ( ) ) { invokedSbbentities = txContext . getInvokedNonReentrantSbbEntities ( ) ; invokedSbbentities . add ( sbbeId ) ; } final JndiManagement jndiManagement = sleeContainer . getJndiManagement ( ) ; jndiManagement . pushJndiContext ( sbbComponent ) ; // invoke method try { //This is required. Since domain chain may indicate RA for instance, or SLEE deployer. If we dont do that test: tests/runtime/security/Test1112012Test.xml and second one, w //will fail because domain of SLEE tck ra is too restrictive (or we have bad desgin taht allows this to happen?) if ( System . getSecurityManager ( ) != null ) { AccessController . doPrivileged ( new PrivilegedExceptionAction < Object > ( ) { public Object run ( ) throws IllegalAccessException , InvocationTargetException { eventHandlerMethod . getEventHandlerMethod ( ) . invoke ( sbbObject . getSbbConcrete ( ) , parameters ) ; return null ; } } ) ; } else { eventHandlerMethod . getEventHandlerMethod ( ) . invoke ( sbbObject . getSbbConcrete ( ) , parameters ) ; } } catch ( PrivilegedActionException pae ) { Throwable cause = pae . getException ( ) ; if ( cause instanceof IllegalAccessException ) { throw new RuntimeException ( cause ) ; } else if ( cause instanceof InvocationTargetException ) { // Remember the actual exception is hidden inside the // InvocationTarget exception when you use reflection! Throwable realException = cause . getCause ( ) ; if ( realException instanceof RuntimeException ) { throw ( RuntimeException ) realException ; } else if ( realException instanceof Error ) { throw ( Error ) realException ; } else if ( realException instanceof Exception ) { throw ( Exception ) realException ; } } else { pae . printStackTrace ( ) ; } } catch ( IllegalAccessException iae ) { throw new RuntimeException ( iae ) ; } catch ( InvocationTargetException ite ) { Throwable realException = ite . getCause ( ) ; if ( realException instanceof RuntimeException ) { throw ( RuntimeException ) realException ; } else if ( realException instanceof Error ) { throw ( Error ) realException ; } else if ( realException instanceof Exception ) { throw ( Exception ) realException ; } } catch ( Exception e ) { log . error ( e . getMessage ( ) , e ) ; } finally { jndiManagement . popJndiContext ( ) ; if ( invokedSbbentities != null ) { invokedSbbentities . remove ( sbbeId ) ; } } // remove data from tx context txContext . setEventRoutingTransactionData ( null ) ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public void passivateAndReleaseSbbObject ( ) { this . sbbObject . sbbStore ( ) ; this . sbbObject . sbbPassivate ( ) ; this . sbbObject . setState ( SbbObjectState . POOLED ) ; this . sbbObject . setSbbEntity ( null ) ; try { getObjectPool ( ) . returnObject ( this . sbbObject ) ; } catch ( Exception e ) { log . error ( "failed to return sbb object " + sbbObject + " to pool" , e ) ; } this . sbbObject = null ; if ( childsWithSbbObjects != null ) { for ( Iterator < SbbEntity > i = childsWithSbbObjects . iterator ( ) ; i . hasNext ( ) ; ) { SbbEntity childSbbEntity = i . next ( ) ; if ( childSbbEntity . getSbbObject ( ) != null ) { Thread t = Thread . currentThread ( ) ; ClassLoader cl = t . getContextClassLoader ( ) ; t . setContextClassLoader ( childSbbEntity . getSbbComponent ( ) . getClassLoader ( ) ) ; try { childSbbEntity . passivateAndReleaseSbbObject ( ) ; } finally { t . setContextClassLoader ( cl ) ; } } i . remove ( ) ; } } }


Input: / * ( non - Javadoc ) [CODESPLIT] public SbbObjectPool getObjectPool ( ) { if ( _pool == null ) { _pool = sleeContainer . getSbbManagement ( ) . getObjectPool ( getServiceId ( ) , getSbbId ( ) ) ; } return this . _pool ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public ChildRelationImpl getChildRelation ( String accessorName ) { return new ChildRelationImpl ( this . getSbbComponent ( ) . getDescriptor ( ) . getGetChildRelationMethodsMap ( ) . get ( accessorName ) , this ) ; }


Input: TODO improve with sbb local object storage [CODESPLIT] public SbbLocalObjectImpl getSbbLocalObject ( ) { if ( doTraceLogs ) log . trace ( "getSbbLocalObject()" ) ; // The concrete class generated in ConcreteLocalObjectGenerator final Class < ? > sbbLocalClass = getSbbComponent ( ) . getSbbLocalInterfaceConcreteClass ( ) ; if ( sbbLocalClass != null ) { Object [ ] objs = { this } ; Constructor < ? > constructor = getSbbComponent ( ) . getSbbLocalObjectClassConstructor ( ) ; if ( constructor == null ) { final Class < ? > [ ] types = { SbbEntityImpl . class } ; try { constructor = sbbLocalClass . getConstructor ( types ) ; } catch ( Throwable e ) { throw new SLEEException ( "Unable to retrieve sbb local object generated class constructor" , e ) ; } getSbbComponent ( ) . setSbbLocalObjectClassConstructor ( constructor ) ; } try { return ( SbbLocalObjectImpl ) constructor . newInstance ( objs ) ; } catch ( Throwable e ) { throw new SLEEException ( "Failed to create Sbb Local Interface." , e ) ; } } else { return new SbbLocalObjectImpl ( this ) ; } }


Input: / * ( non - Javadoc ) [CODESPLIT] public void assignSbbObject ( ) throws Exception { try { // get one object from the pool this . sbbObject = getObjectPool ( ) . borrowObject ( ) ; // invoke the appropriate sbb life-cycle methods this . sbbObject . setSbbEntity ( this ) ; if ( created ) { this . sbbObject . sbbCreate ( ) ; this . sbbObject . setState ( SbbObjectState . READY ) ; this . sbbObject . sbbPostCreate ( ) ; } else { this . sbbObject . sbbActivate ( ) ; this . sbbObject . setState ( SbbObjectState . READY ) ; } this . sbbObject . sbbLoad ( ) ; } catch ( Exception e ) { log . error ( "Failed to assign and create sbb object" , e ) ; if ( created ) { removeFromCache ( ) ; } throw e ; } }


Input: Computes the index of the next executor to retrieve . Adaptation of the { @link AtomicInteger } incrementAndGet () code . [CODESPLIT] private int getNextIndex ( ) { for ( ; ; ) { int current = index . get ( ) ; int next = ( current == executors . length ? 1 : current + 1 ) ; if ( index . compareAndSet ( current , next ) ) return next - 1 ; } }


Input: / * ( non - Javadoc ) [CODESPLIT] @ Override protected void addExamples ( PrintWriter out ) { out . println ( "" ) ; out . println ( "     1. List usage parameters type for profile table:" ) ; out . println ( "" + name + " CallControlTableName -l --parameters" ) ; out . println ( "" ) ; out . println ( "     2. List existing usage parameters sets:" ) ; out . println ( "" + name + " CallControlTableName -l --sets" ) ; out . println ( "" ) ; out . println ( "     3. Get value of parameter in certain set:" ) ; out . println ( "" + name + " CallControlTableName CertainSetWithValue -g --name=CookiesCount" ) ; out . println ( "" ) ; out . println ( "     4. Get value of parameter in certain set and reset value:" ) ; out . println ( "" + name + " CallControlTableName CertainSetWithValue -g --name=CookiesCount --rst" ) ; out . println ( "" ) ; out . println ( "     5. Reset all parameters in default parameter set of table:" ) ; out . println ( "" + name + " CallControlTableName --reset" ) ; out . println ( "" ) ; out . println ( "     6. Create parameter set:" ) ; out . println ( "" + name + " CallControlTableName NewSet --create" ) ; out . println ( "" ) ; out . println ( "     7. Enable notification generation for parameter:" ) ; out . println ( "" + name + " CallControlTableName -n --name=CookiesCount --value=true" ) ; }


Input: Generates the log4j logger name for the tracer with specified named and notification source . [CODESPLIT] private String tracerNameToLog4JLoggerName ( String tracerName , NotificationSource notificationSource ) { final StringBuilder sb = new StringBuilder ( "javax.slee." ) . append ( notificationSource . toString ( ) ) ; if ( ! tracerName . equals ( ROOT_TRACER_NAME ) ) { sb . append ( ' ' ) . append ( tracerName ) ; } return sb . toString ( ) ; }


Input:
syncs the slee tracer level with the one that related logger has in log4j [CODESPLIT] void syncLevelWithLog4j ( ) { // get the level from log4j, only the root one uses effective level
 Level log4jLevel = parent == null ? logger . getEffectiveLevel ( ) : logger . getLevel ( ) ; if ( level == null ) { // set the level
 assignLog4JLevel ( log4jLevel ) ; } else { // set the level only if differs, otherwise we may loose levels not present in log4j
 if ( tracerToLog4JLevel ( level ) != log4jLevel ) { assignLog4JLevel ( log4jLevel ) ; } } // the root must always have a level
 if ( parent == null && level == null ) { // defaults to INFO
 logger . setLevel ( Level . INFO ) ; level = TraceLevel . INFO ; } // reset the flags
 resetCacheFlags ( false ) ; }


Input: assigns the equiv log4j level to the tracer [CODESPLIT] private void assignLog4JLevel ( Level log4jLevel ) { if ( log4jLevel == null ) { return ; } if ( log4jLevel == Level . DEBUG ) { level = TraceLevel . FINE ; } else if ( log4jLevel == Level . INFO ) { level = TraceLevel . INFO ; } else if ( log4jLevel == Level . WARN ) { level = TraceLevel . WARNING ; } else if ( log4jLevel == Level . ERROR ) { level = TraceLevel . SEVERE ; } else if ( log4jLevel == Level . TRACE ) { level = TraceLevel . FINEST ; } else if ( log4jLevel == Level . OFF ) { level = TraceLevel . OFF ; } }


Input:
manages the flags which cache if levels are enabled [CODESPLIT] void resetCacheFlags ( boolean resetChilds ) { if ( isTraceable ( TraceLevel . FINEST ) ) { finestEnabled = true ; finerEnabled = true ; fineEnabled = true ; configEnabled = true ; infoEnabled = true ; warningEnabled = true ; severeEnabled = true ; } else { finestEnabled = false ; if ( isTraceable ( TraceLevel . FINER ) ) { finerEnabled = true ; fineEnabled = true ; configEnabled = true ; infoEnabled = true ; warningEnabled = true ; severeEnabled = true ; } else { finerEnabled = false ; if ( isTraceable ( TraceLevel . FINE ) ) { fineEnabled = true ; configEnabled = true ; infoEnabled = true ; warningEnabled = true ; severeEnabled = true ; } else { fineEnabled = false ; if ( isTraceable ( TraceLevel . CONFIG ) ) { configEnabled = true ; infoEnabled = true ; warningEnabled = true ; severeEnabled = true ; } else { if ( isTraceable ( TraceLevel . INFO ) ) { infoEnabled = true ; warningEnabled = true ; severeEnabled = true ; } else { infoEnabled = false ; if ( isTraceable ( TraceLevel . WARNING ) ) { warningEnabled = true ; severeEnabled = true ; } else { warningEnabled = false ; if ( isTraceable ( TraceLevel . SEVERE ) ) { severeEnabled = true ; } else { severeEnabled = false ; } } } } } } } if ( resetChilds ) { // implicit change of level demands that we update reset flags on childs without level
 for ( TracerImpl child : childs ) { if ( child . level == null ) { child . resetCacheFlags ( true ) ; } } } }


Input: / * ( non - Javadoc ) [CODESPLIT] public void config ( String message ) throws NullPointerException , FacilityException { sendNotification ( TraceLevel . CONFIG , message , null ) ; logger . info ( message ) ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public void config ( String message , Throwable t ) throws NullPointerException , FacilityException { sendNotification ( TraceLevel . CONFIG , message , t ) ; logger . info ( message , t ) ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public void fine ( String message ) throws NullPointerException , FacilityException { sendNotification ( TraceLevel . FINE , message , null ) ; logger . debug ( message ) ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public void fine ( String message , Throwable t ) throws NullPointerException , FacilityException { sendNotification ( TraceLevel . FINE , message , t ) ; logger . debug ( message , t ) ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public void finer ( String message ) throws NullPointerException , FacilityException { sendNotification ( TraceLevel . FINER , message , null ) ; logger . debug ( message ) ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public void finer ( String message , Throwable t ) throws NullPointerException , FacilityException { sendNotification ( TraceLevel . FINER , message , t ) ; logger . debug ( message , t ) ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public void finest ( String message ) throws NullPointerException , FacilityException { sendNotification ( TraceLevel . FINEST , message , null ) ; logger . trace ( message ) ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public void finest ( String message , Throwable t ) throws NullPointerException , FacilityException { sendNotification ( TraceLevel . FINEST , message , t ) ; logger . trace ( message , t ) ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public void info ( String message ) throws NullPointerException , FacilityException { sendNotification ( TraceLevel . INFO , message , null ) ; logger . info ( message ) ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public void info ( String message , Throwable t ) throws NullPointerException , FacilityException { sendNotification ( TraceLevel . INFO , message , t ) ; logger . info ( message , t ) ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public void severe ( String message ) throws NullPointerException , FacilityException { sendNotification ( TraceLevel . SEVERE , message , null ) ; logger . error ( message ) ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public void severe ( String message , Throwable t ) throws NullPointerException , FacilityException { sendNotification ( TraceLevel . SEVERE , message , t ) ; logger . error ( message , t ) ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public void trace ( TraceLevel traceLevel , String message , Throwable t ) throws NullPointerException , IllegalArgumentException , FacilityException { sendNotification ( traceLevel , message , t ) ; logger . log ( tracerToLog4JLevel ( traceLevel ) , message , t ) ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public void warning ( String message ) throws NullPointerException , FacilityException { sendNotification ( TraceLevel . WARNING , message , null ) ; logger . warn ( message ) ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public void warning ( String message , Throwable t ) throws NullPointerException , FacilityException { sendNotification ( TraceLevel . WARNING , message , t ) ; logger . warn ( message , t ) ; }


Input: THis is internaly called by 1 . 1 tracers [CODESPLIT] void sendNotification ( javax . slee . facilities . TraceLevel level , String message , Throwable t ) { if ( ! isTraceable ( level ) ) { return ; } traceMBean . sendNotification ( new TraceNotification ( notificationSource . getNotificationSource ( ) . getTraceNotificationType ( ) , traceMBean , notificationSource . getNotificationSource ( ) , getTracerName ( ) , level , message , t , notificationSource . getNextSequence ( ) , System . currentTimeMillis ( ) ) ) ; }


Input:
This checks if the specified tracer name is ok . [CODESPLIT] public static void checkTracerName ( String tracerName , NotificationSource notificationSource ) throws NullPointerException , InvalidArgumentException { if ( tracerName . equals ( "" ) ) { // This is root
 return ; } StringTokenizer stringTokenizer = new StringTokenizer ( tracerName , "." , true ) ; String lastToken = null ; while ( stringTokenizer . hasMoreTokens ( ) ) { String token = stringTokenizer . nextToken ( ) ; if ( lastToken == null ) { // this is start
 lastToken = token ; } if ( lastToken . equals ( token ) && token . equals ( "." ) ) { throw new InvalidArgumentException ( "Passed tracer:" + tracerName + ", name for source: " + notificationSource + ", is illegal" ) ; } lastToken = token ; } if ( lastToken . equals ( "." ) ) { throw new IllegalArgumentException ( "Passed tracer:" + tracerName + ", name for source: " + notificationSource + ", is illegal" ) ; } }


Input: Write the current object and vendor - specific data to the output stream . [CODESPLIT] public static void writeObject ( ObjectOutputStream out , Object vendorData ) throws IOException { // write non-transient fields out . defaultWriteObject ( ) ; // check if should we serialize vendor data? if ( vendorData != null ) { // serialize the vendor data out . writeBoolean ( true ) ; // write the vendor data in a marshalled object so deserialization can be deferred out . writeObject ( new MarshalledObject ( vendorData ) ) ; } else out . writeBoolean ( false ) ; }


Input: Read the current object in the input stream from the stream optionally deserializing any vendor - specific data in the stream . [CODESPLIT] public static Object readObject ( ObjectInputStream in , boolean vendorDataDeserializationEnabled ) throws IOException , ClassNotFoundException { // read non-transient fields in . defaultReadObject ( ) ; // read any possible marshalled vendor data from the stream MarshalledObject vendorData = in . readBoolean ( ) ? ( MarshalledObject ) in . readObject ( ) : null ; // now figure out what to return return ( vendorData != null && vendorDataDeserializationEnabled ) ? vendorData . get ( ) : null ; }


Input: Adds a direct dependency to this domain . Direct dependencies are other domains which the domain depends on . [CODESPLIT] public void addDirectDependency ( URLClassLoaderDomainImpl domain ) { if ( logger . isTraceEnabled ( ) ) logger . trace ( toString ( ) + " adding domain " + domain + " to direct dependencies" ) ; directDependencies . add ( domain ) ; }


Input: Retrieves a flat list containing all dependencies for the domain i . e . all direct dependencies and their own dependencies . [CODESPLIT] public List < URLClassLoaderDomainImpl > getAllDependencies ( ) { List < URLClassLoaderDomainImpl > result = new ArrayList < URLClassLoaderDomainImpl > ( ) ; this . getAllDependencies ( result ) ; return result ; }


Input: Finds a class locally i . e . in the URLs managed by the extended URLClassLoader . [CODESPLIT] protected Class < ? > findClassLocally ( String name ) throws ClassNotFoundException { if ( logger . isTraceEnabled ( ) ) { logger . trace ( toString ( ) + " findClassLocally: " + name ) ; } final boolean acquiredLock = acquireGlobalLock ( ) ; try { return findClassLocallyLocked ( name ) ; } finally { if ( acquiredLock ) { releaseGlobalLock ( ) ; } } }


Input: Finds a resource locally i . e . in the URLs managed by the extended URLClassLoader . [CODESPLIT] protected URL findResourceLocally ( String name ) { if ( logger . isTraceEnabled ( ) ) logger . trace ( toString ( ) + " findResourceLocally: " + name ) ; return super . findResource ( name ) ; }


Input: Finds resources locally i . e . in the URLs managed by the extended URLClassLoader . [CODESPLIT] protected Enumeration < URL > findResourcesLocally ( String name ) throws IOException { if ( logger . isTraceEnabled ( ) ) logger . trace ( toString ( ) + " findResourcesLocally: " + name ) ; return super . findResources ( name ) ; }


Input:
/ * ( non - Javadoc ) [CODESPLIT] public ObjectName createProfile ( java . lang . String profileTableName , java . lang . String profileName ) throws java . lang . NullPointerException , UnrecognizedProfileTableNameException , InvalidArgumentException , ProfileAlreadyExistsException , ManagementException { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "createProfile( profileTable = " + profileTableName + " , profile = " + profileName + " )" ) ; } try { ProfileTableImpl . validateProfileName ( profileName ) ; ProfileTableImpl . validateProfileTableName ( profileTableName ) ; } catch ( IllegalArgumentException e ) { throw new InvalidArgumentException ( e . getMessage ( ) ) ; } Transaction transaction = null ; boolean rollback = true ; try { // begin tx
 sleeTransactionManagement . begin ( ) ; transaction = sleeTransactionManagement . getTransaction ( ) ; // This checks if profile table exists - throws SLEEException in
 // case of system level and UnrecognizedProfileTableNameException in
 // case of no such table
 final ProfileTableImpl profileTable = this . sleeProfileManagement . getProfileTable ( profileTableName ) ; // create profile
 profileTable . createProfile ( profileName ) ; if ( sleeTransactionManagement . getRollbackOnly ( ) ) { throw new ManagementException ( "Transaction used in profile creation rolled back" ) ; } else { // create mbean and registers it
 final AbstractProfileMBeanImpl profileMBean = createAndRegisterProfileMBean ( profileName , profileTable ) ; // keep track of the mbean existence
 profileTable . addUncommittedProfileMBean ( profileMBean ) ; TransactionalAction action = new TransactionalAction ( ) { public void execute ( ) { profileTable . removeUncommittedProfileMBean ( profileMBean ) ; } } ; final TransactionContext txContext = sleeTransactionManagement . getTransactionContext ( ) ; txContext . getAfterCommitActions ( ) . add ( action ) ; txContext . getAfterRollbackActions ( ) . add ( action ) ; // indicate profile creation
 profileMBean . createProfile ( ) ; rollback = false ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "createProfile( profileTable = " + profileTableName + " , profile = " + profileName + " ) result is " + profileMBean . getObjectName ( ) ) ; } return profileMBean . getObjectName ( ) ; } } catch ( TransactionRequiredLocalException e ) { throw new ManagementException ( e . getMessage ( ) , e ) ; } catch ( SLEEException e ) { throw new ManagementException ( e . getMessage ( ) , e ) ; } catch ( CreateException e ) { throw new ManagementException ( e . getMessage ( ) , e ) ; } catch ( NotSupportedException e ) { throw new ManagementException ( e . getMessage ( ) , e ) ; } catch ( SystemException e ) { throw new ManagementException ( e . getMessage ( ) , e ) ; } finally { if ( rollback ) { try { if ( sleeTransactionManagement . getTransaction ( ) == null ) { // the tx was suspended, resume it
 sleeTransactionManagement . resume ( transaction ) ; } sleeTransactionManagement . rollback ( ) ; } catch ( Throwable e ) { logger . error ( e . getMessage ( ) , e ) ; } } } }


Input:
Creates and registers a profile mbean for the specified object . [CODESPLIT] private AbstractProfileMBeanImpl createAndRegisterProfileMBean ( String profileName , ProfileTableImpl profileTable ) throws ManagementException { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "createAndRegisterProfileMBean( profileTable = " + profileTable + " , profileName = " + profileName + " )" ) ; } try { ProfileSpecificationComponent component = profileTable . getProfileSpecificationComponent ( ) ; Constructor < ? > constructor = component . getProfileMBeanConcreteImplClass ( ) . getConstructor ( Class . class , String . class , ProfileTableImpl . class ) ; final AbstractProfileMBeanImpl profileMBean = ( AbstractProfileMBeanImpl ) constructor . newInstance ( component . getProfileMBeanConcreteInterfaceClass ( ) , profileName , profileTable ) ; profileMBean . register ( ) ; // add a rollback action to unregister the mbean
 TransactionalAction rollbackAction = new TransactionalAction ( ) { public void execute ( ) { try { profileMBean . unregister ( ) ; } catch ( Throwable e ) { logger . error ( e . getMessage ( ) , e ) ; } } } ; sleeTransactionManagement . getTransactionContext ( ) . getAfterRollbackActions ( ) . add ( rollbackAction ) ; return profileMBean ; } catch ( Throwable e ) { throw new ManagementException ( e . getMessage ( ) , e ) ; } }


Input: / * ( non - Javadoc ) [CODESPLIT] public void createProfileTable ( ProfileSpecificationID specificationID , String profileTableName ) throws NullPointerException , UnrecognizedProfileSpecificationException , InvalidArgumentException , ProfileTableAlreadyExistsException , ManagementException { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "createProfileTable( profileTable = " + profileTableName + " , specificationID = " + specificationID + " )" ) ; } try { ProfileTableImpl . validateProfileTableName ( profileTableName ) ; } catch ( IllegalArgumentException e ) { throw new InvalidArgumentException ( e . getMessage ( ) ) ; } final SleeContainer sleeContainer = getSleeContainer ( ) ; if ( sleeContainer . getSleeState ( ) != SleeState . RUNNING ) return ; ProfileSpecificationComponent component = sleeContainer . getComponentRepository ( ) . getComponentByID ( specificationID ) ; if ( component == null ) throw new UnrecognizedProfileSpecificationException ( ) ; ClassLoader currentClassLoader = Thread . currentThread ( ) . getContextClassLoader ( ) ; boolean terminateTx = sleeTransactionManagement . requireTransaction ( ) ; boolean doRollback = true ; try { Thread . currentThread ( ) . setContextClassLoader ( component . getClassLoader ( ) ) ; sleeProfileManagement . addProfileTable ( profileTableName , component ) ; doRollback = false ; } catch ( ProfileTableAlreadyExistsException e ) { throw e ; } catch ( Throwable e ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( e . getMessage ( ) , e ) ; } throw new ManagementException ( e . getMessage ( ) , e ) ; } finally { Thread . currentThread ( ) . setContextClassLoader ( currentClassLoader ) ; try { sleeTransactionManagement . requireTransactionEnd ( terminateTx , doRollback ) ; } catch ( Throwable e ) { throw new ManagementException ( e . getMessage ( ) , e ) ; } } }


Input:
/ * ( non - Javadoc ) [CODESPLIT] public ObjectName getDefaultProfile ( String profileTableName ) throws NullPointerException , UnrecognizedProfileTableNameException , ManagementException { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "getDefaultProfile( profileTable = " + profileTableName + " )" ) ; } try { return _getProfile ( profileTableName , null ) ; } catch ( UnrecognizedProfileNameException e ) { // can't happen
 throw new ManagementException ( e . getMessage ( ) , e ) ; } }


Input: / * ( non - Javadoc ) [CODESPLIT] public ObjectName getProfile ( java . lang . String profileTableName , java . lang . String profileName ) throws NullPointerException , UnrecognizedProfileTableNameException , UnrecognizedProfileNameException , ManagementException { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "getProfile( profileTable = " + profileTableName + " , profile = " + profileName + " )" ) ; } ProfileTableImpl . validateProfileName ( profileName ) ; ObjectName objectName = _getProfile ( profileTableName , profileName ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "getProfile( profileTable = " + profileTableName + " , profile = " + profileName + " ) result is " + objectName ) ; } return objectName ; }


Input:
/ * ( non - Javadoc ) [CODESPLIT] public ProfileSpecificationID getProfileSpecification ( String profileTableName ) throws NullPointerException , UnrecognizedProfileTableNameException , ManagementException { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "getProfileSpecification( profileTableName = " + profileTableName + " )" ) ; } if ( profileTableName == null ) throw new NullPointerException ( "Argument[ProfileTableName] must not be null" ) ; boolean b = false ; try { b = this . sleeTransactionManagement . requireTransaction ( ) ; ProfileTableImpl profileTable = this . sleeProfileManagement . getProfileTable ( profileTableName ) ; return profileTable . getProfileSpecificationComponent ( ) . getProfileSpecificationID ( ) ; } catch ( SLEEException e ) { throw new ManagementException ( "Failed to obtain ProfileSpecID name for ProfileTable: " + profileTableName , e ) ; } catch ( UnrecognizedProfileTableNameException e ) { throw e ; } catch ( Exception e ) { throw new ManagementException ( "Failed to obtain ProfileSpecID name for ProfileTable: " + profileTableName , e ) ; } finally { // never rollbacks
 try { sleeTransactionManagement . requireTransactionEnd ( b , false ) ; } catch ( Throwable e ) { throw new ManagementException ( e . getMessage ( ) , e ) ; } } }


Input:
/ * ( non - Javadoc ) [CODESPLIT] public ObjectName getProfileTableUsageMBean ( String profileTableName ) throws NullPointerException , UnrecognizedProfileTableNameException , InvalidArgumentException , ManagementException { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "getProfileTableUsageMBean( profileTableName = " + profileTableName + " )" ) ; } if ( profileTableName == null ) throw new NullPointerException ( "Argument[ProfileTableName] must not be null" ) ; boolean b = this . sleeTransactionManagement . requireTransaction ( ) ; try { ProfileTableUsageMBean usageMBeanImpl = this . sleeProfileManagement . getProfileTable ( profileTableName ) . getProfileTableUsageMBean ( ) ; if ( usageMBeanImpl == null ) { throw new InvalidArgumentException ( ) ; } else { // ensure it is open
 usageMBeanImpl . open ( ) ; // return its object name
 return usageMBeanImpl . getObjectName ( ) ; } } catch ( SLEEException e ) { throw new ManagementException ( "Failed to obtain ProfileSpecID name for ProfileTable: " + profileTableName , e ) ; } catch ( UnrecognizedProfileTableNameException e ) { throw e ; } catch ( InvalidArgumentException e ) { throw e ; } catch ( Throwable e ) { throw new ManagementException ( "Failed to obtain ProfileSpecID name for ProfileTable: " + profileTableName , e ) ; } finally { // never rollbacks
 try { sleeTransactionManagement . requireTransactionEnd ( b , false ) ; } catch ( Throwable e ) { throw new ManagementException ( e . getMessage ( ) , e ) ; } } }


Input: / * ( non - Javadoc ) [CODESPLIT] public Collection < String > getProfileTables ( ) throws ManagementException { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "getProfileTables()" ) ; } boolean b = sleeTransactionManagement . requireTransaction ( ) ; try { return sleeProfileManagement . getDeclaredProfileTableNames ( ) ; } catch ( Exception x ) { if ( x instanceof ManagementException ) throw ( ManagementException ) x ; else throw new ManagementException ( "Failed getProfileTable" , x ) ; } finally { try { sleeTransactionManagement . requireTransactionEnd ( b , false ) ; } catch ( Throwable e ) { throw new ManagementException ( e . getMessage ( ) , e ) ; } } }


Input: / * ( non - Javadoc ) [CODESPLIT] public Collection < String > getProfileTables ( ProfileSpecificationID id ) throws java . lang . NullPointerException , UnrecognizedProfileSpecificationException , ManagementException { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "getProfileTables( id = " + id + " )" ) ; } if ( id == null ) { throw new NullPointerException ( "null profile spec id" ) ; } boolean b = sleeTransactionManagement . requireTransaction ( ) ; try { return sleeProfileManagement . getDeclaredProfileTableNames ( id ) ; } catch ( UnrecognizedProfileSpecificationException x ) { throw x ; } catch ( Throwable x ) { throw new ManagementException ( "Failed createProfileTable" , x ) ; } finally { try { sleeTransactionManagement . requireTransactionEnd ( b , false ) ; } catch ( Throwable e ) { throw new ManagementException ( e . getMessage ( ) , e ) ; } } }


Input: / * ( non - Javadoc ) [CODESPLIT] public Collection < ProfileID > getProfiles ( String profileTableName ) throws NullPointerException , UnrecognizedProfileTableNameException , ManagementException { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "getProfiles( profileTableName = " + profileTableName + " )" ) ; } boolean b = sleeTransactionManagement . requireTransaction ( ) ; try { return sleeProfileManagement . getProfileTable ( profileTableName ) . getProfiles ( ) ; } catch ( NullPointerException e ) { throw e ; } catch ( UnrecognizedProfileTableNameException e ) { throw e ; } catch ( Throwable e ) { throw new ManagementException ( e . getMessage ( ) , e ) ; } finally { try { sleeTransactionManagement . requireTransactionEnd ( b , false ) ; } catch ( Throwable e ) { throw new ManagementException ( e . getMessage ( ) , e ) ; } } }


Input: / * ( non - Javadoc ) [CODESPLIT] public Collection < ProfileID > getProfilesByAttribute ( String profileTableName , String attributeName , Object attributeValue ) throws NullPointerException , UnrecognizedProfileTableNameException , UnrecognizedAttributeException , AttributeTypeMismatchException , ManagementException { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "getProfilesByAttribute( profileTableName = " + profileTableName + " , attributeName = " + attributeName + " , attributeValue = " + attributeValue + " )" ) ; } boolean b = sleeTransactionManagement . requireTransaction ( ) ; try { ProfileTableImpl profileTable = sleeProfileManagement . getProfileTable ( profileTableName ) ; if ( ! profileTable . getProfileSpecificationComponent ( ) . isSlee11 ( ) ) { throw new UnsupportedOperationException ( "JAIN SLEE 1.1 Specs forbiddens the usage of this method on SLEE 1.0 Profile Tables" ) ; } else { return profileTable . getProfilesByAttribute ( attributeName , attributeValue , true ) ; } } catch ( NullPointerException e ) { throw e ; } catch ( UnrecognizedProfileTableNameException e ) { throw e ; } catch ( UnrecognizedAttributeException e ) { throw e ; } catch ( AttributeTypeMismatchException e ) { throw e ; } catch ( Throwable e ) { throw new ManagementException ( e . getMessage ( ) , e ) ; } finally { try { sleeTransactionManagement . requireTransactionEnd ( b , false ) ; } catch ( Throwable e ) { throw new ManagementException ( e . getMessage ( ) , e ) ; } } }


Input: / * ( non - Javadoc ) [CODESPLIT] public Collection < ProfileID > getProfilesByDynamicQuery ( String profileTableName , QueryExpression queryExpression ) throws NullPointerException , UnrecognizedProfileTableNameException , UnrecognizedAttributeException , AttributeTypeMismatchException , ManagementException { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "getProfilesByDynamicQuery( profileTableName = " + profileTableName + " , queryExpression = " + queryExpression + " )" ) ; } if ( queryExpression == null ) { throw new NullPointerException ( "queryExpression is null" ) ; } boolean b = sleeTransactionManagement . requireTransaction ( ) ; Collection < ProfileID > profileIDs = new ArrayList < ProfileID > ( ) ; try { ProfileTableImpl profileTable = sleeProfileManagement . getProfileTable ( profileTableName ) ; if ( ! profileTable . getProfileSpecificationComponent ( ) . isSlee11 ( ) ) { throw new UnsupportedOperationException ( "JAIN SLEE 1.1 Specs forbiddens the usage of this method on SLEE 1.0 Profile Tables" ) ; } for ( ProfileEntity profileEntity : profileTable . getProfileSpecificationComponent ( ) . getProfileEntityFramework ( ) . getProfilesByDynamicQuery ( profileTableName , queryExpression ) ) { profileIDs . add ( new ProfileID ( profileEntity . getTableName ( ) , profileEntity . getProfileName ( ) ) ) ; } } catch ( NullPointerException e ) { throw e ; } catch ( UnrecognizedProfileTableNameException e ) { throw e ; } catch ( UnrecognizedAttributeException e ) { throw e ; } catch ( AttributeTypeMismatchException e ) { throw e ; } catch ( Throwable e ) { throw new ManagementException ( "Failed to obtain ProfileNames for ProfileTable: " + profileTableName , e ) ; } finally { try { sleeTransactionManagement . requireTransactionEnd ( b , false ) ; } catch ( Throwable e ) { throw new ManagementException ( e . getMessage ( ) , e ) ; } } return profileIDs ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public Collection < ProfileID > getProfilesByStaticQuery ( String profileTableName , String queryName , Object [ ] parameters ) throws NullPointerException , UnrecognizedProfileTableNameException , UnrecognizedQueryNameException , InvalidArgumentException , AttributeTypeMismatchException , ManagementException { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "getProfilesByStaticQuery( profileTableName = " + profileTableName + " , queryName = " + queryName + " , parameters = " + Arrays . asList ( parameters ) + " )" ) ; } if ( queryName == null ) { throw new NullPointerException ( "queryName is null" ) ; } boolean b = sleeTransactionManagement . requireTransaction ( ) ; Collection < ProfileID > profileIDs = new ArrayList < ProfileID > ( ) ; try { ProfileTableImpl profileTable = sleeProfileManagement . getProfileTable ( profileTableName ) ; if ( ! profileTable . getProfileSpecificationComponent ( ) . isSlee11 ( ) ) { throw new UnsupportedOperationException ( "JAIN SLEE 1.1 Specs forbiddens the usage of this method on SLEE 1.0 Profile Tables" ) ; } for ( ProfileEntity profileEntity : profileTable . getProfileSpecificationComponent ( ) . getProfileEntityFramework ( ) . getProfilesByStaticQuery ( profileTableName , queryName , parameters ) ) { profileIDs . add ( new ProfileID ( profileEntity . getTableName ( ) , profileEntity . getProfileName ( ) ) ) ; } } catch ( NullPointerException e ) { throw e ; } catch ( UnrecognizedProfileTableNameException e ) { throw e ; } catch ( UnrecognizedQueryNameException e ) { throw e ; } catch ( InvalidArgumentException e ) { throw e ; } catch ( AttributeTypeMismatchException e ) { throw e ; } catch ( Throwable e ) { throw new ManagementException ( "Failed to obtain ProfileNames for ProfileTable: " + profileTableName , e ) ; } finally { try { sleeTransactionManagement . requireTransactionEnd ( b , false ) ; } catch ( Throwable e ) { throw new ManagementException ( e . getMessage ( ) , e ) ; } } return profileIDs ; }


Input: / * ( non - Javadoc ) [CODESPLIT] public void removeProfile ( java . lang . String profileTableName , java . lang . String profileName ) throws java . lang . NullPointerException , UnrecognizedProfileTableNameException , UnrecognizedProfileNameException , ManagementException { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "removeProfile( profileTableName = " + profileTableName + " , profileName = " + profileName + " )" ) ; } if ( profileTableName == null ) throw new NullPointerException ( "Argument[ProfileTableName] must nto be null" ) ; if ( profileName == null ) throw new NullPointerException ( "Argument[ProfileName] must nto be null" ) ; boolean b = this . sleeTransactionManagement . requireTransaction ( ) ; boolean rb = true ; try { ProfileTableImpl profileTable = this . sleeProfileManagement . getProfileTable ( profileTableName ) ; if ( ! profileTable . profileExists ( profileName ) ) { throw new UnrecognizedProfileNameException ( "There is no such profile: " + profileName + ", in profile table: " + profileTableName ) ; } profileTable . removeProfile ( profileName , true , false ) ; if ( ! sleeTransactionManagement . getRollbackOnly ( ) ) { rb = false ; } else { throw new ManagementException ( "Transaction used in profile removal rolled back" ) ; } } catch ( UnrecognizedProfileTableNameException e ) { throw e ; } catch ( UnrecognizedProfileNameException e ) { throw e ; } catch ( Exception e ) { throw new ManagementException ( "Failed to remove due to system level failure." , e ) ; } finally { try { sleeTransactionManagement . requireTransactionEnd ( b , rb ) ; } catch ( Throwable e ) { throw new ManagementException ( e . getMessage ( ) , e ) ; } } }


Input: / * ( non - Javadoc ) [CODESPLIT] public void removeProfileTable ( String profileTableName ) throws NullPointerException , UnrecognizedProfileTableNameException , ManagementException { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "removeProfileTable( profileTableName = " + profileTableName + " )" ) ; } if ( profileTableName == null ) throw new NullPointerException ( "profileTableName is null" ) ; boolean b = this . sleeTransactionManagement . requireTransaction ( ) ; boolean rb = false ; try { this . sleeProfileManagement . removeProfileTable ( profileTableName ) ; } catch ( UnrecognizedProfileTableNameException e ) { rb = true ; throw e ; } catch ( Throwable e ) { rb = true ; throw new ManagementException ( "Failed to remove due to system level failure." , e ) ; } finally { try { sleeTransactionManagement . requireTransactionEnd ( b , rb ) ; } catch ( Throwable e ) { throw new ManagementException ( e . getMessage ( ) , e ) ; } } }


Input: / * ( non - Javadoc ) [CODESPLIT] public void renameProfileTable ( java . lang . String oldProfileTableName , java . lang . String newProfileTableName ) throws java . lang . NullPointerException , UnrecognizedProfileTableNameException , InvalidArgumentException , ProfileTableAlreadyExistsException , ManagementException { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "renameProfileTable( oldProfileTableName = " + oldProfileTableName + " , newProfileTableName = " + newProfileTableName + " )" ) ; } if ( oldProfileTableName == null ) throw new NullPointerException ( "Argument[OldProfileTableName] must nto be null" ) ; if ( newProfileTableName == null ) throw new NullPointerException ( "Argument[NewProfileTableName] must nto be null" ) ; ProfileTableImpl . validateProfileTableName ( newProfileTableName ) ; boolean b = this . sleeTransactionManagement . requireTransaction ( ) ; boolean rb = true ; try { this . sleeProfileManagement . renameProfileTable ( oldProfileTableName , newProfileTableName ) ; rb = false ; } catch ( UnrecognizedProfileTableNameException e ) { throw e ; } catch ( ProfileTableAlreadyExistsException e ) { throw e ; } catch ( Throwable e ) { throw new ManagementException ( "Failed to remove due to system level failure." , e ) ; } finally { try { sleeTransactionManagement . requireTransactionEnd ( b , rb ) ; } catch ( Throwable e ) { throw new ManagementException ( e . getMessage ( ) , e ) ; } } }


Input: Convenience method to create new instance of concrete impl class of { @link AbstractUsageParameterSet } . [CODESPLIT] public static final AbstractUsageParameterSet newInstance ( Class < ? > concreteClass , NotificationSource notificationSource , String parameterSetName , SleeContainer sleeContainer ) throws SecurityException , NoSuchMethodException , IllegalArgumentException , InstantiationException , IllegalAccessException , InvocationTargetException { Constructor < ? > constructor = concreteClass . getConstructor ( NotificationSource . class , String . class , SleeContainer . class ) ; return ( AbstractUsageParameterSet ) constructor . newInstance ( notificationSource , parameterSetName , sleeContainer ) ; }


Input: Suspends the current tx ( if exists ) . [CODESPLIT] SleeTransaction suspendTransaction ( ) throws SLEEException { try { final SleeTransaction tx = txManager . getTransaction ( ) ; if ( tx != null ) { txManager . suspend ( ) ; } return tx ; } catch ( SystemException e ) { throw new SLEEException ( e . getMessage ( ) , e ) ; } }


Input: Resumes the specified tx . If it is null nothing is done . [CODESPLIT] void resumeTransaction ( SleeTransaction transaction ) throws SLEEException { if ( transaction != null ) { try { txManager . resume ( transaction ) ; } catch ( Throwable e ) { throw new SLEEException ( e . getMessage ( ) , e ) ; } } }


Input: / * ( non - Javadoc ) [CODESPLIT] public ComponentClassLoaderImpl newComponentClassLoader ( ComponentID componentID , URLClassLoaderDomain parent ) { return new ComponentClassLoaderImpl ( componentID , ( URLClassLoaderDomainImpl ) parent ) ; }


Input: Retrieves the JAIN SLEE specs descriptor [CODESPLIT] public javax . slee . management . ServiceDescriptor getSpecsDescriptor ( ) { if ( specsDescriptor == null ) { specsDescriptor = new javax . slee . management . ServiceDescriptor ( getServiceID ( ) , getDeployableUnit ( ) . getDeployableUnitID ( ) , getDeploymentUnitSource ( ) , descriptor . getRootSbbID ( ) , descriptor . getAddressProfileTable ( ) , descriptor . getResourceInfoProfileTable ( ) ) ; } return specsDescriptor ; }


Input: Retrieves the set of sbbs used by this service [CODESPLIT] public Set < SbbID > getSbbIDs ( ComponentRepository componentRepository ) { Set < SbbID > result = new HashSet < SbbID > ( ) ; buildSbbTree ( descriptor . getRootSbbID ( ) , result , componentRepository ) ; return result ; }


Input: Retrieves the set of ra entity links referenced by the sbbs related with the service . [CODESPLIT] public Set < String > getResourceAdaptorEntityLinks ( ComponentRepository componentRepository ) { Set < String > result = new HashSet < String > ( ) ; for ( SbbID sbbID : getSbbIDs ( componentRepository ) ) { SbbComponent sbbComponent = componentRepository . getComponentByID ( sbbID ) ; for ( ResourceAdaptorTypeBindingDescriptor raTypeBinding : sbbComponent . getDescriptor ( ) . getResourceAdaptorTypeBindings ( ) ) { for ( ResourceAdaptorEntityBindingDescriptor raEntityBinding : raTypeBinding . getResourceAdaptorEntityBinding ( ) ) { result . add ( raEntityBinding . getResourceAdaptorEntityLink ( ) ) ; } } } return result ; }


Input:
Adds a URL to the specified resource ( as returned by the system classloader ) . to the resource table of the resolver . [CODESPLIT] private void registerResource ( String publicID , String resourceName ) { URL url = this . getClass ( ) . getClassLoader ( ) . getResource ( resourceName ) ; if ( url != null ) { resources . put ( publicID , url ) ; } else { //All the slee dtds should be packaged locally in sar of slee itself
 throw new IllegalStateException ( "Cannot find resource:" + resourceName ) ; } }


Input: dumps the container state as a string useful for debug / profiling [CODESPLIT] public String dumpState ( ) { return componentManagement + "\n" + resourceManagement + "\n" + timerFacility + "\n" + traceMBeanImpl + "\n" + sleeProfileTableManager + "\n" + activityContextFactory + "\n" + activityContextNamingFacility + "\n" + nullActivityFactory + "\n" + getEventRouter ( ) + "\n" + getEventContextFactory ( ) + "\n" + getTransactionManager ( ) + "\n" ; //+ cluster.getMobicentsCache().getCacheContent(); }


Input: Initiates the SLEE container [CODESPLIT] public void initSlee ( ) throws InvalidStateException { if ( sleeState != null ) { throw new InvalidStateException ( "slee in " + sleeState + " state" ) ; } // slee init beforeModulesInitialization ( ) ; for ( Iterator < SleeContainerModule > i = modules . iterator ( ) ; i . hasNext ( ) ; ) { i . next ( ) . sleeInitialization ( ) ; } afterModulesInitialization ( ) ; sleeState = SleeState . STOPPED ; }


Input: Shutdown of the SLEE container [CODESPLIT] public void shutdownSlee ( ) throws InvalidStateException { if ( sleeState != SleeState . STOPPED ) { throw new InvalidStateException ( "slee in " + sleeState + " state" ) ; } // slee shutdown beforeModulesShutdown ( ) ; for ( Iterator < SleeContainerModule > i = modules . descendingIterator ( ) ; i . hasNext ( ) ; ) { i . next ( ) . sleeShutdown ( ) ; } afterModulesShutdown ( ) ; sleeState = null ; }