@Test public void testNoKeys() throws Exception { PartitionContextSupplier contextSupplier = new AnnotationPartitionContextSupplier(MyService.class, MyServiceImpl.class); assertTrue(contextSupplier.forCall(MyService.class.getMethod("noKey", boolean.class), false).asMap().isEmpty()); }
@Override public PartitionContext forCall(Method method, Object... args) { String[] mappings = _keyMappings.get(method); if (mappings == null) { return PartitionContextBuilder.empty(); } PartitionContextBuilder builder = new PartitionContextBuilder(); for (int i = 0; i < mappings.length; i++) { if (mappings[i] != null && args[i] != null) { builder.put(mappings[i], args[i]); } } return builder.build(); }
AnnotationPartitionContextSupplier implements PartitionContextSupplier { @Override public PartitionContext forCall(Method method, Object... args) { String[] mappings = _keyMappings.get(method); if (mappings == null) { return PartitionContextBuilder.empty(); } PartitionContextBuilder builder = new PartitionContextBuilder(); for (int i = 0; i < mappings.length; i++) { if (mappings[i] != null && args[i] != null) { builder.put(mappings[i], args[i]); } } return builder.build(); } }
AnnotationPartitionContextSupplier implements PartitionContextSupplier { @Override public PartitionContext forCall(Method method, Object... args) { String[] mappings = _keyMappings.get(method); if (mappings == null) { return PartitionContextBuilder.empty(); } PartitionContextBuilder builder = new PartitionContextBuilder(); for (int i = 0; i < mappings.length; i++) { if (mappings[i] != null && args[i] != null) { builder.put(mappings[i], args[i]); } } return builder.build(); } <S> AnnotationPartitionContextSupplier(Class<S> ifc, Class<? extends S> impl); }
AnnotationPartitionContextSupplier implements PartitionContextSupplier { @Override public PartitionContext forCall(Method method, Object... args) { String[] mappings = _keyMappings.get(method); if (mappings == null) { return PartitionContextBuilder.empty(); } PartitionContextBuilder builder = new PartitionContextBuilder(); for (int i = 0; i < mappings.length; i++) { if (mappings[i] != null && args[i] != null) { builder.put(mappings[i], args[i]); } } return builder.build(); } <S> AnnotationPartitionContextSupplier(Class<S> ifc, Class<? extends S> impl); @Override PartitionContext forCall(Method method, Object... args); }
AnnotationPartitionContextSupplier implements PartitionContextSupplier { @Override public PartitionContext forCall(Method method, Object... args) { String[] mappings = _keyMappings.get(method); if (mappings == null) { return PartitionContextBuilder.empty(); } PartitionContextBuilder builder = new PartitionContextBuilder(); for (int i = 0; i < mappings.length; i++) { if (mappings[i] != null && args[i] != null) { builder.put(mappings[i], args[i]); } } return builder.build(); } <S> AnnotationPartitionContextSupplier(Class<S> ifc, Class<? extends S> impl); @Override PartitionContext forCall(Method method, Object... args);  }