• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ClassUtils类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: initProvider

import org.jivesoftware.util.ClassUtils; //导入依赖的package包/类
/**
 * Initializes the server's security audit provider, based on configuration and defaults to
 * DefaultSecurityAuditProvider if the specified provider is not valid or not specified.
 */
private void initProvider() {
    // Convert XML based provider setup to Database based
    JiveGlobals.migrateProperty("provider.securityAudit.className");

    String className = JiveGlobals.getProperty("provider.securityAudit.className",
            "org.jivesoftware.openfire.security.DefaultSecurityAuditProvider");
    // Check if we need to reset the provider class
    if (provider == null || !className.equals(provider.getClass().getName())) {
        try {
            Class c = ClassUtils.forName(className);
            provider = (SecurityAuditProvider) c.newInstance();
        }
        catch (Exception e) {
            Log.error("Error loading security audit provider: " + className, e);
            provider = new DefaultSecurityAuditProvider();
        }
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:23,代码来源:SecurityAuditManager.java


示例2: initProvider

import org.jivesoftware.util.ClassUtils; //导入依赖的package包/类
/**
 * Initializes the server's admin provider, based on configuration and defaults to
 * DefaultAdminProvider if the specified provider is not valid or not specified.
 */
private void initProvider() {
    // Convert XML based provider setup to Database based
    JiveGlobals.migrateProperty("provider.admin.className");

    String className = JiveGlobals.getProperty("provider.admin.className",
            "org.jivesoftware.openfire.admin.DefaultAdminProvider");
    // Check if we need to reset the provider class
    if (provider == null || !className.equals(provider.getClass().getName())) {
        try {
            Class c = ClassUtils.forName(className);
            provider = (AdminProvider) c.newInstance();
        }
        catch (Exception e) {
            Log.error("Error loading admin provider: " + className, e);
            provider = new DefaultAdminProvider();
        }
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:23,代码来源:AdminManager.java


示例3: initProvider

import org.jivesoftware.util.ClassUtils; //导入依赖的package包/类
private void initProvider() {
    // Convert XML based provider setup to Database based
    JiveGlobals.migrateProperty("provider.group.className");

    // Load a group provider.
    String className = JiveGlobals.getProperty("provider.group.className",
            "org.jivesoftware.openfire.group.DefaultGroupProvider");
    try {
        Class c = ClassUtils.forName(className);
        provider = (GroupProvider) c.newInstance();
    }
    catch (Exception e) {
        Log.error("Error loading group provider: " + className, e);
        provider = new DefaultGroupProvider();
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:17,代码来源:GroupManager.java


示例4: initProvider

import org.jivesoftware.util.ClassUtils; //导入依赖的package包/类
private void initProvider() {
    JiveGlobals.migrateProperty("provider.roster.className");
    String className = JiveGlobals.getProperty("provider.roster.className",
            "org.jivesoftware.openfire.roster.DefaultRosterItemProvider");

    if (provider == null || !className.equals(provider.getClass().getName())) {
        try {
            Class c = ClassUtils.forName(className);
            provider = (RosterItemProvider) c.newInstance();
        }
        catch (Exception e) {
            Log.error("Error loading roster provider: " + className, e);
            provider = new DefaultRosterItemProvider();
        }
    }

}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:18,代码来源:RosterManager.java


示例5: MappedUserPropertyProvider

import org.jivesoftware.util.ClassUtils; //导入依赖的package包/类
public MappedUserPropertyProvider()
{
    // Migrate properties.
    JiveGlobals.migrateProperty( PROPERTY_MAPPER_CLASSNAME );

    // Instantiate mapper.
    final String mapperClass = JiveGlobals.getProperty( PROPERTY_MAPPER_CLASSNAME );
    if ( mapperClass == null )
    {
        throw new IllegalStateException( "A mapper must be specified via openfire.xml or the system properties." );
    }

    try
    {
        final Class c = ClassUtils.forName( mapperClass );
        mapper = (UserPropertyProviderMapper) c.newInstance();
    }
    catch ( Exception e )
    {
        throw new IllegalStateException( "Unable to create new instance of UserPropertyProviderMapper class: " + mapperClass, e );
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:23,代码来源:MappedUserPropertyProvider.java


示例6: instantiate

import org.jivesoftware.util.ClassUtils; //导入依赖的package包/类
/**
 * Instantiates a UserPropertyProvider based on a property value (that is expected to be a class name). When the
 * property is not set, this method returns null. When the property is set, but an exception occurs while
 * instantiating the class, this method logs the error and returns null.
 *
 * UserProvider classes are required to have a public, no-argument constructor.
 *
 * @param propertyName A property name (cannot ben ull).
 * @return A user provider (can be null).
 */
public static UserPropertyProvider instantiate( String propertyName )
{
    final String className = JiveGlobals.getProperty( propertyName );
    if ( className == null )
    {
        Log.debug( "Property '{}' is undefined. Skipping.", propertyName );
        return null;
    }
    Log.debug( "About to to instantiate an UserPropertyProvider '{}' based on the value of property '{}'.", className, propertyName );
    try
    {
        final Class c = ClassUtils.forName( className );
        final UserPropertyProvider provider = (UserPropertyProvider) c.newInstance();
        Log.debug( "Instantiated UserPropertyProvider '{}'", className );
        return provider;
    }
    catch ( Exception e )
    {
        Log.error( "Unable to load UserPropertyProvider '{}'. Users in this provider will be disabled.", className, e );
        return null;
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:33,代码来源:MappedUserPropertyProvider.java


示例7: instantiate

import org.jivesoftware.util.ClassUtils; //导入依赖的package包/类
/**
 * Instantiates a UserProvider based on a property value (that is expected to be a class name). When the property
 * is not set, this method returns null. When the property is set, but an exception occurs while instantiating
 * the class, this method logs the error and returns null.
 *
 * UserProvider classes are required to have a public, no-argument constructor.
 *
 * @param propertyName A property name (cannot ben ull).
 * @return A user provider (can be null).
 */
public static UserProvider instantiate( String propertyName )
{
    final String className = JiveGlobals.getProperty( propertyName );
    if ( className == null )
    {
        Log.debug( "Property '{}' is undefined. Skipping.", propertyName );
        return null;
    }
    Log.debug( "About to to instantiate an UserProvider '{}' based on the value of property '{}'.", className, propertyName );
    try
    {
        final Class c = ClassUtils.forName( className );
        final UserProvider provider = (UserProvider) c.newInstance();
        Log.debug( "Instantiated UserProvider '{}'", className );
        return provider;
    }
    catch ( Exception e )
    {
        Log.error( "Unable to load UserProvider '{}'. Users in this provider will be disabled.", className, e );
        return null;
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:33,代码来源:UserMultiProvider.java


示例8: initProvider

import org.jivesoftware.util.ClassUtils; //导入依赖的package包/类
private void initProvider() {
    // Convert XML based provider setup to Database based
    JiveGlobals.migrateProperty("provider.user.className");

    String className = JiveGlobals.getProperty("provider.user.className",
            "org.jivesoftware.openfire.user.DefaultUserProvider");
    // Check if we need to reset the provider class
    if (provider == null || !className.equals(provider.getClass().getName())) {
        try {
            Class c = ClassUtils.forName(className);
            provider = (UserProvider) c.newInstance();
        }
        catch (Exception e) {
            Log.error("Error loading user provider: " + className, e);
            provider = new DefaultUserProvider();
        }
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:19,代码来源:UserManager.java


示例9: initPropertyProvider

import org.jivesoftware.util.ClassUtils; //导入依赖的package包/类
private void initPropertyProvider() {
    // Convert XML based provider setup to Database based
    JiveGlobals.migrateProperty("provider.userproperty.className");

    String className = JiveGlobals.getProperty("provider.userproperty.className",
                                               "org.jivesoftware.openfire.user.property.DefaultUserPropertyProvider");
    // Check if we need to reset the provider class
    if (propertyProvider == null || !className.equals(propertyProvider.getClass().getName())) {
        try {
            Class c = ClassUtils.forName(className);
            propertyProvider = (UserPropertyProvider) c.newInstance();
        }
        catch (Exception e) {
            Log.error("Error loading user property provider: " + className, e);
            propertyProvider = new DefaultUserPropertyProvider();
        }
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:19,代码来源:UserManager.java


示例10: MappedUserProvider

import org.jivesoftware.util.ClassUtils; //导入依赖的package包/类
public MappedUserProvider()
{

    // Migrate properties.
    JiveGlobals.migrateProperty( PROPERTY_MAPPER_CLASSNAME );

    // Instantiate mapper.
    final String mapperClass = JiveGlobals.getProperty( PROPERTY_MAPPER_CLASSNAME );
    if ( mapperClass == null )
    {
        throw new IllegalStateException( "A mapper must be specified via openfire.xml or the system properties." );
    }

    try
    {
        final Class c = ClassUtils.forName( mapperClass );
        mapper = (UserProviderMapper) c.newInstance();
    }
    catch ( Exception e )
    {
        throw new IllegalStateException( "Unable to create new instance of UserProviderMapper class: " + mapperClass, e );
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:24,代码来源:MappedUserProvider.java


示例11: initProvider

import org.jivesoftware.util.ClassUtils; //导入依赖的package包/类
private static void initProvider() {
    // Convert XML based provider setup to Database based
    JiveGlobals.migrateProperty("provider.auth.className");

    String className = JiveGlobals.getProperty("provider.auth.className",
            "org.jivesoftware.openfire.auth.DefaultAuthProvider");
    // Check if we need to reset the auth provider class 
    if (authProvider == null || !className.equals(authProvider.getClass().getName())) {
        try {
            Class c = ClassUtils.forName(className);
            authProvider = (AuthProvider)c.newInstance();
        }
        catch (Exception e) {
            Log.error("Error loading auth provider: " + className, e);
            authProvider = new DefaultAuthProvider();
        }
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:19,代码来源:AuthFactory.java


示例12: instantiateProvider

import org.jivesoftware.util.ClassUtils; //导入依赖的package包/类
protected static AuthProvider instantiateProvider( String propertyName )
{
    final String className = JiveGlobals.getProperty( propertyName );
    if ( className == null )
    {
        throw new IllegalStateException( "A class name must be specified via openfire.xml or the system properties." );
    }

    try
    {
        final Class c = ClassUtils.forName( className );
        return (AuthProvider) c.newInstance();
    }
    catch ( Exception e )
    {
        throw new IllegalStateException( "Unable to create new instance of AuthProvider: " + className, e );
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:19,代码来源:AuthorizationBasedAuthProviderMapper.java


示例13: MappedAuthProvider

import org.jivesoftware.util.ClassUtils; //导入依赖的package包/类
public MappedAuthProvider()
{
    // Migrate properties.
    JiveGlobals.migrateProperty( PROPERTY_MAPPER_CLASSNAME );

    // Instantiate mapper.
    final String mapperClass = JiveGlobals.getProperty( PROPERTY_MAPPER_CLASSNAME );
    if ( mapperClass == null )
    {
        throw new IllegalStateException( "A mapper must be specified via openfire.xml or the system properties." );
    }

    try
    {
        final Class c = ClassUtils.forName( mapperClass );
        mapper = (AuthProviderMapper) c.newInstance();
    }
    catch ( Exception e )
    {
        throw new IllegalStateException( "Unable to create new instance of AuthProviderMapper class: " + mapperClass, e );
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:23,代码来源:MappedAuthProvider.java


示例14: createProxyTransfer

import org.jivesoftware.util.ClassUtils; //导入依赖的package包/类
private ProxyTransfer createProxyTransfer(String transferDigest, Socket targetSocket)
        throws IOException {
    ProxyTransfer provider;
    try {
        Class c = ClassUtils.forName(className);
        provider = (ProxyTransfer) c.newInstance();
    }
    catch (Exception e) {
        Log.error("Error loading proxy transfer provider: " + className, e);
        provider = new DefaultProxyTransfer();
    }

    provider.setTransferDigest(transferDigest);
    provider.setOutputStream(targetSocket.getOutputStream());
    return provider;
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:17,代码来源:ProxyConnectionManager.java


示例15: initialize

import org.jivesoftware.util.ClassUtils; //导入依赖的package包/类
@Override
public void initialize(XMPPServer server) {
    instance = this;

    // Convert XML based provider setup to Database based
    JiveGlobals.migrateProperty("provider.vcard.className");

    // Load a VCard provider.
    String className = JiveGlobals.getProperty("provider.vcard.className",
            DefaultVCardProvider.class.getName());
    try {
        Class c = ClassUtils.forName(className);
        provider = (VCardProvider) c.newInstance();
    }
    catch (Exception e) {
        Log.error("Error loading vcard provider: " + className, e);
        provider = new DefaultVCardProvider();
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:20,代码来源:VCardManager.java


示例16: initProvider

import org.jivesoftware.util.ClassUtils; //导入依赖的package包/类
/**
 * Initializes the server's lock out provider, based on configuration and defaults to
 * DefaultLockOutProvider if the specified provider is not valid or not specified.
 */
private void initProvider() {
    // Convert XML based provider setup to Database based
    JiveGlobals.migrateProperty("provider.lockout.className");

    String className = JiveGlobals.getProperty("provider.lockout.className",
            "org.jivesoftware.openfire.lockout.DefaultLockOutProvider");
    // Check if we need to reset the provider class
    if (provider == null || !className.equals(provider.getClass().getName())) {
        try {
            Class c = ClassUtils.forName(className);
            provider = (LockOutProvider) c.newInstance();
        }
        catch (Exception e) {
            Log.error("Error loading lockout provider: " + className, e);
            provider = new DefaultLockOutProvider();
        }
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:23,代码来源:LockOutManager.java


示例17: ensureConnectionProvider

import org.jivesoftware.util.ClassUtils; //导入依赖的package包/类
/**
 * Ensures that the connection provider exists and is set
 */
private static void ensureConnectionProvider() {
    if (connectionProvider != null) return;
    
    synchronized (providerLock) {
        if (connectionProvider != null) return;
        
        // Attempt to load the connection provider classname as a Jive property.
        String className = JiveGlobals.getXMLProperty("connectionProvider.className");
        if (className != null) {
            // Attempt to load the class.
            try {
                Class conClass = ClassUtils.forName(className);
                setConnectionProvider((ConnectionProvider)conClass.newInstance());
            } catch (Exception e) {
                Log.warn("Failed to create the " +
                        "connection provider specified by connection" +
                        "Provider.className. Using the default pool.", e);
                setConnectionProvider(new DefaultConnectionProvider());
            }
        } else {
            setConnectionProvider(new DefaultConnectionProvider());
        }
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:28,代码来源:DbConnectionManager.java


示例18: initialize

import org.jivesoftware.util.ClassUtils; //导入依赖的package包/类
@Override
public void initialize(XMPPServer server) {
       instance = this;

       // Convert XML based provider setup to Database based
       JiveGlobals.migrateProperty("provider.vcard.className");

       // Load a VCard provider.
       String className = JiveGlobals.getProperty("provider.vcard.className",
               DefaultVCardProvider.class.getName());
       try {
           Class c = ClassUtils.forName(className);
           provider = (VCardProvider) c.newInstance();
       }
       catch (Exception e) {
           Log.error("Error loading vcard provider: " + className, e);
           provider = new DefaultVCardProvider();
       }
   }
 
开发者ID:coodeer,项目名称:g3server,代码行数:20,代码来源:VCardManager.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java OAuth2TokenValidationRequestDTO类代码示例发布时间:2022-05-22
下一篇:
Java IntAVLTreeSet类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap