本文整理汇总了Java中org.jivesoftware.util.ClassUtils类的典型用法代码示例。如果您正苦于以下问题:Java ClassUtils类的具体用法?Java ClassUtils怎么用?Java ClassUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ClassUtils类属于org.jivesoftware.util包,在下文中一共展示了ClassUtils类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
}
}
示例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();
}
}
}
示例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();
}
}
示例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();
}
}
}
示例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 );
}
}
示例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;
}
}
示例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;
}
}
示例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();
}
}
}
示例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();
}
}
}
示例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 );
}
}
示例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();
}
}
}
示例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 );
}
}
示例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 );
}
}
示例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;
}
示例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();
}
}