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


Java ObjectName.toString方法代码示例

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


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

示例1: getClassLoader

import javax.management.ObjectName; //导入方法依赖的package包/类
/**
 * <p>Return the named {@link java.lang.ClassLoader}.
 * @param loaderName The ObjectName of the ClassLoader.
 * @return The named ClassLoader.
 * @exception InstanceNotFoundException if the named ClassLoader
 * is not found.
 */
public ClassLoader getClassLoader(ObjectName loaderName)
        throws InstanceNotFoundException {

    if (loaderName == null) {
        checkMBeanPermission((String) null, null, null, "getClassLoader");
        return server.getClass().getClassLoader();
    }

    DynamicMBean instance = getMBean(loaderName);
    checkMBeanPermission(instance, null, loaderName, "getClassLoader");

    Object resource = getResource(instance);

    /* Check if the given MBean is a ClassLoader */
    if (!(resource instanceof ClassLoader))
        throw new InstanceNotFoundException(loaderName.toString() +
                                            " is not a classloader");

    return (ClassLoader) resource;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:28,代码来源:DefaultMBeanServerInterceptor.java

示例2: createConnector

import javax.management.ObjectName; //导入方法依赖的package包/类
/**
 * Create a new Connector
 *
 * @param parent
 *            MBean Name of the associated parent component
 * @param address
 *            The IP address on which to bind
 * @param port
 *            TCP port number to listen on
 * @param isAjp
 *            Create a AJP/1.3 Connector
 * @param isSSL
 *            Create a secure Connector
 *
 * @exception Exception
 *                if an MBean cannot be created or registered
 */
private String createConnector(String parent, String address, int port, boolean isAjp, boolean isSSL)
		throws Exception {
	Connector retobj = new Connector();
	if ((address != null) && (address.length() > 0)) {
		retobj.setProperty("address", address);
	}
	// Set port number
	retobj.setPort(port);
	// Set the protocol
	retobj.setProtocol(isAjp ? "AJP/1.3" : "HTTP/1.1");
	// Set SSL
	retobj.setSecure(isSSL);
	retobj.setScheme(isSSL ? "https" : "http");
	// Add the new instance to its parent component
	// FIX ME - addConnector will fail
	ObjectName pname = new ObjectName(parent);
	Service service = getService(pname);
	service.addConnector(retobj);

	// Return the corresponding MBean name
	ObjectName coname = retobj.getObjectName();

	return (coname.toString());
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:42,代码来源:MBeanFactory.java

示例3: createStandardEngine

import javax.management.ObjectName; //导入方法依赖的package包/类
/**
 * Create a new StandardEngine.
 *
 * @param parent MBean Name of the associated parent component
 * @param name Unique name of this Engine
 * @param defaultHost Default hostname of this Engine
 *
 * @exception Exception if an MBean cannot be created or registered
 */
public String createStandardEngine(String parent, String name,
                                   String defaultHost)
    throws Exception {

    // Create a new StandardEngine instance
    StandardEngine engine = new StandardEngine();
    engine.setName(name);
    engine.setDefaultHost(defaultHost);

    // Add the new instance to its parent component
    ObjectName pname = new ObjectName(parent);
    Server server = ServerFactory.getServer();
    Service service = server.findService(pname.getKeyProperty("name"));
    service.setContainer(engine);

    // Return the corresponding MBean name
    ManagedBean managed = registry.findManagedBean("StandardEngine");
    ObjectName oname =
        MBeanUtils.createObjectName(managed.getDomain(), engine);
    return (oname.toString());

}
 
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:32,代码来源:MBeanFactory.java

示例4: findUser

import javax.management.ObjectName; //导入方法依赖的package包/类
/**
 * Return the MBean Name for the specified user name (if any); otherwise
 * return <code>null</code>.
 *
 * @param username
 *            User name to look up
 */
public String findUser(String username) {

	UserDatabase database = (UserDatabase) this.resource;
	User user = database.findUser(username);
	if (user == null) {
		return (null);
	}
	try {
		ObjectName oname = MBeanUtils.createObjectName(managedUser.getDomain(), user);
		return (oname.toString());
	} catch (MalformedObjectNameException e) {
		IllegalArgumentException iae = new IllegalArgumentException(
				"Cannot create object name for user [" + username + "]");
		iae.initCause(e);
		throw iae;
	}

}
 
开发者ID:how2j,项目名称:lazycat,代码行数:26,代码来源:MemoryUserDatabaseMBean.java

示例5: createWebappLoader

import javax.management.ObjectName; //导入方法依赖的package包/类
/**
 * Create a new Web Application Loader.
 *
 * @param parent
 *            MBean Name of the associated parent component
 *
 * @exception Exception
 *                if an MBean cannot be created or registered
 */
public String createWebappLoader(String parent) throws Exception {

	// Create a new WebappLoader instance
	WebappLoader loader = new WebappLoader();

	// Add the new instance to its parent component
	ObjectName pname = new ObjectName(parent);
	ContainerBase containerBase = getParentContainerFromParent(pname);
	if (containerBase != null) {
		containerBase.setLoader(loader);
	}
	// FIXME add Loader.getObjectName
	// ObjectName oname = loader.getObjectName();
	ObjectName oname = MBeanUtils.createObjectName(pname.getDomain(), loader);
	return (oname.toString());

}
 
开发者ID:how2j,项目名称:lazycat,代码行数:27,代码来源:MBeanFactory.java

示例6: createSingleSignOn

import javax.management.ObjectName; //导入方法依赖的package包/类
/**
 * Create a new Single Sign On Valve.
 *
 * @param parent MBean Name of the associated parent component
 *
 * @exception Exception if an MBean cannot be created or registered
 *
 * @deprecated  Will be removed in Tomcat 8.0.x. Replaced by {@link
 *              #createValve(String, String)}.
 */
@Deprecated

public String createSingleSignOn(String parent)
    throws Exception {

    // Create a new SingleSignOn instance
    SingleSignOn valve = new SingleSignOn();

    // Add the new instance to its parent component
    ObjectName pname = new ObjectName(parent);
    ContainerBase containerBase = getParentContainerFromParent(pname);
    containerBase.getPipeline().addValve(valve);
    ObjectName oname = valve.getObjectName();
    return (oname.toString());

}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:27,代码来源:MBeanFactory.java

示例7: findGroup

import javax.management.ObjectName; //导入方法依赖的package包/类
/**
 * Return the MBean Name for the specified group name (if any); otherwise
 * return <code>null</code>.
 *
 * @param groupname
 *            Group name to look up
 */
public String findGroup(String groupname) {

	UserDatabase database = (UserDatabase) this.resource;
	Group group = database.findGroup(groupname);
	if (group == null) {
		return (null);
	}
	try {
		ObjectName oname = MBeanUtils.createObjectName(managedGroup.getDomain(), group);
		return (oname.toString());
	} catch (MalformedObjectNameException e) {
		IllegalArgumentException iae = new IllegalArgumentException(
				"Cannot create object name for group [" + groupname + "]");
		iae.initCause(e);
		throw iae;
	}

}
 
开发者ID:how2j,项目名称:lazycat,代码行数:26,代码来源:MemoryUserDatabaseMBean.java

示例8: createUserDatabaseRealm

import javax.management.ObjectName; //导入方法依赖的package包/类
/**
 * Create a new  UserDatabaseRealm.
 *
 * @param parent MBean Name of the associated parent component
 * @param resourceName Global JNDI resource name of the associated
 *  UserDatabase
 *
 * @exception Exception if an MBean cannot be created or registered
 */
public String createUserDatabaseRealm(String parent, String resourceName)
    throws Exception {

     // Create a new UserDatabaseRealm instance
    UserDatabaseRealm realm = new UserDatabaseRealm();
    realm.setResourceName(resourceName);
    
    // Add the new instance to its parent component
    ObjectName pname = new ObjectName(parent);
    ContainerBase containerBase = getParentContainerFromParent(pname);
    // Add the new instance to its parent component
    containerBase.setRealm(realm);
    // Return the corresponding MBean name
    ObjectName oname = realm.getObjectName();
    // FIXME getObjectName() returns null
    //ObjectName oname = 
    //    MBeanUtils.createObjectName(pname.getDomain(), realm);
    if (oname != null) {
        return (oname.toString());
    } else {
        return null;
    }   

}
 
开发者ID:sunmingshuai,项目名称:apache-tomcat-7.0.73-with-comment,代码行数:34,代码来源:MBeanFactory.java

示例9: createUserDatabaseRealm

import javax.management.ObjectName; //导入方法依赖的package包/类
/**
 * Create a new UserDatabaseRealm.
 *
 * @param parent
 *            MBean Name of the associated parent component
 * @param resourceName
 *            Global JNDI resource name of the associated UserDatabase
 *
 * @exception Exception
 *                if an MBean cannot be created or registered
 */
public String createUserDatabaseRealm(String parent, String resourceName) throws Exception {

	// Create a new UserDatabaseRealm instance
	UserDatabaseRealm realm = new UserDatabaseRealm();
	realm.setResourceName(resourceName);

	// Add the new instance to its parent component
	ObjectName pname = new ObjectName(parent);
	ContainerBase containerBase = getParentContainerFromParent(pname);
	// Add the new instance to its parent component
	containerBase.setRealm(realm);
	// Return the corresponding MBean name
	ObjectName oname = realm.getObjectName();
	// FIXME getObjectName() returns null
	// ObjectName oname =
	// MBeanUtils.createObjectName(pname.getDomain(), realm);
	if (oname != null) {
		return (oname.toString());
	} else {
		return null;
	}

}
 
开发者ID:how2j,项目名称:lazycat,代码行数:35,代码来源:MBeanFactory.java

示例10: createJNDIRealm

import javax.management.ObjectName; //导入方法依赖的package包/类
/**
 * Create a new JNDI Realm.
 *
 * @param parent MBean Name of the associated parent component
 *
 * @exception Exception if an MBean cannot be created or registered
 */
public String createJNDIRealm(String parent)
    throws Exception {

     // Create a new JNDIRealm instance
    JNDIRealm realm = new JNDIRealm();

    // Add the new instance to its parent component
    ObjectName pname = new ObjectName(parent);
    ContainerBase containerBase = getParentContainerFromParent(pname);
    // Add the new instance to its parent component
    containerBase.setRealm(realm);
    // Return the corresponding MBean name
    ObjectName oname = realm.getObjectName();

    if (oname != null) {
        return (oname.toString());
    } else {
        return null;
    }   


}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:30,代码来源:MBeanFactory.java

示例11: CacheServerMembershipListenerAdapter

import javax.management.ObjectName; //导入方法依赖的package包/类
public CacheServerMembershipListenerAdapter(
    NotificationBroadcasterSupport serverLevelNotifEmitter,
    NotificationBroadcasterSupport memberLevelNotifEmitter, ObjectName serverSource) {
  this.serverLevelNotifEmitter = serverLevelNotifEmitter;
  this.memberLevelNotifEmitter = memberLevelNotifEmitter;
  this.serverSource = serverSource.toString();
}
 
开发者ID:ampool,项目名称:monarch,代码行数:8,代码来源:ManagementAdapter.java

示例12: createDataSourceRealm

import javax.management.ObjectName; //导入方法依赖的package包/类
/**
 * Create a new DataSource Realm.
 *
 * @param parent MBean Name of the associated parent component
 *
 * @exception Exception if an MBean cannot be created or registered
 */
public String createDataSourceRealm(String parent, String dataSourceName, 
    String roleNameCol, String userCredCol, String userNameCol, 
    String userRoleTable, String userTable) throws Exception {

    // Create a new DataSourceRealm instance
    DataSourceRealm realm = new DataSourceRealm();
    realm.setDataSourceName(dataSourceName);
    realm.setRoleNameCol(roleNameCol);
    realm.setUserCredCol(userCredCol);
    realm.setUserNameCol(userNameCol);
    realm.setUserRoleTable(userRoleTable);
    realm.setUserTable(userTable);

    // Add the new instance to its parent component
    ObjectName pname = new ObjectName(parent);
    ContainerBase containerBase = getParentContainerFromParent(pname);
    // Add the new instance to its parent component
    containerBase.setRealm(realm);
    // Return the corresponding MBean name
    ObjectName oname = realm.getObjectName();
    if (oname != null) {
        return (oname.toString());
    } else {
        return null;
    }   

}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:35,代码来源:MBeanFactory.java

示例13: createRemoteHostValve

import javax.management.ObjectName; //导入方法依赖的package包/类
/**
 * Create a new Remote Host Filter Valve.
 *
 * @param parent MBean Name of the associated parent component
 *
 * @exception Exception if an MBean cannot be created or registered
 */
public String createRemoteHostValve(String parent)
    throws Exception {

    // Create a new RemoteHostValve instance
    RemoteHostValve valve = new RemoteHostValve();

    // Add the new instance to its parent component
    ObjectName pname = new ObjectName(parent);
    ContainerBase containerBase = getParentContainerFromParent(pname);
    containerBase.addValve(valve);
    ObjectName oname = valve.getObjectName();
    return (oname.toString());
    
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:22,代码来源:MBeanFactory.java

示例14: createRequestDumperValve

import javax.management.ObjectName; //导入方法依赖的package包/类
/**
 * Create a new Request Dumper Valve.
 *
 * @param parent MBean Name of the associated parent component
 *
 * @exception Exception if an MBean cannot be created or registered
 */
public String createRequestDumperValve(String parent)
    throws Exception {

    // Create a new RequestDumperValve instance
    RequestDumperValve valve = new RequestDumperValve();

    // Add the new instance to its parent component
    ObjectName pname = new ObjectName(parent);
    ContainerBase containerBase = getParentContainerFromParent(pname);
    containerBase.addValve(valve);
    ObjectName oname = valve.getObjectName();
    return (oname.toString());

}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:22,代码来源:MBeanFactory.java

示例15: getMBean

import javax.management.ObjectName; //导入方法依赖的package包/类
private DynamicMBean getMBean(ObjectName name)
throws InstanceNotFoundException {
    DynamicMBean mbean = mbeans.get(name);
    if (mbean == null)
        throw new InstanceNotFoundException(name.toString());
    return mbean;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:8,代码来源:OldMBeanServerTest.java


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