Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 35 for NewProxy (0.1 sec)

  1. guava-tests/test/com/google/common/reflect/AbstractInvocationHandlerTest.java

      private static List<String> newDelegatingList(List<String> delegate) {
        return Reflection.newProxy(List.class, new DelegatingInvocationHandler(delegate));
      }
    
      @SuppressWarnings("unchecked") // proxy of List<String>
      private static List<String> newDelegatingListWithEquals(List<String> delegate) {
        return Reflection.newProxy(List.class, new DelegatingInvocationHandlerWithEquals(delegate));
      }
    
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Mon Apr 17 15:49:06 UTC 2023
    - 5.8K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/reflect/AbstractInvocationHandlerTest.java

      private static List<String> newDelegatingList(List<String> delegate) {
        return Reflection.newProxy(List.class, new DelegatingInvocationHandler(delegate));
      }
    
      @SuppressWarnings("unchecked") // proxy of List<String>
      private static List<String> newDelegatingListWithEquals(List<String> delegate) {
        return Reflection.newProxy(List.class, new DelegatingInvocationHandlerWithEquals(delegate));
      }
    
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Mon Apr 17 15:49:06 UTC 2023
    - 5.8K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/util/concurrent/SimpleTimeLimiterTest.java

        service = SimpleTimeLimiter.create(executor);
      }
    
      public void testNewProxy_goodMethodWithEnoughTime() throws Exception {
        SampleImpl target = new SampleImpl(DELAY_MS);
        Sample proxy = service.newProxy(target, Sample.class, ENOUGH_MS, MILLISECONDS);
        Stopwatch stopwatch = Stopwatch.createStarted();
    
        String result = proxy.sleepThenReturnInput("x");
    
        assertThat(result).isEqualTo("x");
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Sep 06 17:04:31 UTC 2023
    - 9.5K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/util/concurrent/SimpleTimeLimiterTest.java

        service = SimpleTimeLimiter.create(executor);
      }
    
      public void testNewProxy_goodMethodWithEnoughTime() throws Exception {
        SampleImpl target = new SampleImpl(DELAY_MS);
        Sample proxy = service.newProxy(target, Sample.class, ENOUGH_MS, MILLISECONDS);
        Stopwatch stopwatch = Stopwatch.createStarted();
    
        String result = proxy.sleepThenReturnInput("x");
    
        assertThat(result).isEqualTo("x");
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Sep 06 17:04:31 UTC 2023
    - 9.5K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/reflect/ReflectionTest.java

      }
    
      public void testNewProxy() throws Exception {
        Runnable runnable = Reflection.newProxy(Runnable.class, X_RETURNER);
        assertEquals("x", runnable.toString());
      }
    
      public void testNewProxyCantWorkOnAClass() throws Exception {
        assertThrows(
            IllegalArgumentException.class, () -> Reflection.newProxy(Object.class, X_RETURNER));
      }
    
      private static final InvocationHandler X_RETURNER =
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Sep 06 17:04:31 UTC 2023
    - 2.7K bytes
    - Viewed (0)
  6. guava/src/com/google/common/util/concurrent/SimpleTimeLimiter.java

                    callable, timeoutDuration, timeoutUnit, interruptibleMethods.contains(method));
              }
            };
        return newProxy(interfaceType, handler);
      }
    
      // TODO: replace with version in common.reflect if and when it's open-sourced
      private static <T> T newProxy(Class<T> interfaceType, InvocationHandler handler) {
        Object object =
            Proxy.newProxyInstance(
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Tue Jun 27 14:21:11 UTC 2023
    - 9.7K bytes
    - Viewed (0)
  7. guava/src/com/google/common/util/concurrent/TimeLimiter.java

       * @throws IllegalArgumentException if {@code interfaceType} is a regular class, enum, or
       *     annotation type, rather than an interface
       * @since 28.0
       */
      default <T> T newProxy(T target, Class<T> interfaceType, Duration timeout) {
        return newProxy(target, interfaceType, toNanosSaturated(timeout), TimeUnit.NANOSECONDS);
      }
    
      /**
       * Invokes a specified Callable, timing out after the specified time limit. If the target method
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Fri May 12 18:32:03 UTC 2023
    - 15.3K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/util/concurrent/SimpleTimeLimiter.java

                    callable, timeoutDuration, timeoutUnit, interruptibleMethods.contains(method));
              }
            };
        return newProxy(interfaceType, handler);
      }
    
      // TODO: replace with version in common.reflect if and when it's open-sourced
      private static <T> T newProxy(Class<T> interfaceType, InvocationHandler handler) {
        Object object =
            Proxy.newProxyInstance(
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Tue Jun 27 14:21:11 UTC 2023
    - 9.7K bytes
    - Viewed (0)
  9. guava-testlib/src/com/google/common/testing/ForwardingWrapperTester.java

          Class<T> interfaceType, Method method, Function<? super T, ? extends T> wrapperFunction) {
        RuntimeException exception = new RuntimeException();
        T proxy =
            Reflection.newProxy(
                interfaceType,
                new AbstractInvocationHandler() {
                  @Override
                  protected Object handleInvocation(Object p, Method m, @Nullable Object[] args)
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Thu Feb 08 17:31:55 UTC 2024
    - 9.1K bytes
    - Viewed (0)
  10. guava/src/com/google/common/util/concurrent/FakeTimeLimiter.java

    @J2ktIncompatible
    @GwtIncompatible
    @ElementTypesAreNonnullByDefault
    public final class FakeTimeLimiter implements TimeLimiter {
      @CanIgnoreReturnValue // TODO(kak): consider removing this
      @Override
      public <T> T newProxy(
          T target, Class<T> interfaceType, long timeoutDuration, TimeUnit timeoutUnit) {
        checkNotNull(target);
        checkNotNull(interfaceType);
        checkNotNull(timeoutUnit);
        return target; // ha ha
      }
    
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Thu Dec 14 20:35:03 UTC 2023
    - 3.5K bytes
    - Viewed (0)
Back to top