private String getAllPublishedInterfaces ( final GeneratorContext context ) throws IOException { StringBuilder sb = new StringBuilder ( ) ; Container container = getContainer ( context ) ; // The creatormanager holds the list of beans CreatorManager ctManager = ( CreatorManager ) container . getBean ( CreatorManager . class . getName ( ) ) ; if ( null != ctManager ) { Collection < String > creators ; if ( ctManager instanceof DefaultCreatorManager ) { DefaultCreatorManager creatorManager = ( DefaultCreatorManager ) ctManager ; boolean currentDebugValue = creatorManager . isDebug ( ) ; creatorManager . setDebug ( true ) ; // DWR will throw a // SecurityException if not in // debug mode ... creators = ctManager . getCreatorNames ( false ) ; creatorManager . setDebug ( currentDebugValue ) ; } else { log . warn ( "Getting creator names from an unknown CreatorManager. This may fail ..." ) ; creators = ctManager . getCreatorNames ( false ) ; } List < String > creatorList = new ArrayList <> ( creators ) ; Collections . sort ( creatorList ) ; for ( String name : creatorList ) { if ( log . isDebugEnabled ( ) ) log . debug ( "_** mapping: generating found interface named: " + name ) ; InterfaceHandler handler = ( InterfaceHandler ) ContainerUtil . getHandlerForUrlProperty ( container , INTERFACE_HANDLER_URL ) ; sb . append ( handler . generateInterfaceScript ( context . getServletContext ( ) . getContextPath ( ) , context . getConfig ( ) . getDwrMapping ( ) , name ) ) ; } } return sb . toString ( ) ; }
Get all interfaces in one script