@Test public void getAll() throws Exception { underTest.add(CAPABILITY_TYPE, true, null, null); underTest.add(CAPABILITY_TYPE, true, null, null); final Collection<? extends CapabilityReference> references = underTest.getAll(); assertThat(references, hasSize(2)); }
@Override public Collection<DefaultCapabilityReference> getAll() { try { lock.readLock().lock(); return ImmutableSet.copyOf(references.values()); } finally { lock.readLock().unlock(); } }
DefaultCapabilityRegistry extends ComponentSupport implements CapabilityRegistry, EventAware, EventAware.Asynchronous { @Override public Collection<DefaultCapabilityReference> getAll() { try { lock.readLock().lock(); return ImmutableSet.copyOf(references.values()); } finally { lock.readLock().unlock(); } } }
DefaultCapabilityRegistry extends ComponentSupport implements CapabilityRegistry, EventAware, EventAware.Asynchronous { @Override public Collection<DefaultCapabilityReference> getAll() { try { lock.readLock().lock(); return ImmutableSet.copyOf(references.values()); } finally { lock.readLock().unlock(); } } @Inject  DefaultCapabilityRegistry(final CapabilityStorage capabilityStorage,
                            final CapabilityFactoryRegistry capabilityFactoryRegistry,
                            final CapabilityDescriptorRegistry capabilityDescriptorRegistry,
                            final EventManager eventManager,
                            final ActivationConditionHandlerFactory activationConditionHandlerFactory,
                            final ValidityConditionHandlerFactory validityConditionHandlerFactory,
                            final PasswordHelper passwordHelper,
                            final Provider<Validator> validatorProvider); }
DefaultCapabilityRegistry extends ComponentSupport implements CapabilityRegistry, EventAware, EventAware.Asynchronous { @Override public Collection<DefaultCapabilityReference> getAll() { try { lock.readLock().lock(); return ImmutableSet.copyOf(references.values()); } finally { lock.readLock().unlock(); } } @Inject  DefaultCapabilityRegistry(final CapabilityStorage capabilityStorage,
                            final CapabilityFactoryRegistry capabilityFactoryRegistry,
                            final CapabilityDescriptorRegistry capabilityDescriptorRegistry,
                            final EventManager eventManager,
                            final ActivationConditionHandlerFactory activationConditionHandlerFactory,
                            final ValidityConditionHandlerFactory validityConditionHandlerFactory,
                            final PasswordHelper passwordHelper,
                            final Provider<Validator> validatorProvider); @Override CapabilityReference add(final CapabilityType type,
                                 final boolean enabled,
                                 @Nullable final String notes,
                                 @Nullable final Map<String, String> properties); @Subscribe void on(final CapabilityStorageItemCreatedEvent event); @Override CapabilityReference update(final CapabilityIdentity id,
                                    final boolean enabled,
                                    @Nullable final String notes,
                                    @Nullable final Map<String, String> properties); @Subscribe void on(final CapabilityStorageItemUpdatedEvent event); @Override CapabilityReference remove(final CapabilityIdentity id); @Subscribe void on(final CapabilityStorageItemDeletedEvent event); @Override CapabilityReference enable(final CapabilityIdentity id); @Override CapabilityReference disable(final CapabilityIdentity id); @Override DefaultCapabilityReference get(final CapabilityIdentity id); @Override Collection<DefaultCapabilityReference> get(final Predicate<CapabilityReference> filter); @Override Collection<DefaultCapabilityReference> getAll(); void load(); }
DefaultCapabilityRegistry extends ComponentSupport implements CapabilityRegistry, EventAware, EventAware.Asynchronous { @Override public Collection<DefaultCapabilityReference> getAll() { try { lock.readLock().lock(); return ImmutableSet.copyOf(references.values()); } finally { lock.readLock().unlock(); } } @Inject  DefaultCapabilityRegistry(final CapabilityStorage capabilityStorage,
                            final CapabilityFactoryRegistry capabilityFactoryRegistry,
                            final CapabilityDescriptorRegistry capabilityDescriptorRegistry,
                            final EventManager eventManager,
                            final ActivationConditionHandlerFactory activationConditionHandlerFactory,
                            final ValidityConditionHandlerFactory validityConditionHandlerFactory,
                            final PasswordHelper passwordHelper,
                            final Provider<Validator> validatorProvider); @Override CapabilityReference add(final CapabilityType type,
                                 final boolean enabled,
                                 @Nullable final String notes,
                                 @Nullable final Map<String, String> properties); @Subscribe void on(final CapabilityStorageItemCreatedEvent event); @Override CapabilityReference update(final CapabilityIdentity id,
                                    final boolean enabled,
                                    @Nullable final String notes,
                                    @Nullable final Map<String, String> properties); @Subscribe void on(final CapabilityStorageItemUpdatedEvent event); @Override CapabilityReference remove(final CapabilityIdentity id); @Subscribe void on(final CapabilityStorageItemDeletedEvent event); @Override CapabilityReference enable(final CapabilityIdentity id); @Override CapabilityReference disable(final CapabilityIdentity id); @Override DefaultCapabilityReference get(final CapabilityIdentity id); @Override Collection<DefaultCapabilityReference> get(final Predicate<CapabilityReference> filter); @Override Collection<DefaultCapabilityReference> getAll(); void load();  }