/** * Convenience function to make the Java code more readable. * * <pre><code> * UnitMatcher<X> matcher = UnitMatcher.create(...); * * matcher.match(obj); * </code></pre> * * @param i the argument to apply the match to * @throws scala.MatchError if there is no match */ public void match(I i) throws MatchError { statements.apply(i); } }
/** * Convenience function to make the Java code more readable. * * <p> * * <pre><code> * UnitMatcher<X> matcher = UnitMatcher.create(...); * * matcher.match(obj); * </code></pre> * * @param i the argument to apply the match to * @throws scala.MatchError if there is no match */ public void match(I i) throws MatchError { statements.apply(i); } }
/** * Convenience function to make the Java code more readable. * * <pre><code> * Matcher<X, Y> matcher = Matcher.create(...); * * Y someY = matcher.match(obj); * </code></pre> * * @param i the argument to apply the match to * @return the result of the application * @throws MatchError if there is no match */ public R match(I i) throws MatchError { return statements.apply(i); } }
/** * Convenience function to make the Java code more readable. * * <p> * * <pre><code> * Match<X, Y> matcher = Match.create(...); * * Y someY = matcher.match(obj); * </code></pre> * * @param i the argument to apply the match to * @return the result of the application * @throws MatchError if there is no match */ public R match(I i) throws MatchError { return statements.apply(i); } }
/** * Convenience function to make the Java code more readable. * * <p> * * <pre><code> * UnitMatcher<X> matcher = UnitMatcher.create(...); * * matcher.match(obj); * </code></pre> * * @param i the argument to apply the match to * @throws scala.MatchError if there is no match */ public void match(I i) throws MatchError { statements.apply(i); } }
/** * Convenience function to make the Java code more readable. * * <p> * * <pre><code> * UnitMatcher<X> matcher = UnitMatcher.create(...); * * matcher.match(obj); * </code></pre> * * @param i the argument to apply the match to * @throws scala.MatchError if there is no match */ public void match(I i) throws MatchError { statements.apply(i); } }
/** * Convenience function to make the Java code more readable. * * <p> * * <pre><code> * Match<X, Y> matcher = Match.create(...); * * Y someY = matcher.match(obj); * </code></pre> * * @param i the argument to apply the match to * @return the result of the application * @throws MatchError if there is no match */ public R match(I i) throws MatchError { return statements.apply(i); } }
/** * Convenience function to make the Java code more readable. * * <p> * * <pre><code> * Match<X, Y> matcher = Match.create(...); * * Y someY = matcher.match(obj); * </code></pre> * * @param i the argument to apply the match to * @return the result of the application * @throws MatchError if there is no match */ public R match(I i) throws MatchError { return statements.apply(i); } }
public static Result routeAndCall(Class<? extends Router> router, RequestBuilder requestBuilder, long timeout) { try { Request request = requestBuilder.build(); Router routes = (Router) router.getClassLoader().loadClass(router.getName() + "$").getDeclaredField("MODULE$").get(null); if(routes.routes().isDefinedAt(request._underlyingRequest())) { return invokeHandler(routes.routes().apply(request._underlyingRequest()), request, timeout); } else { return null; } } catch(RuntimeException e) { throw e; } catch(Throwable t) { throw new RuntimeException(t); } }
public static Result routeAndCall(Router router, RequestBuilder requestBuilder, long timeout) { try { Request request = requestBuilder.build(); if(router.routes().isDefinedAt(request._underlyingRequest())) { return invokeHandler(router.routes().apply(request._underlyingRequest()), request, timeout); } else { return null; } } catch(RuntimeException e) { throw e; } catch(Throwable t) { throw new RuntimeException(t); } }
/** * Convenience function to make the Java code more readable. * * <pre><code> * UnitMatcher<X> matcher = UnitMatcher.create(...); * * matcher.match(obj); * </code></pre> * * @param i the argument to apply the match to * @throws scala.MatchError if there is no match */ public void match(I i) throws MatchError { statements.apply(i); } }
/** * Convenience function to make the Java code more readable. * * <pre><code> * UnitMatcher<X> matcher = UnitMatcher.create(...); * * matcher.match(obj); * </code></pre> * * @param i the argument to apply the match to * @throws scala.MatchError if there is no match */ public void match(I i) throws MatchError { statements.apply(i); } }
/** * Convenience function to make the Java code more readable. * * <pre><code> * Matcher<X, Y> matcher = Matcher.create(...); * * Y someY = matcher.match(obj); * </code></pre> * * @param i the argument to apply the match to * @return the result of the application * @throws MatchError if there is no match */ public R match(I i) throws MatchError { return statements.apply(i); } }
/** * Convenience function to make the Java code more readable. * * <pre><code> * UnitMatcher<X> matcher = UnitMatcher.create(...); * * matcher.match(obj); * </code></pre> * * @param i the argument to apply the match to * @throws scala.MatchError if there is no match */ public void match(I i) throws MatchError { statements.apply(i); } }
/** * Convenience function to make the Java code more readable. * * <pre><code> * UnitMatcher<X> matcher = UnitMatcher.create(...); * * matcher.match(obj); * </code></pre> * * @param i the argument to apply the match to * @throws scala.MatchError if there is no match */ public void match(I i) throws MatchError { statements.apply(i); } }
/** * Convenience function to make the Java code more readable. * * <pre><code> * Matcher<X, Y> matcher = Matcher.create(...); * * Y someY = matcher.match(obj); * </code></pre> * * @param i the argument to apply the match to * @return the result of the application * @throws MatchError if there is no match */ public R match(I i) throws MatchError { return statements.apply(i); } }
/** * Convenience function to make the Java code more readable. * * <pre><code> * Matcher<X, Y> matcher = Matcher.create(...); * * Y someY = matcher.match(obj); * </code></pre> * * @param i the argument to apply the match to * @return the result of the application * @throws MatchError if there is no match */ public R match(I i) throws MatchError { return statements.apply(i); } }
private <A extends ThingModifiedEvent> void applyEvent(final A event) { handleThingEvents.onMessage().apply(event); notifySubscribers(event); }
private <A extends ThingModifiedEvent> void applyEvent(final A event) { handleThingEvents.onMessage().apply(event); notifySubscribers(event); }
private <E extends PolicyEvent> void processEvent(final E event, final Procedure<E> handler) { log.debug("About to persist Event <{}>.", event.getType()); persist(event, persistedEvent -> { log.info("Successfully persisted Event <{}>.", event.getType()); // after the event was persisted, apply the event on the current actor state handlePolicyEvents.onMessage().apply(persistedEvent); /* * The event has to be applied before creating the snapshot, otherwise a snapshot with new * sequence no (e.g. 2), but old thing revision no (e.g. 1) will be created. This can lead to serious * aftereffects. */ handler.apply(persistedEvent); // save a snapshot if there were too many changes since the last snapshot if ((lastSequenceNr() - lastSnapshotSequenceNr) > snapshotThreshold) { doSaveSnapshot(null); } notifySubscribers(event); }); }