Package org.jdesktop.wonderland.common.utils

Examples of org.jdesktop.wonderland.common.utils.ScannedClassLoader


     * Load plugins specified as services in the various plugin jars
     */
    protected void loadPlugins() {
        // get the service providers for the ServerPlugin class
        // and check each provider
        ScannedClassLoader scl = ScannedClassLoader.getSystemScannedClassLoader();
        Iterator<ServerPlugin> plugins = scl.getAll(Plugin.class,
                                                    ServerPlugin.class);

        while (plugins.hasNext()) {
            ServerPlugin plugin = plugins.next();
           
View Full Code Here


                    factoryList.clear();

                    if (server != null) {
                        // Look for classes annotated with @ContextMenuEntry, and
                        // add them to the factory List
                        ScannedClassLoader cl = server.getClassloader();
                        Iterator<ContextMenuFactorySPI> it = cl.getAll(
                                ContextMenuFactory.class, ContextMenuFactorySPI.class);
                        while (it.hasNext() == true) {
                            factoryList.add(it.next());
                        }
                    }
View Full Code Here

        throws LoadCellMOException
    {      
        CellMO res = null;

        // get a list of providers by type or annotation
        ScannedClassLoader scl = ScannedClassLoader.getSystemScannedClassLoader();
        Iterator<CellMOProvider> i = scl.getAll(
                org.jdesktop.wonderland.server.cell.annotation.CellMOProvider.class,
                CellMOProvider.class);

        // check each provider
        while (i.hasNext()) {
View Full Code Here

        ModulePluginList list = ModuleUtils.fetchPluginJars(serverURL);
        List<URL> urls = new ArrayList<URL>();
        if (list == null) {
            logger.warning("Unable to configure classlaoder, falling back to " +
                           "system classloader");
            return new ScannedClassLoader(new URL[0],
                                          getClass().getClassLoader());
        }

        for (JarURI uri : list.getJarURIs()) {
            try {
                // check the filter to see if we should add this URI
                if (LoginManager.getPluginFilter().shouldDownload(this, uri)) {
                    urls.add(uri.toURL());
                }
            } catch (Exception excp) {
                excp.printStackTrace();
           }
        }

        return new ScannedClassLoader(urls.toArray(new URL[0]),
                                      getClass().getClassLoader());
    }
View Full Code Here

     * manager.
     */
    protected synchronized void registerFactories(ServerSessionManager manager) {
        // search annotations
        // now search annotations
        ScannedClassLoader cl = manager.getClassloader();
        Iterator<CellComponentFactorySPI> it = cl.getAll(
                CellComponentFactory.class, CellComponentFactorySPI.class);
        while (it.hasNext()) {
            CellComponentFactorySPI factory = it.next();
            registerCellComponentFactory(factory);
            sessionFactories.add(factory);
View Full Code Here

     * Register all factories associated with the given session
     * manager.
     */
    protected synchronized void registerFactories(ServerSessionManager manager) {
        // search annotations
        ScannedClassLoader cl = manager.getClassloader();
        Iterator<CellFactorySPI> it = cl.getAll(CellFactory.class,
                                                CellFactorySPI.class);
        while (it.hasNext()) {
            CellFactorySPI factory = it.next();
            addFactory(factory);
            sessionFactories.add(factory);
View Full Code Here

        Map<String, CommunicationsProtocol> protocols =
                new ScalableHashMap<String, CommunicationsProtocol>();
        AppContext.getDataManager().setBinding(BINDING_NAME, protocols);

        // find all annotated protocols and install them
        ScannedClassLoader scl = ScannedClassLoader.getSystemScannedClassLoader();
        Iterator<CommunicationsProtocol> pi = scl.getAll(Protocol.class,
                                                         CommunicationsProtocol.class);
        while (pi.hasNext()) {
            CommunicationsProtocol cp = pi.next();
            protocols.put(cp.getName(), cp);
        }

        // find all annotated client handlers and install them
        Iterator<ClientConnectionHandler> ci = scl.getAll(ClientHandler.class,
                                                          ClientConnectionHandler.class);
        while (ci.hasNext()) {
            WonderlandSessionListener.registerClientHandler(ci.next());
        }
    }
View Full Code Here

        }

        // Next find all of the classes that are annotated with @AvatarFactory.
        // and place their classes in the set of loading classes.
        Set<AvatarFactorySPI> factorySet = new HashSet();
        ScannedClassLoader scl = manager.getClassloader();
        Iterator<AvatarFactorySPI> it = scl.getAll(AvatarFactory.class, AvatarFactorySPI.class);
        while (it.hasNext() == true) {
            factorySet.add(it.next());
        }

        // Place each of the factory classes in the loading set
View Full Code Here

     * Unloads all of the avatars associated with the server session.
     */
    public void unload() {
        // Find all of the classes that are annotated with @AvatarFactory and
        // tell them to unload.
        ScannedClassLoader scl = manager.getClassloader();
        Iterator<AvatarFactorySPI> it = scl.getAll(AvatarFactory.class, AvatarFactorySPI.class);
        while (it.hasNext() == true) {
            it.next().unregisterAvatars(manager);
        }

        // Finally put the state back to INIT
View Full Code Here

        // Look for all factories and add them to the map. Look to see if the
        // 'default' flag is set on the annoation and if so mark it as the
        // default. If there is more than one, then simply use the last 'default'
        // factory found.
        if (server != null) {
            ScannedClassLoader cl = server.getClassloader();
            Iterator<AvatarLoaderFactorySPI> it =
                    cl.getAll(AvatarLoaderFactory.class, AvatarLoaderFactorySPI.class);
            while (it.hasNext() == true) {
                AvatarLoaderFactorySPI factory = it.next();
                Class clazz = factory.getClass();
                avatarLoaderMap.put(clazz.getName(), factory);
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.common.utils.ScannedClassLoader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.