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


Java ComponentManagerFactory类代码示例

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


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

示例1: destroy

import org.xmpp.component.ComponentManagerFactory; //导入依赖的package包/类
/**
 * Destroying the wrapped component. After this call, the wrapped component can be re-initialized.
 *
 * @throws Exception On any problem.
 */
public synchronized void destroy() throws Exception
{
    Log.debug( "Destroying Jitsi Focus Component..." );

    if ( jicofoComponent == null)
    {
        Log.warn( "Unable to destroy the Jitsi Focus Component, as none appears to be running!" );
    }
    else
    {
        ComponentManagerFactory.getComponentManager().removeComponent(jicofoSubdomain);
        jicofoSubdomain = null;

        jicofoComponent.dispose();
        jicofoComponent = null;

    }

    Log.trace( "Successfully destroyed Jitsi Focus Component.   " );
}
 
开发者ID:igniterealtime,项目名称:ofmeet-openfire-plugin,代码行数:26,代码来源:JitsiJicofoWrapper.java

示例2: initializePlugin

import org.xmpp.component.ComponentManagerFactory; //导入依赖的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

示例3: initializePlugin

import org.xmpp.component.ComponentManagerFactory; //导入依赖的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

示例4: workgroupManagerStop

import org.xmpp.component.ComponentManagerFactory; //导入依赖的package包/类
private void workgroupManagerStop() {
    // Unregister workgroup component
    try {
        ComponentManagerFactory.getComponentManager().removeComponent("workgroup");
    }
    catch (ComponentException e) {
        Log.error("Error unregistering workgroup component", e);
    }
    if (workgroupManager != null) {
        // Unregister the provider of workgroup names
        UserNameManager.removeUserNameProvider(workgroupManager.getAddress().toString());
        // Stop the Fastpath module
        workgroupManager.stop();
    }
    // Clean up the reference to the workgroup manager as a way to say that FP is no longer running in this JVM
    workgroupManager = null;
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:18,代码来源:FastpathPlugin.java

示例5: saveAgent

import org.xmpp.component.ComponentManagerFactory; //导入依赖的package包/类
private void saveAgent() {
    Connection con = null;
    PreparedStatement pstmt = null;
    try {
        con = DbConnectionManager.getConnection();
        pstmt = con.prepareStatement(SAVE_AGENT);
        pstmt.setString(1, nickname);
        // If the JID of the agent is of the local server then just store the username
        String hostname = ComponentManagerFactory.getComponentManager().getServerName();
        String agentBareJID = agentJID.toBareJID();
        if (hostname.equals(agentJID.getDomain())) {
            agentBareJID = agentJID.getNode();
        }
        pstmt.setString(2, agentBareJID);
        pstmt.setInt(3, maxChats);
        pstmt.setLong(4, id);
        pstmt.executeUpdate();
    }
    catch (Exception ex) {
        Log.error(ex.getMessage(), ex);
    }
    finally {
        DbConnectionManager.closeConnection(pstmt, con);
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:26,代码来源:Agent.java

示例6: initializePlugin

import org.xmpp.component.ComponentManagerFactory; //导入依赖的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

示例7: initializePlugin

import org.xmpp.component.ComponentManagerFactory; //导入依赖的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

示例8: ExternalComponentManager

import org.xmpp.component.ComponentManagerFactory; //导入依赖的package包/类
/**
 * Constructs a new ExternalComponentManager that will make connections to
 * the specified XMPP server on the given port.
 *
 * @param host the IP address or name of the XMPP server to connect to (e.g. "example.com").
 * @param port the port to connect on.
 */
@Deprecated
public ExternalComponentManager(String host, int port) {
    if (host == null) {
        throw new IllegalArgumentException("Host of XMPP server cannot be null");
    }
    this.host = host;
    this.port = port;

    createDummyLogger();

    // Set this ComponentManager as the current component manager
    ComponentManagerFactory.setComponentManager(this);
}
 
开发者ID:igniterealtime,项目名称:Whack,代码行数:21,代码来源:ExternalComponentManager.java

示例9: registerMultiUserChatService

import org.xmpp.component.ComponentManagerFactory; //导入依赖的package包/类
/**
 * Registers a new MultiUserChatService implementation to the manager.
 * This is typically used if you have a custom MUC implementation that you
 * want to register with the manager.  In other words, it may not be database
 * stored and may follow special rules, implementating MultiUserChatService.
 * It is also used internally to register services from the database.  Triggers
 * the service to start up.
 *
 * @param service The MultiUserChatService to be registered.
 */
public void registerMultiUserChatService(MultiUserChatService service) {
    Log.debug("MultiUserChatManager: Registering MUC service "+service.getServiceName());
    try {
        ComponentManagerFactory.getComponentManager().addComponent(service.getServiceName(), service);
        mucServices.put(service.getServiceName(), service);
    }
    catch (ComponentException e) {
        Log.error("MultiUserChatManager: Unable to add "+service.getServiceName()+" as component.", e);
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:21,代码来源:MultiUserChatManager.java

示例10: unregisterMultiUserChatService

import org.xmpp.component.ComponentManagerFactory; //导入依赖的package包/类
/**
 * Unregisters a MultiUserChatService from the manager.  It can be used
 * to explicitly unregister services, and is also used internally to unregister
 * database stored services.  Triggers the service to shut down.
 *
 * @param subdomain The subdomain of the service to be unregistered.
 */
public void unregisterMultiUserChatService(String subdomain) {
    Log.debug("MultiUserChatManager: Unregistering MUC service "+subdomain);
    MultiUserChatService service = mucServices.get(subdomain);
    if (service != null) {
        service.shutdown();
        try {
            ComponentManagerFactory.getComponentManager().removeComponent(subdomain);
        }
        catch (ComponentException e) {
            Log.error("MultiUserChatManager: Unable to remove "+subdomain+" from component manager.", e);
        }
        mucServices.remove(subdomain);
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:22,代码来源:MultiUserChatManager.java

示例11: start

import org.xmpp.component.ComponentManagerFactory; //导入依赖的package包/类
@Override
public void start() {
    // Set this ComponentManager as the current component manager
    ComponentManagerFactory.setComponentManager(instance);

    XMPPServer server = XMPPServer.getInstance();
    serverDomain = server.getServerInfo().getXMPPDomain();
    // Set the address of this internal service. component.[domain]
    serviceAddress = new JID(null, "component." + serverDomain, null);
    if (!server.isSetupMode()) {
        // Add a route to this service
        server.getRoutingTable().addComponentRoute(getAddress(), this);
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:15,代码来源:InternalComponentManager.java

示例12: initializePlugin

import org.xmpp.component.ComponentManagerFactory; //导入依赖的package包/类
public void initializePlugin(PluginManager manager, File pluginDirectory) {
    componentManager = ComponentManagerFactory.getComponentManager();
    JingleNodesComponent component = new JingleNodesComponent(this);
    try {
        componentManager.addComponent(serviceName, component);
    } catch (ComponentException e) {
        Log.error("Could NOT load " + component.getName());
    }
    setup();
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:11,代码来源:JingleNodesPlugin.java

示例13: initializePlugin

import org.xmpp.component.ComponentManagerFactory; //导入依赖的package包/类
public void initializePlugin(PluginManager manager, File pluginDirectory) {
    pluginManager = manager;

    componentManager = ComponentManagerFactory.getComponentManager();
    try {
        componentManager.addComponent(serviceName, this);
    } catch (ComponentException e) {
        Log.error(e.getMessage(), e);
    }
    PropertyEventDispatcher.addListener(this);
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:12,代码来源:SearchPlugin.java

示例14: addAgents

import org.xmpp.component.ComponentManagerFactory; //导入依赖的package包/类
/**
 * Adds agents to a request queue.
 *
 * @param queue  the <code>RequestQueue</code> to add agents to.
 * @param agents a comma-delimited list of agents.
 */
public static void addAgents(RequestQueue queue, String agents) {
    WorkgroupManager workgroupManager = WorkgroupManager.getInstance();
    AgentManager agentManager = workgroupManager.getAgentManager();

    // loop thru all params
    StringTokenizer tokenizer = new StringTokenizer(agents, ", \t\n\r\f");
    while (tokenizer.hasMoreTokens()) {
        String usernameToken = tokenizer.nextToken();
        if (usernameToken.indexOf('@') != -1) {
            usernameToken = JID.escapeNode(usernameToken);
        }
        try {
            // See if they are a user in the system.
            UserManager.getInstance().getUser(usernameToken);
            usernameToken += ("@" + ComponentManagerFactory.getComponentManager().getServerName());
            JID address = new JID(usernameToken.trim());
            Agent agent;

            if (agentManager.hasAgent(address)) {
                agent = agentManager.getAgent(address);
            }
            else {
                agent = agentManager.createAgent(address);
            }
            queue.addMember(agent);
        }
        catch (Exception e) {
            Log.error(e.getMessage(), e);
        }
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:38,代码来源:WorkgroupUtils.java

示例15: loadAgent

import org.xmpp.component.ComponentManagerFactory; //导入依赖的package包/类
private void loadAgent(long agentID) {
    Connection con = null;
    PreparedStatement pstmt = null;
    ResultSet rs = null;
    try {
        con = DbConnectionManager.getConnection();
        pstmt = con.prepareStatement(LOAD_AGENT);
        pstmt.setLong(1, agentID);
        rs = pstmt.executeQuery();
        if (rs.next()) {
            nickname = rs.getString(1);
            String agentJID = rs.getString(2);
            // If the agentJID was just a username then create a JID where the domain is the
            // local server
            if (!agentJID.contains("@")) {
                agentJID = agentJID + "@" +
                        ComponentManagerFactory.getComponentManager().getServerName();
            }
            this.agentJID = new JID(agentJID);
            maxChats = rs.getInt(3);
        }
    }
    catch (Exception ex) {
        Log.error(ex.getMessage(), ex);
    }
    finally {
        DbConnectionManager.closeConnection(rs, pstmt, con);
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:30,代码来源:Agent.java


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