001    /* 
002     * Copyright 2004 Niclas Hedhman.
003     *
004     * Licensed  under the  Apache License,  Version 2.0  (the "License");
005     * you may not use  this file  except in  compliance with the License.
006     * You may obtain a copy of the License at 
007     * 
008     *   http://www.apache.org/licenses/LICENSE-2.0
009     * 
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed  under the  License is distributed on an "AS IS" BASIS,
012     * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
013     * implied.
014     * 
015     * See the License for the specific language governing permissions and
016     * limitations under the License.
017     */
018    
019    package net.dpml.transit.monitor;
020    
021    import java.net.URI;
022    import java.net.URL;
023    
024    import java.lang.reflect.Constructor;
025     
026    /**
027     * Defintion of a repository monitor.
028     *
029     * @author <a href="http://www.dpml.net">Digital Product Meta Library</a>
030     * @version 1.1.0
031     */
032    public interface RepositoryMonitor extends Monitor
033    {
034       /**
035        * Handle notification of an information message.
036        * @param info the message
037        */
038        void sequenceInfo( String info );
039        
040       /**
041        * Handle notification of a request for the establishment of a plugin.
042        * @param parent the parent classloader
043        * @param uri the requested plugin uri
044        * @param args the supplied constructor arguments
045        */
046        void getPluginRequested( ClassLoader parent, URI uri, Object[] args );
047        
048       /**
049        * Handle notification of the establishment of a plugin class.
050        * @param pluginClass the plugin class
051        */
052        void establishedPluginClass( Class pluginClass );
053        
054       /**
055        * Handle notification of an exception related to plugin establishment.
056        * @param methodname the method raising the exception
057        * @param e the causal exception
058        */
059        void exceptionOccurred( String methodname, Exception e );
060        
061       /**
062        * Handle notification of the discovery of a plugin constructor.
063        * @param constructor the constructor
064        * @param args the constructor args
065        */
066        void pluginConstructorFound( Constructor constructor, Object[] args );
067        
068       /**
069        * Handle notification of the instantiation of a plugin.
070        * @param pluginInstance the plugin instance
071        */
072        void pluginInstantiated( Object pluginInstance );
073        
074       /**
075        * Handle notification of the creation of a new classloader.
076        * @param type the type of classloader (api, spi or impl)
077        * @param classloader the new classloader 
078        */
079        void classloaderConstructed( String type, ClassLoader classloader );
080        
081       /**
082        * Handle notification of system classloader expansion.
083        * @param plugin the uri of the plugin requesting system classloader expansion
084        * @param urls the array of urls added to the system classloader
085        */
086        void systemExpanded( URI plugin, URL[] urls );
087    }