public Set < String > resolveMessageDestination ( final String messageDestName , final VirtualFile deploymentRoot ) { if ( messageDestName . contains ( "#" ) ) { final String [ ] parts = messageDestName . split ( "#" ) ; String path = parts [ 0 ] ; if ( ! path . startsWith ( "../" ) ) { path = "../" + path ; } final VirtualFile virtualPath = deploymentRoot . getChild ( path ) ; final String name = parts [ 1 ] ; final Set < String > ret = new HashSet < String > ( ) ; final List < MessageDestinationMapping > data = messageDestinationJndiMapping . get ( name ) ; if ( data != null ) { for ( final MessageDestinationMapping i : data ) { //now we need to check the path if ( virtualPath . equals ( i . deploymentRoot ) ) { ret . add ( i . jndiName ) ; } } } return ret ; } else { final Set < String > all = new HashSet < String > ( ) ; final Set < String > thisDeployment = new HashSet < String > ( ) ; final List < MessageDestinationMapping > data = messageDestinationJndiMapping . get ( messageDestName ) ; if ( data != null ) { for ( final MessageDestinationMapping i : data ) { all . add ( i . jndiName ) ; if ( i . deploymentRoot . equals ( deploymentRoot ) ) { thisDeployment . add ( i . jndiName ) ; } } } if ( all . size ( ) > 1 ) { return thisDeployment ; } return all ; } }
Resolves a message destination name into a JNDI name