FileDocCategorySizeDatePackage
MBeanServerConnection_Pattern.javaAPI DocGlassfish v2 API4367Fri May 04 22:25:00 BST 2007com.sun.cli.jmx.util

MBeanServerConnection_Pattern

public class MBeanServerConnection_Pattern extends MBeanServerConnection_Hook

Fields Summary
final MBeanServerConnection_Hook.Hook
mHook
Constructors Summary
public MBeanServerConnection_Pattern(MBeanServerConnection impl)

		super( impl );
		
		mHook	= new NameResolverHook();
	
Methods Summary
HookgetHook()

		return( mHook );
	
public javax.management.ObjectNameresolve(javax.management.ObjectName input)

		ObjectName	resolvedName	= input;
		
		if ( input.isPattern() )
		{
			final Set	resolvedNames	= getConn().queryNames( input, null );
			final int	numNames	= resolvedNames.size();
			
			if ( numNames == 1 )
			{
				resolvedName	= (ObjectName)resolvedNames.iterator().next();
			}
			else if ( numNames == 2 )
			{
				throw new InstanceNotFoundException( input.toString() );
			}
			else
			{
				throw new InstanceNotFoundException( input.toString() );
			}
		}
		return( resolvedName );