- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.jivesoftware.openfire.XMPPServer.getInstance()
方法的一些代码示例,展示了XMPPServer.getInstance()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMPPServer.getInstance()
方法的具体详情如下:
包路径:org.jivesoftware.openfire.XMPPServer
类名称:XMPPServer
方法名:getInstance
[英]Returns a singleton instance of XMPPServer.
[中]返回XMPPServer的单例实例。
代码示例来源:origin: igniterealtime/Openfire
public PubSubInfo()
{
super( XMPPServer.getInstance().getPubSubModule() );
}
}
代码示例来源:origin: igniterealtime/Openfire
/**
* Returns the XMPP server object -- can get many config items from here.
*/
public XMPPServer getXMPPServer() {
final XMPPServer xmppServer = XMPPServer.getInstance();
if (xmppServer == null) {
// Show that the server is down
showServerDown();
return null;
}
return xmppServer;
}
代码示例来源:origin: igniterealtime/Openfire
public void pluginsMonitored()
{
Log.debug( "Received plugin monitor event! Plugins should now be loaded." );
// Stop listening for plugin events
XMPPServer.getInstance().getPluginManager().removePluginManagerListener( this );
// Start listeners
startListeners();
}
} );
代码示例来源:origin: igniterealtime/Openfire
private boolean isHostUnknown(String host) {
if (host == null) {
// Answer false since when using server dialback the stream header will not
// have a TO attribute
return false;
}
if (XMPPServer.getInstance().getServerInfo().getXMPPDomain().equals( host )) {
// requested host matched the server name
return false;
}
return true;
}
代码示例来源:origin: igniterealtime/Openfire
/**
* @deprecated Obtain and use the corresponding {@link org.jivesoftware.openfire.spi.ConnectionListener} instead.
*/
@Deprecated
public static boolean isServiceEnabled() {
ConnectionManager connectionManager = XMPPServer.getInstance().getConnectionManager();
return connectionManager.isComponentListenerEnabled();
}
代码示例来源:origin: igniterealtime/Openfire
@Override
StanzaHandler createStanzaHandler( NIOConnection connection )
{
return new ServerStanzaHandler( XMPPServer.getInstance().getPacketRouter(), connection );
}
代码示例来源:origin: igniterealtime/Openfire
@Override
public void leftCluster() {
if (!XMPPServer.getInstance().isShuttingDown()) {
restoreCacheContent();
}
}
代码示例来源:origin: igniterealtime/Openfire
/**
* Returns the fully-qualifed domain name of this chat service.
* The domain is composed by the service name and the
* name of the XMPP server where the service is running.
*
* @return the file transfer server domain (service name + host name).
*/
public String getServiceDomain() {
return proxyServiceName + "." + XMPPServer.getInstance().getServerInfo().getXMPPDomain();
}
代码示例来源:origin: igniterealtime/Openfire
/**
* @deprecated Obtain and use the corresponding {@link org.jivesoftware.openfire.spi.ConnectionListener} instead.
*/
@Deprecated
public static void setServiceEnabled(boolean enabled) throws ModificationNotAllowedException {
// Alert listeners about this event
for (ExternalComponentManagerListener listener : listeners) {
listener.serviceEnabled(enabled);
}
ConnectionManager connectionManager = XMPPServer.getInstance().getConnectionManager();
connectionManager.enableComponentListener(enabled);
}
代码示例来源:origin: igniterealtime/Openfire
/**
* @deprecated Obtain and use the corresponding {@link org.jivesoftware.openfire.spi.ConnectionListener} instead.
*/
@Deprecated
public static void setServicePort(int port) throws ModificationNotAllowedException {
// Alert listeners about this event
for (ExternalComponentManagerListener listener : listeners) {
listener.portChanged(port);
}
ConnectionManager connectionManager = XMPPServer.getInstance().getConnectionManager();
connectionManager.setComponentListenerPort(port);
}
代码示例来源:origin: igniterealtime/Openfire
public PubSubServiceInfo(PubSubService pubSubService) {
if (pubSubService == null) {
throw new IllegalArgumentException("Argument 'pubSubService' cannot be null.");
}
this.pubSubService = pubSubService;
xmppServer = XMPPServer.getInstance();
pubSubModule = xmppServer.getPubSubModule();
groupManager = GroupManager.getInstance();
userManager = xmppServer.getUserManager();
}
代码示例来源:origin: igniterealtime/Openfire
private boolean validateHost(String host) {
boolean result = true;
if (JiveGlobals.getBooleanProperty("xmpp.client.validate.host", false)) {
result = XMPPServer.getInstance().getServerInfo().getXMPPDomain().equals(host);
}
return result;
}
代码示例来源:origin: igniterealtime/Openfire
@Override
public void sendPacket(Component component, Packet packet) {
if (packet != null && packet.getFrom() == null) {
throw new IllegalArgumentException("Packet with no FROM address was received from component.");
}
PacketRouter router = XMPPServer.getInstance().getPacketRouter();
if (router != null) {
router.route(packet);
}
}
代码示例来源:origin: igniterealtime/Openfire
@Override
public ConnectionConfiguration getConfiguration() {
if (configuration == null) {
final ConnectionManagerImpl connectionManager = ((ConnectionManagerImpl) XMPPServer.getInstance().getConnectionManager());
configuration = connectionManager.getListener( connectionType, true ).generateConnectionConfiguration();
}
return configuration;
}
代码示例来源:origin: igniterealtime/Openfire
/**
* Returns an iterator for all groups that the User is a member of.
*
* @param user the user.
* @return all groups the user belongs to.
*/
public Collection<Group> getGroups(User user) {
return getGroups(XMPPServer.getInstance().createJID(user.getUsername(), null, true));
}
代码示例来源:origin: igniterealtime/Openfire
/**
* Returns the name of the directory of the parent for this plugin. The value is retrieved from the plugin.xml file
* of the plugin (which is casted down to lower-case). If the value could not be found, <tt>null</tt> will be returned.
*
* @param plugin The plugin (cannot be null)
* @return the parent plugin's directory name
*/
public static String getParentPlugin( Plugin plugin )
{
return getParentPlugin( XMPPServer.getInstance().getPluginManager().getPluginPath( plugin ) );
}
代码示例来源:origin: igniterealtime/Openfire
private void broadcast(org.xmpp.packet.Roster roster) {
JID recipient = XMPPServer.getInstance().createJID(username, null, true);
roster.setTo(recipient);
// When roster versioning is enabled, the server MUST include
// the updated roster version with each roster push.
if (RosterManager.isRosterVersioningEnabled()) {
roster.getChildElement().addAttribute("ver", String.valueOf( roster.hashCode() ) );
}
SessionManager.getInstance().userBroadcast(username, roster);
}
代码示例来源:origin: igniterealtime/Openfire
/**
* Sends a presence probe to the probee for each connected resource of this user.
*/
private void probePresence(JID probee) {
final PresenceManager presenceManager = XMPPServer.getInstance().getPresenceManager();
for (ClientSession session : SessionManager.getInstance().getSessions(username)) {
presenceManager.probePresence(session.getAddress(), probee);
}
}
代码示例来源:origin: igniterealtime/Openfire
private void startProxy() {
connectionManager.processConnections(bindInterface, getProxyPort());
routingTable.addComponentRoute(getAddress(), this);
XMPPServer server = XMPPServer.getInstance();
server.getIQDiscoItemsHandler().addServerItemsProvider(this);
}
代码示例来源:origin: igniterealtime/Openfire
@Override
public void stop() {
super.stop();
XMPPServer.getInstance().getIQDiscoItemsHandler()
.removeComponentItem(getAddress().toString());
routingTable.removeComponentRoute(getAddress());
connectionManager.disable();
}
我正在按照本教程创建 Singleton,所有者在以下方法时有评论 http://www.journaldev.com/1377/java-singleton-design-pattern-best-
package com.example.vivanksharma.firebase; import android.support.v7.app.AppCompatActivity; import a
自从首次引入它来替换 Date 以来,我一直在使用静态方法 Calendar.getInstance() 来获取新的 Calendar目的。我从来没有遇到过问题,但出于某种原因我只是想知道使用 Gre
我正在使用适用于 Windows 8 的 MVVM Light 第 4 版;它包括 SimpleIOC。在各种示例中,我有时会看到基于 SimpleIoc 请求对象的代码......有时它基于 Ser
我看过这个post关于注册泛型类型。 如何注册的示例: bind(new TypeLiteral>() {}).to((Class>) ResponseDal.class); 但是如何从注入(inj
我想在我的 unitTest 中从 Guice injector 注入(inject)一个实例。 我可以使用哪个微分器? 我知道构造函数参数中使用了@annotation机制 但是 junit 不允许
我正在使用静态实例对象来获取与应用程序中另一个 Activity 相关的数据。但这会导致内存泄漏。 public class ChartActivity extends AppCompatActivi
以前用过C#,我考虑过 Calendar cal = Calendar.getInstance(); 根据 GoF 成为单例方法 Singleton pattern (Wikipedia)我想知道如何
我很难找到以对性能最友好的方式使用单例类的正确方法。我有 3 种方法,也许有人可以向我解释最有效的方法: 1: public functionA() { SingletonClassA.get
最近我阅读了一些使用广泛遵循 getInstance() 方法的 C++ 代码: class S { private: int some_int = 0; public
许多公开可用的 Java API 似乎都使用 getInstance 来生成和返回对象。我很好奇为什么会这样——为什么不直接使用默认/参数化构造函数呢? 是否有关联的设计模式? 最佳答案 我建议阅读
我遇到过单例模式。我无法理解 singletonobj.getinstance().dosomething() //1st one 和 singletonobj.dosomething() //2nd
getInstance() 在 Java 中的作用是什么? 在我的研究过程中,我一直在读到 getInstance() 有助于实现单例设计模式(据我了解,这意味着整个程序中只有一个实例)。但是我不能只
Firebase Firestore 提供 getInstance()方法,它打开一个套接字(在应用程序执行的任何时候只有一个)并实例化 Firestore 客户端。 我想查询和存储数据,使用或不使用
我正在将一个表单组件放入 joomla.In 中,我将在其中放置一个文本框、一个编辑器和一个按钮。 我为此表单创建了 View 文件,并且组件已成功安装。但是当我单击以在前端显示此表单时,会出现如下错
我正在尝试跟踪人们是否从广告或其他地方找到了我的 Android 应用。所以我发现谷歌分析可以通过这个表单生成的精心构建的 url 来跟踪它: http://code.google.com/mobil
我观看了此视频(https://www.youtube.com/watch?v=idb6hOxlyb8),该视频是2013年8月上传的。它声称我们应该使用 ptor.get(url) 而不是 brow
创建 google-service.json 后运行示例时,应用在尝试在 SignInActivity 中获取数据库引用时崩溃 mDatabase = FirebaseDatabase.getInst
基于以下问题:Decimal point or decimal comma in Android我尝试获取设备中使用的小数点分隔符。我正在使用Kotlin,因此我的代码如下所示: import and
从 Fabric Crashlytics 迁移到 FirebaseCrashlytics SDK 后,我在另一个进程(不是主进程)上遇到了一些崩溃。 当在 Activity 中调用 FirebaseC
我是一名优秀的程序员,十分优秀!