private Message handleFault(Message msg, String endpointUri, AxisFault e, List<String> failedUris) { Throwable cause = e.getCause(); if (cause instanceof ConnectException) { failedUris.add(endpointUri); if (failedUris.size() != endpointUris.size()) { // Retry till all URIs are exhausted return invoke(msg); } } SOAPFaultDetail element = e.getFaultDetailElement(); if (element == null) { throw new ServiceUnavailableException("Service fault was: \n" + e + "\n\n", e); } OMNode child = element.getFirstOMChild(); if (child == null) { throw new ServiceUnavailableException("Service fault was: \n" + e + "\n\n", e); } throw new ServiceUnavailableException("Service fault was: \n" + child + "\n\n", e); }
@Override public synchronized InstanceWrapper getWrapper(KEY contextId) throws TargetResolutionException { if (wrapper == null) { try { wrapper = createInstanceWrapper(); wrapper.start(); } catch (Exception e) { wrapper = null; throw new ServiceUnavailableException(e); } } return wrapper; }
public byte[] sendAndReply(byte[] message, int index, WorkContext workContext) { try { byte[] serializedWorkContext = serialize(workContext); Request request = new Request(message, index, serializedWorkContext); queue.put(request); return request.get(100000, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.interrupted(); throw new ServiceRuntimeException(e); } catch (ExecutionException e) { throw new ServiceRuntimeException(e); } catch (TimeoutException e) { throw new ServiceUnavailableException(e); } catch (IOException e) { throw new ServiceUnavailableException(e); } }
public byte[] sendAndReply(byte[] message, int index, WorkContext workContext) { try { byte[] serializedWorkContext = serialize(workContext); Request request = new Request(message, index, serializedWorkContext); queue.put(request); return request.get(100000, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.interrupted(); throw new ServiceRuntimeException(e); } catch (ExecutionException e) { throw new ServiceRuntimeException(e); } catch (TimeoutException | Fabric3Exception e) { throw new ServiceUnavailableException(e); } }
@SuppressWarnings("unchecked") private BindingHandler<T> inject() { if (delegate == null) { synchronized (this) { if (delegate == null) { Component component = componentManager.getComponent(handlerUri); if (component == null) { throw new ServiceUnavailableException("Handler component not found: " + handlerUri); } if (!(component instanceof ScopedComponent)) { throw new ServiceRuntimeException("Handler component must be a scoped component type: " + handlerUri); } delegate = (ScopedComponent) component; } } } // resolve the instance on every invocation so that stateless scoped components receive a new instance return (BindingHandler<T>) delegate.getInstance(); }
@SuppressWarnings("unchecked") private BindingHandler<T> inject() { if (delegate == null) { synchronized (this) { if (delegate == null) { Component component = componentManager.getComponent(handlerUri); if (component == null) { throw new ServiceUnavailableException("Handler component not found: " + handlerUri); } if (!(component instanceof ScopedComponent)) { throw new ServiceRuntimeException("Handler component must be a scoped component type: " + handlerUri); } delegate = (ScopedComponent) component; } } } // resolve the instance on every invocation so that stateless scoped components receive a new instance return (BindingHandler<T>) delegate.getInstance(); }
javax.jms.Message resultMessage = responseListener.receive(correlationId, session, responseTimeout); if (resultMessage == null) { throw new ServiceUnavailableException("Timeout waiting for response to message: " + correlationId);
if (e.getCause() instanceof SocketTimeoutException) { if (retry > retries) { throw new ServiceUnavailableException(e); if (wse.getCause() instanceof SocketTimeoutException) { if (retry >= retries) { throw new ServiceUnavailableException(e);
if (e.getCause() instanceof SocketTimeoutException) { if (retry > retries) { throw new ServiceUnavailableException(e); if (wse.getCause() instanceof SocketTimeoutException) { if (retry >= retries) { throw new ServiceUnavailableException(e);
public Message invoke(Message msg) { UsernamePasswordToken token = new UsernamePasswordToken(username, password); try { SecuritySubject subject = authenticationService.authenticate(token); msg.getWorkContext().setSubject(subject); } catch (AuthenticationException e) { throw new ServiceUnavailableException("Error authenticating", e); } return next.invoke(msg); }
@SuppressWarnings("unchecked") public T getDelegate() { if (delegate == null) { synchronized (this) { Component component = componentManager.getComponent(filterUri); if (component == null) { throw new ServiceUnavailableException("Provider component not found: " + filterUri); } if (!(component instanceof ScopedComponent)) { throw new ServiceRuntimeException("Provider component must be a scoped component type: " + filterUri); } delegate = (ScopedComponent) component; } } try { return ((T) delegate.getInstance()); } catch (Fabric3Exception e) { throw new ServiceRuntimeException(e); } } }
@SuppressWarnings("unchecked") public T getDelegate() { if (delegate == null) { synchronized (this) { Component component = componentManager.getComponent(filterUri); if (component == null) { throw new ServiceUnavailableException("Provider component not found: " + filterUri); } if (!(component instanceof ScopedComponent)) { throw new ServiceRuntimeException("Provider component must be a scoped component type: " + filterUri); } delegate = (ScopedComponent) component; } } try { return ((T) delegate.getInstance()); } catch (Fabric3Exception e) { throw new ServiceRuntimeException(e); } } }
@SuppressWarnings("unchecked") private BindingHandler<T> inject() { if (delegate == null) { synchronized (this) { if (delegate == null) { Component component = componentManager.getComponent(handlerUri); if (component == null) { throw new ServiceUnavailableException("Handler component not found: " + handlerUri); } if (!(component instanceof ScopedComponent)) { throw new ServiceRuntimeException("Handler component must be a scoped component type: " + handlerUri); } delegate = (ScopedComponent) component; } } } try { // resolve the instance on every invocation so that stateless scoped components receive a new instance return (BindingHandler<T>) delegate.getInstance(); } catch (InstanceLifecycleException e) { throw new ServiceRuntimeException(e); } }
throw new ServiceUnavailableException("The service " + name + " has not been contributed to the domain");
throw new ServiceUnavailableException("The service " + name + " has not been contributed to the domain");
request.setException(new ServiceUnavailableException("Timeout waiting on response")); request.run(); continue;
request.setException(new ServiceUnavailableException("Timeout waiting on response")); request.run(); continue;
} catch (RuntimeException e) { throw new ServiceUnavailableException(e);
} catch (RuntimeException e) { throw new ServiceUnavailableException(e);
} catch (RuntimeException e) { throw new ServiceUnavailableException(e);