private static String createNewKey ( final List < String > _names , final Class < ? > _bundleclass ) throws EFapsException { final StringBuilder builder = new StringBuilder ( ) ; final List < String > oids = new ArrayList <> ( ) ; String ret = null ; try { for ( final String name : _names ) { if ( builder . length ( ) > 0 ) { builder . append ( "-" ) ; } final Cache < String , StaticCompiledSource > cache = InfinispanCache . get ( ) . < String , StaticCompiledSource > getIgnReCache ( BundleMaker . NAMECACHE ) ; if ( ! cache . containsKey ( name ) ) { final QueryBuilder queryBldr = new QueryBuilder ( CIAdminProgram . StaticCompiled ) ; queryBldr . addWhereAttrEqValue ( CIAdminProgram . StaticCompiled . Name , name ) ; final MultiPrintQuery multi = queryBldr . getPrint ( ) ; multi . addAttribute ( CIAdminProgram . StaticCompiled . Name ) ; multi . execute ( ) ; while ( multi . next ( ) ) { final String statName = multi . < String > getAttribute ( CIAdminProgram . StaticCompiled . Name ) ; final StaticCompiledSource source = new StaticCompiledSource ( multi . getCurrentInstance ( ) . getOid ( ) , statName ) ; cache . put ( source . getName ( ) , source ) ; } } if ( cache . containsKey ( name ) ) { final String oid = cache . get ( name ) . getOid ( ) ; builder . append ( oid ) ; oids . add ( oid ) ; } } ret = builder . toString ( ) ; final BundleInterface bundle = ( BundleInterface ) _bundleclass . newInstance ( ) ; bundle . setKey ( ret , oids ) ; final Cache < String , BundleInterface > cache = InfinispanCache . get ( ) . < String , BundleInterface > getIgnReCache ( BundleMaker . CACHE4BUNDLE ) ; cache . put ( ret , bundle ) ; } catch ( final InstantiationException e ) { throw new EFapsException ( BundleMaker . class , "createNewKey.InstantiationException" , e , _bundleclass ) ; } catch ( final IllegalAccessException e ) { throw new EFapsException ( BundleMaker . class , "createNewKey.IllegalAccessException" , e , _bundleclass ) ; } return ret ; }
Creates a new Key and instantiates the BundleInterface .