message.put(PREVIOUS_MESSAGE, new WeakReference<Message>(oldMessage)); while (state == State.EXECUTING && iterator.hasNext()) { try { Interceptor<Message> currentInterceptor = (Interceptor<Message>)iterator.next(); if (isFineLogging) { LOG.fine("Invoking handleMessage on interceptor " + currentInterceptor); if (iterator.hasPrevious()) { iterator.previous();
message.put(PREVIOUS_MESSAGE, new WeakReference<Message>(oldMessage)); while (state == State.EXECUTING && iterator.hasNext()) { try { Interceptor<Message> currentInterceptor = (Interceptor<Message>)iterator.next(); if (isFineLogging) { LOG.fine("Invoking handleMessage on interceptor " + currentInterceptor); if (iterator.hasPrevious()) { iterator.previous();
message.put(PREVIOUS_MESSAGE, new WeakReference<Message>(oldMessage)); while (state == State.EXECUTING && iterator.hasNext()) { try { Interceptor<Message> currentInterceptor = (Interceptor<Message>)iterator.next(); if (isFineLogging) { LOG.fine("Invoking handleMessage on interceptor " + currentInterceptor); && iterator.hasPrevious()) { iterator.previous();
message.put(PREVIOUS_MESSAGE, new WeakReference<Message>(oldMessage)); while (state == State.EXECUTING && iterator.hasNext()) { try { Interceptor<Message> currentInterceptor = (Interceptor<Message>)iterator.next(); if (isFineLogging) { LOG.fine("Invoking handleMessage on interceptor " + currentInterceptor); && iterator.hasPrevious()) { iterator.previous();
/** * Intercept a message, invoking each phase's handlers in turn, * starting at the specified interceptor. * * @param message the message * @param startingAtInterceptorID the id of the interceptor * @throws Exception */ public synchronized boolean doInterceptStartingAt(Message message, String startingAtInterceptorID) { updateIterator(); while (state == State.EXECUTING && iterator.hasNext()) { PhaseInterceptor<? extends Message> currentInterceptor = (PhaseInterceptor<? extends Message>)iterator.next(); if (currentInterceptor.getId().equals(startingAtInterceptorID)) { iterator.previous(); break; } } return doIntercept(message); }
/** * Intercept a message, invoking each phase's handlers in turn, * starting after the specified interceptor. * * @param message the message * @param startingAfterInterceptorID the id of the interceptor * @throws Exception */ public synchronized boolean doInterceptStartingAfter(Message message, String startingAfterInterceptorID) { updateIterator(); while (state == State.EXECUTING && iterator.hasNext()) { PhaseInterceptor<? extends Message> currentInterceptor = (PhaseInterceptor<? extends Message>)iterator.next(); if (currentInterceptor.getId().equals(startingAfterInterceptorID)) { break; } } return doIntercept(message); }
/** * Intercept a message, invoking each phase's handlers in turn, * starting after the specified interceptor. * * @param message the message * @param startingAfterInterceptorID the id of the interceptor * @throws Exception */ public synchronized boolean doInterceptStartingAfter(Message message, String startingAfterInterceptorID) { updateIterator(); while (state == State.EXECUTING && iterator.hasNext()) { PhaseInterceptor<? extends Message> currentInterceptor = (PhaseInterceptor<? extends Message>)iterator.next(); if (currentInterceptor.getId().equals(startingAfterInterceptorID)) { break; } } return doIntercept(message); }
/** * Intercept a message, invoking each phase's handlers in turn, * starting at the specified interceptor. * * @param message the message * @param startingAtInterceptorID the id of the interceptor * @throws Exception */ public synchronized boolean doInterceptStartingAt(Message message, String startingAtInterceptorID) { updateIterator(); while (state == State.EXECUTING && iterator.hasNext()) { PhaseInterceptor<? extends Message> currentInterceptor = (PhaseInterceptor<? extends Message>)iterator.next(); if (currentInterceptor.getId().equals(startingAtInterceptorID)) { iterator.previous(); break; } } return doIntercept(message); }
/** * Intercept a message, invoking each phase's handlers in turn, * starting at the specified interceptor. * * @param message the message * @param startingAtInterceptorID the id of the interceptor * @throws Exception */ public synchronized boolean doInterceptStartingAt(Message message, String startingAtInterceptorID) { updateIterator(); while (state == State.EXECUTING && iterator.hasNext()) { PhaseInterceptor<? extends Message> currentInterceptor = (PhaseInterceptor<? extends Message>)iterator.next(); if (currentInterceptor.getId().equals(startingAtInterceptorID)) { iterator.previous(); break; } } return doIntercept(message); }
/** * Intercept a message, invoking each phase's handlers in turn, * starting after the specified interceptor. * * @param message the message * @param startingAfterInterceptorID the id of the interceptor * @throws Exception */ public synchronized boolean doInterceptStartingAfter(Message message, String startingAfterInterceptorID) { updateIterator(); while (state == State.EXECUTING && iterator.hasNext()) { PhaseInterceptor<? extends Message> currentInterceptor = (PhaseInterceptor<? extends Message>)iterator.next(); if (currentInterceptor.getId().equals(startingAfterInterceptorID)) { break; } } return doIntercept(message); }
/** * Intercept a message, invoking each phase's handlers in turn, * starting at the specified interceptor. * * @param message the message * @param startingAtInterceptorID the id of the interceptor * @throws Exception */ public synchronized boolean doInterceptStartingAt(Message message, String startingAtInterceptorID) { updateIterator(); while (state == State.EXECUTING && iterator.hasNext()) { PhaseInterceptor<? extends Message> currentInterceptor = (PhaseInterceptor<? extends Message>)iterator.next(); if (currentInterceptor.getId().equals(startingAtInterceptorID)) { iterator.previous(); break; } } return doIntercept(message); }
/** * Intercept a message, invoking each phase's handlers in turn, * starting after the specified interceptor. * * @param message the message * @param startingAfterInterceptorID the id of the interceptor * @throws Exception */ public synchronized boolean doInterceptStartingAfter(Message message, String startingAfterInterceptorID) { updateIterator(); while (state == State.EXECUTING && iterator.hasNext()) { PhaseInterceptor<? extends Message> currentInterceptor = (PhaseInterceptor<? extends Message>)iterator.next(); if (currentInterceptor.getId().equals(startingAfterInterceptorID)) { break; } } return doIntercept(message); }
@SuppressWarnings("unchecked") public void unwind(Message message) { while (iterator.hasPrevious()) { Interceptor<Message> currentInterceptor = (Interceptor<Message>)iterator.previous(); if (isFineLogging) { LOG.fine("Invoking handleFault on interceptor " + currentInterceptor); } try { currentInterceptor.handleFault(message); } catch (RuntimeException e) { LOG.log(Level.WARNING, "Exception in handleFault on interceptor " + currentInterceptor, e); throw e; } catch (Exception e) { LOG.log(Level.WARNING, "Exception in handleFault on interceptor " + currentInterceptor, e); throw new RuntimeException(e); } } }
@SuppressWarnings("unchecked") public void unwind(Message message) { while (iterator.hasPrevious()) { Interceptor<Message> currentInterceptor = (Interceptor<Message>)iterator.previous(); if (isFineLogging) { LOG.fine("Invoking handleFault on interceptor " + currentInterceptor); } try { currentInterceptor.handleFault(message); } catch (RuntimeException e) { LOG.log(Level.WARNING, "Exception in handleFault on interceptor " + currentInterceptor, e); throw e; } catch (Exception e) { LOG.log(Level.WARNING, "Exception in handleFault on interceptor " + currentInterceptor, e); throw new RuntimeException(e); } } }
@SuppressWarnings("unchecked") public void unwind(Message message) { while (iterator.hasPrevious()) { Interceptor<Message> currentInterceptor = (Interceptor<Message>)iterator.previous(); if (isFineLogging) { LOG.fine("Invoking handleFault on interceptor " + currentInterceptor); } try { currentInterceptor.handleFault(message); } catch (RuntimeException e) { LOG.log(Level.WARNING, "Exception in handleFault on interceptor " + currentInterceptor, e); throw e; } catch (Exception e) { LOG.log(Level.WARNING, "Exception in handleFault on interceptor " + currentInterceptor, e); throw new RuntimeException(e); } } }
@SuppressWarnings("unchecked") public void unwind(Message message) { while (iterator.hasPrevious()) { Interceptor<Message> currentInterceptor = (Interceptor<Message>)iterator.previous(); if (isFineLogging) { LOG.fine("Invoking handleFault on interceptor " + currentInterceptor); } try { currentInterceptor.handleFault(message); } catch (RuntimeException e) { LOG.log(Level.WARNING, "Exception in handleFault on interceptor " + currentInterceptor, e); throw e; } catch (Exception e) { LOG.log(Level.WARNING, "Exception in handleFault on interceptor " + currentInterceptor, e); throw new RuntimeException(e); } } }
public static boolean setCurrentMessage(PhaseInterceptorChain chain, Message m) { if (getCurrentMessage() == m) { return false; } if (chain.iterator.hasPrevious()) { chain.iterator.previous(); if (chain.iterator.next() instanceof ServiceInvokerInterceptor) { CURRENT_MESSAGE.set(m); return true; } String error = "Only ServiceInvokerInterceptor can update the current chain message"; LOG.warning(error); throw new IllegalStateException(error); } return false; }
public static boolean setCurrentMessage(PhaseInterceptorChain chain, Message m) { if (getCurrentMessage() == m) { return false; } if (chain.iterator.hasPrevious()) { chain.iterator.previous(); if (chain.iterator.next() instanceof ServiceInvokerInterceptor) { CURRENT_MESSAGE.set(m); return true; } String error = "Only ServiceInvokerInterceptor can update the current chain message"; LOG.warning(error); throw new IllegalStateException(error); } return false; }
public ListIterator<Interceptor<? extends Message>> getIterator() { return new PhaseInterceptorIterator(heads); }
public PhaseInterceptorIterator(InterceptorHolder h[]) { heads = h; first = findFirst(); }