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


Java ClusterManager.startup方法代码示例

本文整理汇总了Java中org.jivesoftware.openfire.cluster.ClusterManager.startup方法的典型用法代码示例。如果您正苦于以下问题:Java ClusterManager.startup方法的具体用法?Java ClusterManager.startup怎么用?Java ClusterManager.startup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jivesoftware.openfire.cluster.ClusterManager的用法示例。


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

示例1: initializeClustering

import org.jivesoftware.openfire.cluster.ClusterManager; //导入方法依赖的package包/类
private void initializeClustering() {
    logger.info("All plugins have initialized; initializing clustering");
    // Check if another cluster is installed and stop loading this plugin if found
    File pluginDir = new File(JiveGlobals.getHomeDirectory(), "plugins");
    File[] jars = pluginDir.listFiles(new FileFilter() {
        public boolean accept(File pathname) {
            String fileName = pathname.getName().toLowerCase();
            return (fileName.equalsIgnoreCase("enterprise.jar") || 
                    fileName.equalsIgnoreCase("coherence.jar"));
        }
    });
    if (jars.length > 0) {
        // Do not load this plugin if a conflicting implementation exists
        logger.warn("Conflicting clustering plugins found; remove Coherence and/or Enterprise jar files");
        throw new IllegalStateException("Clustering plugin configuration conflict (Coherence)");
    }
    ClusterManager.startup();
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:19,代码来源:HazelcastPlugin.java

示例2: run

import org.jivesoftware.openfire.cluster.ClusterManager; //导入方法依赖的package包/类
@Override
public void run() {
       System.out.println("Starting Hazelcast Clustering Plugin");

       // Check if another cluster is installed and stop loading this plugin if found
       File pluginDir = new File(JiveGlobals.getHomeDirectory(), "plugins");
       File[] jars = pluginDir.listFiles(new FileFilter() {
           public boolean accept(File pathname) {
               String fileName = pathname.getName().toLowerCase();
               return (fileName.equalsIgnoreCase("enterprise.jar") || 
               		fileName.equalsIgnoreCase("coherence.jar"));
           }
       });
       if (jars.length > 0) {
           // Do not load this plugin if a conflicting implementation exists
           logger.warn("Conflicting clustering plugins found; remove Coherence and/or Enterprise jar files");
           throw new IllegalStateException("Clustering plugin configuration conflict (Coherence)");
       }
       ClusterManager.startup();
}
 
开发者ID:idwanglu2010,项目名称:openfire,代码行数:21,代码来源:HazelcastPlugin.java

示例3: initializePlugin

import org.jivesoftware.openfire.cluster.ClusterManager; //导入方法依赖的package包/类
public void initializePlugin(PluginManager manager, File pluginDirectory) {
        System.out.println("Starting Clustering Plugin");

        // Check if we Enterprise is installed and stop loading this plugin if found
        File pluginDir = new File(JiveGlobals.getHomeDirectory(), "plugins");
        File[] jars = pluginDir.listFiles(new FileFilter() {
            public boolean accept(File pathname) {
                String fileName = pathname.getName().toLowerCase();
                return (fileName.equalsIgnoreCase("enterprise.jar"));
            }
        });
        if (jars.length > 0) {
            // Do not load this plugin since Enterprise is still installed
            System.out.println("Enterprise plugin found. Stopping Clustering Plugin");
            throw new IllegalStateException("This plugin cannot run next to the Enterprise plugin");
        }

        // Make sure that the enteprise folder exists under the home directory
        File enterpriseDir = new File(JiveGlobals.getHomeDirectory() +
            File.separator + "enterprise");
        if (!enterpriseDir.exists()) {
            enterpriseDir.mkdirs();
        }

        // Check if Coherence libs are installed and stop loading this plugin if NOT found
//        File libDir = new File(JiveGlobals.getHomeDirectory(), "lib");
//        jars = libDir.listFiles(new FileFilter() {
//            public boolean accept(File pathname) {
//                String fileName = pathname.getName().toLowerCase();
//                return (fileName.equalsIgnoreCase("coherence.jar"));
//            }
//        });
//        if (jars.length == 0) {
//            // Do not load this plugin since Coherence libs are not installed
//            System.out.println("Coherence libs not found. Stopping Clustering Plugin. Copy tangosol.jar, " +
//                    "coherence.jar and coherence-work.jar files to [OPENFIRE_HOME]/lib and restart the server.");
//            throw new IllegalStateException("Coherence libs not found. Stopping Clustering Plugin. Copy " +
//                    "tangosol.jar, coherence.jar and coherence-work.jar files to [OPENFIRE_HOME]/lib and restart the server.");
//        }

        // List for clustering setting events (e.g. enabled/disabled)
        PropertyEventDispatcher.addListener(this);

        // Delete no longer used COHERENCE_CONFIG file. Java system properties should be used
        // to customize coherence
        File configFile = new File(enterpriseDir, COHERENCE_CONFIG + ".xml");
        if (configFile.exists()) {
            configFile.delete();
        }
        // Delete no longer used COHERENCE_CACHE_CONFIG file. Admins should use system properties
        // to override default values. Same system properties will be used when not using enterprise or not
        // using clustering
        configFile = new File(enterpriseDir, COHERENCE_CACHE_CONFIG + ".xml");
        if (configFile.exists()) {
            configFile.delete();
        }

        try {
            // Add openfireHome/enterprise dir to pluginclassloader
            // Add enterprise plugin dir to pluginclassloader
            URL url = new File(pluginDirectory + File.separator).toURL();
            manager.getPluginClassloader(manager.getPlugin(pluginDirectory.getName())).addURLFile(url);
        }
        catch (MalformedURLException e) {
            Log.error("Error adding openfireHome/enterprise to the classpath of the enterprise plugin", e);
        }

        if (ClusterManager.isClusteringEnabled()) {
            initForClustering();

            // Start up or join the cluster and initialize caches
            ClusterManager.startup();
        }

    }
 
开发者ID:coodeer,项目名称:g3server,代码行数:76,代码来源:ClusteringPlugin.java

示例4: initializePlugin

import org.jivesoftware.openfire.cluster.ClusterManager; //导入方法依赖的package包/类
public void initializePlugin(PluginManager manager, File pluginDirectory) {
        System.out.println("Starting Clustering Plugin");

        // Check if we Enterprise is installed and stop loading this plugin if found
        File pluginDir = new File(JiveGlobals.getHomeDirectory(), "plugins");
        File[] jars = pluginDir.listFiles(new FileFilter() {
            public boolean accept(File pathname) {
                String fileName = pathname.getName().toLowerCase();
                return (fileName.equalsIgnoreCase("enterprise.jar") || fileName.equalsIgnoreCase("hazelcast.jar"));
            }
        });
        if (jars.length > 0) {
            // Do not load this plugin since Enterprise is still installed
            System.out.println("Conflicting plugin found. Stopping Clustering Plugin");
            throw new IllegalStateException("This plugin cannot run with the Enterprise or Hazelcast plugin");
        }

        // Make sure that the enteprise folder exists under the home directory
        File enterpriseDir = new File(JiveGlobals.getHomeDirectory() +
            File.separator + "enterprise");
        if (!enterpriseDir.exists()) {
            enterpriseDir.mkdirs();
        }

        // Check if Coherence libs are installed and stop loading this plugin if NOT found
//        File libDir = new File(JiveGlobals.getHomeDirectory(), "lib");
//        jars = libDir.listFiles(new FileFilter() {
//            public boolean accept(File pathname) {
//                String fileName = pathname.getName().toLowerCase();
//                return (fileName.equalsIgnoreCase("coherence.jar"));
//            }
//        });
//        if (jars.length == 0) {
//            // Do not load this plugin since Coherence libs are not installed
//            System.out.println("Coherence libs not found. Stopping Clustering Plugin. Copy tangosol.jar, " +
//                    "coherence.jar and coherence-work.jar files to [OPENFIRE_HOME]/lib and restart the server.");
//            throw new IllegalStateException("Coherence libs not found. Stopping Clustering Plugin. Copy " +
//                    "tangosol.jar, coherence.jar and coherence-work.jar files to [OPENFIRE_HOME]/lib and restart the server.");
//        }

        // Delete no longer used COHERENCE_CONFIG file. Java system properties should be used
        // to customize coherence
        File configFile = new File(enterpriseDir, COHERENCE_CONFIG + ".xml");
        if (configFile.exists()) {
            configFile.delete();
        }
        // Delete no longer used COHERENCE_CACHE_CONFIG file. Admins should use system properties
        // to override default values. Same system properties will be used when not using enterprise or not
        // using clustering
        configFile = new File(enterpriseDir, COHERENCE_CACHE_CONFIG + ".xml");
        if (configFile.exists()) {
            configFile.delete();
        }

        try {
            // Add openfireHome/enterprise dir to pluginclassloader
            // Add enterprise plugin dir to pluginclassloader
            URL url = new File(pluginDirectory + File.separator).toURL();
            manager.getPluginClassloader(manager.getPlugin(pluginDirectory.getName())).addURLFile(url);
        }
        catch (MalformedURLException e) {
            Log.error("Error adding openfireHome/enterprise to the classpath of the enterprise plugin", e);
        }
        CacheFactory.getClusterConfig();
        ClusterManager.startup();
    }
 
开发者ID:idwanglu2010,项目名称:openfire,代码行数:67,代码来源:ClusteringPlugin.java


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