当前位置: 首页>>代码示例>>Java>>正文


Java PluginManager类代码示例

本文整理汇总了Java中org.jivesoftware.openfire.container.PluginManager的典型用法代码示例。如果您正苦于以下问题:Java PluginManager类的具体用法?Java PluginManager怎么用?Java PluginManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PluginManager类属于org.jivesoftware.openfire.container包,在下文中一共展示了PluginManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initialize

import org.jivesoftware.openfire.container.PluginManager; //导入依赖的package包/类
/**
 * Initialize the wrapped component.
 *
 * @throws Exception On any problem.
 */
public synchronized void initialize(final PluginManager manager, final File pluginDirectory) throws Exception
{
    Log.debug( "Initializing Jitsi Videobridge..." );

    if ( jitsiPlugin != null )
    {
        Log.warn( "Another Jitsi Videobridge appears to have been initialized earlier! Unexpected behavior might be the result of this new initialization!" );
    }

    // Disable health check. Our JVB is not an external component, so there's no need to check for its connectivity.
    System.setProperty( "org.jitsi.videobridge.PING_INTERVAL", "-1" );

    jitsiPlugin = new PluginImpl();
    jitsiPlugin.initializePlugin( manager, pluginDirectory );
    Log.trace( "Successfully initialized Jitsi Videobridge." );
}
 
开发者ID:igniterealtime,项目名称:ofmeet-openfire-plugin,代码行数:22,代码来源:JitsiPluginWrapper.java

示例2: getPluginResourceBundle

import org.jivesoftware.openfire.container.PluginManager; //导入依赖的package包/类
/**
 * Retrieve the <code>ResourceBundle</code> that is used with this plugin.
 *
 * @param pluginName the name of the plugin.
 * @return the ResourceBundle used with this plugin.
 * @throws Exception thrown if an exception occurs.
 */
public static ResourceBundle getPluginResourceBundle(String pluginName) throws Exception {
    final Locale locale = JiveGlobals.getLocale();

    String i18nFile = getI18nFile(pluginName);

    // 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);
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:24,代码来源:LocaleUtils.java

示例3: getClusteredCacheStrategyClassLoader

import org.jivesoftware.openfire.container.PluginManager; //导入依赖的package包/类
private static ClassLoader getClusteredCacheStrategyClassLoader() {
    PluginManager pluginManager = XMPPServer.getInstance().getPluginManager();
    Plugin plugin = pluginManager.getPlugin("hazelcast");
    if (plugin == null) {
        plugin = pluginManager.getPlugin("clustering");
        if (plugin == null) {
            plugin = pluginManager.getPlugin("enterprise");
        }
    }
    PluginClassLoader pluginLoader = pluginManager.getPluginClassloader(plugin);
    if (pluginLoader != null) {
        if (log.isDebugEnabled()) {
            StringBuffer pluginLoaderDetails = new StringBuffer("Clustering plugin class loader: ");
            pluginLoaderDetails.append(pluginLoader.getClass().getName());
            for (URL url : pluginLoader.getURLs()) {
                pluginLoaderDetails.append("\n\t").append(url.toExternalForm());
            }
            log.debug(pluginLoaderDetails.toString());
        }
        return pluginLoader;
    }
    else {
        log.warn("CacheFactory - Unable to find a Plugin that provides clustering support.");
        return Thread.currentThread().getContextClassLoader();
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:27,代码来源:CacheFactory.java

示例4: logoutSession

import org.jivesoftware.openfire.container.PluginManager; //导入依赖的package包/类
/**
 * Logs out session via the web interface.
 *
 *
 * @param registrationID ID number associated with registration to log off.
 * @return registration ID on success, -1 on failure (-1 so that js cb_logoutSession knows which Div to edit)
*/

public Integer logoutSession(Integer registrationID)
{
    try
    {
        PluginManager pluginManager = XMPPServer.getInstance().getPluginManager();
        KrakenPlugin plugin = (KrakenPlugin)pluginManager.getPlugin("kraken");
        Registration registration = new Registration(registrationID);
        if (!plugin.getTransportInstance(registration.getTransportType().toString()).isEnabled()) {
            return -1;
        }
        JID jid = registration.getJID();
        TransportSession session = plugin.getTransportInstance(registration.getTransportType().toString()).getTransport().getSessionManager().getSession(jid);
        plugin.getTransportInstance(registration.getTransportType().toString()).getTransport().registrationLoggedOut(session);
        return registrationID;
    }
    catch(NotFoundException e)
    {
        return -1;
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:29,代码来源:ConfigManager.java

示例5: initializePlugin

import org.jivesoftware.openfire.container.PluginManager; //导入依赖的package包/类
public void initializePlugin(PluginManager manager, File pluginDirectory) {
    pluginManager = manager;
    sessionManager = SessionManager.getInstance();
    groupManager = GroupManager.getInstance();
    userManager = UserManager.getInstance();

    // Register as a component.
    componentManager = ComponentManagerFactory.getComponentManager();
    try {
        componentManager.addComponent(serviceName, this);
    }
    catch (Exception e) {
        Log.error(e.getMessage(), e);
    }
    PropertyEventDispatcher.addListener(this);
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:17,代码来源:BroadcastPlugin.java

示例6: initializePlugin

import org.jivesoftware.openfire.container.PluginManager; //导入依赖的package包/类
public void initializePlugin(PluginManager manager, File pluginDirectory) {
    pluginManager = manager;
    XMPPServer server = XMPPServer.getInstance();
    userManager = server.getUserManager();
    presenceManager = server.getPresenceManager();
    hostname = server.getServerInfo().getXMPPDomain();
    probedPresence = new ConcurrentHashMap<String, Presence>();
    componentJID = new JID(subdomain + "." + hostname);
    // Register new component
    componentManager = ComponentManagerFactory.getComponentManager();
    try {
        componentManager.addComponent(subdomain, this);
    }
    catch (Exception e) {
        Log.error(e.getMessage(), e);
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:18,代码来源:PresencePlugin.java

示例7: initializePlugin

import org.jivesoftware.openfire.container.PluginManager; //导入依赖的package包/类
@Override
public void initializePlugin( PluginManager manager, File pluginDirectory )
{
    for ( final String publicResource : publicResources )
    {
        AuthCheckFilter.addExclude( publicResource );
    }

    // Add the Webchat sources to the same context as the one that's providing the BOSH interface.
    context = new WebAppContext( null, pluginDirectory.getPath() + File.separator + "classes/", "/inverse" );
    context.setClassLoader( this.getClass().getClassLoader() );

    // Ensure the JSP engine is initialized correctly (in order to be able to cope with Tomcat/Jasper precompiled JSPs).
    final List<ContainerInitializer> initializers = new ArrayList<>();
    initializers.add( new ContainerInitializer( new JettyJasperInitializer(), null ) );
    context.setAttribute("org.eclipse.jetty.containerInitializers", initializers);
    context.setAttribute( InstanceManager.class.getName(), new SimpleInstanceManager());

    HttpBindManager.getInstance().addJettyHandler( context );
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:21,代码来源:InversePlugin.java

示例8: getResource

import org.jivesoftware.openfire.container.PluginManager; //导入依赖的package包/类
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;
            }
        }
    }
    return resource;
}
 
开发者ID:idwanglu2010,项目名称:openfire,代码行数:19,代码来源:ClusterClassLoader.java

示例9: loadClass

import org.jivesoftware.openfire.container.PluginManager; //导入依赖的package包/类
public Class<?> loadClass(String name) throws ClassNotFoundException {
    try {
        return hazelcastClassloader.loadClass(name);
    }
    catch (ClassNotFoundException e) {
        PluginManager pluginManager = XMPPServer.getInstance().getPluginManager();
        for (Plugin plugin : pluginManager.getPlugins()) {
            String pluginName = pluginManager.getPluginDirectory(plugin).getName();
            if ("hazelcast".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
            }
        }
    }
    throw new ClassNotFoundException(name);
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:23,代码来源:ClusterClassLoader.java

示例10: loadClass

import org.jivesoftware.openfire.container.PluginManager; //导入依赖的package包/类
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
            }
        }
    }
    throw new ClassNotFoundException(name);
}
 
开发者ID:idwanglu2010,项目名称:openfire,代码行数:23,代码来源:ClusterClassLoader.java

示例11: initializePlugin

import org.jivesoftware.openfire.container.PluginManager; //导入依赖的package包/类
public void initializePlugin(PluginManager manager, File pluginDirectory) {
    server = XMPPServer.getInstance();
    userManager = server.getUserManager();
    rosterManager = server.getRosterManager();

    secret = JiveGlobals.getProperty("plugin.userservice.secret", "");
    // If no secret key has been assigned to the user service yet, assign a
    // random one.
    if (secret.equals("")) {
        secret = StringUtils.randomString(8);
        setSecret(secret);
    }

    // See if the service is enabled or not.
    enabled = JiveGlobals.getBooleanProperty("plugin.userservice.enabled", false);

    // See if the HTTP Basic Auth is enabled or not.
    httpBasicAuth = JiveGlobals.getBooleanProperty("plugin.userservice.httpAuth.enabled", false);

    // Get the list of IP addresses that can use this service. An empty list
    // means that this filter is disabled.
    allowedIPs = StringUtils.stringToCollection(JiveGlobals.getProperty("plugin.userservice.allowedIPs", ""));

    // Listen to system property events
    PropertyEventDispatcher.addListener(this);
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:27,代码来源:UserServicePlugin.java

示例12: initializePlugin

import org.jivesoftware.openfire.container.PluginManager; //导入依赖的package包/类
@Override
public void initializePlugin( PluginManager manager, File pluginDirectory )
{
    for ( final String publicResource : publicResources )
    {
        AuthCheckFilter.addExclude( publicResource );
    }

    // Add the Webchat sources to the same context as the one that's providing the BOSH interface.
    context = new WebAppContext( null, pluginDirectory.getPath() + File.separator + "classes", "/candy" );
    context.setClassLoader( this.getClass().getClassLoader() );

    // Ensure the JSP engine is initialized correctly (in order to be able to cope with Tomcat/Jasper precompiled JSPs).
    final List<ContainerInitializer> initializers = new ArrayList<>();
    initializers.add( new ContainerInitializer( new JettyJasperInitializer(), null ) );
    context.setAttribute("org.eclipse.jetty.containerInitializers", initializers);
    context.setAttribute( InstanceManager.class.getName(), new SimpleInstanceManager());

    HttpBindManager.getInstance().addJettyHandler( context );
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:21,代码来源:CandyPlugin.java

示例13: initializePlugin

import org.jivesoftware.openfire.container.PluginManager; //导入依赖的package包/类
public void initializePlugin(PluginManager manager, File pluginDirectory) {
    componentManager = ComponentManagerFactory.getComponentManager();
    component = new RayoComponent(this);
    try {
        componentManager.addComponent(serviceName, component);
    	bridge.appStart(pluginDirectory);
    	checkNatives(pluginDirectory);
    	checkRecordingFolder(pluginDirectory);
    	SessionEventDispatcher.addListener(this);
    } catch (ComponentException e) {
        Log.error("Could NOT load " + component.getName());
    }
    setup();

    component.doStart();
}
 
开发者ID:idwanglu2010,项目名称:openfire,代码行数:17,代码来源:RayoPlugin.java

示例14: initializePlugin

import org.jivesoftware.openfire.container.PluginManager; //导入依赖的package包/类
public void initializePlugin(PluginManager manager, File pluginDirectory) {
    componentManager = ComponentManagerFactory.getComponentManager();
    component = new RayoComponent(this);
    try {
        componentManager.addComponent(serviceName, component);
        bridge.appStart(pluginDirectory);
        checkNatives(pluginDirectory);
        checkRecordingFolder(pluginDirectory);
        SessionEventDispatcher.addListener(this);
    } catch (ComponentException e) {
        Log.error("Could NOT load " + component.getName());
    }
    setup();

    component.doStart();
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:17,代码来源:RayoPlugin.java

示例15: getPluginResourceBundle

import org.jivesoftware.openfire.container.PluginManager; //导入依赖的package包/类
/**
 * Retrieve the <code>ResourceBundle</code> that is used with this plugin.
 *
 * @param pluginName the name of the plugin.
 * @return the ResourceBundle used with this plugin.
 * @throws Exception thrown if an exception occurs.
 */
public static ResourceBundle getPluginResourceBundle(String pluginName) throws Exception {
    final Locale locale = JiveGlobals.getLocale();

    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);
}
 
开发者ID:coodeer,项目名称:g3server,代码行数:24,代码来源:LocaleUtils.java


注:本文中的org.jivesoftware.openfire.container.PluginManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。