public Set < String > endpointUris ( ) { try { // we must use reflection for now until Camel supports the getEndpoints() method // https://issues.apache.org/jira/browse/CAMEL-3644 // ... // the above is no longer valid since Camel 2.7.0 List < CamelEndpointFactoryBean > endpoints = contextElement . getEndpoints ( ) ; List < String > uris = new LinkedList < String > ( ) ; if ( endpoints != null ) { for ( CamelEndpointFactoryBean cefb : endpoints ) { uris . add ( cefb . getUri ( ) ) ; } } // lets detect any drools endpoints... List < Node > sessions = nodesByNamespace ( doc , droolsNamespace . getURI ( ) , "ksession" ) ; if ( sessions != null ) { for ( Node session : sessions ) { if ( session instanceof Element ) { Element e = ( Element ) session ; String node = e . getAttributeValue ( "node" ) ; String sid = e . getAttributeValue ( "id" ) ; if ( node != null && node . length ( ) > 0 && sid != null && sid . length ( ) > 0 ) { String du = "drools:" + node + "/" + sid ; boolean exists = false ; for ( String uri : uris ) { if ( uri . startsWith ( du ) ) { exists = true ; } } if ( ! exists ) { uris . add ( du ) ; } } } } } return new TreeSet < String > ( uris ) ; } catch ( Exception e ) { LOG . error ( e . getMessage ( ) , e ) ; return new HashSet < String > ( ) ; } }
Returns the endpoint URIs used in the context