本文整理汇总了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." );
}
示例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);
}
示例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();
}
}
示例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;
}
}
示例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);
}
示例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);
}
}
示例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 );
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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 );
}
示例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();
}
示例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();
}
示例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);
}