1 23 24 29 30 31 package com.sun.enterprise.admin.dottedname; 32 33 import java.util.Set ; 34 35 import javax.management.ObjectName ; 36 import javax.management.MBeanServerConnection ; 37 import javax.management.MalformedObjectNameException ; 38 39 import com.sun.enterprise.admin.util.ArrayConversion; 40 41 42 46 47 public class DottedNameResolverForAliases implements DottedNameResolver 48 { 49 final DottedNameQuery mQuery; 50 final DottedNameServerInfo mServerInfo; 51 52 public 53 DottedNameResolverForAliases( 54 final DottedNameQuery query, 55 final DottedNameServerInfo serverInfo ) 56 { 57 mQuery = query; 58 mServerInfo = serverInfo; 59 } 60 61 62 66 protected String 67 getUnaliasedName( final String dottedNameString ) 68 { 69 final DottedName dn = DottedNameFactory.getInstance().get( dottedNameString ); 70 DottedName actualDN = dn; 71 72 if ( ! DottedName.isWildcardName( dottedNameString ) ) 73 { 74 try 75 { 76 final String actualScope = 77 DottedNameAliasSupport.resolveScope( mServerInfo, dn ); 78 79 if ( ! actualScope.equals( dn.getScope() ) ) 80 { 81 actualDN = DottedNameFactory.getInstance().get( 82 DottedName.toString( dn.getDomain(), actualScope, dn.getParts() ) ); 83 } 84 } 85 catch( Exception e ) 86 { 87 DottedNameLogger.logException( e ); 88 } 89 } 90 91 return( actualDN.toString() ); 92 } 93 94 108 109 public ObjectName 110 resolveDottedName( final String dottedName ) 111 { 112 final String unaliasedName = getUnaliasedName( dottedName ); 113 114 final ObjectName result = mQuery.dottedNameToObjectName( unaliasedName ); 115 116 return( result ); 117 } 118 } 119 120 121 122 123 | Popular Tags |