private final Timer timer;
- private HashedWheelTimerCloseable(Timer timer) {
+ private HashedWheelTimerCloseable(final Timer timer) {
this.timer = timer;
}
}
@Override
- public Timeout newTimeout(TimerTask task, long delay, TimeUnit unit) {
+ public Timeout newTimeout(final TimerTask task, final long delay, final TimeUnit unit) {
return this.timer.newTimeout(task, delay, unit);
}
return this.timer.stop();
}
- public static HashedWheelTimerCloseable newInstance(@Nullable ThreadFactory threadFactory,
- @Nullable Long duration, @Nullable Integer ticksPerWheel) {
+ public static HashedWheelTimerCloseable newInstance(@Nullable final ThreadFactory threadFactory,
+ @Nullable final Long duration, @Nullable final Integer ticksPerWheel) {
TimeUnit unit = TimeUnit.MILLISECONDS;
if(!nullOrNonPositive(duration) && threadFactory == null && nullOrNonPositive(ticksPerWheel)) {
return new HashedWheelTimerCloseable(new HashedWheelTimer(duration, unit));
return new HashedWheelTimerCloseable(new HashedWheelTimer());
}
- private static boolean nullOrNonPositive(Number n) {
+ private static boolean nullOrNonPositive(final Number n) {
return n == null || n.longValue() <= 0;
}
}
org.opendaylight.controller.config.yang.netty.timer.AbstractHashedWheelTimerModule {
private BundleContext bundleContext;
- public HashedWheelTimerModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
- org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
+ public HashedWheelTimerModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier,
+ final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
super(identifier, dependencyResolver);
}
- public HashedWheelTimerModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
- org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
- HashedWheelTimerModule oldModule, java.lang.AutoCloseable oldInstance) {
+ public HashedWheelTimerModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier,
+ final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
+ final HashedWheelTimerModule oldModule, final java.lang.AutoCloseable oldInstance) {
super(identifier, dependencyResolver, oldModule, oldInstance);
}
return Reflection.newProxy(AutoCloseableTimerInterface.class, new AbstractInvocationHandler() {
@Override
- protected Object handleInvocation(Object proxy, Method method, Object[] args) throws Throwable {
+ protected Object handleInvocation(final Object proxy, final Method method, final Object[] args) throws Throwable {
if (method.getName().equals("close")) {
tracker.close();
return null;
});
}
- public void setBundleContext(BundleContext bundleContext) {
+ public void setBundleContext(final BundleContext bundleContext) {
this.bundleContext = bundleContext;
}
@Deprecated
public class HashedWheelTimerModuleFactory extends AbstractHashedWheelTimerModuleFactory {
@Override
- public HashedWheelTimerModule instantiateModule(String instanceName, DependencyResolver dependencyResolver,
- HashedWheelTimerModule oldModule, AutoCloseable oldInstance, BundleContext bundleContext) {
+ public HashedWheelTimerModule instantiateModule(final String instanceName, final DependencyResolver dependencyResolver,
+ final HashedWheelTimerModule oldModule, final AutoCloseable oldInstance, final BundleContext bundleContext) {
HashedWheelTimerModule module = super.instantiateModule(instanceName, dependencyResolver, oldModule,
oldInstance, bundleContext);
module.setBundleContext(bundleContext);
}
@Override
- public HashedWheelTimerModule instantiateModule(String instanceName, DependencyResolver dependencyResolver,
- BundleContext bundleContext) {
+ public HashedWheelTimerModule instantiateModule(final String instanceName, final DependencyResolver dependencyResolver,
+ final BundleContext bundleContext) {
HashedWheelTimerModule module = super.instantiateModule(instanceName, dependencyResolver, bundleContext);
module.setBundleContext(bundleContext);
return module;
createInstance(transaction, instanceName, 0L, 10, true);
transaction.validateConfig();
fail();
- } catch (ValidationException e) {
+ } catch (final ValidationException e) {
assertTrue(e.getMessage().contains("TickDuration value must be greater than 0"));
}
}
createInstance(transaction, instanceName, 500L, 0, true);
transaction.validateConfig();
fail();
- } catch (ValidationException e) {
+ } catch (final ValidationException e) {
assertTrue(e.getMessage().contains("TicksPerWheel value must be greater than 0"));
}
}