public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<JMXComponent<?>> context) {
// Parent will discover deployed applications through JMX
Set<DiscoveredResourceDetails> jmxResources = super.discoverResources(context);
// JMX resources don't set the filename property, so munge them before going on
JMXComponent parentComponent = context.getParentResourceComponent();
ApplicationServerComponent applicationServerComponent = (ApplicationServerComponent) parentComponent;
EmsConnection emsConnection = parentComponent.getEmsConnection();
String deployDirectoryPath = generateDeployDirectory(applicationServerComponent.getConfigurationPath()
.getPath());
List<String> earNames = new ArrayList<String>();
for (DiscoveredResourceDetails jmxResource : jmxResources) {