private static void injectServiceMethod ( Method method , ServiceMethod annotation ) throws DataException { ServiceData serviceData = new ServiceData ( ) ; String template = annotation . template ( ) ; int accessLevel = annotation . accessLevel ( ) ; String serviceType = ( ! annotation . type ( ) . equals ( "" ) ) ? annotation . type ( ) : null ; String errorMessage = annotation . errorMessage ( ) ; String subjects = annotation . subjects ( ) ; String serviceName = annotation . name ( ) ; try { serviceData . init ( serviceName , ServiceProxy . class . getName ( ) , accessLevel , template , serviceType , errorMessage , subjects ) ; } catch ( Exception e ) { throw new DataException ( "Cannot create ServiceData object for " + serviceName + " - " + e . getMessage ( ) ) ; } // action parameters, none by default String controlFlags = "" ; String methodHashCode = MethodRegistry . addMethod ( method ) ; if ( methodHashCode == null ) { throw new DataException ( "Cannot register method " + method . toString ( ) + " because it has a null hashCode" ) ; } try { serviceData . addAction ( Action . CODE_TYPE , "delegateWithParameters" , methodHashCode , controlFlags , "" ) ; } catch ( DataException e ) { throw new DataException ( "Cannot add defaut action to service" + serviceName + " - " + e . getMessage ( ) ) ; } // inject service ServiceManager . putService ( serviceName , serviceData ) ; }
Injects a single UCMService annotation into the ServiceManager registry .