Esempio n. 1
0
 public void setEndpoint(Endpoint endpoint) {
   this.endpoint = endpoint;
   this.uri = null;
   if (endpoint != null) {
     this.uri = endpoint.getEndpointUri();
   }
 }
 /** Returns the endpoint URI or the name of the reference to it */
 public Object getUriOrRef() {
   if (ObjectHelper.isNotEmpty(uri)) {
     return uri;
   } else if (endpoint != null) {
     return endpoint.getEndpointUri();
   }
   return ref;
 }
 public String getUri() {
   if (uri != null) {
     return uri;
   } else if (endpoint != null) {
     return endpoint.getEndpointUri();
   } else {
     return null;
   }
 }
 // Implementation methods
 // -----------------------------------------------------------------------
 protected static String description(String uri, String ref, Endpoint endpoint) {
   if (ref != null) {
     return "ref:" + ref;
   } else if (endpoint != null) {
     return endpoint.getEndpointUri();
   } else if (uri != null) {
     return uri;
   } else {
     return "no uri or ref supplied!";
   }
 }
 private static final void setEndpointUri(Endpoint endpoint, String namespace) {
   if (endpoint instanceof DefaultEndpoint) {
     String old_uri = endpoint.getEndpointUri();
     String new_uri = addNamespaceParameter(old_uri, namespace);
     if (!old_uri.equals(new_uri)) {
       try {
         Method setEndpointUri =
             DefaultEndpoint.class.getDeclaredMethod("setEndpointUri", new Class[] {String.class});
         new MethodAccess<String>(null, setEndpointUri).write((DefaultEndpoint) endpoint, new_uri);
       } catch (NoSuchMethodException nsfe) {
         throw new SwitchYardException(nsfe);
       }
     }
   }
 }
Esempio n. 6
0
 @Override
 public String toString() {
   return "Consumer[" + URISupport.sanitizeUri(endpoint.getEndpointUri()) + "]";
 }
 public void setDeadLetter(Endpoint deadLetter) {
   this.deadLetter = deadLetter;
   this.deadLetterUri = deadLetter.getEndpointUri();
 }