@ SuppressWarnings ( "unchecked" ) public static < T extends Plugin > void add ( ExtensionPoint < T > point ) { ArrayList < Plugin > plugins = new ArrayList <> ( ) ; synchronized ( points ) { points . add ( point ) ; for ( Iterator < Plugin > it = waitingPlugins . iterator ( ) ; it . hasNext ( ) ; ) { Plugin pi = it . next ( ) ; if ( point . getPluginClass ( ) . isAssignableFrom ( pi . getClass ( ) ) ) { plugins . add ( pi ) ; it . remove ( ) ; } } } synchronized ( point ) { for ( Plugin pi : plugins ) point . addPlugin ( ( T ) pi ) ; } }
Add an extension point .