Package org.jivesoftware.openfire.container

Examples of org.jivesoftware.openfire.container.PluginManager$PluginMonitor


        if (isSocketStarted || sessionManager == null || deliverer == null || router == null || serverName == null) {
            return;
        }

        // Check if plugins have been loaded
        PluginManager pluginManager = XMPPServer.getInstance().getPluginManager();
        if (!pluginManager.isExecuted()) {
            pluginManager.addPluginManagerListener(new PluginManagerListener() {
                public void pluginsMonitored() {
                    // Stop listening for plugin events
                    XMPPServer.getInstance().getPluginManager().removePluginManagerListener(this);
                    // Start listeners
                    startListeners();
View Full Code Here


        field.setVariable("FORM_TYPE");
        field.addValue("http://jabber.org/protocol/admin");


        // Gets a valid bind interface
        PluginManager pluginManager = XMPPServer.getInstance().getPluginManager();
        AdminConsolePlugin adminConsolePlugin = ((AdminConsolePlugin) pluginManager.getPlugin("admin"));

        String bindInterface = adminConsolePlugin.getBindInterface();
        int adminPort = adminConsolePlugin.getAdminUnsecurePort();
        int adminSecurePort = adminConsolePlugin.getAdminSecurePort();
View Full Code Here

        }
        String i18nFile = pluginName + "_i18n";

        // Retrieve classloader from pluginName.
        final XMPPServer xmppServer = XMPPServer.getInstance();
        PluginManager pluginManager = xmppServer.getPluginManager();
        Plugin plugin = pluginManager.getPlugin(pluginName);
        if (plugin == null) {
            throw new NullPointerException("Plugin could not be located: " + pluginName);
        }

        ClassLoader pluginClassLoader = pluginManager.getPluginClassloader(plugin);
        try {
            ResourceBundle bundle = ResourceBundle.getBundle(i18nFile, locale, pluginClassLoader);
            return getLocalizedString(key, locale, arguments, bundle);
        }
        catch (MissingResourceException mre) {
View Full Code Here

        String i18nFile = pluginName + "_i18n";

        // Retrieve classloader from pluginName.
        final XMPPServer xmppServer = XMPPServer.getInstance();
        PluginManager pluginManager = xmppServer.getPluginManager();
        Plugin plugin = pluginManager.getPlugin(pluginName);
        if (plugin == null) {
            throw new NullPointerException("Plugin could not be located.");
        }

        ClassLoader pluginClassLoader = pluginManager.getPluginClassloader(plugin);
        return ResourceBundle.getBundle(i18nFile, locale, pluginClassLoader);
    }
View Full Code Here

            // Store server info
            xmppServerInfo = new XMPPServerInfoImpl(name, host, version, startDate, getConnectionManager());

            // Create PluginManager now (but don't start it) so that modules may use it
            File pluginDir = new File(openfireHome, "plugins");
            pluginManager = new PluginManager(pluginDir);

            // If the server has already been setup then we can start all the server's modules
            if (!setupMode) {
                verifyDataSource();
                // First load all the modules so that modules may access other modules while
View Full Code Here

     * @return true if database schema checked out fine, or was automatically installed
     *      or updated successfully, or if it isn't needed. False will only be returned
     *      if there is an error.
     */
    public boolean checkPluginSchema(final Plugin plugin) {
        final PluginManager pluginManager = XMPPServer.getInstance().getPluginManager();
        String schemaKey = pluginManager.getDatabaseKey(plugin);
        int schemaVersion = pluginManager.getDatabaseVersion(plugin);
        // If the schema key or database version aren't defined, then the plugin doesn't
        // need database tables.
        if (schemaKey == null || schemaVersion == -1) {
            return true;
        }
        Connection con = null;
        try {
            con = DbConnectionManager.getConnection();
            return checkSchema(con, schemaKey, schemaVersion, new ResourceLoader() {
                @Override
        public InputStream loadResource(String resourceName) {
                    File file = new File(pluginManager.getPluginDirectory(plugin) +
                            File.separator + "database", resourceName);
                    try {
                        return new FileInputStream(file);
                    }
                    catch (FileNotFoundException e) {
View Full Code Here

    public Class<?> loadClass(String name) throws ClassNotFoundException {
        try {
            return enterpriseClassloader.loadClass(name);
        }
        catch (ClassNotFoundException e) {
            PluginManager pluginManager = XMPPServer.getInstance().getPluginManager();
            for (Plugin plugin : pluginManager.getPlugins()) {
                String pluginName = pluginManager.getPluginDirectory(plugin).getName();
                if ("clustering".equals(pluginName) || "admin".equals(pluginName)) {
                    continue;
                }
                PluginClassLoader pluginClassloader = pluginManager.getPluginClassloader(plugin);
                try {
                    return pluginClassloader.loadClass(name);
                }
                catch (ClassNotFoundException e1) {
                    // Do nothing. Continue to the next plugin
View Full Code Here

    }

    public URL getResource(String name) {
        URL resource = enterpriseClassloader.getResource(name);
        if (resource == null) {
            PluginManager pluginManager = XMPPServer.getInstance().getPluginManager();
            for (Plugin plugin : pluginManager.getPlugins()) {
                String pluginName = pluginManager.getPluginDirectory(plugin).getName();
                if ("clustering".equals(pluginName) || "admin".equals(pluginName)) {
                    continue;
                }
                PluginClassLoader pluginClassloader = pluginManager.getPluginClassloader(plugin);
                resource = pluginClassloader.getResource(name);
                if (resource != null) {
                    return resource;
                }
            }
View Full Code Here

        }
        catch (IOException e) {
            // Ignore
        }
        if (answer == null || !answer.hasMoreElements()) {
            PluginManager pluginManager = XMPPServer.getInstance().getPluginManager();
            for (Plugin plugin : pluginManager.getPlugins()) {
                String pluginName = pluginManager.getPluginDirectory(plugin).getName();
                if ("clustering".equals(pluginName) || "admin".equals(pluginName)) {
                    continue;
                }
                PluginClassLoader pluginClassloader = pluginManager.getPluginClassloader(plugin);
                try {
                    answer = pluginClassloader.getResources(name);
                }
                catch (IOException e) {
                    // Ignore
View Full Code Here

     * Adds the encoded imageMap to the database.
     *
     * @param workgroupJID - the jid of the workgroup to setup.
     */
    private void createImageSettings(JID workgroupJID) {
        PluginManager pluginManager = XMPPServer.getInstance().getPluginManager();
        Plugin fastpathPlugin = pluginManager.getPlugin("fastpath");
        File fastpathPluginDirectory = pluginManager.getPluginDirectory(fastpathPlugin);

        File imagesDir = new File(fastpathPluginDirectory, "web/images");

        for (KeyEnum key : imageMap.keySet()) {
            String value = imageMap.get(key);
View Full Code Here

TOP

Related Classes of org.jivesoftware.openfire.container.PluginManager$PluginMonitor

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.