container/components/components/src/main/java/org/mobicents/slee/container/component/validator/ProfileSpecificationComponentValidator.java
boolean validateProfileManagementInterface() {
		// this is optional
		boolean passed = true;
		String errorBuffer = new String("");

		if (this.component.getProfileManagementInterfaceClass() == null) {
			// it can hapen when its not present
			return passed;
		}

		try {
			Class profileManagementInterfaceClass = this.component
					.getProfileManagementInterfaceClass();

			if (!profileManagementInterfaceClass.isInterface()) {
				passed = false;
				errorBuffer = appendToBuffer(
						"Profile specification profile management interface is not an interface class!!!",
						"10.10", errorBuffer);
				return passed;

			}

			if (this.component.isSlee11()
					&& profileManagementInterfaceClass.getPackage() == null) {
				passed = false;
				errorBuffer = appendToBuffer(
						"Profile specification profile management interface must be declared within named package.",
						"10.10", errorBuffer);
			}

			if (!Modifier.isPublic(profileManagementInterfaceClass
					.getModifiers())) {

				passed = false;
				errorBuffer = appendToBuffer(
						"Profile specification profile management interface must be declaredas public.",
						"10.10", errorBuffer);

			}

			// now here comes the fun. methods are subject to restrictions form
			// 10.17 and 10.18, BUT interface may implement or just define CMPs
			// that MUST reasemlbe CMPs definition from CMP interface - that is
			// all getter/setter methods defined
			Set<String> ignore = new HashSet<String>();
			ignore.add("java.lang.Object");
			Map<String, Method> cmpInterfaceMethods = ClassUtils
					.getAllInterfacesMethods(this.component
							.getProfileCmpInterfaceClass(), ignore);
			Map<String, Method> managementInterfaceMethods = ClassUtils
					.getAllInterfacesMethods(profileManagementInterfaceClass,
							ignore);

			// we cant simply remove all methods from
			// managementInterfaceMethods.removeAll(cmpInterfaceMethods) since
			// with abstract classes it becomes comp;licated
			// we can have doubling definition with for instance return type or
			// throws clause (as diff) which until concrete class wont be
			// noticed - and is an error....
			// FIXME: does mgmt interface have to define both CMP accessors?
			Iterator<Entry<String, Method>> entryIterator = managementInterfaceMethods
					.entrySet().iterator();
			while (entryIterator.hasNext()) {

				Entry<String, Method> entry = entryIterator.next();
				String key = entry.getKey();

				if (cmpInterfaceMethods.containsKey(key)) {

					// FIXME: possibly we shoudl iterate over names?

					if (!compareMethod(entry.getValue(), cmpInterfaceMethods
							.get(key))) {
						// return type or throws clause, or modifiers differ
						passed = false;
						errorBuffer = appendToBuffer(
								"Profile specification profile management interface declares method which has signature simlar to CMP method, but it has different throws clause, return type or modifiers, which is wrong.",
								"10.10", errorBuffer);

					}
				} else {
					// we can have setter/getter like as stand alone ?
					if (_FORBIDEN_METHODS.contains(key)) {
						// this is forrbiden, section 10.18
						passed = false;
						errorBuffer = appendToBuffer(
								"Profile specification profile management interface declares method from forbiden list, method: "
										+ entry.getKey(), "10.18", errorBuffer);

						continue;
					}
					// is this the right place? This tells validator
					// wheather it should require profile abstract class in
					// case of 1.1
					requiredProfileAbstractClass = true;
					// we know that name is ok.
					// FIXME: SPECS Are weird - Management methods may not
					// have the same name and arguments as a Profile CMP
					// field get or set accessor method. <---- ITS CMP
					// METHOD< SIGNATURE IS NAME AND
					// PARAMETERS and its implemented if its doubled from
					// CMP or this interface extends CMP
					// interface.....!!!!!!!!!!!!!!!!!!

					if (key.startsWith("ejb")) {
						passed = false;
						errorBuffer = appendToBuffer(
								"Profile specification profile management interface declares method with wrong prefix, method: "
										+ entry.getKey(), "10.18", errorBuffer);

						continue;
					}

					// there are no reqs other than parameters?
					Class[] params = entry.getValue().getParameterTypes();
					for (int index = 0; index < params.length; index++) {
						if (_ALLOWED_MANAGEMENT_TYPES.contains(params[index]
								.toString()) || ClassUtils.checkInterfaces(params[index], "java.io.Serializable")!=null) {

						} else {
							passed = false;
							errorBuffer = appendToBuffer(
									"Profile specification profile management interface declares management method with wrong parameter at index["
											+ index
											+ "], method: "
											+ entry.getKey(), "10.18",
									errorBuffer);
						}
					}

				}
			}

		} finally {

			if (!passed) {
				if(logger.isEnabledFor(Level.ERROR))
					logger.error(errorBuffer);
				//System.err.println(errorBuffer);
			}

		}

		return passed;
	}
boolean validateProfileManagementInterface() {
		// this is optional
		boolean passed = true;
		String errorBuffer = new String("");

		if (this.component.getProfileManagementInterfaceClass() == null) {
			// it can hapen when its not present
			return passed;
		}

		try {
			Class profileManagementInterfaceClass = this.component
					.getProfileManagementInterfaceClass();

			if (!profileManagementInterfaceClass.isInterface()) {
				passed = false;
				errorBuffer = appendToBuffer(
						"Profile specification profile management interface is not an interface class!!!",
						"10.10", errorBuffer);
				return passed;

			}

			if (this.component.isSlee11()
					&& profileManagementInterfaceClass.getPackage() == null) {
				passed = false;
				errorBuffer = appendToBuffer(
						"Profile specification profile management interface must be declared within named package.",
						"10.10", errorBuffer);
			}

			if (!Modifier.isPublic(profileManagementInterfaceClass
					.getModifiers())) {

				passed = false;
				errorBuffer = appendToBuffer(
						"Profile specification profile management interface must be declaredas public.",
						"10.10", errorBuffer);

			}

			// now here comes the fun. methods are subject to restrictions form
			// 10.17 and 10.18, BUT interface may implement or just define CMPs
			// that MUST reasemlbe CMPs definition from CMP interface - that is
			// all getter/setter methods defined
			Set<String> ignore = new HashSet<String>();
			ignore.add("java.lang.Object");
			Map<String, Method> cmpInterfaceMethods = ClassUtils
					.getAllInterfacesMethods(this.component
							.getProfileCmpInterfaceClass(), ignore);
			Map<String, Method> managementInterfaceMethods = ClassUtils
					.getAllInterfacesMethods(profileManagementInterfaceClass,
							ignore);

			// we cant simply remove all methods from
			// managementInterfaceMethods.removeAll(cmpInterfaceMethods) since
			// with abstract classes it becomes comp;licated
			// we can have doubling definition with for instance return type or
			// throws clause (as diff) which until concrete class wont be
			// noticed - and is an error....
			// FIXME: does mgmt interface have to define both CMP accessors?
			Iterator<Entry<String, Method>> entryIterator = managementInterfaceMethods
					.entrySet().iterator();
			while (entryIterator.hasNext()) {

				Entry<String, Method> entry = entryIterator.next();
				String key = entry.getKey();

				if (cmpInterfaceMethods.containsKey(key)) {

					// FIXME: possibly we shoudl iterate over names?

					if (!compareMethod(entry.getValue(), cmpInterfaceMethods
							.get(key))) {
						// return type or throws clause, or modifiers differ
						passed = false;
						errorBuffer = appendToBuffer(
								"Profile specification profile management interface declares method which has signature simlar to CMP method, but it has different throws clause, return type or modifiers, which is wrong.",
								"10.10", errorBuffer);

					}
				} else {
					// we can have setter/getter like as stand alone ?
					if (_FORBIDEN_METHODS.contains(key)) {
						// this is forrbiden, section 10.18
						passed = false;
						errorBuffer = appendToBuffer(
								"Profile specification profile management interface declares method from forbiden list, method: "
										+ entry.getKey(), "10.18", errorBuffer);

						continue;
					}
					// is this the right place? This tells validator
					// wheather it should require profile abstract class in
					// case of 1.1
					requiredProfileAbstractClass = true;
					// we know that name is ok.
					// FIXME: SPECS Are weird - Management methods may not
					// have the same name and arguments as a Profile CMP
					// field get or set accessor method. <---- ITS CMP
					// METHOD< SIGNATURE IS NAME AND
					// PARAMETERS and its implemented if its doubled from
					// CMP or this interface extends CMP
					// interface.....!!!!!!!!!!!!!!!!!!

					if (key.startsWith("ejb")) {
						passed = false;
						errorBuffer = appendToBuffer(
								"Profile specification profile management interface declares method with wrong prefix, method: "
										+ entry.getKey(), "10.18", errorBuffer);

						continue;
					}

					// there are no reqs other than parameters?
					Class[] params = entry.getValue().getParameterTypes();
					for (int index = 0; index < params.length; index++) {
						if (_ALLOWED_MANAGEMENT_TYPES.contains(params[index]
								.toString()) || ClassUtils.checkInterfaces(params[index], "java.io.Serializable")!=null) {

						} else {
							passed = false;
							errorBuffer = appendToBuffer(
									"Profile specification profile management interface declares management method with wrong parameter at index["
											+ index
											+ "], method: "
											+ entry.getKey(), "10.18",
									errorBuffer);
						}
					}

				}
			}

		} finally {

			if (!passed) {
				if(logger.isEnabledFor(Level.ERROR))
					logger.error(errorBuffer);
				//System.err.println(errorBuffer);
			}

		}

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

@return
Should not be called when CMP interface validation fails cause it depends on result of it